-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVisAID.cs
More file actions
35 lines (30 loc) · 1.17 KB
/
VisAID.cs
File metadata and controls
35 lines (30 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using UnityEngine;
public class VisAID : MonoBehaviour
{
[Header("Basics")]
[SerializeField] private bool _EnableVisAID = true;
[SerializeField] private Color _Colour = new Color(1f, 0f, 0f, 1f);
[Header("Sphere Rendering")]
[SerializeField] private bool _EnableCentralSphere = true;
[SerializeField] private float _SphereSize = .15f;
[Header("Line Rendering")]
[SerializeField] private bool _EnableLineRendering = false;
[SerializeField] private float _LineLength = 1f;
[SerializeField] private bool _EnableSphereEndPoint = false;
private void OnDrawGizmosSelected()
{
if (_EnableVisAID)
{
Gizmos.color = _Colour;
if (_EnableCentralSphere)
{
Gizmos.DrawWireSphere(transform.position, _SphereSize);
}
if (_EnableLineRendering)
{
Gizmos.DrawLine(transform.position, transform.position + transform.right * _LineLength);
if (_EnableSphereEndPoint) {Gizmos.DrawWireSphere(transform.position + transform.right * _LineLength, _SphereSize);}
}
}
}
}