public void ClickNext() { GameLord gameLordInstance = GameLord.Instance; if (gameLordInstance != null) { gameLordInstance.NextLevel(); } }
public void ClickMenu() { GameLord gameLordInstance = GameLord.Instance; if (gameLordInstance != null) { gameLordInstance.BackToMenu(); } }
public void ClickPlayLevel(int index) { GameLord gameLordInstance = GameLord.Instance; if (gameLordInstance != null) { gameLordInstance.LoadLevel(index); } }
private void NotifyOnGameStateChanged() { GameLord gameLordInstance = GameLord.Instance; if (gameLordInstance != null) { gameLordInstance.UpdateTimeScale(); } if (GameManager.OnGameStateChanged != null) { GameManager.OnGameStateChanged(_currentGameState); } }
protected override void Awake() { base.Awake(); GameLord instance = GameLord.Instance; if (instance != null) { } GUILord guiLord = GUILord.Instance; if (guiLord != null) { _referenceResolution = guiLord.ReferenceResolution; } }
void Awake() { instance = this; DontDestroyOnLoad(gameObject); Cursor.visible = false; // Tell Oculus to use roomscale if (UnityEngine.XR.XRDevice.isPresent) { if (debug) { Debug.Log("UnityEngine.XR.XRDevice.model: " + UnityEngine.XR.XRDevice.model); } if (UnityEngine.XR.XRDevice.model == "Oculus Rift CV1") { if (debug) { Debug.Log("in roomscale set"); } UnityEngine.XR.XRDevice.SetTrackingSpaceType(UnityEngine.XR.TrackingSpaceType.RoomScale); } } Scene = Scene.Init; loading = Loading.Default; string model = UnityEngine.XR.XRDevice.model != null ? UnityEngine.XR.XRDevice.model : ""; if (model.IndexOf("Rift") >= 0) { deviceType = DeviceType.Oculus; } else { deviceType = DeviceType.Vive; } blackoutLength = 2.0f; blackoutTimer = blackoutLength; InitPlayer( ); InitMusicLord( ); InitOpponentLord( ); InitScenes( ); }
private void InitializeGameLord() { _currentPlayerData = PlayerData.Load(); _instance = this; UnityEngine.SceneManagement.Scene activeScene = UnityEngine.SceneManagement.SceneManager.GetActiveScene(); _currentSceneName = activeScene.name; if (_currentSceneName == sceneName_start) { _currentGameState = GameState.GS_MENU; _currentSceneName = ""; } else { _currentGameState = GameState.GS_GAME; } }
private void Start( ) { instance = this; textWait = 6.0f; opponentCount = 30; Ddebug = false; timer = timerDur; GameState = GameStates.Default; text.text = "PINATA BIRTHDAY GIRL!"; InitPlayer( ); InitOpponentLord( ); InitCam( ); Instantiate(environmentPrefab, Vector3.zero, Quaternion.identity); // Start game in a few seconds. CoHelp.Instance.DoWhen(textWait / 2.0f, delegate { StartCoroutine(GameLoop( )); }); }
private void InitializeGameLord() { GameLord._instance = this; _currentTransitionState = TransitionState.TS_NONE; _targetGameState = AppState.AS_NONE; string loadedSceneName = SceneManager.GetActiveScene().name; if (loadedSceneName == startSceneName) { _currentGameState = AppState.AS_MENU; } else { bool foundAny = false; for (int i = 0; i < _sceneNameCount; ++i) { //Debug.LogWarningFormat("Check \"{0}\" with \"{1}\"", _sceneNames[i], loadedSceneName); if (_sceneNames[i] == loadedSceneName) { foundAny = true; _currentLevelIndex = i; ChangeGameState(AppState.AS_GAME, true); break; } } if (!foundAny) { _currentGameState = AppState.AS_NONE; Debug.LogErrorFormat("Scene {0} not added to GameLord!!!", loadedSceneName); } } for (int i = 0; i < _stateCount; ++i) { _stateInfos[i].panelGO.SetActive(_stateInfos[i].state == _currentGameState); } UpdateTimeScale(); }
private void InitHudController() { _gameLord = GameLord.Instance; _hudLord = HudLord.Instance; }
public void Start() { audioSource = GetComponent <AudioSource>(); gameLord = GameObject.Find("GameLord").GetComponent <GameLord>(); }
private void HandleAppState(GameLord.AppState appState) { switch(appState) { case GameLord.AppState.AS_GAME: ChangeGameState(GameState.GS_GAME); ResetGame(); break; default: ChangeGameState(GameState.GS_NONE); break; } }
private void InitializeGameLord() { GameLord._instance = this; _currentTransitionState = TransitionState.TS_NONE; _targetGameState = AppState.AS_NONE; string loadedSceneName = SceneManager.GetActiveScene().name; if(loadedSceneName == startSceneName) { _currentGameState = AppState.AS_MENU; } else { bool foundAny = false; for(int i = 0;i < _sceneNameCount;++i) { //Debug.LogWarningFormat("Check \"{0}\" with \"{1}\"", _sceneNames[i], loadedSceneName); if(_sceneNames[i] == loadedSceneName) { foundAny = true; _currentLevelIndex = i; ChangeGameState(AppState.AS_GAME,true); break; } } if(!foundAny) { _currentGameState = AppState.AS_NONE; Debug.LogErrorFormat("Scene {0} not added to GameLord!!!", loadedSceneName); } } for(int i = 0;i < _stateCount;++i) { _stateInfos[i].panelGO.SetActive(_stateInfos[i].state == _currentGameState); } UpdateTimeScale(); }