private void OnEnable() { _gizmoEngine = target as RTGizmosEngine; _gizmoEngine.MainToolbar.GetTabByIndex(_generalTab).AddTargetSettings(_gizmoEngine.Settings); _gizmoEngine.MainToolbar.GetTabByIndex(_sceneGizmo).AddTargetSettings(_gizmoEngine.SceneGizmoLookAndFeel); _gizmoEngine.MoveGizmoSettings2D.FoldoutLabel = "2D Mode settings"; _gizmoEngine.MoveGizmoSettings2D.UsesFoldout = true; _gizmoEngine.MoveGizmoSettings3D.FoldoutLabel = "3D Mode settings"; _gizmoEngine.MoveGizmoSettings3D.UsesFoldout = true; _gizmoEngine.MoveGizmoLookAndFeel2D.FoldoutLabel = "2D Mode look & feel"; _gizmoEngine.MoveGizmoLookAndFeel2D.UsesFoldout = true; _gizmoEngine.MoveGizmoLookAndFeel3D.FoldoutLabel = "3D Mode look & feel"; _gizmoEngine.MoveGizmoLookAndFeel3D.UsesFoldout = true; _gizmoEngine.MoveGizmoHotkeys.FoldoutLabel = "Hotkeys"; _gizmoEngine.MoveGizmoHotkeys.UsesFoldout = true; _gizmoEngine.ObjectMoveGizmoSettings.FoldoutLabel = "Object settings"; _gizmoEngine.ObjectMoveGizmoSettings.UsesFoldout = true; _gizmoEngine.RotationGizmoSettings3D.FoldoutLabel = "Settings"; _gizmoEngine.RotationGizmoSettings3D.UsesFoldout = true; _gizmoEngine.RotationGizmoLookAndFeel3D.FoldoutLabel = "Look & feel"; _gizmoEngine.RotationGizmoLookAndFeel3D.UsesFoldout = true; _gizmoEngine.RotationGizmoHotkeys.FoldoutLabel = "Hotkeys"; _gizmoEngine.RotationGizmoHotkeys.UsesFoldout = true; _gizmoEngine.ObjectRotationGizmoSettings.FoldoutLabel = "Object settings"; _gizmoEngine.ObjectRotationGizmoSettings.UsesFoldout = true; _gizmoEngine.ScaleGizmoSettings3D.FoldoutLabel = "Settings"; _gizmoEngine.ScaleGizmoSettings3D.UsesFoldout = true; _gizmoEngine.ScaleGizmoLookAndFeel3D.FoldoutLabel = "Look & feel"; _gizmoEngine.ScaleGizmoLookAndFeel3D.UsesFoldout = true; _gizmoEngine.ScaleGizmoHotkeys.FoldoutLabel = "Hotkeys"; _gizmoEngine.ScaleGizmoHotkeys.UsesFoldout = true; _gizmoEngine.ObjectScaleGizmoSettings.FoldoutLabel = "Object settings"; _gizmoEngine.ObjectScaleGizmoSettings.UsesFoldout = true; _gizmoEngine.UniversalGizmoSettings2D.FoldoutLabel = "2D Mode settings"; _gizmoEngine.UniversalGizmoSettings2D.UsesFoldout = true; _gizmoEngine.UniversalGizmoSettings3D.FoldoutLabel = "3D Mode settings"; _gizmoEngine.UniversalGizmoSettings3D.UsesFoldout = true; _gizmoEngine.UniversalGizmoLookAndFeel2D.FoldoutLabel = "2D Mode look & feel"; _gizmoEngine.UniversalGizmoLookAndFeel2D.UsesFoldout = true; _gizmoEngine.UniversalGizmoLookAndFeel3D.FoldoutLabel = "3D Mode look & feel"; _gizmoEngine.UniversalGizmoLookAndFeel3D.UsesFoldout = true; _gizmoEngine.UniversalGizmoHotkeys.FoldoutLabel = "Hotkeys"; _gizmoEngine.UniversalGizmoHotkeys.UsesFoldout = true; _gizmoEngine.ObjectUniversalGizmoSettings.FoldoutLabel = "Object settings"; _gizmoEngine.ObjectUniversalGizmoSettings.UsesFoldout = true; var tab = _gizmoEngine.MainToolbar.GetTabByIndex(_moveGizmoTab); tab.AddTargetSettings(_gizmoEngine.ObjectMoveGizmoSettings); tab.AddTargetSettings(_gizmoEngine.MoveGizmoSettings3D); tab.AddTargetSettings(_gizmoEngine.MoveGizmoSettings2D); tab.AddTargetSettings(_gizmoEngine.MoveGizmoLookAndFeel3D); tab.AddTargetSettings(_gizmoEngine.MoveGizmoLookAndFeel2D); tab.AddTargetSettings(_gizmoEngine.MoveGizmoHotkeys); tab = _gizmoEngine.MainToolbar.GetTabByIndex(_rotationGizmoTab); tab.AddTargetSettings(_gizmoEngine.ObjectRotationGizmoSettings); tab.AddTargetSettings(_gizmoEngine.RotationGizmoSettings3D); tab.AddTargetSettings(_gizmoEngine.RotationGizmoLookAndFeel3D); tab.AddTargetSettings(_gizmoEngine.RotationGizmoHotkeys); tab = _gizmoEngine.MainToolbar.GetTabByIndex(_scaleGizmoTab); tab.AddTargetSettings(_gizmoEngine.ObjectScaleGizmoSettings); tab.AddTargetSettings(_gizmoEngine.ScaleGizmoSettings3D); tab.AddTargetSettings(_gizmoEngine.ScaleGizmoLookAndFeel3D); tab.AddTargetSettings(_gizmoEngine.ScaleGizmoHotkeys); tab = _gizmoEngine.MainToolbar.GetTabByIndex(_universalGizmoTab); tab.AddTargetSettings(_gizmoEngine.UniversalGizmoConfig); tab.AddTargetSettings(_gizmoEngine.ObjectUniversalGizmoSettings); tab.AddTargetSettings(_gizmoEngine.UniversalGizmoSettings2D); tab.AddTargetSettings(_gizmoEngine.UniversalGizmoSettings3D); tab.AddTargetSettings(_gizmoEngine.UniversalGizmoLookAndFeel2D); tab.AddTargetSettings(_gizmoEngine.UniversalGizmoLookAndFeel3D); tab.AddTargetSettings(_gizmoEngine.UniversalGizmoHotkeys); }
protected override void RenderContent(UnityEngine.Object undoRecordObject) { RTGizmosEngine gizmosEngine = RTGizmosEngine.Get; var content = new GUIContent(); EditorGUILayout.BeginHorizontal(); content.text = "Inherit"; content.tooltip = "Inherit different category of settings from the other gizmos (move, rotate or scale)."; if (GUILayout.Button(content)) { EditorUndoEx.Record(undoRecordObject); if (InheritCategory == UniversalGizmoSettingsCategory.Move) { if (InheritType == UniversalGizmoSettingsType.Settings2D) { gizmosEngine.UniversalGizmoSettings2D.Inherit(gizmosEngine.MoveGizmoSettings2D); } else if (InheritType == UniversalGizmoSettingsType.Settings3D) { gizmosEngine.UniversalGizmoSettings3D.Inherit(gizmosEngine.MoveGizmoSettings3D); } else if (InheritType == UniversalGizmoSettingsType.LookAndFeel2D) { gizmosEngine.UniversalGizmoLookAndFeel2D.Inherit(gizmosEngine.MoveGizmoLookAndFeel2D); } else if (InheritType == UniversalGizmoSettingsType.LookAndFeel3D) { gizmosEngine.UniversalGizmoLookAndFeel3D.Inherit(gizmosEngine.MoveGizmoLookAndFeel3D); } } else if (InheritCategory == UniversalGizmoSettingsCategory.Rotate) { if (InheritType == UniversalGizmoSettingsType.Settings3D) { gizmosEngine.UniversalGizmoSettings3D.Inherit(gizmosEngine.RotationGizmoSettings3D); } else if (InheritType == UniversalGizmoSettingsType.LookAndFeel3D) { gizmosEngine.UniversalGizmoLookAndFeel3D.Inherit(gizmosEngine.RotationGizmoLookAndFeel3D); } } else if (InheritCategory == UniversalGizmoSettingsCategory.Scale) { if (InheritType == UniversalGizmoSettingsType.Settings3D) { gizmosEngine.UniversalGizmoSettings3D.Inherit(gizmosEngine.ScaleGizmoSettings3D); } else if (InheritType == UniversalGizmoSettingsType.LookAndFeel3D) { gizmosEngine.UniversalGizmoLookAndFeel3D.Inherit(gizmosEngine.ScaleGizmoLookAndFeel3D); } } } UniversalGizmoSettingsCategory newCategory; UniversalGizmoSettingsType newInheritType; newCategory = (UniversalGizmoSettingsCategory)EditorGUILayout.EnumPopup(InheritCategory); if (newCategory != InheritCategory) { EditorUndoEx.Record(undoRecordObject); InheritCategory = newCategory; } newInheritType = (UniversalGizmoSettingsType)EditorGUILayout.EnumPopup(InheritType); if (newInheritType != InheritType) { EditorUndoEx.Record(undoRecordObject); InheritType = newInheritType; } EditorGUILayout.EndHorizontal(); content.text = "Display category"; content.tooltip = "Specifies what category of settings are currently displayed for modification."; newCategory = (UniversalGizmoSettingsCategory)EditorGUILayout.EnumPopup(content, DisplayCategory); if (newCategory != DisplayCategory) { EditorUndoEx.Record(undoRecordObject); DisplayCategory = newCategory; } gizmosEngine.UniversalGizmoSettings2D.DisplayCategory = DisplayCategory; gizmosEngine.UniversalGizmoSettings3D.DisplayCategory = DisplayCategory; gizmosEngine.UniversalGizmoLookAndFeel2D.DisplayCategory = DisplayCategory; gizmosEngine.UniversalGizmoLookAndFeel3D.DisplayCategory = DisplayCategory; gizmosEngine.UniversalGizmoSettings2D.CanBeDisplayed = true; gizmosEngine.UniversalGizmoLookAndFeel2D.CanBeDisplayed = true; gizmosEngine.UniversalGizmoSettings3D.CanBeDisplayed = true; gizmosEngine.UniversalGizmoLookAndFeel3D.CanBeDisplayed = true; if (DisplayCategory != UniversalGizmoSettingsCategory.Move) { gizmosEngine.UniversalGizmoSettings2D.CanBeDisplayed = false; gizmosEngine.UniversalGizmoLookAndFeel2D.CanBeDisplayed = false; } }