public void Initialize() { clientSkeld = FindObjectOfType <ClientSkeld>(); clientSkeld.playGamePhaseUserInterface.activeSceneUserInterface.interactButton.UpdateCallbacks(); InitializePlayers(); SetupCamera(); scenesManager.UnloadScene(Scene.RoleReveal); }
private void UpdateState() { isDisabled = false; isHidden = false; if (lobbyGamePhase.IsActive()) { isDisabled = lobbyGamePhase.lobby.activeSceneUserInterface.settingsButton.SettingsMenuActive; isHidden = false; } if (playGamePhase.IsActive()) { ClientSkeld clientSkeld = playGamePhase.clientSkeld; isDisabled = clientSkeld.playGamePhaseUserInterface.activeSceneUserInterface.settingsButton.SettingsMenuActive; isHidden = clientSkeld.playGamePhaseUserInterface.minimapButton.IsMinimapShown || clientSkeld.adminPanel.isControlledPlayerViewing || clientSkeld.securityPanel.isControlledPlayerViewing; } UpdateImage(interactor.chosen); }
private void RemoveCallbacks() { if (interactor != null) { interactor.newInteractableChosen -= UpdateState; } if (lobbyGamePhase.IsActive()) { ActiveSceneUserInterface lobbyUserInterface = lobbyGamePhase.lobby.activeSceneUserInterface; lobbyUserInterface.settingsButton.onToggle -= UpdateState; } if (playGamePhase.IsActive()) { PlayGamePhaseUserInterface skeldUserInterface = playGamePhase.clientSkeld.playGamePhaseUserInterface; skeldUserInterface.minimapButton.onToggle -= UpdateState; skeldUserInterface.activeSceneUserInterface.settingsButton.onToggle -= UpdateState; ClientSkeld clientSkeld = playGamePhase.clientSkeld; clientSkeld.adminPanel.onInteraction -= UpdateState; clientSkeld.securityPanel.onInterfaceToggle -= UpdateState; } }