public void GameOver() { State = GameState.GameOver; PanelGameOver.Play("Open"); PanelGamePlay.Play("Close"); ScoreGame.text = Mathf.Round(Score).ToString(); foreach (Transform t in ObstacleParent) { Destroy(t.gameObject); } UpdateHigthScore(); }
/// <summary> /// Hiện panel Overgame /// </summary> public void ShowPanelGameOver(int isplayer)//Index là cho đội player(0) hoặc Enemy(1) { //??? Advertising.LoadInterstitialAd(); bool isReady = Advertising.IsInterstitialAdReady(); if (isReady) { Advertising.ShowInterstitialAd(); } _ListPopup[3].SetActive(true); PanelGameOver over = _ListPopup[3].GetComponent <PanelGameOver>(); over.SetPopup(isplayer); }
// Start is called before the first frame update void Start() { Instance = this; anim = GetComponent <Animator>(); }
public void GameOver() { PanelGamePlay.SetActive(false); PanelGameOver.SetActive(true); GetScore(); }
void Awake() { AdControl.hideBanner(); Application.targetFrameRate = 60; gameState = GameConst.GAME_STATE.PLAYING; bonusStyleControl = GetComponent<BonusStyleControl> (); trans = GetComponent<Transform> (); canvas = GameObject.Find ("Canvas"); score = canvas.GetComponent<Score>(); panelGameOver = goPanelGameover.GetComponent<PanelGameOver> (); panelPause = goPanelPause.GetComponent<PanelPause> (); listSnake = new List<SnakeBody> (); listFood = new List<Food>(); snakeState = GameConst.snakeState.MOVING; AudioSource[] audios = gameObject.GetComponents<AudioSource> (); combineSound = audios[0]; eatSound = audios[1]; crushSound = audios[2]; }
public void Home() { PanelGameOver.Play("Close"); PanelMainMenu.Play("Open"); SceneManager.LoadScene(0); }