protected void OnEditModeStart(Editor editor, EditMode.SceneViewEditMode mode) { if (mode == EditMode.SceneViewEditMode.Collider && editor == this) { this.OnEditStart(); } }
public static void DoInspectorToolbar(EditMode.SceneViewEditMode[] modes, GUIContent[] guiContents, Bounds bounds, Editor caller) { if (!EditorUtility.IsPersistent(caller.target)) { EditMode.DetectMainToolChange(); if (EditMode.s_ToolbarBaseStyle == null) { EditMode.s_ToolbarBaseStyle = "Command"; } int instanceID = caller.GetInstanceID(); int num = ArrayUtility.IndexOf <EditMode.SceneViewEditMode>(modes, EditMode.editMode); if (EditMode.ownerID != instanceID) { num = -1; } EditorGUI.BeginChangeCheck(); int num2 = GUILayout.Toolbar(num, guiContents, EditMode.s_ToolbarBaseStyle, new GUILayoutOption[0]); if (EditorGUI.EndChangeCheck()) { EditMode.SceneViewEditMode mode = (num2 != num) ? modes[num2] : EditMode.SceneViewEditMode.None; EditMode.ChangeEditMode(mode, bounds, caller); } } }
private static void DoEditModeInspectorModeButton(EditMode.SceneViewEditMode mode, string label, GUIContent icon, Func <Bounds> getBoundsOfTargets, IToolModeOwner owner) { EditMode.DetectMainToolChange(); Rect controlRect = EditorGUILayout.GetControlRect(true, 23f, EditMode.Styles.singleButtonStyle, new GUILayoutOption[0]); Rect position = new Rect(controlRect.xMin + EditorGUIUtility.labelWidth, controlRect.yMin, 33f, 23f); GUIContent content = new GUIContent(label); Vector2 vector = GUI.skin.label.CalcSize(content); Rect position2 = new Rect(position.xMax + 5f, controlRect.yMin + (controlRect.height - vector.y) * 0.5f, vector.x, controlRect.height); int instanceID = owner.GetInstanceID(); bool value = EditMode.editMode == mode && EditMode.ownerID == instanceID; EditorGUI.BeginChangeCheck(); bool flag = false; using (new EditorGUI.DisabledScope(!owner.areToolModesAvailable)) { flag = GUI.Toggle(position, value, icon, EditMode.Styles.singleButtonStyle); GUI.Label(position2, label); } if (EditorGUI.EndChangeCheck()) { EditMode.ChangeEditMode((!flag) ? EditMode.SceneViewEditMode.None : mode, (getBoundsOfTargets != null) ? getBoundsOfTargets() : owner.GetWorldBoundsOfTargets(), owner); } }
private static void EndSceneViewEditing() { EditMode.ChangeEditMode(EditMode.SceneViewEditMode.None, new Bounds(Vector3.zero, Vector3.positiveInfinity), null); }
private bool IsReflectionProbeEditMode(EditMode.SceneViewEditMode editMode) { return ((editMode == EditMode.SceneViewEditMode.ReflectionProbeBox) || (editMode == EditMode.SceneViewEditMode.ReflectionProbeOrigin)); }
public static void OnSelectionChange() { EditMode.QuitEditMode(); }
private static void EndSceneViewEditing() { EditMode.ChangeEditMode(EditMode.SceneViewEditMode.None, default(Bounds), null); }
internal static void DoEditModeInspectorModeButton(EditMode.SceneViewEditMode mode, string label, GUIContent icon, IToolModeOwner owner) { EditMode.DoEditModeInspectorModeButton(mode, label, icon, null, owner); }
private static void EditModeChanged(Bounds bounds) { if (EditMode.editMode != EditMode.SceneViewEditMode.None && (UnityEngine.Object)SceneView.lastActiveSceneView != (UnityEngine.Object)null && ((UnityEngine.Object)SceneView.lastActiveSceneView.camera != (UnityEngine.Object)null && !EditMode.SeenByCamera(SceneView.lastActiveSceneView.camera, bounds))) { SceneView.lastActiveSceneView.Frame(bounds); } SceneView.RepaintAll(); }
private static void EndSceneViewEditing() { EditMode.ChangeEditMode(EditMode.SceneViewEditMode.None, new Bounds(), (Editor)null); }
private bool IsReflectionProbeEditMode(EditMode.SceneViewEditMode editMode) { return editMode == EditMode.SceneViewEditMode.ReflectionProbeBox || editMode == EditMode.SceneViewEditMode.ReflectionProbeOrigin; }
private static void ChangeEditMode(EditMode.SceneViewEditMode mode, Bounds bounds, Editor caller) { Editor objectFromInstanceId = InternalEditorUtility.GetObjectFromInstanceID(EditMode.ownerID) as Editor; EditMode.editMode = mode; EditMode.ownerID = mode == EditMode.SceneViewEditMode.None ? 0 : caller.GetInstanceID(); if (EditMode.onEditModeEndDelegate != null) EditMode.onEditModeEndDelegate(objectFromInstanceId); if (EditMode.editMode != EditMode.SceneViewEditMode.None && EditMode.onEditModeStartDelegate != null) EditMode.onEditModeStartDelegate(caller, EditMode.editMode); EditMode.EditModeChanged(bounds); InspectorWindow.RepaintAllInspectors(); }
public static void DoInspectorToolbar(EditMode.SceneViewEditMode[] modes, GUIContent[] guiContents, Bounds bounds, Editor caller) { if (EditorUtility.IsPersistent(caller.target)) return; EditMode.DetectMainToolChange(); if (EditMode.s_ToolbarBaseStyle == null) EditMode.s_ToolbarBaseStyle = (GUIStyle) "Command"; int instanceId = caller.GetInstanceID(); int selected = ArrayUtility.IndexOf<EditMode.SceneViewEditMode>(modes, EditMode.editMode); if (EditMode.ownerID != instanceId) selected = -1; EditorGUI.BeginChangeCheck(); int index = GUILayout.Toolbar(selected, guiContents, EditMode.s_ToolbarBaseStyle, new GUILayoutOption[0]); if (!EditorGUI.EndChangeCheck()) return; EditMode.ChangeEditMode(index != selected ? modes[index] : EditMode.SceneViewEditMode.None, bounds, caller); }
public static void DoEditModeInspectorModeButton(EditMode.SceneViewEditMode mode, string label, GUIContent icon, Bounds bounds, Editor caller) { EditMode.DoEditModeInspectorModeButton(mode, label, icon, () => bounds, caller); }
private bool IsLightProbeVolumeProxyEditMode(EditMode.SceneViewEditMode editMode) { return ((editMode == EditMode.SceneViewEditMode.LightProbeProxyVolumeBox) || (editMode == EditMode.SceneViewEditMode.LightProbeProxyVolumeOrigin)); }
public static void DoEditModeInspectorModeButton(EditMode.SceneViewEditMode mode, string label, GUIContent icon, Func <Bounds> getBoundsOfTargets, Editor caller) { EditMode.DoEditModeInspectorModeButton(mode, label, icon, getBoundsOfTargets, caller); }
public static bool IsOwner(Editor editor) { return(EditMode.IsOwner(editor)); }
private static Vector3[] GetPoints(Bounds bounds) { return(EditMode.BoundsToPoints(bounds)); }
private static bool SeenByCamera(Camera camera, Bounds bounds) { return(EditMode.AnyPointSeenByCamera(camera, EditMode.GetPoints(bounds))); }
public static void DoInspectorToolbar(EditMode.SceneViewEditMode[] modes, GUIContent[] guiContents, Bounds bounds, Editor caller) { if (EditorUtility.IsPersistent(caller.target)) { return; } EditMode.DetectMainToolChange(); if (EditMode.s_ToolbarBaseStyle == null) { EditMode.s_ToolbarBaseStyle = "Command"; } int instanceID = caller.GetInstanceID(); int num = ArrayUtility.IndexOf<EditMode.SceneViewEditMode>(modes, EditMode.editMode); if (EditMode.ownerID != instanceID) { num = -1; } EditorGUI.BeginChangeCheck(); int num2 = GUILayout.Toolbar(num, guiContents, EditMode.s_ToolbarBaseStyle, new GUILayoutOption[0]); if (EditorGUI.EndChangeCheck()) { EditMode.SceneViewEditMode mode = (num2 != num) ? modes[num2] : EditMode.SceneViewEditMode.None; EditMode.ChangeEditMode(mode, bounds, caller); } }
internal static void ChangeEditMode(EditMode.SceneViewEditMode mode, IToolModeOwner owner) { EditMode.ChangeEditMode(mode, owner.GetWorldBoundsOfTargets(), owner); }
private static void EditModeChanged(Bounds bounds) { if (EditMode.editMode != EditMode.SceneViewEditMode.None && SceneView.lastActiveSceneView != null && SceneView.lastActiveSceneView.camera != null && !EditMode.SeenByCamera(SceneView.lastActiveSceneView.camera, bounds)) { SceneView.lastActiveSceneView.Frame(bounds, EditorApplication.isPlaying); } SceneView.RepaintAll(); }
public static void ChangeEditMode(EditMode.SceneViewEditMode mode, Bounds bounds, Editor caller) { EditMode.ChangeEditMode(mode, bounds, caller); }
internal static void DoInspectorToolbar(EditMode.SceneViewEditMode[] modes, GUIContent[] guiContents, IToolModeOwner owner) { EditMode.DoInspectorToolbar(modes, guiContents, null, owner); }
public static void DoInspectorToolbar(EditMode.SceneViewEditMode[] modes, GUIContent[] guiContents, Func <Bounds> getBoundsOfTargets, Editor caller) { EditMode.DoInspectorToolbar(modes, guiContents, getBoundsOfTargets, caller); }
public static void DoInspectorToolbar(EditMode.SceneViewEditMode[] modes, GUIContent[] guiContents, Bounds bounds, Editor caller) { EditMode.DoInspectorToolbar(modes, guiContents, () => bounds, caller); }
public static void DoEditModeInspectorModeButton(EditMode.SceneViewEditMode mode, string label, GUIContent icon, Bounds bounds, Editor caller) { if (EditorUtility.IsPersistent(caller.target)) return; EditMode.DetectMainToolChange(); if (EditMode.s_EditColliderButtonStyle == null) { EditMode.s_EditColliderButtonStyle = new GUIStyle((GUIStyle) "Button"); EditMode.s_EditColliderButtonStyle.padding = new RectOffset(0, 0, 0, 0); EditMode.s_EditColliderButtonStyle.margin = new RectOffset(0, 0, 0, 0); } Rect controlRect = EditorGUILayout.GetControlRect(true, 23f, new GUILayoutOption[0]); Rect position1 = new Rect(controlRect.xMin + EditorGUIUtility.labelWidth, controlRect.yMin, 33f, 23f); Vector2 vector2 = GUI.skin.label.CalcSize(new GUIContent(label)); Rect position2 = new Rect(position1.xMax + 5f, controlRect.yMin + (float) (((double) controlRect.height - (double) vector2.y) * 0.5), vector2.x, controlRect.height); int instanceId = caller.GetInstanceID(); bool flag1 = EditMode.editMode == mode && EditMode.ownerID == instanceId; EditorGUI.BeginChangeCheck(); bool flag2 = GUI.Toggle(position1, flag1, icon, EditMode.s_EditColliderButtonStyle); GUI.Label(position2, label); if (!EditorGUI.EndChangeCheck()) return; EditMode.ChangeEditMode(!flag2 ? EditMode.SceneViewEditMode.None : mode, bounds, caller); }