A game about forced loneliness, made by TACStudios
1using UnityEngine;
2using UnityHandles = UnityEditor.Handles;
3using UnityTexture2D = UnityEngine.Texture2D;
4
5namespace UnityEditor.U2D.Sprites
6{
7 internal interface IHandles
8 {
9 Color color { get; set; }
10 Matrix4x4 matrix { get; set; }
11
12 Vector3[] MakeBezierPoints(Vector3 startPosition, Vector3 endPosition, Vector3 startTangent, Vector3 endTangent, int division);
13
14 void DrawAAPolyLine(ITexture2D lineTex, float width, params Vector3[] points);
15 void DrawAAPolyLine(ITexture2D lineTex, params Vector3[] points);
16
17 void DrawLine(Vector3 p1, Vector3 p2);
18
19 void SetDiscSectionPoints(Vector3[] dest, Vector3 center, Vector3 normal, Vector3 from, float angle, float radius);
20 }
21
22 internal class HandlesSystem : IHandles
23 {
24 static IHandles m_System;
25
26 static public void SetSystem(IHandles system)
27 {
28 m_System = system;
29 }
30
31 static public IHandles GetSystem()
32 {
33 if (m_System == null)
34 m_System = new HandlesSystem();
35 return m_System;
36 }
37
38 public Color color
39 {
40 get { return UnityHandles.color; }
41 set { UnityHandles.color = value; }
42 }
43 public Matrix4x4 matrix
44 {
45 get { return UnityHandles.matrix; }
46 set { UnityHandles.matrix = value; }
47 }
48
49 public Vector3[] MakeBezierPoints(Vector3 startPosition, Vector3 endPosition, Vector3 startTangent, Vector3 endTangent, int division)
50 {
51 return UnityHandles.MakeBezierPoints(startPosition, endPosition, startTangent, endTangent, division);
52 }
53
54 public void DrawAAPolyLine(ITexture2D lineTex, float width, params Vector3[] points)
55 {
56 UnityHandles.DrawAAPolyLine((UnityTexture2D)lineTex, width, points);
57 }
58
59 public void DrawAAPolyLine(ITexture2D lineTex, params Vector3[] points)
60 {
61 UnityHandles.DrawAAPolyLine((UnityTexture2D)lineTex, points);
62 }
63
64 public void DrawLine(Vector3 p1, Vector3 p2)
65 {
66 UnityHandles.DrawLine(p1, p2);
67 }
68
69 public void SetDiscSectionPoints(Vector3[] dest, Vector3 center, Vector3 normal, Vector3 from, float angle, float radius)
70 {
71 UnityHandles.SetDiscSectionPoints(dest, center, normal, from, angle, radius);
72 }
73 }
74}