Skip to content

Commit 023006b

Browse files
author
Orkun Manap
committed
Make materials more transparent, origin indicator update, handle prefab update, etc.
1 parent c4e729f commit 023006b

File tree

12 files changed

+177
-50
lines changed

12 files changed

+177
-50
lines changed

Assets/Plugins/TransformHandle/Materials/Blue.mat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,6 @@ Material:
7575
- _UVSec: 0
7676
- _ZWrite: 1
7777
m_Colors:
78-
- _Color: {r: 0.2627451, g: 0.5921569, b: 1, a: 1}
78+
- _Color: {r: 0.26274505, g: 0.5921568, b: 1, a: 0.5019608}
7979
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
8080
m_BuildTextureStacks: []

Assets/Plugins/TransformHandle/Materials/Cube.mat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Material:
121121
- _ZWrite: 1
122122
m_Colors:
123123
- _BaseColor: {r: 0.8396226, g: 0.8396226, b: 0.8396226, a: 1}
124-
- _Color: {r: 0.8396226, g: 0.8396226, b: 0.8396226, a: 1}
124+
- _Color: {r: 0.8396226, g: 0.8396226, b: 0.8396226, a: 0.5019608}
125125
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
126126
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
127127
m_BuildTextureStacks: []

Assets/Plugins/TransformHandle/Materials/Green.mat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,6 @@ Material:
7575
- _UVSec: 0
7676
- _ZWrite: 1
7777
m_Colors:
78-
- _Color: {r: 0.654902, g: 1, b: 0.34117648, a: 1}
78+
- _Color: {r: 0.654902, g: 1, b: 0.34117645, a: 0.5019608}
7979
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
8080
m_BuildTextureStacks: []

Assets/Plugins/TransformHandle/Materials/Orange.mat

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,22 @@ Material:
88
m_PrefabInstance: {fileID: 0}
99
m_PrefabAsset: {fileID: 0}
1010
m_Name: Orange
11-
m_Shader: {fileID: 4800000, guid: 371d5ee14005f40b1867133c56230652, type: 3}
11+
m_Shader: {fileID: 4800000, guid: 293ac2bf2c4de442bac948ef7b91ebd1, type: 3}
1212
m_ValidKeywords: []
1313
m_InvalidKeywords: []
1414
m_LightmapFlags: 4
1515
m_EnableInstancingVariants: 0
1616
m_DoubleSidedGI: 0
17-
m_CustomRenderQueue: -1
17+
m_CustomRenderQueue: 3002
1818
stringTagMap: {}
1919
disabledShaderPasses: []
2020
m_SavedProperties:
2121
serializedVersion: 3
2222
m_TexEnvs:
23+
- _BaseMap:
24+
m_Texture: {fileID: 0}
25+
m_Scale: {x: 1, y: 1}
26+
m_Offset: {x: 0, y: 0}
2327
- _BumpMap:
2428
m_Texture: {fileID: 0}
2529
m_Scale: {x: 1, y: 1}
@@ -56,25 +60,55 @@ Material:
5660
m_Texture: {fileID: 0}
5761
m_Scale: {x: 1, y: 1}
5862
m_Offset: {x: 0, y: 0}
63+
- _SpecGlossMap:
64+
m_Texture: {fileID: 0}
65+
m_Scale: {x: 1, y: 1}
66+
m_Offset: {x: 0, y: 0}
67+
- unity_Lightmaps:
68+
m_Texture: {fileID: 0}
69+
m_Scale: {x: 1, y: 1}
70+
m_Offset: {x: 0, y: 0}
71+
- unity_LightmapsInd:
72+
m_Texture: {fileID: 0}
73+
m_Scale: {x: 1, y: 1}
74+
m_Offset: {x: 0, y: 0}
75+
- unity_ShadowMasks:
76+
m_Texture: {fileID: 0}
77+
m_Scale: {x: 1, y: 1}
78+
m_Offset: {x: 0, y: 0}
5979
m_Ints: []
6080
m_Floats:
81+
- _AlphaClip: 0
82+
- _Blend: 0
6183
- _BumpScale: 1
84+
- _ClearCoatMask: 0
85+
- _ClearCoatSmoothness: 0
86+
- _Cull: 2
6287
- _Cutoff: 0.5
88+
- _DetailAlbedoMapScale: 1
6389
- _DetailNormalMapScale: 1
6490
- _DstBlend: 0
91+
- _EnvironmentReflections: 1
6592
- _GlossMapScale: 1
6693
- _Glossiness: 0.5
6794
- _GlossyReflections: 1
6895
- _Metallic: 0
6996
- _Mode: 0
7097
- _OcclusionStrength: 1
7198
- _Parallax: 0.02
99+
- _QueueOffset: 0
100+
- _ReceiveShadows: 1
101+
- _Smoothness: 0.5
72102
- _SmoothnessTextureChannel: 0
73103
- _SpecularHighlights: 1
74104
- _SrcBlend: 1
105+
- _Surface: 0
75106
- _UVSec: 0
107+
- _WorkflowMode: 1
76108
- _ZWrite: 1
77109
m_Colors:
78-
- _Color: {r: 1, g: 0.47833467, b: 0, a: 0.5019608}
110+
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
111+
- _Color: {r: 1, g: 0.64708, b: 0, a: 1}
79112
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
113+
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
80114
m_BuildTextureStacks: []

