Пример #1
0
 protected override void OnAwake()
 {
     base.OnAwake();
     toggle  = CacheTransform.GetComponent <UIToggle>();
     label   = CacheTransform.Find("Label").GetComponent <UILabel>();
     warning = CacheTransform.Find("Warning").GetComponent <UISprite>();
 }
Пример #2
0
    public void InitPanelDetph()
    {
        if (null == m_lst_panels)
        {
            m_lst_panels = new List <UIPanel>();
            List <UIDefine.UIPanelHierarchyData> panelHierarchyData = new List <UIDefine.UIPanelHierarchyData>();
            UIPanel panel = CacheTransform.GetComponent <UIPanel>();
            if (null != panel)
            {
                m_lst_panels.Add(panel);
            }
            UIPanelManager.GetPanelHierarchydepth(CacheTransform, 0, ref panelHierarchyData);
            if (panelHierarchyData.Count > 0)
            {
                panelHierarchyData.Sort((left, right) =>
                {
                    return(left.hierachyDepth - right.hierachyDepth);
                });

                for (int i = 0; i < panelHierarchyData.Count; i++)
                {
                    m_lst_panels.Add(panelHierarchyData[i].panel);
                }
            }
        }
    }
Пример #3
0
 protected override void OnAwake()
 {
     base.OnAwake();
     m_spIcon       = CacheTransform.Find("Content/Icon").GetComponent <UISpriteEx>();
     m_ts           = CacheTransform.GetComponent <TweenScale>();
     m_tsSelectMask = CacheTransform.Find("Content/SelectMask");
     SetTriggerEffect(false);
 }
Пример #4
0
 /// <summary>
 /// 初始化
 /// </summary>
 /// <param name="renderObj"></param>
 /// <param name="rotateY">起始旋转</param>
 /// <param name="size">UITexture size</param>
 /// touchcallback  触摸时回调
 public void Initialize(IRenerTextureObj renderObj, float rotateY, Vector2 size, Action touchCallBack = null)
 {
     m_touchCallBack = touchCallBack;
     this.rotateY    = rotateY;
     this.renderObj  = renderObj;
     if (texture == null)
     {
         texture = CacheTransform.GetComponent <UITexture>();
     }
     texture.width       = (int)size.x;
     texture.height      = (int)size.y;
     texture.mainTexture = this.renderObj.GetTexture();
     ready = true;
 }
Пример #5
0
        protected void SetModel(GameObject actor)
        {
            //ModelGameObject = model;

            CacheTransform  = actor.transform;
            ModelGameObject = actor.transform.FindChild("Model").gameObject;

            //modelTransform.localPosition = Vector2.zero;
            //modelTransform.localScale = Vector3.one;
            //modelTransform.localRotation = Quaternion.identity;

            mAnimation           = mModelGameObject.GetComponent <Animation>();
            _characterController = CacheTransform.GetComponent <CharacterController>();
        }
Пример #6
0
 protected override void OnAwake()
 {
     base.OnAwake();
     InitItemInfoGrid(CacheTransform.Find("Content/InfoGridRoot/InfoGrid"));
     m_tsContent             = CacheTransform.Find("Content");
     m_playTween             = CacheTransform.Find("Content").GetComponent <UIPlayTween>();
     m_playTween.resetOnPlay = true;
     m_tp            = CacheTransform.Find("Content").GetComponent <TweenPosition>();
     m_tp.method     = UITweener.Method.EaseIn;
     m_ts            = CacheTransform.Find("Content").GetComponent <TweenScale>();
     m_tp.worldSpace = true;
     m_panel         = CacheTransform.GetComponent <UIPanel>();
     m_tp.onFinished.Add(new EventDelegate(() =>
     {
         SetVisible(false);
         AnimOut();
     }));
 }
Пример #7
0
 protected override void OnAwake()
 {
     base.OnAwake();
     m_ts       = CacheTransform.GetComponent <TweenScale>();
     m_collider = CacheTransform.GetComponent <BoxCollider>();
     m_tsNone   = CacheTransform.Find("Content/None");
     UIEventListener.Get(m_tsNone.gameObject).onClick = (obj) =>
     {
         InvokeUIDlg(UIEventType.Click, this, null);
     };
     m_tsCharacterInfo = CacheTransform.Find("Content/Info");
     m_spCIcon         = CacheTransform.Find("Content/Info/Icon").GetComponent <UISpriteEx>();
     m_spSelectBg      = CacheTransform.Find("Content/Info/Bg").GetComponent <UISpriteEx>();
     m_tsSelectMask    = CacheTransform.Find("Content/Info/SelectMask");
     m_labLv           = CacheTransform.Find("Content/Info/Lv").GetComponent <UILabel>();
     m_labName         = CacheTransform.Find("Content/Info/Name").GetComponent <UILabel>();
     m_labLeftTime     = CacheTransform.Find("Content/Info/DeleteLeftTime").GetComponent <UILabel>();
     SetTriggerEffect(false);
     m_deleteBtn = CacheTransform.Find("Content/Info/SelectMask/DeleteRoleBtn").gameObject;
     if (m_deleteBtn != null)
     {
         UIEventListener.Get(m_deleteBtn).onClick = onClick_DeleteRoleBtn_Btn;
     }
 }
