ButtonWithAnimatedIconRotation GetCollabButton() { if (m_CollabButton == null) { const int repaintsPerSecond = 20; const float animSpeed = 500f; const bool mouseDownButton = true; m_CollabButton = new ButtonWithAnimatedIconRotation(() => (float)EditorApplication.timeSinceStartup * animSpeed, Toolbar.RepaintToolbar, repaintsPerSecond, mouseDownButton); } return(m_CollabButton); }
public void OnEnable() { EditorApplication.modifierKeysChanged = (EditorApplication.CallbackFunction)Delegate.Combine(EditorApplication.modifierKeysChanged, new EditorApplication.CallbackFunction(base.Repaint)); Undo.undoRedoPerformed = (Undo.UndoRedoCallback)Delegate.Combine(Undo.undoRedoPerformed, new Undo.UndoRedoCallback(this.OnSelectionChange)); UnityConnect.instance.StateChanged += new UnityEditor.Connect.StateChangedDelegate(this.OnUnityConnectStateChanged); UnityConnect.instance.UserStateChanged += new UserStateChangedDelegate(this.OnUnityConnectUserStateChanged); Toolbar.get = this; Collab.instance.StateChanged += new UnityEditor.Collaboration.StateChangedDelegate(this.OnCollabStateChanged); if (this.m_CollabButton == null) { this.m_CollabButton = new ButtonWithAnimatedIconRotation(() => (float)EditorApplication.timeSinceStartup * 500f, new Action(base.Repaint), 20f, true); } }
public CollabToolbarButton() { InitializeToolIcons(); Collab.instance.StateChanged += OnCollabStateChanged; UnityConnect.instance.StateChanged += OnUnityConnectStateChanged; UnityConnect.instance.UserStateChanged += OnUnityConnectUserStateChanged; if (m_CollabButton == null) { const int repaintsPerSecond = 20; const float animSpeed = 500f; const bool mouseDownButton = true; m_CollabButton = new ButtonWithAnimatedIconRotation(() => (float)EditorApplication.timeSinceStartup * animSpeed, Toolbar.RepaintToolbar, repaintsPerSecond, mouseDownButton); } }
protected override void OnEnable() { base.OnEnable(); // Disable clipping on the root element to fix case 931831 visualTree.clippingOptions = VisualElement.ClippingOptions.NoClipping; EditorApplication.modifierKeysChanged += Repaint; // when undo or redo is done, we need to reset global tools rotation Undo.undoRedoPerformed += OnSelectionChange; UnityConnect.instance.StateChanged += OnUnityConnectStateChanged; UnityConnect.instance.UserStateChanged += OnUnityConnectUserStateChanged; get = this; Collab.instance.StateChanged += OnCollabStateChanged; if (m_CollabButton == null) { const int repaintsPerSecond = 20; const float animSpeed = 500f; const bool mouseDownButton = true; m_CollabButton = new ButtonWithAnimatedIconRotation(() => (float)EditorApplication.timeSinceStartup * animSpeed, Repaint, repaintsPerSecond, mouseDownButton); } }