Пример #1
0
 public void Remove()
 {
     if (!isAdded)
     {
         return;
     }
     GizmoDebug.RemoveGizmo(this);
     isAdded = false;
 }
Пример #2
0
 public void Add()
 {
     if (isAdded)
     {
         return;
     }
     GizmoDebug.StartGizmo(this);
     isAdded = true;
 }
Пример #3
0
        // this method is use to append data to List and initiate singleton if there is not such thing
        public static void StartGizmo <T>(T gizmoData)
        {
            #region init singleton
            if (singleton == null)
            {
                singleton = new GameObject("GizmoDebug").AddComponent <GizmoDebug>();
            }
            #endregion

            #region Append Data to List
            if (gizmoData.GetType() == typeof(GizLineData)) // if gizmoData is a line
            {
                singleton._lines.Add(gizmoData as GizLineData);
            }
            else if (gizmoData.GetType() == typeof(GizBoxData)) // if gizmoData is a Box
            {
                singleton._boxes.Add(gizmoData as GizBoxData);
            }
            else if (gizmoData.GetType() == typeof(GizSphereData)) // if gizmoData is a Sphere
            {
                singleton._sphere.Add(gizmoData as GizSphereData);
            }
            #endregion
        }