Assets/Plugins/TransformHandle/Materials/Red.mat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,6 @@ Material:
7575
- _UVSec: 0
7676
- _ZWrite: 1
7777
m_Colors:
78-
- _Color: {r: 1, g: 0.3019608, b: 0.13725491, a: 1}
78+
- _Color: {r: 1, g: 0.30196074, b: 0.13725483, a: 0.5019608}
7979
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
8080
m_BuildTextureStacks: []

Assets/Plugins/TransformHandle/Prefabs/NativeTransformHandle.prefab

Lines changed: 70 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ Transform:
418418
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
419419
m_LocalPosition: {x: 0, y: 0, z: 0}
420420
m_LocalScale: {x: 1, y: 1, z: 1}
421-
m_ConstrainProportionsScale: 0
421+
m_ConstrainProportionsScale: 1
422422
m_Children:
423423
- {fileID: 812008594596781465}
424424
- {fileID: 392816819990612828}
@@ -1097,7 +1097,7 @@ Transform:
10971097
m_PrefabAsset: {fileID: 0}
10981098
m_GameObject: {fileID: 5827055862590351340}
10991099
m_LocalRotation: {x: 0, y: 0, z: -0.70710677, w: 0.70710677}
1100-
m_LocalPosition: {x: 0.8, y: 0, z: 0}
1100+
m_LocalPosition: {x: 1.2, y: -0, z: 0}
11011101
m_LocalScale: {x: 0.3, y: 0.3, z: 0.3}
11021102
m_ConstrainProportionsScale: 1
11031103
m_Children: []
@@ -1328,7 +1328,7 @@ Transform:
13281328
m_GameObject: {fileID: 5827055862963285280}
13291329
m_LocalRotation: {x: 0.5, y: 0.5, z: -0.5, w: 0.5}
13301330
m_LocalPosition: {x: 0, y: 0, z: 0}
1331-
m_LocalScale: {x: 1, y: 1, z: 1}
1331+
m_LocalScale: {x: 1, y: 1.5, z: 1}
13321332
m_ConstrainProportionsScale: 0
13331333
m_Children: []
13341334
m_Father: {fileID: 5827055862299714563}
@@ -1430,6 +1430,7 @@ Transform:
14301430
- {fileID: 5827055863773847535}
14311431
- {fileID: 957109806586100794}
14321432
- {fileID: 1443671245192161137}
1433+
- {fileID: 5711902125622514346}
14331434
m_Father: {fileID: 0}
14341435
m_RootOrder: 0
14351436
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -1484,7 +1485,7 @@ Transform:
14841485
m_GameObject: {fileID: 5827055863681706732}
14851486
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
14861487
m_LocalPosition: {x: 0, y: 0, z: 0}
1487-
m_LocalScale: {x: 1, y: 1, z: 1}
1488+
m_LocalScale: {x: 1, y: 1.5, z: 1}
14881489
m_ConstrainProportionsScale: 0
14891490
m_Children: []
14901491
m_Father: {fileID: 5827055863686819234}
@@ -1686,7 +1687,7 @@ Transform:
16861687
m_PrefabAsset: {fileID: 0}
16871688
m_GameObject: {fileID: 5827055863795520170}
16881689
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
1689-
m_LocalPosition: {x: 0, y: 0.8, z: 0}
1690+
m_LocalPosition: {x: 0, y: 1.2, z: 0}
16901691
m_LocalScale: {x: 0.3, y: 0.3, z: 0.3}
16911692
m_ConstrainProportionsScale: 1
16921693
m_Children: []
@@ -1917,7 +1918,7 @@ Transform:
19171918
m_PrefabAsset: {fileID: 0}
19181919
m_GameObject: {fileID: 5827055864096891426}
19191920
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
1920-
m_LocalPosition: {x: 0, y: 0, z: 0.8}
1921+
m_LocalPosition: {x: 0, y: 0, z: 1.2}
19211922
m_LocalScale: {x: 0.3, y: 0.3, z: 0.3}
19221923
m_ConstrainProportionsScale: 1
19231924
m_Children: []
@@ -2035,7 +2036,7 @@ Transform:
20352036
m_GameObject: {fileID: 5827055864119891324}
20362037
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
20372038
m_LocalPosition: {x: 0, y: 0, z: 0}
2038-
m_LocalScale: {x: 1, y: 1, z: 1}
2039+
m_LocalScale: {x: 1, y: 1.5, z: 1}
20392040
m_ConstrainProportionsScale: 0
20402041
m_Children: []
20412042
m_Father: {fileID: 5827055862256505812}
@@ -2728,3 +2729,65 @@ BoxCollider:
27282729
serializedVersion: 2
27292730
m_Size: {x: 1, y: 1, z: 1}
27302731
m_Center: {x: 0, y: 0, z: 0}
2732+
--- !u!1001 &7243128248437682385
2733+
PrefabInstance:
2734+
m_ObjectHideFlags: 0
2735+
serializedVersion: 2
2736+
m_Modification:
2737+
m_TransformParent: {fileID: 5827055863349941014}
2738+
m_Modifications:
2739+
- target: {fileID: 2015394401006608186, guid: 1b2ae2914c65a400db274270801b75dc, type: 3}
2740+
propertyPath: m_Name
2741+
value: OriginIndicator
2742+
objectReference: {fileID: 0}
2743+
- target: {fileID: 3152522471886742139, guid: 1b2ae2914c65a400db274270801b75dc, type: 3}
2744+
propertyPath: m_RootOrder
2745+
value: 3
2746+
objectReference: {fileID: 0}
2747+
- target: {fileID: 3152522471886742139, guid: 1b2ae2914c65a400db274270801b75dc, type: 3}
2748+
propertyPath: m_LocalPosition.x
2749+
value: 0
2750+
objectReference: {fileID: 0}
2751+
- target: {fileID: 3152522471886742139, guid: 1b2ae2914c65a400db274270801b75dc, type: 3}
2752+
propertyPath: m_LocalPosition.y
2753+
value: 0
2754+
objectReference: {fileID: 0}
2755+
- target: {fileID: 3152522471886742139, guid: 1b2ae2914c65a400db274270801b75dc, type: 3}
2756+
propertyPath: m_LocalPosition.z
2757+
value: 0
2758+
objectReference: {fileID: 0}
2759+
- target: {fileID: 3152522471886742139, guid: 1b2ae2914c65a400db274270801b75dc, type: 3}
2760+
propertyPath: m_LocalRotation.w
2761+
value: 1
2762+
objectReference: {fileID: 0}
2763+
- target: {fileID: 3152522471886742139, guid: 1b2ae2914c65a400db274270801b75dc, type: 3}
2764+
propertyPath: m_LocalRotation.x
2765+
value: -0
2766+
objectReference: {fileID: 0}
2767+
- target: {fileID: 3152522471886742139, guid: 1b2ae2914c65a400db274270801b75dc, type: 3}
2768+
propertyPath: m_LocalRotation.y
2769+
value: -0
2770+
objectReference: {fileID: 0}
2771+
- target: {fileID: 3152522471886742139, guid: 1b2ae2914c65a400db274270801b75dc, type: 3}
2772+
propertyPath: m_LocalRotation.z
2773+
value: -0
2774+
objectReference: {fileID: 0}
2775+
- target: {fileID: 3152522471886742139, guid: 1b2ae2914c65a400db274270801b75dc, type: 3}
2776+
propertyPath: m_LocalEulerAnglesHint.x
2777+
value: 0
2778+
objectReference: {fileID: 0}
2779+
- target: {fileID: 3152522471886742139, guid: 1b2ae2914c65a400db274270801b75dc, type: 3}
2780+
propertyPath: m_LocalEulerAnglesHint.y
2781+
value: 0
2782+
objectReference: {fileID: 0}
2783+
- target: {fileID: 3152522471886742139, guid: 1b2ae2914c65a400db274270801b75dc, type: 3}
2784+
propertyPath: m_LocalEulerAnglesHint.z
2785+
value: 0
2786+
objectReference: {fileID: 0}
2787+
m_RemovedComponents: []
2788+
m_SourcePrefab: {fileID: 100100000, guid: 1b2ae2914c65a400db274270801b75dc, type: 3}
2789+
--- !u!4 &5711902125622514346 stripped
2790+
Transform:
2791+
m_CorrespondingSourceObject: {fileID: 3152522471886742139, guid: 1b2ae2914c65a400db274270801b75dc, type: 3}
2792+
m_PrefabInstance: {fileID: 7243128248437682385}
2793+
m_PrefabAsset: {fileID: 0}

