Exemplo n.º 1
0
    /// <summary>
    /// item初始化函数
    /// </summary>
    protected override void InitItem()
    {
        //初始化
        icon = transform.Find("Icon").GetComponent <GUISingleButton>();

        icon.onClick = OnIconClick;

        border = transform.Find("Border").GetComponent <UISprite>();
        //qualityLabel = transform.Find("QualityLabel").GetComponent<UILabel>();
        levelLabel = transform.Find("LevelLabel").GetComponent <UILabel>();
        nameLabel  = transform.Find("NameLabel").GetComponent <UILabel>();
        mask       = UnityUtil.FindCtrl <UISprite>(gameObject, "Mask");
        typeS      = UnityUtil.FindCtrl <UISprite>(gameObject, "Type");
        suo        = UnityUtil.FindCtrl <UISprite>(gameObject, "Suo");
        souStoneL  = UnityUtil.FindCtrl <UILabel>(gameObject, "SouStoneL");
        summonBtn  = UnityUtil.FindCtrl <UIButton>(gameObject, "SummonBtn");

        for (int i = 1; i <= 5; i++)
        {
            startList.Add(transform.Find("Star" + i).GetComponent <UISprite>());
        }

        //EventDelegate.Set(mask.onClick, this.OnMackBtn);

        GetComponent <BoxCollider>().enabled = false;


        herolist = UIHeroList.instance;

        EventDelegate.Set(summonBtn.onClick, OnSummonBtnClick);
    }
Exemplo n.º 2
0
    protected override void Init()
    {
        base.Init();

        instance = this;
        HeroDetList.gameObject.SetActive(true);

        foreach (Transform rune in transform.Find("RunesSeat"))
        {
            runeList.Add(rune.gameObject);
        }

        backBtn.onClick    = OnBackBtnClick;
        detailsTab.onClick = OnDetailsTabClick;

        isOne = true;

        UIHeroList = UIHeroList.instance;

        PowerProgress.width        = 0;
        PowerProgress.pivot        = UIWidget.Pivot.Left;
        IntelligenceProgress.width = 0;
        IntelligenceProgress.pivot = UIWidget.Pivot.Left;
        AgilityProgress.width      = 0;
        AgilityProgress.pivot      = UIWidget.Pivot.Left;
    }
Exemplo n.º 3
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.º 4
0
    void OnDestroy()
    {
        instance  = null;
        rootPanel = null;

        lobbyPanelPathArray = null;

        uiLobby      = null;
        uiMessageBox = null;
        uiGameReady  = null;
        uiHeroList   = null;
        uiTowerList  = null;
        uiWaiting    = null;
        uiBaseInfo   = null;
        uiGameOption = null;
        uiShop       = null;
    }
Exemplo n.º 5
0
    private void LoadUICompleteCB(GameObject gameObj, System.Guid uid, params object[] param)
    {
        if (gameObj != null)
        {
            GameObject createObj = Instantiate(gameObj) as GameObject;

            createObj.transform.parent        = rootPanel.transform;
            createObj.transform.localPosition = Vector3.zero;
            createObj.transform.localScale    = gameObj.transform.localScale;

            switch ((eUIType)param[0])
            {
            case eUIType.Type_Lobby:
                uiLobby = createObj.GetComponent <UILobby>();
                break;

            case eUIType.Type_MessageBox:
                uiMessageBox = createObj.GetComponent <UIMessageBox>();
                break;

            case eUIType.Type_GameReady:
                uiGameReady = createObj.GetComponent <UIGameReady>();
                if (param.Length > 1 && (bool)param[1])
                {
                    uiGameReady.OpenFrame();
                }
                break;

            case eUIType.Type_Hero:
                uiHeroList = createObj.GetComponent <UIHeroList>();
                if (param.Length > 1 && (bool)param[1])
                {
                    uiHeroList.OpenFrame();
                }
                break;

            case eUIType.Type_Tower:
                uiTowerList = createObj.GetComponent <UITowerList>();
                if (param.Length > 1 && (bool)param[1])
                {
                    uiTowerList.OpenFrame();
                }
                break;

            case eUIType.Type_Waiting:
                uiWaiting = createObj.GetComponent <UIWaiting>();
                break;

            case eUIType.Type_Base:
                uiBaseInfo = createObj.GetComponent <UIBaseInfo>();
                if (param.Length > 1 && (bool)param[1])
                {
                    uiBaseInfo.OpenFrame();
                }
                break;

            case eUIType.Type_Option:
                uiGameOption = createObj.GetComponent <UIGameOption>();
                if (param.Length > 1 && (bool)param[1])
                {
                    uiGameOption.OpenFrame();
                }
                break;

            case eUIType.Type_Shop:
                uiShop = createObj.GetComponent <UIShop>();
                if (param.Length > 1 && (bool)param[1])
                {
                    uiShop.OpenFrame();
                }
                break;
            }
        }
    }