/// <summary> /// This method can be called to redo the action. /// </summary> public void Redo() { EditorGizmoSystem gizmoSystem = EditorGizmoSystem.Instance; gizmoSystem.TurnOffGizmos(); GizmosTurnedOffMessage.SendToInterestedListeners(_activeGizmoType); }
/// <summary> /// Executes the action. /// </summary> public void Execute() { // Execute the action if the gizmos are not already turned off EditorGizmoSystem gizmoSystem = EditorGizmoSystem.Instance; if (!gizmoSystem.AreGizmosTurnedOff) { gizmoSystem.TurnOffGizmos(); GizmosTurnedOffMessage.SendToInterestedListeners(_activeGizmoType); EditorUndoRedoSystem.Instance.RegisterAction(this); } }
/// <summary> /// Convenience function for sending a gizmos turned off message to /// all interested listeners. /// </summary> /// <param name="activeGizmoType"> /// This represents the type of gizmo that was active before the gizmos /// were turned off. /// </param> public static void SendToInterestedListeners(GizmoType activeGizmoType) { var message = new GizmosTurnedOffMessage(activeGizmoType); MessageListenerDatabase.Instance.SendMessageToInterestedListeners(message); }