예제 #1
0
 public void SetTool(EditorTool targetTool)
 {
     if (tileSelector == null)
     {
         tileSelector = new GameObject("TileSelector").AddComponent <TileSelector>(); tileSelector.transform.SetParent(ScenePrimer.curPrimerComponent.primerParrentObj.transform);
     }
     if (targetTool == curEditorTool)
     {
         curEditorTool.PreToolDeActivation();
         tileSelector = curEditorTool.curTileSelector;
         tileSelector.gameObject.SetActive(false);
         curEditorTool = null;
     }
     else
     {
         if (curEditorTool != null)
         {
             curEditorTool.PreToolDeActivation();
             tileSelector = curEditorTool.curTileSelector;
             tileSelector.gameObject.SetActive(false);
         }
         curEditorTool = targetTool;
         tileSelector.gameObject.SetActive(true);
         curEditorTool.curTileSelector = tileSelector;
         curEditorTool.PreToolActivation();
     }
 }
예제 #2
0
 public void DeActivateTool()
 {
     if (curEditorTool != null)
     {
         curEditorTool.PreToolDeActivation();
         tileSelector = curEditorTool.curTileSelector;
         tileSelector.gameObject.SetActive(false);
         curEditorTool = null;
     }
 }