示例#1
0
 void HandleUndoRedoPerformed()
 {
     if (ToolManager.IsActiveTool(this))
     {
         m_CurrentState = ShapeState.ResetState();
     }
 }
 void ActionPerformed(MenuAction newActionPerformed)
 {
     if (ToolManager.IsActiveTool(m_Tool) && newActionPerformed.GetType() != this.GetType())
     {
         LeaveTool();
     }
 }
示例#3
0
 void OnActiveToolChanged()
 {
     if (ToolManager.IsActiveTool(this))
     {
         SetBounds(currentShapeInOverlay.size);
     }
 }
示例#4
0
 void OnSelectionChanged()
 {
     if (ToolManager.IsActiveTool(this))
     {
         if (Selection.activeGameObject != null)
         {
             m_CurrentState = ShapeState.ResetState();
             ToolManager.RestorePreviousTool();
         }
     }
 }
 void OnSelectionChanged()
 {
     if (ToolManager.IsActiveTool(this))
     {
         if (Selection.activeGameObject != null &&
             MeshSelection.activeMesh != currentShapeInOverlay.mesh)
         {
             m_CurrentState = ShapeState.ResetState();
             ToolManager.RestorePreviousTool();
         }
     }
 }
示例#6
0
 void OnSelectionChanged()
 {
     if (ToolManager.IsActiveTool(this))
     {
         if (Selection.activeGameObject != null &&
             (MeshSelection.activeMesh == null ||
              MeshSelection.activeMesh.GetComponent <ProBuilderShape>() == null))
         {
             m_CurrentState = ShapeState.ResetState();
             ToolManager.RestorePreviousTool();
         }
     }
 }
示例#7
0
 void OnToolChanged()
 {
     if (ToolManager.IsActiveTool(this))
     {
         UpdateTarget();
         if (polygon == null)
         {
             End();
         }
     }
     else if (polygon != null)
     {
         End();
     }
 }
示例#8
0
 void OnToolChanged()
 {
     if (ToolManager.IsActiveTool(this))
     {
         UpdateTarget();
         if (polygon == null)
         {
             End();
         }
     }
     else if (polygon != null)
     {
         End();
         EditorApplication.delayCall += () => CheckForSelectModeAfterToolQuit();
     }
 }
示例#9
0
        void OnSelectModeChanged(SelectMode selectMode)
        {
            if (!ToolManager.IsActiveTool(this))
            {
                return;
            }

            if (MeshSelection.activeMesh)
            {
                PolyShape shape = MeshSelection.activeMesh.GetComponent <PolyShape>();
                if (shape != null && shape != polygon || selectMode != SelectMode.Object)
                {
                    LeaveTool(false);
                }
            }
        }
示例#10
0
        void OnObjectSelectionChanged()
        {
            if (!ToolManager.IsActiveTool(this) || polygon == null)
            {
                return;
            }

            if (MeshSelection.activeMesh)
            {
                PolyShape shape = MeshSelection.activeMesh.GetComponent <PolyShape>();
                if (shape == null)
                {
                    LeaveTool(true);
                }
                else if (shape != polygon)
                {
                    UpdateTarget(shape);
                }
            }
        }
 public static bool IsActiveTool(EditorTool tool)
 {
     return(ToolManager.IsActiveTool(tool));
 }