Exemplo n.º 1
0
    }                                                //召唤英雄ID

    #endregion
    protected override void Init()
    {
        base.Init();

        instance = this;

        getHeroPanel = transform.Find("GetHeroPanel").GetComponent <GetHeroPanel>();

        allofMultList        = transform.Find("HeroListScrollView/AllofMultList").GetComponent <GUISingleMultList>();
        powerMultList        = transform.Find("HeroListScrollView/PowerMultList").GetComponent <GUISingleMultList>();
        agileMultList        = transform.Find("HeroListScrollView/AgileMultList").GetComponent <GUISingleMultList>();
        intelligenceMultList = transform.Find("HeroListScrollView/IntelligenceMultList").GetComponent <GUISingleMultList>();
        tabList = transform.Find("HeroListScrollView").GetComponentsInChildren <GUISingleMultList>();
        //foreach (Transform item in transform.Find("HeroListScrollView"))
        //{
        //    tabList.Add(item.gameObject);
        //}

        backBtn.onClick     = OnBackBtnClick;
        typeHeroTab.onClick = OnTypeHeroTabClick;

        //获取全部英雄
        objDic = FSDataNodeTable <HeroNode> .GetSingleton().DataNodeList;

        int heroCount = 0;

        foreach (object hn in objDic.Values)
        {
            if (((HeroNode)hn).released == 1)
            {
                heroCount++;
            }
        }

        obj = new object[heroCount];

        int index = 0;

        foreach (object hn in objDic.Values)
        {
            if (((HeroNode)hn).released == 1)
            {
                if (index < obj.Length)
                {
                    obj[index] = hn;
                    index++;
                }
            }
        }
    }
Exemplo n.º 2
0
 void Awake()
 {
     instance = this;
 }