コード例 #1
0
        VertexManipulationTool GetToolForSelectMode(Tool tool, SelectMode mode)
        {
            switch (tool)
            {
            case Tool.Move:
                return(mode.IsTextureMode()
                        ? GetTool <TextureMoveTool>()
                        : GetTool <PositionMoveTool>());

            case Tool.Rotate:
                return(mode.IsTextureMode()
                        ? GetTool <TextureRotateTool>()
                        : GetTool <PositionRotateTool>());

            case Tool.Scale:
                return(mode.IsTextureMode()
                        ? GetTool <TextureScaleTool>()
                        : GetTool <PositionScaleTool>());

            default:
                return(null);
            }
        }
コード例 #2
0
 static void UpdateToolContext()
 {
     if (selectMode.IsPositionMode() && ToolManager.activeContextType != typeof(PositionToolContext))
     {
         ToolManager.SetActiveContext <PositionToolContext>();
     }
     else if (selectMode.IsTextureMode() && ToolManager.activeContextType != typeof(TextureToolContext))
     {
         ToolManager.SetActiveContext <TextureToolContext>();
     }
     else if (!selectMode.IsPositionMode())
     {
         ToolManager.SetActiveContext <GameObjectToolContext>();
     }
 }