void Update() { ScoreLeft.text = "" + scoreLeft; ScoreRight.text = "" + scoreRight; //ScoreLeft.text = ""+ scoreLeft; //ScoreLeft Metnini güncel skor ile güncelle //ScoreRight.text = "" + scoreRight; //ScoreRight Metnini güncel skor ile güncelle if (scoreLeft == 10 || scoreRight == 10) { Time.timeScale = 0f; RestartButton.SetActive(true); ExitButton.SetActive(true); DeveloperText.SetActive(true); LoserText.SetActive(true); if (scoreRight == 10) { loserText.text = "Loser: Left Side"; } else if (scoreLeft == 10) { loserText.text = "Loser: Right Side"; } } if (Input.GetKeyDown(KeyCode.Escape)) { Time.timeScale = 0f; //Oyun duraklatıldı ResumeButton.SetActive(true); ExitButton.SetActive(true); RestartButton.SetActive(true); } }
private void Start() { playButton = new PlayButton(playBtnObj); restartButton = new RestartButton(restartBtnObj); restartButton.SetActive(Button.ButtonActive.Disabled); Time.timeScale = 0; }
// Start is called before the first frame update void Start() { rb = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); GameOverText.SetActive(false); RestartButton.SetActive(false); }
// Use this for initialization void Start() { GameOverText.SetActive(false); RestartButton.SetActive(false); rig = GetComponent <Rigidbody2D>(); }
public void OnClickResumeButton() { Time.timeScale = 1f; //Oyun devam ediyor ResumeButton.SetActive(false); RestartButton.SetActive(false); ExitButton.SetActive(false); }
public void GameOver() { ChangeState("You Loose!"); StopGame(); RestartButton.SetActive(true); MenuButton.SetActive(true); LevelManager.LevelWon = false; }
// Use this for initialization void Start() { RestartButton.SetActive(false); PauseButton.SetActive(false); NextLevelButton.onClick.AddListener(startNextLevel); hide(nextLevelImage); Input.multiTouchEnabled = true; }
public void is_Correct() { win = true; main.text = "I Guess the Number is : " + guess; HigherButton.SetActive(false); LowerButton.SetActive(false); CorrectButton.SetActive(false); RestartButton.SetActive(true); }
private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag.Equals("enemy")) { GameOverText.SetActive(true); RestartButton.SetActive(true); gameObject.SetActive(false); } }
void CpuLose() { main.text = "You have defeated me ! I will get you next time... "; NextButton.SetActive(false); CorrectButton.SetActive(false); RestartButton.SetActive(true); HigherButton.SetActive(false); LowerButton.SetActive(false); }
void OnCollisionEnter2D(Collision2D col) { if (col.gameObject.tag.Equals("enemy")) { GameOverText.SetActive(true); RestartButton.SetActive(true); Destroy(this.gameObject); } }
public void reStart() { GameObject[] Enemy = GameObject.FindGameObjectsWithTag("Enemy"); for (int i = 0; i < Enemy.Length; i++) { Destroy(Enemy[i]); } GameOverImage.SetActive(false); RestartButton.SetActive(false); }
void Welcome() { main.text = "Pick a Number! Lowest Number is : " + min + " Highest Number is : " + max; NextButton.SetActive(true); CorrectButton.SetActive(false); RestartButton.SetActive(false); HigherButton.SetActive(false); LowerButton.SetActive(false); attempts = 5; }
public void SetDisable() { helicopter = GameObject.FindWithTag("Player"); if (helicopter != null) { RestartButton.SetActive(false); StoreButton.SetActive(false); AdButton.SetActive(false); text.color = new Color(0, 0, 0, 0); } }
void Start() { helicopter = GameObject.FindWithTag("Player"); RestartButton.SetActive(false); StoreButton.SetActive(false); AdButton.SetActive(false); text = GetComponent <Text>(); text.color = new Color(0, 0, 0, 0); }
// Start is called before the first frame update void Start() { //giving player full lives at start of the game health = 3; heart1.SetActive(true); heart2.SetActive(true); heart3.SetActive(true); gameOver.SetActive(false); playerWin.SetActive(false); RestartButton.SetActive(false); }
public void gameEnd() { StartButton.SetActive(false); RestartButton.SetActive(true); QuitButton.SetActive(true); gameActiveState = false; PauseButton.SetActive(false); if (((int)(GameObject.FindWithTag("Player").transform.position.z - 18) / 10) >= boundaryScore) { show(nextLevelImage); } }
public void UpdateGuess() { if (attempts != 0) { main.text = "Is it ? " + guess + " Or click higher or lower ?"; NextButton.SetActive(false); RestartButton.SetActive(false); CorrectButton.SetActive(true); HigherButton.SetActive(true); LowerButton.SetActive(true); } }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } CanvasState.SetActive(false); RestartButton.SetActive(false); MenuButton.SetActive(false); }
// Update is called once per frame void Update() { if (health > 4) { health = 3; } //what to do when each life is lost switch (health) { //special case when player wins case 4: PauseButton.SetActive(false); playerWin.SetActive(true); RestartButton.SetActive(true); Time.timeScale = 0; break; case 3: heart1.SetActive(true); heart2.SetActive(true); heart3.SetActive(true); break; case 2: heart1.SetActive(true); heart2.SetActive(true); heart3.SetActive(false); break; case 1: heart1.SetActive(true); heart2.SetActive(false); heart3.SetActive(false); break; //game over case 0: heart1.SetActive(false); heart2.SetActive(false); heart3.SetActive(false); PauseButton.SetActive(false); gameOver.SetActive(true); RestartButton.SetActive(true); Time.timeScale = 0; break; } }
public void gameActiveStateSwitch() { if (gameActiveState) { gameActiveState = false; pauseText.text = "Return"; RestartButton.SetActive(true); QuitButton.SetActive(true); } else if (!gameActiveState) { gameActiveState = true; pauseText.text = "Pause"; RestartButton.SetActive(false); QuitButton.SetActive(false); } }
// Start is called before the first frame update void Start() { playerLayer = this.gameObject.layer; enemyLayer = LayerMask.NameToLayer("Enemy"); Physics2D.IgnoreLayerCollision(playerLayer, enemyLayer, false); heart1 = GameObject.Find("Heart01"); heart2 = GameObject.Find("Heart02"); heart3 = GameObject.Find("Heart03"); heart1.gameObject.SetActive(true); heart2.gameObject.SetActive(true); heart3.gameObject.SetActive(true); rend = GetComponent <Renderer>(); color = rend.material.color; gameOverText.SetActive(false); RestartButton.SetActive(false); }
void Update() { helicopter = GameObject.FindWithTag("Player"); if (helicopter != null) { coins = PlayerPrefs.GetInt("TotalCoins"); RestartButton.SetActive(false); StoreButton.SetActive(false); AdButton.SetActive(false); text.color = new Color(0, 0, 0, 0); } else if (helicopter == null) { text.color = new Color(0, 0, 0, 1); text.text = "Game Over\nYour Score:\n" + coins + " Coins"; RestartButton.SetActive(true); StoreButton.SetActive(true); AdButton.SetActive(true); } }
void OnCollisionEnter2D(Collision2D col) { if (col.gameObject.tag.Equals("Enemy")) { playerHealth -= 1; switch (playerHealth) { case 2: heart3.gameObject.SetActive(false); if (coroutineAllowed) { StartCoroutine("Immortal"); } break; case 1: heart2.gameObject.SetActive(false); if (coroutineAllowed) { StartCoroutine("Immortal"); } break; case 0: heart1.gameObject.SetActive(false); if (coroutineAllowed) { StartCoroutine("Immortal"); } break; } if (playerHealth < 1) { gameOverText.SetActive(true); RestartButton.SetActive(true); gameObject.SetActive(false); } } }
public void Restart() { RestartButton.SetActive(true); }
public void GameOver(bool isCleared) // life==0일때 gamemanager에서 호출하는 모달 팝업 매니징 함수 { // isCleared면 Clear, 아니면 GameOver Debug.Log("gameover"); StopCoroutine("Timer"); GameOverWindow.SetActive(true); current_Time = 0; TimeText.text = "0 sec"; requestWaiting = true; if (!sentPutRequest && currentMode == 0) { Debug.Log("putrankinfo"); gameObject.GetComponent <RankManager>().PutRankInfo(1503); } /*int count = 0; * try * { * while (requestWaiting) { Debug.Log("Waiting for response..."); count++; } * if (count >= 10000000) throw new Exception("Failed to put data on server, callback timeout"); * * } * catch(Exception e) * { * Debug.Log(e.Message); * }*/ GameOverBackground.SetActive(false); Chapter1ClearBackground.SetActive(false); Chapter2ClearBackground.SetActive(false); Chapter3ClearBackground.SetActive(false); BackgroundFilter.SetActive(true); if (isCleared) { switch (currentMode) { case 0: // 순위모드 실패시 GameOverBackground.SetActive(true); GameOverBack.SetActive(true); requestWaiting = true; if (!sentPutRequest) { Debug.Log("getrankinfo"); // gameObject.GetComponent<RankManager>().GetRankInfo(1); sentPutRequest = true; } /*count = 0; * try * { * while (requestWaiting) { Debug.Log("Waiting for response..."); count++; } * if (count >= 10000000) throw new Exception("Failed to put data on server, callback timeout"); * * } * catch (Exception e) * { * Debug.Log(e.Message); * }*/ break; case 1: // 스토리모드 성공시 Chapter1ClearBackground.SetActive(true); break; case 2: Chapter2ClearBackground.SetActive(true); break; case 3: Chapter3ClearBackground.SetActive(true); break; } } else { // 스토리모드 실패시 GameOverBackground.SetActive(true); if (currentMode != 0) { GameOverBackStory.SetActive(true); } else { GameOverBack.SetActive(true); } } if (currentMode == 0 || currentMode == 3) { // 순위전 버튼구성 if (currentMode == 0) { RankingMain.SetActive(true); RankingSub1.SetActive(true); RankingSub2.SetActive(true); RestartButton.SetActive(true); } else { if (isCleared) { ChallengeButtonforSimilarity.SetActive(true); } else { RestartButton.SetActive(true); } } //RankingButton.SetActive(true); } else { // 스토리모드 버튼구성 if (isCleared) { NextStageButton.SetActive(true); } else { RestartButton.SetActive(true); } ChallengeButton.SetActive(true); } return; }
public void PlayerDeadDisplayButtons() { StartCoroutine(DeadDelay()); playButton.SetActive(Button.ButtonActive.Disabled); restartButton.SetActive(Button.ButtonActive.Enabled); }
// Update is called once per frame private void Start() { GameOverText.SetActive(false); RestartButton.SetActive(false); }