Exemplo n.º 1
0
    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();
    }
Exemplo n.º 2
0
    /// <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);
    }
Exemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     Instance = this;
     anim     = GetComponent <Animator>();
 }
Exemplo n.º 4
0
 public void GameOver()
 {
     PanelGamePlay.SetActive(false);
     PanelGameOver.SetActive(true);
     GetScore();
 }
Exemplo n.º 5
0
    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];
    }
Exemplo n.º 6
0
 public void Home()
 {
     PanelGameOver.Play("Close");
     PanelMainMenu.Play("Open");
     SceneManager.LoadScene(0);
 }