示例#1
0
    //-----------------------------------------------选择技能
    public void OnClickChooseSkill()
    {
        StageParent.SetActive(false);
        ViewCard.SetActive(false);
        ChooseSkill.SetActive(false);
        Cheat_UI.SetActive(false);

        Close.SetActive(true);
        Title_UI.SetActive(true);
        Title_UI.GetComponent <Text> ().text = "选择技能\n";


        List <SkillInfo> SkillList = GameInfo.GetComponent <GameInfo> ().SkillList;
        Vector3          Position  = new Vector3(-21, 14, 0);

        SkillObjectList.Clear();
        for (int i = 1; i < SkillList.Count; i++)
        {
            GameObject tmp = Instantiate(Skill_Prefab, Position, Quaternion.identity);
            tmp.GetComponent <Skill>().SkillNum = i;
            tmp.GetComponent <Skill> ().Init();
            SkillObjectList.Add(tmp);
            Position += new Vector3(0, -5.5f, 0);
        }
    }
示例#2
0
    //------------------------------------------------点击关卡
    public void OnClickStage(GameObject c)
    {
        StageLevel = c.GetComponent <Stage> ().StageLevel;
        string StageType = c.GetComponent <Stage> ().StageType;

        if (StageType == "Game")
        {
            //开始关卡
            ReadyToPlay.transform.parent.gameObject.SetActive(true);
            ReadyToPlay.GetComponent <Text> ().text = "开始关卡\"" + c.GetComponent <Stage> ().Description + "\"";
        }
        if (StageType == "UpGrade")
        {
            //升级卡牌
            StageParent.SetActive(false);
            ViewCard.SetActive(false);
            ChooseSkill.SetActive(false);
            Cheat_UI.SetActive(false);

            Close.SetActive(true);
            Title_UI.SetActive(true);
            Title_UI.GetComponent <Text>().text  = c.GetComponent <Stage> ().Description;
            Title_UI.GetComponent <Text>().text += "\n当前升级所需花费为" + (-c.GetComponent <Stage> ().GoldReword).ToString() + "金币";
            StageSelect = c;

            ShowPlayerCard("UpGrade");
            GameInfo.GetComponent <GameInfo> ().LoadStage(StageLevel);
            GameInfo.GetComponent <GameInfo> ().WinGame();
            int StageNum = GameInfo.GetComponent <GameInfo> ().StageNum;
            for (int i = 0; i < StageNum; i++)
            {
                Stage [i].GetComponent <Stage> ().Init();
            }
        }
        if (StageType == "Remove")
        {
            //移除卡牌
            StageParent.SetActive(false);
            ViewCard.SetActive(false);
            ChooseSkill.SetActive(false);
            Cheat_UI.SetActive(false);

            Close.SetActive(true);
            Title_UI.SetActive(true);
            Title_UI.GetComponent <Text>().text  = c.GetComponent <Stage> ().Description;
            Title_UI.GetComponent <Text>().text += "\n当前移除所需花费为" + (-c.GetComponent <Stage> ().GoldReword).ToString() + "金币";
            StageSelect = c;

            ShowPlayerCard("Remove");
            GameInfo.GetComponent <GameInfo> ().LoadStage(StageLevel);
            GameInfo.GetComponent <GameInfo> ().WinGame();
            int StageNum = GameInfo.GetComponent <GameInfo> ().StageNum;
            for (int i = 0; i < StageNum; i++)
            {
                Stage [i].GetComponent <Stage> ().Init();
            }
        }
    }
示例#3
0
    public void OnClickCancelRemove()
    {
        int GoldNeed = -GameInfo.GetComponent <GameInfo> ().StageList[GameInfo.GetComponent <GameInfo> ().StageLevel - 1].GoldReword;

        Title_UI.GetComponent <Text>().text  = StageSelect.GetComponent <Stage> ().Description;
        Title_UI.GetComponent <Text>().text += "\n当前移除所需花费为" + GoldNeed.ToString() + "金币";

        ReadyToRemove.SetActive(false);
        ShowPlayerCard("Remove");
    }
示例#4
0
    public void OnClickViewCard()
    {
        StageParent.SetActive(false);
        ViewCard.SetActive(false);
        ChooseSkill.SetActive(false);
        Cheat_UI.SetActive(false);

        Close.SetActive(true);
        Title_UI.SetActive(true);
        Title_UI.GetComponent <Text> ().text = "查看牌组";

        ShowPlayerCard("View");
    }
示例#5
0
    //-------------------------------------------移除卡牌
    public void OnClickDoRemove()
    {
        List <CardInfo> Player_CardListHere = GameInfo.GetComponent <GameInfo> ().Player_CardList;

        Player_CardListHere.Remove(Player_CardListHere [CardSelected]);
        GameInfo.GetComponent <GameInfo> ().Shooping();
        int GoldNeed = -GameInfo.GetComponent <GameInfo> ().StageList[GameInfo.GetComponent <GameInfo> ().StageLevel - 1].GoldReword;

        Title_UI.GetComponent <Text>().text  = StageSelect.GetComponent <Stage> ().Description;
        Title_UI.GetComponent <Text>().text += "\n当前移除所需花费为" + GoldNeed.ToString() + "金币";

        ReadyToRemove.SetActive(false);
        ShowPlayerCard("Remove");
    }
示例#6
0
    //-----------------------------------------返回按钮
    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();
    }