Пример #8
0
    protected override void OnAwake()
    {
        base.OnAwake();
        m_panel       = CacheTransform.GetComponent <UIPanel>();
        m_tsContent   = CacheTransform.Find("Content");
        m_ts_PointBox = CacheTransform.Find("Content/UnconstrainPointBox");
        m_ts_Arrow    = CacheTransform.Find("Content/UnconstrainPointBox/UnArrowContent");
        m_tween_Arrow = CacheTransform.Find("Content/UnconstrainPointBox/UnArrowContent/Arrow").GetComponent <TweenPosition>();

        m_ts_pointContent = CacheTransform.Find("Content/UnconstrainPointBox/UnPointBoxContent");

        m_sp_GuideBorder = CacheTransform.Find("Content/UnconstrainPointBox/UnPointBoxContent/BgBorder").GetComponent <UISprite>();

        m_tsLeft  = CacheTransform.Find("Content/UnconstrainPointBox/UnPointBoxContent/PBLeftContent");
        m_tsRight = CacheTransform.Find("Content/UnconstrainPointBox/UnPointBoxContent/PBRightContent");

        m_lab_lefDes   = CacheTransform.Find("Content/UnconstrainPointBox/UnPointBoxContent/PBLeftContent/UnGuideContentLeft").GetComponent <UILabel>();
        m_lab_rightDes = CacheTransform.Find("Content/UnconstrainPointBox/UnPointBoxContent/PBRightContent/UnGuideContentRight").GetComponent <UILabel>();

        m_sp_highLightBg   = CacheTransform.Find("Content/UnconstrainPointBox/HighLightBorder").GetComponent <UISprite>();
        m_fingerEffectRoot = CacheTransform.Find("Content/UnconstrainPointBox/FingerEffectRoot");
        m_effectRoot       = CacheTransform.Find("Content/UnconstrainPointBox/FingerEffectRoot/EffectRoot");
        if (null != m_effectRoot)
        {
            m_particle = m_effectRoot.GetComponent <UIParticleWidget>();
            if (null == m_particle)
            {
                m_particle = m_effectRoot.gameObject.AddComponent <UIParticleWidget>();
                if (null != m_lab_lefDes)
                {
                    m_particle.depth = m_lab_lefDes.depth + 1;
                }
            }
            m_v3EffectSourcePos = m_effectRoot.transform.localPosition;
        }
    }
Пример #9
0
 protected override void OnAwake()
 {
     base.OnAwake();
     texture = CacheTransform.GetComponent <UITexture>();
 }
Пример #10
0
 protected override void OnAwake()
 {
     base.OnAwake();
     m_labDes = CacheTransform.GetComponent <UILabel>();
     //sp = CacheTransform.Find("sprite").GetComponent<UISprite>();
 }
Пример #11
0
    protected override void OnAwake()
    {
        base.OnAwake();
        mtsBg = CacheTransform.Find("Content/Bg");
        Transform tempTs = CacheTransform.Find("Content/Icon");

        if (null != tempTs)
        {
            m_sp_icon = tempTs.GetComponent <UITexture>();
        }
        tempTs = CacheTransform.Find("Content/Border");
        if (null != tempTs)
        {
            m_sp_border = tempTs.GetComponent <UISprite>();
        }
        tempTs = CacheTransform.Find("Content/Num");
        if (null != tempTs)
        {
            m_lab_num       = tempTs.GetComponent <UILabel>();
            m_lab_num.depth = 15;
            m_lab_num.color = ColorManager.GetColor32OfType(ColorType.White);
        }
        m_ts_powerContent  = CacheTransform.Find("Content/PowerContent");
        m_ts_fightUpMask   = CacheTransform.Find("Content/PowerContent/PowerPromote");
        m_ts_fightDownMask = CacheTransform.Find("Content/PowerContent/PowerFallOff");
        tempTs             = CacheTransform.Find("Content/WarningMask");
        if (null != tempTs)
        {
            m_sp_warningMask = tempTs.GetComponent <UISprite>();
        }
        m_ts_highLight = CacheTransform.Find("Content/HighLight");

        tempTs = CacheTransform.Find("Content/Lock");
        if (null != tempTs)
        {
            m_obj_lockmask = tempTs.gameObject;
        }
        tempTs = CacheTransform.Find("Content/Clock");
        if (null != tempTs)
        {
            m_obj_timeLimitmask = tempTs.gameObject;
        }
        tempTs = CacheTransform.Find("Content/MuhonMask");
        if (null != tempTs)
        {
            m_obj_muhonMaskContent = tempTs.gameObject;
        }

        tempTs = CacheTransform.Find("Content/MuhonMask/StarSlider");
        if (null != tempTs)
        {
            m_sl_starLv = tempTs.GetComponent <UISlider>();
        }
        m_tsMuhonLv = CacheTransform.Find("Content/MuhonLevel");
        tempTs      = CacheTransform.Find("Content/MuhonLevel/Grade/RsGrade");
        if (null != tempTs)
        {
            m_lab_muhonLv = tempTs.GetComponent <UILabel>();
        }

        tempTs = CacheTransform.Find("Content/RunestoneMask");
        if (null != tempTs)
        {
            m_obj_runestoneMaskContent = tempTs.gameObject;
        }
        tempTs = CacheTransform.Find("Content/RunestoneMask/Grade/RsGrade");
        if (null != tempTs)
        {
            m_lab_rsGrade = tempTs.GetComponent <UILabel>();
        }


        m_ts_notEnoughGet = CacheTransform.Find("Content/NotEnoughGetMask");
        if (null != m_ts_notEnoughGet)
        {
            tempTs = m_ts_notEnoughGet.Find("Get");
            if (null != tempTs)
            {
                UILabel label = tempTs.GetComponent <UILabel>();
                if (null != label)
                {
                    label.fontSize = 22;
                    label.color    = ColorManager.GetColor32OfType(ColorType.Green);
                }
            }
        }
        UIWidget widgets = CacheTransform.GetComponent <UIWidget>();

        if (null == widgets)
        {
            widgets = CacheTransform.gameObject.AddComponent <UIWidget>();
        }
        if (null != widgets)
        {
            widgets.depth = 22;
        }

        m_tsChipsMask = CacheTransform.Find("Content/suipian");
    }