Example #1
0
    void InitBtns()
    {
        m_lstBtns = new List <MainBtn>();

        //特效TipsUI
        m_sprite_TipsUI.gameObject.SetActive(false);

        RegisterBtnEvent(true);
        //
        m_trans_roleInfoRoot.gameObject.SetActive(true);
        m_trans_target.gameObject.SetActive(false);
        m_trans_MainRoleBUffContainer.gameObject.SetActive(false);
        //


        m_trans_btn_Left_Root.gameObject.SetActive(false);
        //if (Application.isEditor)
        {
            if (m_trans_AnchorTopRight != null)
            {
                Transform gmTrans = m_trans_AnchorTopRight.Find("GM");
                if (gmTrans != null)
                {
                    gmTrans.gameObject.SetActive(true);
                }
            }
        }
        TweenRotation tween = m_btn_leftbtn.GetComponent <TweenRotation>();

        if (tween != null)
        {
            m_btnTween = tween;
            tween.AddOnFinished(new EventDelegate(() =>
            {
                bool show = IsShowRightBtn();
                Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.MAINRIGHTBTN_TOGGLE, show);
                UISprite leftBtnSp = m_btnTween.GetComponent <UISprite>();
                if (show)
                {
                    ResetLeftBtnsPos(false);
                    leftBtnSp.spriteName       = "anniu_yuan_shouqi";
                    m_btn_leftbtn.normalSprite = "anniu_yuan_shouqi";
                }
                else
                {
                    leftBtnSp.spriteName       = "anniu_yuan_zhankai";
                    m_btn_leftbtn.normalSprite = "anniu_yuan_zhankai";
                }

                //发送UI,功能按钮状态变化事件
                SendGameObjMoveStatusEvent((show) ? UIDefine.GameObjMoveStatus.Visible : UIDefine.GameObjMoveStatus.Invisible, m_lst_FuncBtnsRight);
            }));
        }
    }