Exemple #1
0
 //--------------------------------------画面效果
 void UpdateUI()
 {
     Player_Health_UI.GetComponent <Text> ().text = "生命:" + Player_Health.ToString();
     CPU_Health_UI.GetComponent <Text> ().text    = "生命:" + CPU_Health.ToString();
     Player_Armor_UI.GetComponent <Text> ().text  = "护甲:" + Player_Armor.ToString();
     CPU_Armor_UI.GetComponent <Text> ().text     = "护甲:" + CPU_Armor.ToString();
 }
Exemple #2
0
    //----------------------------------游戏阶段进程
    void GameEnd()
    {
        GameResult.SetActive(true);
        if (Player_Health > CPU_Health || (Player_Health == CPU_Health && Player_Armor > CPU_Armor) || (Player_Health > 0 && CPU_Health <= 0))
        {
            GameResult.GetComponent <Text> ().text = "生命 " + Player_Health.ToString() + ":" + CPU_Health.ToString() + "\n"
                                                     + "护甲" + Player_Armor.ToString() + ":" + CPU_Armor.ToString() + "\n" + "获胜!";
            Invoke("Win", 3.0f);
        }
        if (Player_Health < CPU_Health || (Player_Health == CPU_Health && Player_Armor < CPU_Armor) || (Player_Health <= 0 && CPU_Health > 0))
        {
            GameResult.GetComponent <Text> ().text = "生命 " + Player_Health.ToString() + ":" + CPU_Health.ToString() + "\n"
                                                     + "护甲 " + Player_Armor.ToString() + ":" + CPU_Armor.ToString() + "\n" + "败北!";

            Invoke("Lose", 3.0f);
        }
        if ((Player_Health == CPU_Health && Player_Armor == CPU_Armor) || (Player_Health <= 0 && CPU_Health <= 0))
        {
            GameResult.GetComponent <Text> ().text = "生命 " + Player_Health.ToString() + ":" + CPU_Health.ToString() + "\n"
                                                     + "护甲 " + Player_Armor.ToString() + ":" + CPU_Armor.ToString() + "\n" + "平局!";

            Invoke("Lose", 3.0f);
        }
    }