-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathDebugXSample_Other.cs
More file actions
49 lines (44 loc) · 1.85 KB
/
Copy pathDebugXSample_Other.cs
File metadata and controls
49 lines (44 loc) · 1.85 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using DCFApixels.DebugXCore.Samples.Internal;
using UnityEngine;
namespace DCFApixels.DebugXCore.Samples
{
[SelectionBase]
public class DebugXSample_Other : MonoBehaviour
{
public Gradient Gradient;
public float GradientMultiplier = 5;
public Color TextBackgroundColor = Color.white;
public Transform[] Points;
#if UNITY_EDITOR
private void OnDrawGizmos()
{
Draw();
}
#else
private void Update()
{
Draw();
}
#endif
private void Draw()
{
int i = -1;
const float RADIUS_M = 0.5f;
i++; DebugX.Draw(GetColor(Points[i])).BillboardCross(Points[i].position, Points[i].localScale.x);
i++; DebugX.Draw(GetColor(Points[i])).BillboardCircle(Points[i].position, Points[i].localScale.x * RADIUS_M);
i++; DebugX.Draw(GetColor(Points[i])).WireMesh<SphereMesh>(Points[i].position, Points[i].rotation, Points[i].localScale * RADIUS_M);
i++; DebugX.Draw(GetColor(Points[i])).Text(Points[i].position, Points[i].name, DebugXTextSettings.WorldSpace.Size(26).BackgroundColor(TextBackgroundColor));
i++; DebugX.Draw(GetColor(Points[i])).Dot(Points[i].position);
i++; DebugX.Draw(GetColor(Points[i])).WireDot(Points[i].position);
i++; DebugX.Draw(GetColor(Points[i])).DotQuad(Points[i].position);
i++; DebugX.Draw(GetColor(Points[i])).WireDotQuad(Points[i].position);
i++; DebugX.Draw(GetColor(Points[i])).DotDiamond(Points[i].position);
i++; DebugX.Draw(GetColor(Points[i])).WireDotDiamond(Points[i].position);
i++; DebugX.Draw(GetColor(Points[i])).DotCross(Points[i].position);
}
private Color GetColor(Transform pos1)
{
return Gradient.Evaluate(pos1, GradientMultiplier);
}
}
}