void StartBP() { GameStage = "BP"; BPNumber = 2; GetGold.SetActive(true); GetGold.GetComponent <Text> ().text = "移除对手的2张牌"; //玩家卡牌 Vector3 PlayerCardPosition = new Vector3(-9, -16, 0); for (int i = 0; i < Player_CardListInGame.Count; i++) { GameObject CardObject_tmp = Instantiate(Card_Prefab, PlayerCardPosition, Quaternion.identity); CardObject_tmp.GetComponent <Card> ().Init(Player_CardListInGame[i], true, "Player", "Game"); Player_CardObjectList.Add(CardObject_tmp); PlayerCardPosition += new Vector3(5.5f, 0, 0); } //机器卡牌 Vector3 CPUCardPosition = new Vector3(-16, 0, 0); for (int i = 0; i < CPU_CardListInGame.Count; i++) { GameObject CardObject_tmp = Instantiate(Card_Prefab, CPUCardPosition, Quaternion.identity); CardObject_tmp.GetComponent <Card> ().Init(CPU_CardListInGame[i], true, "CPU", "Game"); CPU_CardObjectList.Add(CardObject_tmp); CPUCardPosition += new Vector3(5.5f, 0, 0); } }
void Lose() { GameInfo.GetComponent <GameInfo> ().LostGame(); GameResult.SetActive(false); GetGold.SetActive(true); int GoldReword = GameInfo.GetComponent <GameInfo> ().StageList[GameInfo.GetComponent <GameInfo> ().StageLevel - 1].GoldReword; GetGold.GetComponent <Text> ().text = "获得" + (GoldReword / 2).ToString() + "金币"; Invoke("BackToStage", 2.0f); }
void Win() { GameInfo.GetComponent <GameInfo> ().WinGame(); GameResult.SetActive(false); GetGold.SetActive(true); int GoldReword = GameInfo.GetComponent <GameInfo> ().StageList[GameInfo.GetComponent <GameInfo> ().StageLevel - 1].GoldReword; GetGold.GetComponent <Text> ().text = "获得" + GoldReword.ToString() + "金币\n请选择一张牌添加到牌库中"; string[] t = { "攻击", "防御", "技能" }; int point = Random.Range(1, AddCardLevel + 1); string type = t [Random.Range(0, 3)]; AddCardList.Add(new CardInfo(point, "剪", type)); point = Random.Range(1, AddCardLevel + 1); type = t [Random.Range(0, 3)]; AddCardList.Add(new CardInfo(point, "石", type)); point = Random.Range(1, AddCardLevel + 1); type = t [Random.Range(0, 3)]; AddCardList.Add(new CardInfo(point, "布", type)); Vector3 CPUCardPosition = new Vector3(-10, 0, 0); for (int i = 0; i < AddCardList.Count; i++) { GameObject CardObject_tmp = Instantiate(Card_Prefab, CPUCardPosition, Quaternion.identity); CardObject_tmp.GetComponent <Card> ().Init(AddCardList[i], true, "CPU", "AddCard"); AddCardObjectList.Add(CardObject_tmp); CPUCardPosition += new Vector3(10, 0, 0); } CancelAddCardButton.SetActive(true); }