コード例 #1
0
 void Update()
 {
     if (GameData.Instance.isLost)
     {
         theGameOverPanel.Apply(timer);
         Clear();
         GameData.Instance.isLost = false;
         StopAllCoroutines();
     }
 }
コード例 #2
0
 void Update()
 {
     if (GameData.Instance.isLost)
     {
         theGameOverPanel.Apply(timer);
         Clear();
         GameData.Instance.isLost    = false;
         GameData.Instance.rewardNum = 0;
         StopAllCoroutines();
     }
     diamondsLabel.text = GameData.Instance.diamonds.ToString();
     if (GameData.Instance.isBloodSplash)
     {
         StartCoroutine("BloodSplashShow");
     }
 }
コード例 #3
0
ファイル: GamePanel.cs プロジェクト: tangjingwei88/Project24
    /// <summary>
    /// 倒计时显示
    /// </summary>
    /// <param name="time"></param>
    /// <returns></returns>
    public IEnumerator TimeSliping(float time)
    {
        while (time >= 0)
        {
            yield return(new WaitForSeconds(1));

            TimeLabel.text = time.ToString();
            time--;
            timer++;
            if (time < 40)
            {
                //TimeLabel.gameObject.transform.localScale = new Vector3(3.0f,3.0f,3.0f);
                //TimeLabel.gameObject.transform.GetComponent<Animator>().Play();
            }
        }

        //TODO
        //游戏结束
        Debug.LogError("游戏结束");
        theShowLogPart.Clear();
//        GamePanel.Instance.timer = 0;
        theGameOverPanel.gameObject.SetActive(true);
        theGameOverPanel.Apply();
    }