Esempio n. 1
0
        public void UpdateCollabToolbarState()
        {
            var  currentCollabState = CollabToolbarState.UpToDate;
            bool networkAvailable   = UnityConnect.instance.connectInfo.online && UnityConnect.instance.connectInfo.loggedIn;

            m_DynamicTooltip = "";

            if (UnityConnect.instance.isDisableCollabWindow)
            {
                currentCollabState = CollabToolbarState.Plastic;
            }
            else if (networkAvailable)
            {
                Collab         collab      = Collab.instance;
                CollabInfo     currentInfo = collab.collabInfo;
                UnityErrorInfo errInfo;
                bool           error = false;
                if (collab.GetError((UnityConnect.UnityErrorFilter.ByContext | UnityConnect.UnityErrorFilter.ByChild), out errInfo))
                {
                    error            = (errInfo.priority <= (int)UnityConnect.UnityErrorPriority.Error);
                    m_DynamicTooltip = errInfo.shortMsg;
                }

                if (!currentInfo.ready)
                {
                    currentCollabState = CollabToolbarState.InProgress;
                }
                else if (error)
                {
                    currentCollabState = CollabToolbarState.OperationError;
                }
                else if (currentInfo.inProgress)
                {
                    currentCollabState = CollabToolbarState.InProgress;
                }
                else
                {
                    bool collabEnable = Collab.instance.IsCollabEnabledForCurrentProject();

                    if (UnityConnect.instance.projectInfo.projectBound == false || !collabEnable)
                    {
                        currentCollabState = CollabToolbarState.Plastic;
                    }
                    else if (currentInfo.update)
                    {
                        currentCollabState = CollabToolbarState.ServerHasChanges;
                    }
                    else if (currentInfo.conflict)
                    {
                        currentCollabState = CollabToolbarState.Conflict;
                    }
                    else if (currentInfo.publish)
                    {
                        currentCollabState = CollabToolbarState.FilesToPush;
                    }
                }
            }
            else
            {
                currentCollabState = CollabToolbarState.Offline;
            }

            if (Collab.IsToolbarVisible != null)
            {
                if (currentCollabState != m_CollabToolbarState ||
                    Collab.IsToolbarVisible() == m_ShowCollabTooltip)
                {
                    m_CollabToolbarState = currentCollabState;
                    m_ShowCollabTooltip  = !Collab.IsToolbarVisible();
                    Toolbar.RepaintToolbar();
                }
            }
        }
Esempio n. 2
0
		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));
			Toolbar.get = this;
		}
Esempio n. 3
0
 internal static void RepaintAllToolViews()
 {
     Toolbar.RepaintToolbar();
     SceneView.RepaintAll();
     InspectorWindow.RepaintAllInspectors();
 }
Esempio n. 4
0
 void OnPlasticNotificationUpdated()
 {
     Toolbar.RepaintToolbar();
 }
 static internal void SetStopmodeLayout()
 {
     WindowLayout.ShowAppropriateViewOnEnterExitPlaymode(false);
     Toolbar.RepaintToolbar();
 }
Esempio n. 6
0
        static internal void InitPlaymodeLayout()
        {
            InitializePlaymodeViewList();
            WindowLayout.ShowAppropriateViewOnEnterExitPlaymodeList(true, out m_PlayModeViewList);

            var fullscreenDetected = false;
            var monitorNames       = EditorFullscreenController.GetConnectedDisplayNames();

            foreach (var playModeView in m_PlayModeViewList)
            {
                if (playModeView == null)
                {
                    continue;
                }

                if (playModeView.fullscreenMonitorIdx >= monitorNames.Length)
                {
                    continue;
                }

                if (playModeView.enterPlayModeBehavior == PlayModeView.EnterPlayModeBehavior.PlayFullscreen)
                {
                    EditorFullscreenController.SetSettingsForCurrentDisplay(playModeView.fullscreenMonitorIdx);
                    EditorFullscreenController.isFullscreenOnPlay           = true;
                    EditorFullscreenController.fullscreenDisplayId          = playModeView.fullscreenMonitorIdx;
                    EditorFullscreenController.isToolbarEnabledOnFullscreen = false;
                    EditorFullscreenController.targetDisplayID = playModeView.targetDisplay;

                    if (playModeView.m_Parent is DockArea dockArea && dockArea.actualView is GameView gv)
                    {
                        playModeView.m_Parent.EnableVSync(gv.vSyncEnabled);
                        EditorFullscreenController.enableVSync       = gv.vSyncEnabled;
                        EditorFullscreenController.selectedSizeIndex = gv.selectedSizeIndex;
                    }
                    fullscreenDetected = true;
                }
                else if (!fullscreenDetected)
                {
                    EditorFullscreenController.isFullscreenOnPlay = false;
                }

                if (playModeView.enterPlayModeBehavior == PlayModeView.EnterPlayModeBehavior.PlayMaximized)
                {
                    if (playModeView.m_Parent is DockArea dockArea)
                    {
                        m_MaximizePending = WindowLayout.MaximizePrepare(dockArea.actualView);
                        var gv = dockArea.actualView as GameView;
                        if (gv != null)
                        {
                            playModeView.m_Parent.EnableVSync(gv.vSyncEnabled);
                        }
                    }
                }

                EditorFullscreenController.OnEnterPlaymode();

                if (!EditorFullscreenController.isFullscreenOnPlay)
                {
                    playModeView.m_Parent.SetAsStartView();
                    playModeView.m_Parent.SetAsLastPlayModeView();

                    if (playModeView is IGameViewOnPlayMenuUser)
                    {
                        if (((IGameViewOnPlayMenuUser)playModeView).playFocused)
                        {
                            playModeView.m_Parent.Focus();
                        }
                    }
                }
                Toolbar.RepaintToolbar();
            }
        }
