Esempio n. 1
0
    /// <summary>
    /// 初始化选择英雄面板
    /// </summary>
    /// <param name="heroIds"></param>
    public void InitSelectHeroPanel(int[] heroIds)
    {
        GameObject go;

        foreach (int id in heroIds)
        {
            if (idHeroDict.ContainsKey(id))
            {
                continue;
            }
            go = Instantiate(UIHero);
            UIHero hero = go.GetComponent <UIHero>();
            hero.InitView(HeroData.GetHeroData(id));
            go.transform.SetParent(heroParent);
            go.transform.localScale = Vector3.one;
            idHeroDict.Add(id, hero);
        }
    }
Esempio n. 2
0
    /// <summary>
    /// 初始化英雄选择面板
    /// </summary>
    /// <param name="heroIds"></param>
    public void InitSelectHeroPanel(int[] heroIds)
    {
        GameObject go;

        for (int i = 0; i < heroIds.Length; i++)
        {
            if (idHeroDict.ContainsKey(heroIds[i]))
            {
                continue;
            }
            go = Instantiate(UIHero);
            UIHero hero = go.GetComponent <UIHero>();
            hero.InitView(HeroData.GetHeroData(heroIds[i]));
            go.transform.SetParent(heroParent, false);
            go.transform.localScale = Vector3.one;
            idHeroDict.Add(heroIds[i], hero);
        }
    }
Esempio n. 3
0
    /// <summary>
    /// 初始化选择英雄面板,开启选人计时
    /// </summary>
    public void InitSelectHeroPanel(int[] heroIDs)
    {
        GameObject hero;

        for (int i = 0; i < heroIDs.Length; i++)
        {
            if (uiHeroes.ContainsKey(heroIDs[i]))
            {
                continue;
            }
            hero = Instantiate(heroPrefab);
            UIHero uiHero = hero.GetComponent <UIHero>();
            uiHero.InitView(HeroData.GetHeroDataModel(heroIDs[i]));
            hero.transform.SetParent(heroPanel.transform);
            hero.transform.localScale = Vector3.one;
            uiHeroes.Add(heroIDs[i], uiHero);
        }
        timerStart = true;
        timer      = 60;
    }