예제 #1
0
    public void RefreshItems()
    {
        List <int> randInt = RandomList.getRandomIntList(1, itemList.Count - 1, 3);

        CreateItemContainer(itemList[0], 0);

        for (int i = 0; i < 3; i++)
        {
            CreateItemContainer(itemList[randInt[i]], i + 1);
        }
    }
예제 #2
0
    // Start is called before the first frame update
    void Start()
    {
        int temp = 0;

        player            = GameManager.GetLocalPlayer();
        skillItemTemplate = Resources.Load <GameObject>("Skill_Container");
        levelUpUI         = gameObject;
        List <int> randList = RandomList.getRandomIntList(0, GameManager.UnlearntSpellList.Count - 1, Mathf.Max(4 - player.skillLearntCounter, 0));

        for (int i = 0; i < Mathf.Max(4 - player.skillLearntCounter, 0); i++)
        {
            createSkillItemTemplate(GameManager.UnlearntSpellList[randList[i]], offsetCounter++);
            temp++;
        }
        randList = RandomList.getRandomIntList(0, GameManager.LearntSpellList.Count - 1, Mathf.Max(3 - temp, 0));
        for (int i = 0; i < Mathf.Max(3 - temp, 0); i++)
        {
            createSkillItemTemplate(GameManager.LearntSpellList[randList[i]], offsetCounter++);
        }
        tooltip.SetActive(false);
        screen = new Rect(0, 0, Screen.width, Screen.height);
    }