Assets/Plugins/TransformHandle/Prefabs/OriginIndicator.prefab

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ GameObject:
1212
- component: {fileID: 1759149051611183621}
1313
- component: {fileID: 6000998798864599477}
1414
- component: {fileID: 3595158775386651184}
15-
m_Layer: 0
15+
m_Layer: 6
1616
m_Name: OriginIndicator
1717
m_TagString: Untagged
1818
m_Icon: {fileID: 0}
@@ -28,7 +28,7 @@ Transform:
2828
m_GameObject: {fileID: 2015394401006608186}
2929
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
3030
m_LocalPosition: {x: 0, y: 0, z: 0}
31-
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
31+
m_LocalScale: {x: 0.125, y: 0.125, z: 0.125}
3232
m_ConstrainProportionsScale: 1
3333
m_Children: []
3434
m_Father: {fileID: 0}

Assets/Plugins/TransformHandle/Scripts/Ghost.cs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@ namespace TransformHandle
55
{
66
public class Ghost : MonoBehaviour
77
{
8-
[SerializeField] private GameObject originIndicatorPrefab;
9-
108
private TransformHandleManager _handleManager;
119

12-
private GameObject _originIndicator;
13-
private MeshRenderer _originIndicatorRenderer;
1410

1511
private PosRotScale _initialProperties;
1612

@@ -19,40 +15,13 @@ public class Ghost : MonoBehaviour
1915
public virtual void Initialize()
2016
{
2117
_handleManager = TransformHandleManager.Instance;
22-
23-
if (originIndicatorPrefab == null)
24-
{
25-
Debug.LogWarning("Origin indicator prefab is not set.");
26-
}
27-
else
28-
{
29-
_originIndicator = Instantiate(originIndicatorPrefab);
30-
_originIndicatorRenderer = _originIndicator.GetComponent<MeshRenderer>();
31-
if (_originIndicatorRenderer == null)
32-
{
33-
Debug.LogWarning("Origin indicator prefab does not have a mesh renderer.");
34-
}
35-
}
3618
}
3719

3820
public virtual void Terminate()
3921
{
40-
if(_originIndicator != null) DestroyImmediate(_originIndicator);
4122
DestroyImmediate(gameObject);
4223
}
4324

44-
protected virtual void LateUpdate()
45-
{
46-
if(!_originIndicator) return;
47-
_originIndicator.transform.position = transform.position;
48-
}
49-
50-
public void SetOriginIndicatorColor(Color color)
51-
{
52-
if (_originIndicatorRenderer == null) return;
53-
_originIndicatorRenderer.material.color = color;
54-
}
55-
5625
public void UpdateGhostTransform(PosRotScale average)
5726
{
5827
GhostTransform.position = average.Position;

Assets/Plugins/TransformHandle/Shader/HandleShader.shader

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Shader "HandleShader"
1+
Shader "Handles/Handle"
22
{
33
Properties
44
{
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Shader "Handles/Origin"
2+
{
3+
Properties
4+
{
5+
_Color ("Color", Color) = (1,1,1,1)
6+
}
7+
SubShader
8+
{
9+
Tags { "RenderType"="Transparent" "Queue"="Transparent+1" }
10+
LOD 100
11+
12+
ZWrite On
13+
ZTest Always
14+
Cull Off
15+
Blend SrcAlpha OneMinusSrcAlpha
16+
17+
Pass
18+
{
19+
CGPROGRAM
20+
#pragma vertex vert
21+
#pragma fragment frag
22+
23+
#include "UnityCG.cginc"
24+
25+
struct appdata
26+
{
27+
float4 vertex : POSITION;
28+
};
29+
30+
struct v2f
31+
{
32+
float4 vertex : SV_POSITION;
33+
};
34+
35+
float4 _Color;
36+
37+
v2f vert (appdata v)
38+
{
39+
v2f o;
40+
o.vertex = UnityObjectToClipPos(v.vertex);
41+
return o;
42+
}
43+
44+
fixed4 frag (v2f i) : SV_Target
45+
{
46+
return _Color;
47+
}
48+
ENDCG
49+
}
50+
}
51+
}

0 commit comments

Comments
 (0)