Esempio n. 7
0
 public void OnEnable()
 {
   EditorApplication.modifierKeysChanged += new EditorApplication.CallbackFunction(((GUIView) this).Repaint);
   Undo.undoRedoPerformed += new Undo.UndoRedoCallback(this.OnSelectionChange);
   UnityConnect.instance.StateChanged += new StateChangedDelegate(this.OnUnityConnectStateChanged);
   Toolbar.get = this;
 }
Esempio n. 8
0
        public void UpdateCollabToolbarState()
        {
            Toolbar.CollabToolbarState collabToolbarState = Toolbar.CollabToolbarState.UpToDate;
            bool flag = UnityConnect.instance.connectInfo.online && UnityConnect.instance.connectInfo.loggedIn;

            this.m_DynamicTooltip = "";
            if (flag)
            {
                Collab     instance       = Collab.instance;
                CollabInfo collabInfo     = instance.collabInfo;
                int        num            = 0;
                int        num2           = 4;
                int        num3           = 2;
                string     text           = "";
                string     dynamicTooltip = "";
                bool       flag2          = false;
                if (instance.GetError(5, out num, out num2, out num3, out text, out dynamicTooltip))
                {
                    flag2 = (num2 <= 1);
                    this.m_DynamicTooltip = dynamicTooltip;
                }
                if (!collabInfo.ready)
                {
                    collabToolbarState = Toolbar.CollabToolbarState.InProgress;
                }
                else if (flag2)
                {
                    collabToolbarState = Toolbar.CollabToolbarState.OperationError;
                }
                else if (collabInfo.inProgress)
                {
                    collabToolbarState = Toolbar.CollabToolbarState.InProgress;
                }
                else
                {
                    bool flag3 = Collab.instance.IsCollabEnabledForCurrentProject();
                    if (!UnityConnect.instance.projectInfo.projectBound || !flag3)
                    {
                        collabToolbarState = Toolbar.CollabToolbarState.NeedToEnableCollab;
                    }
                    else if (collabInfo.update)
                    {
                        collabToolbarState = Toolbar.CollabToolbarState.ServerHasChanges;
                    }
                    else if (collabInfo.conflict)
                    {
                        collabToolbarState = Toolbar.CollabToolbarState.Conflict;
                    }
                    else if (collabInfo.publish)
                    {
                        collabToolbarState = Toolbar.CollabToolbarState.FilesToPush;
                    }
                }
            }
            else
            {
                collabToolbarState = Toolbar.CollabToolbarState.Offline;
            }
            if (collabToolbarState != this.m_CollabToolbarState || CollabToolbarWindow.s_ToolbarIsVisible == Toolbar.m_ShowCollabTooltip)
            {
                this.m_CollabToolbarState   = collabToolbarState;
                Toolbar.m_ShowCollabTooltip = !CollabToolbarWindow.s_ToolbarIsVisible;
                Toolbar.RepaintToolbar();
            }
        }
Esempio n. 9
0
 protected void OnUnityConnectStateChanged(ConnectInfo state)
 {
     this.UpdateCollabToolbarState();
     Toolbar.RepaintToolbar();
 }