コード例 #1
0
 public ConvertToBrushesButton()
 {
     ChiselToolbarUtility.SetupToolbarElement(this, kIcon, kTooltip);
     this.clicked += OnClicked;
     ChiselSelectionManager.GeneratorSelectionUpdated += UpdateEnabledState;
     UpdateEnabledState();
 }
コード例 #2
0
        public static void DeactivateTool(bool selectNode = false)
        {
            if (!IsActive())
            {
                return;
            }
            // Unity has unreliable events
            ChiselGeneratorManager.GeneratorMode.OnDeactivate();
            ToolManager.RestorePreviousPersistentTool();
            if (!IsActive())
            {
                return;
            }

            if (selectNode && ChiselToolbarUtility.HaveNodesInSelection())
            {
                ChiselEditGeneratorTool.ActivateTool();
                if (!IsActive())
                {
                    return;
                }
            }

            ToolManager.RestorePreviousTool();
            if (!IsActive())
            {
                return;
            }

            Tools.current = Tool.Move;
        }
コード例 #3
0
 public ChiselToggle(string iconName, string tooltipName)
 {
     ChiselToolbarUtility.SetupToolbarElement(this, iconName, tooltipName);
     UpdateEnabledState();
 }
コード例 #4
0
 public RebuildAllButton()
 {
     ChiselToolbarUtility.SetupToolbarElement(this, kIcon, kTooltip);
     this.clicked += OnClicked;
 }
コード例 #5
0
 public CenterPivotOnEachNodeInSelectionButton()
 {
     ChiselToolbarUtility.SetupToolbarElement(this, kIcon, kTooltip);
     this.clicked += OnClicked;
 }