Пример #1
0
    public void GenButtons()
    {
        AllHeros.Clear();

        for (int i = 0; i < CharectorStats.numOfHeroes(); i++)
        {
            AllHeros.Add(CharectorStats.UnlockedCharector(i));
        }

        if (buttons.Count > 0)
        {
            foreach (GameObject button in buttons)
            {
                Destroy(button.gameObject);
            }
            buttons.Clear();
        }
        for (int i = 0; i < AllHeros.Count; i++)
        {
            GameObject button = Instantiate(buttonTemplate) as GameObject;
            buttons.Add(button);
            button.SetActive(true);

            button.GetComponent <TileListButton>().SetText(CharectorStats.HeroName(AllHeros[i][1]));
            button.GetComponent <TileListButton>().SetIndex(i);
            button.transform.SetParent(buttonTemplate.transform.parent, false);
        }
    }
    void GetAvailability()
    {
        int heroSlotsLeft = GameMaster.BackpackSize - CharectorStats.numOfHeroes();

        if (greenOrPurple == true)
        {
            T1Available = InvManager.T1ShardNumCombo();
            if (T1Available > 10)
            {
                T1Available = 10;
            }
            if (T1Available > heroSlotsLeft)
            {
                T1Available = heroSlotsLeft;
            }
        }
        else
        {
            T2Available = InvManager.T2ShardNumCombo();
            if (T2Available > 10)
            {
                T2Available = 10;
            }
            if (T2Available > heroSlotsLeft)
            {
                T2Available = heroSlotsLeft;
            }
        }
    }
    public void TestAddHeroClicked()
    {
        InvManager.GoldAdd(30);
        InvManager.T1ShardAdd(10);
        InvManager.T2ShardAdd(10);
        Debug.Log("current Inv:" + InvManager.GoldReturn().ToString() + " gold, " + InvManager.T1ShardAmount().ToString() + " T1s, " + InvManager.T2ShardAmount().ToString() + " T2s");
        for (int i = 0; i < CharectorStats.numOfHeroes(); i++)
        {
            var character = CharectorStats.UnlockedCharector(i);
            CharectorStats.testAddExp(i, 10);
        }

        SaveManager.SaveParse();
        //GameMaster.CallSave();
    }