Пример #1
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");
    }
Пример #2
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");
    }
Пример #3
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();
    }
Пример #4
0
    public void OnClickCard(GameObject c)
    {
        string w = c.GetComponent <Card> ().InWhere;

        if (w == "UpGrade")
        {
            for (int i = 0; i < Player_CardObjectList.Count; i++)
            {
                if (Player_CardObjectList[i] == c)
                {
                    CardSelected = i;
                }
            }
            ReadyToUpGrade.SetActive(true);

            for (int i = Player_CardObjectList.Count; i > 0; i--)
            {
                Player_CardObjectList [i - 1].GetComponent <Card> ().BeDestroied();;
            }
            Player_CardObjectList.Clear();

            List <CardInfo> Player_CardListHere = GameInfo.GetComponent <GameInfo> ().Player_CardList;
            string          text_tmp            = "升级卡牌\n";
            int             GoldNeed            = -GameInfo.GetComponent <GameInfo> ().StageList[GameInfo.GetComponent <GameInfo> ().StageLevel - 1].GoldReword;
            text_tmp += Player_CardListHere [CardSelected].actionPoint.ToString() + "-";
            text_tmp += Player_CardListHere [CardSelected].actionColor.ToString() + "-";
            text_tmp += Player_CardListHere [CardSelected].actionType.ToString() + " -> ";
            text_tmp += (Player_CardListHere [CardSelected].actionPoint + 1).ToString() + "-";
            text_tmp += Player_CardListHere [CardSelected].actionColor.ToString() + "-";
            text_tmp += Player_CardListHere [CardSelected].actionType.ToString();
            ReadyToUpGrade.GetComponent <Text> ().text = text_tmp;

            if (GameInfo.GetComponent <GameInfo> ().Gold >= GoldNeed)
            {
                GameObject.Find("UpGradeOK").GetComponent <Button> ().interactable = true;
            }
            else
            {
                GameObject.Find("UpGradeOK").GetComponent <Button> ().interactable = false;
            }
        }
        if (w == "Remove")
        {
            for (int i = 0; i < Player_CardObjectList.Count; i++)
            {
                if (Player_CardObjectList[i] == c)
                {
                    CardSelected = i;
                }
            }
            ReadyToRemove.SetActive(true);

            for (int i = Player_CardObjectList.Count; i > 0; i--)
            {
                Player_CardObjectList [i - 1].GetComponent <Card> ().BeDestroied();;
            }
            Player_CardObjectList.Clear();

            List <CardInfo> Player_CardListHere = GameInfo.GetComponent <GameInfo> ().Player_CardList;
            if (Player_CardListHere.Count <= 7)
            {
                string text_tmp = "牌组数量不能少于7张";
                ReadyToRemove.GetComponent <Text> ().text = text_tmp;
                GameObject.Find("RemoveOK").GetComponent <Button> ().interactable = false;
            }
            else
            {
                int    GoldNeed = -GameInfo.GetComponent <GameInfo> ().StageList[GameInfo.GetComponent <GameInfo> ().StageLevel - 1].GoldReword;
                string text_tmp = "移除卡牌\n";
                text_tmp += Player_CardListHere [CardSelected].actionPoint.ToString() + "-";
                text_tmp += Player_CardListHere [CardSelected].actionColor.ToString() + "-";
                text_tmp += Player_CardListHere [CardSelected].actionType.ToString();
                ReadyToRemove.GetComponent <Text> ().text = text_tmp;

                if (GameInfo.GetComponent <GameInfo> ().Gold >= GoldNeed)
                {
                    GameObject.Find("RemoveOK").GetComponent <Button> ().interactable = true;
                }
                else
                {
                    GameObject.Find("RemoveOK").GetComponent <Button> ().interactable = false;
                }
            }
        }
    }