Esempio n. 1
0
    void Start()
    {
        Global.init(() => {
            List <int> random = new List <int>();
            for (int i = 0; i < cards.Length; i++)
            {
                CharacterCard card = cards[i];
                card.data          = Global.CHARACTER_TABLE[i + 1];
                card.gameObject.SetActive(true);
                card.SetIndex(i + 1);
                if (card.GetCanSelect() && (i + 1) != DataUtils.characterID)
                {
                    random.Add(i + 1);
                }
            }
            int r         = random[Random.Range(0, random.Count)];
            string filter = "";
            for (int i = 0; i < random.Count; i++)
            {
                filter += random[i] + ",";
            }
            SelectCard(r);
            okBtnSelectFrame.gameObject.SetActive(true);

            if (DataUtils.runingAutoMode)
            {
                Invoke("AutoGoNext", 3);
            }
        });
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        okBtnFrame.SetActive(true);
        DataUtils.isAutoMode     = false;
        DataUtils.runingAutoMode = false;

        curItem = okBtn;
        //初始化设置
        Global.init(() =>
        {
            for (int i = 0; i < propCards.Length; i++)
            {
                if (Global.PROP_TABLE.ContainsKey(i + 1))
                {
                    propCards[i].SetData(Global.PROP_TABLE[i + 1]);
                    switch (i)
                    {
                    case 0:
                    case 1:
                    case 2:
                        propCards[i].SetBuy(DataUtils.correntPropCount == ((i + 1) * 5)); //纠正道具
                        break;

                    case 3:
                    case 4:
                    case 5:
                        propCards[i].SetBuy(DataUtils.lifeType == (Global.LIFE_TYPE)(i - 2));    //血量道具
                        break;
                    }
                }
            }

            //===================character


            for (int i = 0; i < cards.Length; i++)
            {
                CharacterCard card = cards[i];
                card.data          = Global.CHARACTER_TABLE[i + 1];
                card.gameObject.SetActive(true);
                card.SetIndex(i);
            }

            //随机操作丢到了DataUtils里去了..从SongList过来之前已经随机好了.确保每次进游戏都是选的不同的人.
            int r          = DataUtils.characterID;
            characterIndex = r - 1;
            SetCharacter(r - 1);

            if (Guide.instance != null)
            {
                Guide.instance.Show();
            }
        });
    }