internal static void ChangeEditMode(EditMode.SceneViewEditMode mode, Bounds bounds, IToolModeOwner owner) { IToolModeOwner toolModeOwner = InternalEditorUtility.GetObjectFromInstanceID(EditMode.ownerID) as IToolModeOwner; EditMode.editMode = mode; EditMode.ownerID = ((mode == EditMode.SceneViewEditMode.None) ? 0 : owner.GetInstanceID()); if (EditMode.onEditModeEndDelegate != null && toolModeOwner is Editor) { EditMode.onEditModeEndDelegate(toolModeOwner as Editor); } if (EditMode.editModeEnded != null) { EditMode.editModeEnded(toolModeOwner); } if (EditMode.editMode != EditMode.SceneViewEditMode.None) { if (EditMode.onEditModeStartDelegate != null && owner is Editor) { EditMode.onEditModeStartDelegate(owner as Editor, EditMode.editMode); } if (EditMode.editModeStarted != null) { EditMode.editModeStarted(owner, EditMode.editMode); } } EditMode.EditModeChanged(bounds); InspectorWindow.RepaintAllInspectors(); }
private static void ChangeEditMode(EditMode.SceneViewEditMode mode, Bounds bounds, Editor caller) { Editor editor = InternalEditorUtility.GetObjectFromInstanceID(EditMode.ownerID) as Editor; EditMode.editMode = mode; EditMode.ownerID = ((mode == EditMode.SceneViewEditMode.None) ? 0 : caller.GetInstanceID()); if (EditMode.onEditModeEndDelegate != null) { EditMode.onEditModeEndDelegate(editor); } if (EditMode.editMode != EditMode.SceneViewEditMode.None && EditMode.onEditModeStartDelegate != null) { EditMode.onEditModeStartDelegate(caller, EditMode.editMode); } EditMode.EditModeChanged(bounds); InspectorWindow.RepaintAllInspectors(); }