void Update() { if (serverShip == null || clientShip == null) { gameOverCanvas.SetActive(true); GameOverUI gameOverUI = gameOverCanvas.GetComponent <GameOverUI>(); if (serverShip == null) { if (NetworkManager.Instance.isServer) { gameOverUI.youLost.SetActive(true); } else { gameOverUI.youWon.SetActive(true); } } else { if (NetworkManager.Instance.isServer) { gameOverUI.youWon.SetActive(true); } else { gameOverUI.youLost.SetActive(true); } } } }
void Awake() { if (instance == null) { instance = this; } }
// Use this for initialization public void Setup(LevelManager _lm) { name = "UI"; _levman = _lm; transform.position = new Vector3(Camera.main.transform.position.x, Camera.main.transform.position.y, -100f); GameEventManager.GameStart += GameStart; GameEventManager.GameOver += GameOver; GameEventManager.Respawn += Respawn; _IngameUI = FETool.findWithinChildren(this.gameObject, "Ingame").GetComponent<IngameUI>(); _GameOverUI = FETool.findWithinChildren(this.gameObject, "GameOver").GetComponent<GameOverUI>(); _EntryUI = FETool.findWithinChildren(this.gameObject, "EntryMenu").GetComponent<EntryUI>(); _EndGameUI = FETool.findWithinChildren(this.gameObject, "EndGame").GetComponent<EndGameUI>(); BottomPos = FETool.findWithinChildren(gameObject, "BottomPos").transform; TopPos = FETool.findWithinChildren(gameObject, "TopPos").transform; _IngameUI.SetupSub(this); _IngameUI.Setup(); _GameOverUI.SetupSub(this); _GameOverUI.Setup(); _EntryUI.SetupSub(this); _EntryUI.Setup(); _EndGameUI.SetupSub(this); _EndGameUI.Setup(); if (_lm._profile.SETUP.GameType == GameSetup.versionType.Demo) { _IngameUI.initPos = IngamePlaceDemo; _GameOverUI.lbInitpos = LeaderboardPlaceDemo; _EndGameUI.lbInitpos = LeaderboardPlaceDemo; } }
private void Start() { if (instance == null) { instance = this; } }
void Awake() { Instance = this; Hide(); retry.onClick.AddListener(RetryGame); exit.onClick.AddListener(ExitGame); }
public override void Enter() { GameObject gameOverObject = UIManager.GetInstance().InstantiateForegroundUI(UIManager.GetInstance().GameOverUI); _gameOverUI = gameOverObject.GetComponent<GameOverUI>(); _gameOverUI.Init(_score); _gameOverUI.MainMenuPressed += OnMainMenuPressed; _gameOverUI.RetryPressed += OnRetryPressed; }
/// <summary> /// Окончание игры /// </summary> public void GameOver() { GameStarted = false; //Перейти Hide(); GameOverUI.Open(); }
void Awake() { if (instance != null) { Destroy(this); } instance = this; }
// Use this for initialization void Start() { timeScale = Utils.getTimeScale(); if (gameOver == null) { gameOver = GameObject.Find("GameOverMenu").GetComponentInChildren <GameOverUI>(); } }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); Car.LoadContent(Content); ScoreUI.LoadContent(Content); GameOverUI.LoadContent(Content); FPSUI.LoadContent(Content); CountdownUI.LoadContent(Content); TitleUI.LoadContent(Content); //TODO: probably should load ALL content here. Some content (e.g. sign models) still loaded at runtime }
void Start() { PauseMenuUI.SetActive(false); CountdownUI.SetActive(true); ControlsUI.SetActive(false); MenuCheckUI.SetActive(false); GameOverUI.SetActive(false); StartCoroutine(GameCountDown()); GameIsPaused = false; gameStarted = false; }
// Update is called once per frame void Update() { if (count >= 3) { Scorekeeper.instance.AddScore(20); Scorekeeper.instance.FinalScore(); GameOverUI.SetActive(true); Destroy(BossRef); this.enabled = false; } }
public override void Execute(object data = null) { GameModel gameModel = GetModel <GameModel>(); GameOverUI gameOverUI = GetView <GameOverUI>(); gameOverUI.Show(); gameModel.IsOver = true; //gameModel.IsPause = true; //Time.timeScale = 0; GameSetting.Instance.playSound.PauseBgAudio(); GameSetting.Instance.playSound.PauseStepAudio(); }
void Start() { SetGameOverVisible(true); updater = GameObject.FindGameObjectWithTag("Updater"); score = 0; currentrestDelay = resetDelay; levelCompleteUIFade = levelCompleteUI.transform.Find("Panel").gameObject.GetComponent <Image>(); SceneTransition = sceneTransUI.transform.Find("Panel").gameObject.GetComponent <Image>(); controller = GameObject.FindGameObjectWithTag("GunParent").GetComponent <GunController>(); main.Play(); GameOverUI.SetActive(false); }
IEnumerator gameOveranims() { yield return(new WaitForSeconds(2)); GameOverUI.SetActive(true); yield return(new WaitForSeconds(1.5f)); soundManager.instance.playSound(gameOverSounds); youScored.text = "You scored <color=red> " + Player.instance.score + "</color>"; yield return(new WaitForSeconds(2)); buttons.SetActive(true); }
void Start() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } BlockForBuilding.ranOutOfLives += GameLost; }
private void Awake() { Instance = this; transform.Find("retryBtn").GetComponent <Button>().onClick.AddListener(() => { GameSceneManager.Load(GameSceneManager.Scene.GameScene); }); transform.Find("mainMenuBtn").GetComponent <Button>().onClick.AddListener(() => { GameSceneManager.Load(GameSceneManager.Scene.MainMenuScene); }); Hide(); }
/// <summary> /// Restart button click event listener. Starts game /// </summary> public void Restart() { ControlsUI.SetActive(false); WinnerUI.SetActive(false); PlayerObject.GetComponent <Player>().Restart(); Spawner.GetComponent <EnemySpawner>().Restart(); BackgroundUI.GetComponent <Image>().sprite = LevelOptions.Background; StartGameBtn.SetActive(false); if (_playerDead) { GameOverUI.SetActive(false); _playerDead = false; } OnHealthsUpdate(PlayerObject.GetComponent <Player>().hPoints); }
void Awake() { current = this; gameOverGraphics = GetComponentsInChildren <Graphic>(); foreach (Graphic g in gameOverGraphics) { g.enabled = false; } selectables = GetComponentsInChildren <Selectable>(); foreach (Selectable s in selectables) { s.enabled = false; } }
IEnumerator HPDown() //if HPDown is selected: { if (twranched == true) //check see if twranched { GameOverUI.SetActive(true); CharacterControl.gameOver = true; } else if (twranched == false) //if not twranched, twranch and changes state { player.transform.localScale += new Vector3(0, -.2f); yield return(new WaitForSeconds(.5f)); //bug: probability of killing enemy before twranch can change to true twranched = true; } yield return(new WaitForFixedUpdate()); }
public GameController( IRunner runner, EnemyManager enemyManager, GameScene scene, Signals.PlayerDead playerDeadSignal, ScoreManager score, GameOverUI gameOverUI ) { _runner = runner; _enemyManager = enemyManager; _playerDeadSignal = playerDeadSignal; _score = score; _scene = scene; _gameOverUI = gameOverUI; }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } HandUI = handUI; ScoreUI = scoreUI; GameOverUI = gameOverUI; TutorialUI = tutorialUI; }
/// <summary> /// Initialize component /// </summary> private void Start() { if (!PlayerPrefs.HasKey("soundOff")) { PlayerPrefs.SetInt("soundOff", 1); PlayerPrefs.Save(); } audioSource = gameObject.GetComponent <AudioSource>(); if (PlayerObject != null) { Player.OnPlayerDead += GameOver; Player.OnScoreSet += OnScoreUpdate; Player.OnHealthsSet += OnHealthsUpdate; Player.OnBuyBonus += OnBuyBonus; PlayerObject.SetActive(false); } if (Spawner != null) { Spawner.GetComponent <EnemySpawner>().SetLevelSettings(LevelOptions); Spawner.SetActive(false); } if (GameOverUI != null) { GameOverUI.SetActive(false); } if (WinnerUI != null) { WinnerUI.SetActive(false); } if (MusicToggleUI != null) { musicToggleUI.GetComponent <Toggle>().isOn = PlayerPrefs.GetInt("soundOff") == 1; if (!musicToggleUI.GetComponent <Toggle>().isOn) { var clip = Soundtrack.ElementAt(0); audioSource.clip = clip; audioSource.loop = true; audioSource.Play(); } } }
void HealthDrop(float amt) { t = 0f; newHealth = currHealth + amt; if (newHealth <= 0f) { //show game over stuff //check if highscore, overwrite if so. GameObject.FindObjectOfType <HighScore>().SubmitNewScore(score); //show game over screen GameOverUI.SetActive(true); GameOverUI.transform.Find("HS").GetComponent <Text>().text = "Your Score: " + score + "\nHigh Score: " + PlayerPrefs.GetInt("highestScore"); paused = true; //StartCoroutine (RestartGame ()); } }
private void EndGaming(MessageXieYi xieyi) { Debug.Log("结束游戏"); CurrentPlayType = FramePlayType.游戏未开始; frameIndex = 0; reConnectIndex = 0;//游戏结束的时候未完成复现,则清除重连记录帧 CameraManager.instance.SetCameraEnable(false); CameraManager.instance.SetCameraFollow(transform); foreach (var item in memberGroup) { item.Value.Init(item.Key); } GameRunUI.Close(); TeamType winTeam = (TeamType)int.Parse(SerializeHelper.ConvertToString(xieyi.MessageContent)); RoomUI.Show(); GameOverUI.Show(winTeam); }
// obje kacirildiginda cagirilir public void HealthLose() { health--; star[health].SetActive(false); // tum canlar bittiginde Game Over olmasini saglar if (health <= 0) { Destroy(GameObject.Find("Spawner")); gameManager.SetActive(false); gameOverPanel.SetActive(true); gameOverUI = FindObjectOfType <GameOverUI>(); gameOverUI.SetScore(score); score = 0; health = star.Length; gameObject.SetActive(false); } }
// Use this for initialization void Start() { gameOverUI = gameOverObj.GetComponent <GameOverUI>(); // dataMgrBtn.SetActive(false); gameTip = transform.Find("Tip").GetComponent <Tip>(); //gameStart(); //GameMgr.inst().setGameState(gameState.mainUI); //GameMgr.inst().curGameMode = GameMode.none; //updateDiamondTxt(GameMgr.inst().diamondNum); }
public void resetToInit() { tracking = true; ticks = 0f; interval = baseInterval; range = Mathf.Abs (outerStartPercent - targetPercent); if (gameOverUI == null) { gameOverUI = GameObject.Find("GameOverTitle").GetComponent<GameOverUI>(); } if (smallRing == null) { smallRing = GameObject.Find("ProgressSmallRing"); } GameObject shadowRing = GameObject.Find ("ProgressShadow"); shadowRing.renderer.material.SetFloat("_Percent", outerStartPercent); smallRing.SetActive(false); }
private void Awake() { Instance = this; transform.Find("restartBtn").GetComponent <Button>().onClick.AddListener(() => { GameSceneManager.Load("Level1"); if (Scoreboard.Instance != null) { Scoreboard.Instance.scoreNumber = 0; } PlayerPrefs.SetInt("CurrentScore", 0); Scoreboard.Instance.SubtractScore(); }); transform.Find("quitBtn").GetComponent <Button>().onClick.AddListener(() => { GameSceneManager.Load("MainMenuScene"); PlayerPrefs.SetInt("CurrentScore", 0); }); Hide(); }
public override void Execute(object data) { GameSetting.Instance.playSound.PlayBgAudio(Const.Bgm_ZhanDou); GameModel gameModel = GetModel <GameModel>(); GameOverUI gameOverUI = GetView <GameOverUI>(); ContinueGameUI continueGameUI = GetView <ContinueGameUI>(); if ((bool)data) { gameModel.IsOver = false; //gameModel.IsPause = false; GameSetting.Instance.playSound.PlayStepAudio(); } else { gameModel.IsOver = true; //Time.timeScale = 1; gameOverUI.Hide(); continueGameUI.Show("payContinue"); } }
/// <summary> /// OnPlayerDead event listener /// </summary> private void GameOver() { if (!_playerDead) { _playerDead = true; if (StartGameBtn != null && !StartGameBtn.activeSelf) { StartGameBtn.SetActive(true); } if (GameOverUI != null) { GameOverUI.SetActive(true); } if (ControlsUI != null) { ControlsUI.SetActive(true); } } }
public void gameOver() { // transition to gameover screen gameStarted = false; GameObject[] uis = GameObject.FindGameObjectsWithTag("UI"); foreach (GameObject u in uis) { Destroy(u); } GameObject[] baseshields; baseshields = GameObject.FindGameObjectsWithTag("BaseShield"); foreach (GameObject bs in baseshields) { Destroy(bs); } if (!currentMystery.Equals(null)) { Destroy(currentMystery); mysteryActive = false; } GameObject[] powerups; powerups = GameObject.FindGameObjectsWithTag("Powerup"); foreach (GameObject p in powerups) { Destroy(p); } GameObject gameOverobj = Instantiate(gameOverUI, new Vector3(0, 0, 0), Quaternion.identity) as GameObject; GameOverUI go_UI = gameOverobj.GetComponent <GameOverUI>(); go_UI.controller = gameObject.GetComponent <GameController>(); for (int row = 0; row < 5; row++) { for (int col = 0; col < 11; col++) { Destroy(invaderArr[row, col].gameObject); } } }
IEnumerator LoadPlayerData() { gameoverUI = FindObjectOfType <GameOverUI>(); backgroundController = FindObjectOfType <BackgroundBehaviour>(); changeWaveUI = FindObjectOfType <ChangeWaveUI>(); lineRenderer.GetComponent <MouseMovement>().StreakUIController = FindObjectOfType <StreakUIController>(); lineRenderer.GetComponent <MouseMovement>().mirrorLine.GetComponent <MirrorLineColliderScript>().streakController = FindObjectOfType <StreakUIController>(); backgroundController.SetTheme(); projGenerator.SetCurrentTheme(); projesKilled = 0; totalProjsKilled = 0; print("Loading player from " + Application.persistentDataPath); player.LoadPlayer(); player.ChangeColorDependOnHP(); curAmountOfProjs = 50; projGenerator.coldown = 1; for (int i = 2; i <= player.wave; i++) { curAmountOfProjs += projsToAddPerWave + (int)(i * 0.5); projGenerator.coldown -= projGenerator.coldown * 0.03f; } for (int i = 0; i < blocks.Length; i++) //SKYBLOCKS { blocks[i].CalculateAmountOfHealth(player.wave); } bonusGenerator.ChangeBonusesDuration(player.wave); defendedProjsIndexes = projGenerator.CountDefendedAsteroidsAmount(curAmountOfProjs); changeWaveUI.StartCoroutine("ShowChangeWaveAnimation", player.wave); changingLevel = true; backgroundController.StartCoroutine("BackgroundAppear"); yield return(new WaitForSeconds(changeWavePauseTime)); changingLevel = false; }