コード例 #1
0
 public static void addSelection(Transform select)
 {
     HighlighterTool.highlight(select, Color.yellow);
     EditorObjects.selectDecals(select, true);
     EditorObjects.selection.Add(new EditorSelection(select, select.parent, select.position, select.rotation, select.localScale));
     EditorObjects.calculateHandleOffsets();
 }
コード例 #2
0
 private static void clearSelection()
 {
     for (int i = 0; i < EditorObjects.selection.Count; i++)
     {
         if (EditorObjects.selection[i].transform != null)
         {
             HighlighterTool.unhighlight(EditorObjects.selection[i].transform);
             EditorObjects.selectDecals(EditorObjects.selection[i].transform, false);
             EditorObjects.selection[i].transform.parent = EditorObjects.selection[i].parent;
             if (EditorObjects.selection[i].transform.CompareTag("Barricade") || EditorObjects.selection[i].transform.CompareTag("Structure"))
             {
                 EditorObjects.selection[i].transform.localScale = Vector3.one;
             }
         }
     }
     EditorObjects.selection.Clear();
     EditorObjects.calculateHandleOffsets();
 }
コード例 #3
0
 public static void removeSelection(Transform select)
 {
     for (int i = 0; i < EditorObjects.selection.Count; i++)
     {
         if (EditorObjects.selection[i].transform == select)
         {
             HighlighterTool.unhighlight(select);
             EditorObjects.selectDecals(select, false);
             EditorObjects.selection[i].transform.parent = EditorObjects.selection[i].parent;
             if (EditorObjects.selection[i].transform.CompareTag("Barricade") || EditorObjects.selection[i].transform.CompareTag("Structure"))
             {
                 EditorObjects.selection[i].transform.localScale = Vector3.one;
             }
             EditorObjects.selection.RemoveAt(i);
             break;
         }
     }
     EditorObjects.calculateHandleOffsets();
 }