// Use this for initialization private void Start() { GameContener.Initialize(); //_roundManager = gameObject.GetComponent<RoundManager>(); //_roundManager.OnLastRoundEnded += _roundManager_OnLastRoundEnded; //_roundManager.OnNewRoundStarted += _roundManager_OnNewRoundStarted; _respawnManager = gameObject.GetComponent <RespawnManager>(); _respawnManager.OnLastPlayerDied += _respawnManager_OnLastPlayerDied; _respawnTutorialManager = gameObject.GetComponent <RespawnTutorialManager>(); _respawnTutorialManager.OnPlayerFall += _respawnTutorialManager_OnPlayerFall; _portalCollider = GameObject.Find("PortalCollider").GetComponent <PortalColliderController>(); _portalCollider.OnPlayersPassed += _portalCollider_OnPlayersPassed;; _cameraController = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraController>(); _cameraController.OnCameraStopMoving += _cameraController_OnCameraStopMoving; _cameraController.StartPosition = StartPosition + transform.position; _endCamera = GameObject.Find("End Camera"); _endCamera.SetActive(false); if (GameContener.IsTutorialEnable) { initTutorial(); } else { initGame(); } }
private void GameEnd() { GameContener.FreezePlayers(); _endCamera.SetActive(true); _cameraController.gameObject.SetActive(false); enabled = false; }
private void initTutorial() { _cameraController.IsInitialMoving = false; // _cameraController.SwitchCamera(true); _respawnManager.enabled = false; _respawnTutorialManager.enabled = true; //_roundManager.enabled = false; GameContener.MovePlayersToPosition(StartPosition); //here you may disable HP GameObject.Find("GogTutorialPanel").SetActive(true); }
private void initGame() { GameContener.MovePlayersToPosition(getRandomSpawn()); GameContener.UnfreezePlayers(); _cameraController.IsInitialMoving = false; _cameraController.SwitchCamera(false); _respawnManager.enabled = true; //_roundManager.enabled = true; _respawnTutorialManager.enabled = false; _respawnManager.InitRespawnManager(); GameObject.Find("GogTutorialPanel").SetActive(false); }
private void _cameraController_OnCameraStopMoving(object sender, System.EventArgs e) { //_portalCollider.Collider.enabled = true; GameContener.UnfreezePlayers(); }