コード例 #1
0
 // TODO: move to dedicated manager
 internal static void Register(ChiselEditToolBase editMode)
 {
     if (editMode.GetType() == typeof(ChiselCreateTool))
     {
         return;
     }
     editModes[editMode.ToolName] = editMode;
 }
コード例 #2
0
 internal static void Register(ChiselEditToolBase editMode)
 {
     if (editMode.GetType() == typeof(ChiselPlacementTool))
     {
         return;
     }
     editModes[editMode.ToolName] = editMode;
     editMode.UpdateIcon();
 }
コード例 #3
0
        static void EditModeButton(Rect position, bool enabled, ChiselEditToolBase editMode, GUIStyle style)
        {
            var editModeType = editMode.GetType();

            using (new EditorGUI.DisabledScope(!enabled))
            {
                EditorGUI.BeginChangeCheck();
                var value = Toggle(position, editMode, editModeType, style);
                if (EditorGUI.EndChangeCheck() && value)
                {
                    ToolManager.SetActiveTool(editModeType);
                    ChiselEditorSettings.Save();
                }
            }
        }