public void OnClickUnlockOK() { List <SkillInfo> SkillList = GameInfo.GetComponent <GameInfo> ().SkillList; SkillList [SkillSelect].Unlocked = true; GameInfo.GetComponent <GameInfo> ().Gold -= SkillList [SkillSelect].GoldRequire; for (int i = 0; i < SkillList.Count; i++) { SkillList [i].Used = false; } SkillList [SkillSelect].Used = true; GameInfo.GetComponent <GameInfo> ().Player_SKill_Used = SkillSelect; OnClickChooseSkill(); UnlockSkill.SetActive(false); }
public void OnClickSkill(GameObject c) { SkillSelect = c.GetComponent <Skill> ().SkillNum; List <SkillInfo> SkillList = GameInfo.GetComponent <GameInfo> ().SkillList; if (!c.GetComponent <Skill> ().Unlocked) { UnlockSkill.SetActive(true); SkillInfo SkillThis = GameInfo.GetComponent <GameInfo> ().SkillList [SkillSelect]; for (int i = 0; i < SkillObjectList.Count; i++) { SkillObjectList [i].GetComponent <Skill> ().Destroied(); } UnlockSkill.GetComponent <Text> ().text = "花费" + SkillThis.GoldRequire.ToString() + "金币解锁技能\"" + SkillThis.Name + "\""; if (GameInfo.GetComponent <GameInfo> ().Gold >= SkillThis.GoldRequire) { GameObject.Find("UnlockOK").GetComponent <Button> ().interactable = true; } else { GameObject.Find("UnlockOK").GetComponent <Button> ().interactable = false; } } else { for (int i = 0; i < SkillList.Count; i++) { SkillList [i].Used = false; } SkillList [SkillSelect].Used = true; for (int i = 0; i < SkillObjectList.Count; i++) { SkillObjectList[i].GetComponent <Skill> ().Init(); } GameInfo.GetComponent <GameInfo> ().Player_SKill_Used = SkillSelect; } }
//-----------------------------------------返回按钮 public void OnClickCancel() { for (int i = Player_CardObjectList.Count; i > 0; i--) { Player_CardObjectList [i - 1].GetComponent <Card> ().BeDestroied();; } Player_CardObjectList.Clear(); StageParent.SetActive(true); ViewCard.SetActive(true); ChooseSkill.SetActive(true); Cheat_UI.SetActive(true); Close.SetActive(false); ReadyToUpGrade.SetActive(false); ReadyToRemove.SetActive(false); UnlockSkill.SetActive(false); Title_UI.SetActive(false); for (int i = 0; i < SkillObjectList.Count; i++) { SkillObjectList [i].GetComponent <Skill> ().Destroied(); } SkillObjectList.Clear(); }
public bool IsAnySkillOnCooldown() { return(WeaponSkillA?.IsOnCooldown() == true || WeaponSkillB?.IsOnCooldown() == true || UnlockSkill?.IsOnCooldown() == true); }
public void OnClickUnlockCancel() { OnClickChooseSkill(); UnlockSkill.SetActive(false); }