File tree 3 files changed +9
-21
lines changed
3 files changed +9
-21
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ public class CursorObject : MonoBehaviour
30
30
private float baseRadius ;
31
31
32
32
public Color autoColor ;
33
+ public bool showCursor = true ;
33
34
34
35
35
36
public void Start ( )
@@ -38,7 +39,6 @@ public void Start()
38
39
baseLightIntensity = LightIntensity ;
39
40
baseRadius = Radius ;
40
41
}
41
-
42
42
43
43
public Vector3 Position
44
44
{
@@ -73,8 +73,6 @@ public Color Color
73
73
}
74
74
}
75
75
76
-
77
-
78
76
public bool Visible
79
77
{
80
78
get { return GetComponent < MeshRenderer > ( ) . enabled ; }
@@ -85,10 +83,12 @@ public bool Visible
85
83
}
86
84
}
87
85
88
-
89
-
90
86
public void SetVisibility ( float visibility , bool transparent = false )
91
87
{
88
+ if ( ! showCursor )
89
+ {
90
+ return ;
91
+ }
92
92
//cursor.Radius = Mathf.Lerp(baseCursorRadius * 0.1f, baseCursorRadius, visibility);
93
93
Color c = Color . Lerp ( autoColor , baseColor , visibility ) ;
94
94
c . a = transparent ? Mathf . Lerp ( 0 , 1 , visibility ) : 1 ;
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ public class RayCursor : MonoBehaviour
67
67
public bool rayFiltered ;
68
68
69
69
public float minHighlightDist = 100f ;
70
+ public bool showCursor = true ;
70
71
71
72
// Start is called before the first frame update
72
73
void Start ( )
@@ -252,8 +253,8 @@ public override void Init()
252
253
253
254
cursor . Distance = CurrentDistance ;
254
255
255
- ray . Visible = true ;
256
- cursor . Visible = true ;
256
+ ray . Visible = true && cursorManager . showCursor ;
257
+ cursor . Visible = true && cursorManager . showCursor ;
257
258
258
259
}
259
260
Original file line number Diff line number Diff line change @@ -44,7 +44,6 @@ public void Start()
44
44
parent = transform . parent . gameObject ;
45
45
}
46
46
47
-
48
47
public GameObject Parent
49
48
{
50
49
get { return parent ; }
@@ -60,9 +59,6 @@ public GameObject Parent
60
59
}
61
60
}
62
61
63
-
64
-
65
-
66
62
public bool FilterEnabled
67
63
{
68
64
set
@@ -78,7 +74,6 @@ public bool FilterEnabled
78
74
get { return oneEuroFilter != null ; }
79
75
}
80
76
81
-
82
77
public float FilterMinCutoff
83
78
{
84
79
get { return minCutoff ; }
@@ -101,8 +96,6 @@ public float FilterBeta
101
96
}
102
97
}
103
98
104
-
105
-
106
99
public void Update ( )
107
100
{
108
101
if ( oneEuroFilter != null )
@@ -111,8 +104,6 @@ public void Update()
111
104
transform . position = parent . transform . position ;
112
105
}
113
106
}
114
-
115
-
116
107
117
108
public float Distance
118
109
{
@@ -126,8 +117,6 @@ public float Distance
126
117
lineRenderer . SetPosition ( 1 , Vector3 . forward * 1000 ) ;
127
118
}
128
119
}
129
-
130
-
131
120
132
121
public bool HideRayAfterCursor
133
122
{
@@ -139,8 +128,6 @@ public bool HideRayAfterCursor
139
128
}
140
129
}
141
130
142
-
143
-
144
131
public bool Visible
145
132
{
146
133
get { return lineRenderer . enabled ; }
@@ -151,4 +138,4 @@ public bool Visible
151
138
}
152
139
153
140
}
154
- }
141
+ }
You can’t perform that action at this time.
0 commit comments