示例#1
0
    void InitNormal()
    {
        m_transNormal                       = transform.Find("normal");
        m_trans_normalInfo                  = m_transNormal.Find("normalinfo");
        m_normalRichTextContext             = m_transNormal.Find("normalinfo/xmlText").GetComponent <UIXmlRichText>();
        m_normalRichTextContext.UrlClicked += OnClickUrl;

        m_bgSprite = m_normalRichTextContext.transform.GetComponent <UISprite>();
        m_headIcon = m_transNormal.Find("icon_head").GetComponent <UITexture>();
        if (m_headIcon != null)
        {
            m_headIcon.pivot = UIWidget.Pivot.TopLeft;
        }
        UIEventListener.Get(m_headIcon.gameObject).onClick = OnHeadClick;

        m_lableChannel = m_transNormal.Find("normalinfo/channelName").GetComponent <UILabel>();

        if (m_lableChannel != null)
        {
            m_lableChannel.pivot = UIWidget.Pivot.TopLeft;
        }
        m_lableName = m_transNormal.Find("normalinfo/playerName").GetComponent <UILabel>();
        if (m_lableName != null)
        {
            m_lableName.pivot = UIWidget.Pivot.TopLeft;
        }
        m_spriteNameBg = m_transNormal.Find("normalinfo/channelNameBg").GetComponent <UISpriteEx>();
        if (m_spriteNameBg != null)
        {
            m_spriteNameBg.pivot = UIWidget.Pivot.TopLeft;
        }

        //voice
        m_goVoice                   = m_transNormal.Find("normalinfo/voice").gameObject;
        m_spriteVoiceBg             = m_transNormal.Find("normalinfo/voice/bg/voicebg").GetComponent <UISprite>();
        m_labelVoice                = m_transNormal.Find("normalinfo/voice/length").GetComponent <UILabel>();
        m_goVoiceTip                = m_transNormal.Find("normalinfo/voice/voicetip").gameObject;
        m_VoiceSprite               = m_transNormal.Find("normalinfo/voice/bg/Sprite").GetComponent <UISprite>();
        m_VoiceSprite.type          = UIBasicSprite.Type.Filled;
        m_VoiceSprite.fillDirection = UIBasicSprite.FillDirection.Horizontal;
        m_VoiceSprite.fillAmount    = 1;
        UIEventListener.Get(m_spriteVoiceBg.gameObject).onClick = OnClickVoice;

        m_trans_redPacket = m_transNormal.Find("redEnvelope");

        if (m_trans_redPacket != null)
        {
            Transform redText = m_trans_redPacket.Find("redText");
            if (redText == null)
            {
                return;
            }
            UIEventListener.Get(redText.gameObject).onClick = OnOpenRedPacket;
            Transform bless = redText.Find("blessmessage");
            if (bless != null)
            {
                m_label_blessmsg = bless.GetComponent <UILabel>();
            }
        }
    }
示例#2
0
 void InitOnShow()
 {
     UIEventListener.Get(m_btn_voice_input.gameObject).onPress = OnPreseVoice;
     m_voiceState      = m_trans_voiceMicTips.Find("Spriteleft/Sprite").GetComponent <UISpriteEx>();
     m_voiceStateLabel = m_trans_voiceMicTips.Find("Spriteleft/Label").GetComponent <UILabel>();
     UIEventListener.Get(m_btn_voice_input.gameObject).onDrag = OnDragEnd;
 }
示例#3
0
    /// <summary>
    /// 刷新表现
    /// </summary>
    public void RefreshTitle()
    {
//		Debug.Log ("此时角色穿戴的称号为"+GameCenter.titleMng.CurUseTitle.ID);
        if (titleinfo != null)
        {
            if (titleName != null)
            {
                titleName.spriteName = titleinfo.IconName;
                titleName.MakePixelPerfect();
                UISpriteEx spritex = titleName as UISpriteEx;
                if (spritex != null)
                {
                    spritex.IsGray = titleinfo.IsOwn ? UISpriteEx.ColorGray.normal : UISpriteEx.ColorGray.Gray;
                }
            }
            if (chooseObj != null)
            {
                chooseObj.SetActive(isChoose);
            }
            if (useObj != null)
            {
                useObj.SetActive(isUse);
            }
        }
        else
        {
        }
    }
示例#4
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);
 }
示例#5
0
    /// <summary>
    /// 领奖
    /// </summary>
    void OnClickGetReward(GameObject _go)
    {
        UISpriteEx spEx = getRewardBtn.GetComponentInChildren <UISpriteEx>();

        if (spEx != null && spEx.IsGray == UISpriteEx.ColorGray.normal)
        {
            EffectAnimation();
        }
    }
示例#6
0
    /// <summary>
    /// 显示推送列表
    /// </summary>
    public void ShowTuiSong()
    {
        List <FriendsInfo> list = GameCenter.friendsMng.friendList;

        if (changeBtn != null)
        {
            UIEventListener.Get(changeBtn.gameObject).onClick = delegate
            {
                GameCenter.friendsMng.C2S_ReqDoSomething(FriendOperation.ADDBALCKLIST, 0);//换一批
            }
        }
        ;
        if (list.Count <= 0)
        {
            if (addBtn != null)
            {
                UISpriteEx addEx = addBtn.GetComponentInChildren <UISpriteEx>();
                if (addEx != null)
                {
                    addEx.IsGray = UISpriteEx.ColorGray.Gray;
                }
            }
        }
        else
        {
            if (addBtn != null)
            {
                UISpriteEx addEx = addBtn.GetComponentInChildren <UISpriteEx>();
                if (addEx != null)
                {
                    addEx.IsGray = UISpriteEx.ColorGray.normal;
                }
                if (addEx.IsGray == UISpriteEx.ColorGray.normal)
                {
                    UIEventListener.Get(addBtn.gameObject).onClick = delegate
                    {
                        int id = 0;
                        if (GameCenter.friendsMng.curFriend != null)
                        {
                            id = GameCenter.friendsMng.curFriend.configId;
                        }
                        else if (list.Count > 0)
                        {
                            id = list[0].configId;
                        }
                        if (id != 0)
                        {
                            GameCenter.friendsMng.C2S_AddFriend(id);
                        }
                    }
                }
                ;
            }
        }
    }
示例#7
0
    protected override void OnAwake()
    {
        base.OnAwake();
        m_spriteQualityBg = transform.Find("QulityBg").GetComponent <UISpriteEx>();
        m_spriteIcon      = transform.Find("Icon").GetComponent <UISprite>();
        m_labelName       = transform.Find("Name").GetComponent <UILabel>();
        m_labelNum        = transform.Find("num").GetComponent <UILabel>();
        UIEventListener.Get(CacheTransform.Find("ItemRoot/InfoGrid").gameObject).onClick = OnShowTips;

        InitItemInfoGrid(CacheTransform.Find("ItemRoot/InfoGrid"));
    }
示例#8
0
 //初始化控件变量
 protected override void InitControls()
 {
     fastComponent = GetComponent <FastComponent>();
     fastComponent.BuildFastComponents();
     m_btn_btnclose = fastComponent.FastGetComponent <UIButton>("btnclose");
     if (null == m_btn_btnclose)
     {
         Engine.Utility.Log.Error("m_btn_btnclose 为空,请检查prefab是否缺乏组件");
     }
     m_label_title = fastComponent.FastGetComponent <UILabel>("title");
     if (null == m_label_title)
     {
         Engine.Utility.Log.Error("m_label_title 为空,请检查prefab是否缺乏组件");
     }
     m_sprite_icon = fastComponent.FastGetComponent <UISprite>("icon");
     if (null == m_sprite_icon)
     {
         Engine.Utility.Log.Error("m_sprite_icon 为空,请检查prefab是否缺乏组件");
     }
     m_label_desc = fastComponent.FastGetComponent <UILabel>("desc");
     if (null == m_label_desc)
     {
         Engine.Utility.Log.Error("m_label_desc 为空,请检查prefab是否缺乏组件");
     }
     m_trans_item = fastComponent.FastGetComponent <Transform>("item");
     if (null == m_trans_item)
     {
         Engine.Utility.Log.Error("m_trans_item 为空,请检查prefab是否缺乏组件");
     }
     m_label_conditiondesc = fastComponent.FastGetComponent <UILabel>("conditiondesc");
     if (null == m_label_conditiondesc)
     {
         Engine.Utility.Log.Error("m_label_conditiondesc 为空,请检查prefab是否缺乏组件");
     }
     m_spriteEx_btnget = fastComponent.FastGetComponent <UISpriteEx>("btnget");
     if (null == m_spriteEx_btnget)
     {
         Engine.Utility.Log.Error("m_spriteEx_btnget 为空,请检查prefab是否缺乏组件");
     }
     m_label_btnLabel = fastComponent.FastGetComponent <UILabel>("btnLabel");
     if (null == m_label_btnLabel)
     {
         Engine.Utility.Log.Error("m_label_btnLabel 为空,请检查prefab是否缺乏组件");
     }
     m_trans_UIItemRewardGrid = fastComponent.FastGetComponent <Transform>("UIItemRewardGrid");
     if (null == m_trans_UIItemRewardGrid)
     {
         Engine.Utility.Log.Error("m_trans_UIItemRewardGrid 为空,请检查prefab是否缺乏组件");
     }
     if (null != fastComponent)
     {
         GameObject.Destroy(fastComponent);
     }
 }
示例#9
0
    protected override void OnAwake()
    {
        base.OnAwake();
        m_lableName      = transform.Find("lableName").GetComponent <UILabel>();
        m_spriteStatus   = transform.Find("status").GetComponent <UISpriteEx>();
        m_spriteRoleIcon = transform.Find("roleIcon").GetComponent <UISpriteEx>();
        m_goNewTips      = transform.Find("Tip").gameObject;

        if (m_spriteRoleIcon != null)
        {
            m_lableLevel = m_spriteRoleIcon.transform.Find("roleLevel").GetComponent <UILabel>();
        }
    }
示例#10
0
    //void OnEnable(){
    //    GameCenter.endLessTrialsMng.OnCurChapterStarUpdate += OnCurChapterStarUpdate;
    //}

    //void OnDisable(){
    //    GameCenter.endLessTrialsMng.OnCurChapterStarUpdate -= OnCurChapterStarUpdate;
    //}

    void OnCurChapterStarUpdate()
    {
        if (data == null)
        {
            return;
        }
        if (lineNum != null)
        {
            lineNum.text = data.rewardDes.ToString();
        }
        for (int i = 0, len = items.Length; i < len; i++)
        {
            if (items[i] != null && i < data.reward.Count)
            {
                items[i].FillInfo(new EquipmentInfo(data.reward[i].eid, data.reward[i].count, EquipmentBelongTo.PREVIEW));
                items[i].gameObject.SetActive(true);
            }
            else
            {
                items[i].gameObject.SetActive(false);
            }
        }
        //Debug.Log("data.starNum :  " + data.starNum + "    GetTotalStar : " + GameCenter.endLessTrialsMng.GetTotalStar(curChapter));
        bool isreward = data.starNum > GameCenter.endLessTrialsMng.GetTotalStar(curChapter);

        if (rewardSprite != null)
        {
            rewardSprite.SetActive(!isreward);
            UISpriteEx sp = rewardSprite.GetComponent <UISpriteEx>();
            if (sp != null)
            {
                sp.IsGray = !isreward && !GameCenter.endLessTrialsMng.GetStarReward(curChapter, data.starNum) ? UISpriteEx.ColorGray.normal : UISpriteEx.ColorGray.Gray;
                CheckReadPoint(sp.IsGray == UISpriteEx.ColorGray.normal);
            }
        }
        if (dontRewardSprite != null)
        {
            dontRewardSprite.SetActive(isreward);
        }
        if (btnReward != null)
        {
            UISpriteEx sp = btnReward.GetComponentInChildren <UISpriteEx>();
            if (sp != null)
            {
                sp.IsGray = !isreward && !GameCenter.endLessTrialsMng.GetStarReward(curChapter, data.starNum) ? UISpriteEx.ColorGray.normal : UISpriteEx.ColorGray.Gray;
            }
            UIEventListener.Get(btnReward.gameObject).onClick = delegate {
                GameCenter.endLessTrialsMng.C2S_EndReward(curChapter, data.starNum);
            };
        }
    }
示例#11
0
    void InitSysUI()
    {
        m_transSys      = transform.Find("system");
        m_lableSysTitle = m_transSys.Find("title").GetComponent <UILabel>();
        m_spriteTitleBg = m_transSys.Find("titleBg").GetComponent <UISpriteEx>();
        if (m_spriteTitleBg != null)
        {
            m_spriteTitleBg.pivot = UIWidget.Pivot.TopLeft;
        }
        m_sysRichTextContext = m_transSys.Find("xmlText").GetComponent <UIXmlRichText>();
        m_spriteSysBg        = m_sysRichTextContext.transform.GetComponent <UIWidget>();

        m_sysRichTextContext.UrlClicked += OnClickUrl;
    }
示例#12
0
    void Awake()
    {
        m_lableName = transform.Find("name").GetComponent <UILabel>();
        m_lableLv   = transform.Find("level").GetComponent <UILabel>();
        m_headIcon  = transform.Find("icon").GetComponent <UISpriteEx>();
        m_btnAdd    = transform.Find("btn_add").gameObject;

        if (m_btnAdd != null)
        {
            UIEventListener.Get(m_btnAdd).onClick = OnBtnAdd;
        }
        if (m_headIcon != null)
        {
            UIEventListener.Get(m_headIcon.gameObject).onClick = OnBtnHead;
        }
    }
示例#13
0
    protected override void OnAwake()
    {
        base.OnAwake();
        mark_Leader = transform.Find("member_info/mark_leader").gameObject;
        level       = transform.Find("member_info/level").GetComponent <UILabel>();
        name        = transform.Find("member_info/name").GetComponent <UILabel>();
        icon        = transform.Find("member_info/avatarRoot/HeadIcon").GetComponent <UITexture>();
        mark_job    = transform.Find("member_info/mark_job").GetComponent <UISpriteEx>();
        //rtGo = transform.Find("member_info/avatarRoot/CharacterRenderTexture").gameObject;

        btn_memberInfo = transform.Find("member_info").gameObject;
        btn_addMember  = transform.Find("add_member").gameObject;
        m_lblMatching  = transform.Find("add_member/Matching").gameObject;

        UIEventListener.Get(btn_memberInfo).onClick = OnClickMemberInfo;
        UIEventListener.Get(btn_addMember).onClick  = OnClickAddMember;
    }
示例#14
0
    protected override void OnAwake()
    {
        base.OnAwake();
        //mark_Leader = transform.Find("mark_leader").gameObject;
        //mark_Leader.SetActive(false);
        level    = transform.Find("level").GetComponent <UILabel>();
        name     = transform.Find("name").GetComponent <UILabel>();
        icon     = transform.Find("avatarRoot/HeadIcon").GetComponent <UITexture>();
        mark_job = transform.Find("mark_job").GetComponent <UISpriteEx>();
        //rtGo = transform.Find("avatarRoot/CharacterRenderTexture").gameObject;

        bg_role    = transform.Find("bg_role").gameObject;
        btn_agree  = transform.Find("btn_agree").GetComponent <UIButton>();
        btn_refuse = transform.Find("btn_refuse").GetComponent <UIButton>();

        UIEventListener.Get(btn_agree.gameObject).onClick  = OnClickAgreeBtn;
        UIEventListener.Get(btn_refuse.gameObject).onClick = OnClickRefuse;
    }
示例#15
0
 void Awake()
 {
     m_headIcon    = transform.Find("bg/icon").GetComponent <UISpriteEx>();
     m_lableLevel  = transform.Find("bg/level").GetComponent <UILabel>();
     m_lableName   = transform.Find("bg/name").GetComponent <UILabel>();
     m_labelOnline = transform.Find("bg/online").GetComponent <UILabel>();
     m_tipsGo      = transform.Find("bg/warning").gameObject;
     m_btnGo       = transform.Find("bg/btn_add").gameObject;
     m_btnGo.gameObject.SetActive(false);
     m_marskGo = transform.Find("bg/select").gameObject;
     m_choose  = transform.Find("bg/btn_choose").gameObject;
     if (m_headIcon != null)
     {
         m_headIcon.MakePixelPerfect();
         UIEventListener.Get(m_headIcon.gameObject).onClick = OnShowOpratePanel;
     }
     UIEventListener.Get(m_btnGo).onClick = OnBtnAdd;
     //UIEventListener.Get(transform.Find("bg").gameObject).onClick = OnClickMe;
 }
示例#16
0
    /// <summary>
    /// Draw the sprite preview.
    /// </summary>

    public override void OnPreviewGUI(Rect rect, GUIStyle background)
    {
        UISpriteEx sprite = target as UISpriteEx;

        if (sprite == null || !sprite.isValid)
        {
            return;
        }

        Texture2D tex = sprite.mainTexture as Texture2D;

        if (tex == null)
        {
            return;
        }

        UISpriteData sd = sprite.atlas.GetSprite(sprite.spriteName);

        NGUIEditorTools.DrawSprite(tex, rect, sd, sprite.color);
    }
示例#17
0
    void ShowPageBtn()
    {
        if (parent != null && leftBtn != null && rightBtn != null)
        {
            UISpriteEx leftsp = leftBtn.GetComponentInChildren <UISpriteEx>();
            if (leftsp != null)
            {
                if (parent.transform.localPosition.x < 100)
                {
                    leftsp.IsGray = UISpriteEx.ColorGray.normal;
                }
                else
                {
                    leftsp.IsGray = UISpriteEx.ColorGray.Gray;
                }
            }

            UISpriteEx rightsp = rightBtn.GetComponentInChildren <UISpriteEx>();
            if (rightsp != null)
            {
                int len = 0;
                if (skinItemList.Count / 9 == 0)
                {
                    len = skinItemList.Count / 9 - 1;
                }
                else
                {
                    len = skinItemList.Count / 9;
                }
                if (parent.transform.localPosition.x > (100 - len * 403))
                {
                    rightsp.IsGray = UISpriteEx.ColorGray.normal;
                }
                else
                {
                    rightsp.IsGray = UISpriteEx.ColorGray.Gray;
                }
            }
        }
    }
示例#18
0
    static public UISpriteEx AddSpriteEx(GameObject go)
    {
        UISpriteEx w = NGUITools.AddWidget <UISpriteEx>(go);

        w.name       = "Sprite";
        w.atlas      = atlas;
        w.spriteName = selectedSprite;

        if (w.atlas != null && !string.IsNullOrEmpty(w.spriteName))
        {
            UISpriteData sp = w.atlas.GetSprite(w.spriteName);
            if (sp != null && sp.hasBorder)
            {
                w.type = UISpriteEx.Type.Sliced;
            }
        }

        w.pivot  = pivot;
        w.width  = 100;
        w.height = 100;
        w.MakePixelPerfect();
        return(w);
    }
示例#19
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;
     }
 }
示例#20
0
 //初始化控件变量
 protected override void InitControls()
 {
     fastComponent = GetComponent <FastComponent>();
     fastComponent.BuildFastComponents();
     m_trans_PlayerContent = fastComponent.FastGetComponent <Transform>("PlayerContent");
     if (null == m_trans_PlayerContent)
     {
         Engine.Utility.Log.Error("m_trans_PlayerContent 为空,请检查prefab是否缺乏组件");
     }
     m__modelTexture = fastComponent.FastGetComponent <UITexture>("modelTexture");
     if (null == m__modelTexture)
     {
         Engine.Utility.Log.Error("m__modelTexture 为空,请检查prefab是否缺乏组件");
     }
     m_widget_Equipment = fastComponent.FastGetComponent <UIWidget>("Equipment");
     if (null == m_widget_Equipment)
     {
         Engine.Utility.Log.Error("m_widget_Equipment 为空,请检查prefab是否缺乏组件");
     }
     m_trans_EquipmentGridRoot = fastComponent.FastGetComponent <Transform>("EquipmentGridRoot");
     if (null == m_trans_EquipmentGridRoot)
     {
         Engine.Utility.Log.Error("m_trans_EquipmentGridRoot 为空,请检查prefab是否缺乏组件");
     }
     m_spriteEx_equipfashionbtn = fastComponent.FastGetComponent <UISpriteEx>("equipfashionbtn");
     if (null == m_spriteEx_equipfashionbtn)
     {
         Engine.Utility.Log.Error("m_spriteEx_equipfashionbtn 为空,请检查prefab是否缺乏组件");
     }
     m_widget_Fashion = fastComponent.FastGetComponent <UIWidget>("Fashion");
     if (null == m_widget_Fashion)
     {
         Engine.Utility.Log.Error("m_widget_Fashion 为空,请检查prefab是否缺乏组件");
     }
     m_label_powerLabel = fastComponent.FastGetComponent <UILabel>("powerLabel");
     if (null == m_label_powerLabel)
     {
         Engine.Utility.Log.Error("m_label_powerLabel 为空,请检查prefab是否缺乏组件");
     }
     m_trans_propRoot = fastComponent.FastGetComponent <Transform>("propRoot");
     if (null == m_trans_propRoot)
     {
         Engine.Utility.Log.Error("m_trans_propRoot 为空,请检查prefab是否缺乏组件");
     }
     m_label_ActiveGridSuitLv = fastComponent.FastGetComponent <UILabel>("ActiveGridSuitLv");
     if (null == m_label_ActiveGridSuitLv)
     {
         Engine.Utility.Log.Error("m_label_ActiveGridSuitLv 为空,请检查prefab是否缺乏组件");
     }
     m_btn_BtnGridSuitNormal = fastComponent.FastGetComponent <UIButton>("BtnGridSuitNormal");
     if (null == m_btn_BtnGridSuitNormal)
     {
         Engine.Utility.Log.Error("m_btn_BtnGridSuitNormal 为空,请检查prefab是否缺乏组件");
     }
     m_btn_BtnGridSuitActive = fastComponent.FastGetComponent <UIButton>("BtnGridSuitActive");
     if (null == m_btn_BtnGridSuitActive)
     {
         Engine.Utility.Log.Error("m_btn_BtnGridSuitActive 为空,请检查prefab是否缺乏组件");
     }
     m_label_ActiveColorSuitLv = fastComponent.FastGetComponent <UILabel>("ActiveColorSuitLv");
     if (null == m_label_ActiveColorSuitLv)
     {
         Engine.Utility.Log.Error("m_label_ActiveColorSuitLv 为空,请检查prefab是否缺乏组件");
     }
     m_btn_BtnColorSuitNormal = fastComponent.FastGetComponent <UIButton>("BtnColorSuitNormal");
     if (null == m_btn_BtnColorSuitNormal)
     {
         Engine.Utility.Log.Error("m_btn_BtnColorSuitNormal 为空,请检查prefab是否缺乏组件");
     }
     m_btn_BtnColorSuitActive = fastComponent.FastGetComponent <UIButton>("BtnColorSuitActive");
     if (null == m_btn_BtnColorSuitActive)
     {
         Engine.Utility.Log.Error("m_btn_BtnColorSuitActive 为空,请检查prefab是否缺乏组件");
     }
     m_label_ActiveStoneSuitLv = fastComponent.FastGetComponent <UILabel>("ActiveStoneSuitLv");
     if (null == m_label_ActiveStoneSuitLv)
     {
         Engine.Utility.Log.Error("m_label_ActiveStoneSuitLv 为空,请检查prefab是否缺乏组件");
     }
     m_btn_BtnStoneSuitNormal = fastComponent.FastGetComponent <UIButton>("BtnStoneSuitNormal");
     if (null == m_btn_BtnStoneSuitNormal)
     {
         Engine.Utility.Log.Error("m_btn_BtnStoneSuitNormal 为空,请检查prefab是否缺乏组件");
     }
     m_btn_BtnStoneSuitActive = fastComponent.FastGetComponent <UIButton>("BtnStoneSuitActive");
     if (null == m_btn_BtnStoneSuitActive)
     {
         Engine.Utility.Log.Error("m_btn_BtnStoneSuitActive 为空,请检查prefab是否缺乏组件");
     }
     m_trans_RideContent = fastComponent.FastGetComponent <Transform>("RideContent");
     if (null == m_trans_RideContent)
     {
         Engine.Utility.Log.Error("m_trans_RideContent 为空,请检查prefab是否缺乏组件");
     }
     m_ctor_Ridescrollview = fastComponent.FastGetComponent <UIGridCreatorBase>("Ridescrollview");
     if (null == m_ctor_Ridescrollview)
     {
         Engine.Utility.Log.Error("m_ctor_Ridescrollview 为空,请检查prefab是否缺乏组件");
     }
     m_sprite_RidePropContent = fastComponent.FastGetComponent <UISprite>("RidePropContent");
     if (null == m_sprite_RidePropContent)
     {
         Engine.Utility.Log.Error("m_sprite_RidePropContent 为空,请检查prefab是否缺乏组件");
     }
     m__model_bg = fastComponent.FastGetComponent <UITexture>("model_bg");
     if (null == m__model_bg)
     {
         Engine.Utility.Log.Error("m__model_bg 为空,请检查prefab是否缺乏组件");
     }
     m_sprite_line = fastComponent.FastGetComponent <UISprite>("line");
     if (null == m_sprite_line)
     {
         Engine.Utility.Log.Error("m_sprite_line 为空,请检查prefab是否缺乏组件");
     }
     m__rideModel = fastComponent.FastGetComponent <UITexture>("rideModel");
     if (null == m__rideModel)
     {
         Engine.Utility.Log.Error("m__rideModel 为空,请检查prefab是否缺乏组件");
     }
     m_label_speed = fastComponent.FastGetComponent <UILabel>("speed");
     if (null == m_label_speed)
     {
         Engine.Utility.Log.Error("m_label_speed 为空,请检查prefab是否缺乏组件");
     }
     m_label_level = fastComponent.FastGetComponent <UILabel>("level");
     if (null == m_label_level)
     {
         Engine.Utility.Log.Error("m_label_level 为空,请检查prefab是否缺乏组件");
     }
     m_label_Ride_Name = fastComponent.FastGetComponent <UILabel>("Ride_Name");
     if (null == m_label_Ride_Name)
     {
         Engine.Utility.Log.Error("m_label_Ride_Name 为空,请检查prefab是否缺乏组件");
     }
     m_ctor_RideSkill = fastComponent.FastGetComponent <UIGridCreatorBase>("RideSkill");
     if (null == m_ctor_RideSkill)
     {
         Engine.Utility.Log.Error("m_ctor_RideSkill 为空,请检查prefab是否缺乏组件");
     }
     m_trans_PetContent = fastComponent.FastGetComponent <Transform>("PetContent");
     if (null == m_trans_PetContent)
     {
         Engine.Utility.Log.Error("m_trans_PetContent 为空,请检查prefab是否缺乏组件");
     }
     m_ctor_petscrollview = fastComponent.FastGetComponent <UIGridCreatorBase>("petscrollview");
     if (null == m_ctor_petscrollview)
     {
         Engine.Utility.Log.Error("m_ctor_petscrollview 为空,请检查prefab是否缺乏组件");
     }
     m_trans_PetPropRoot = fastComponent.FastGetComponent <Transform>("PetPropRoot");
     if (null == m_trans_PetPropRoot)
     {
         Engine.Utility.Log.Error("m_trans_PetPropRoot 为空,请检查prefab是否缺乏组件");
     }
     m_label_typeName = fastComponent.FastGetComponent <UILabel>("typeName");
     if (null == m_label_typeName)
     {
         Engine.Utility.Log.Error("m_label_typeName 为空,请检查prefab是否缺乏组件");
     }
     m__PetModel = fastComponent.FastGetComponent <UITexture>("PetModel");
     if (null == m__PetModel)
     {
         Engine.Utility.Log.Error("m__PetModel 为空,请检查prefab是否缺乏组件");
     }
     m_label_fightingLabel = fastComponent.FastGetComponent <UILabel>("fightingLabel");
     if (null == m_label_fightingLabel)
     {
         Engine.Utility.Log.Error("m_label_fightingLabel 为空,请检查prefab是否缺乏组件");
     }
     m_label_petshowname = fastComponent.FastGetComponent <UILabel>("petshowname");
     if (null == m_label_petshowname)
     {
         Engine.Utility.Log.Error("m_label_petshowname 为空,请检查prefab是否缺乏组件");
     }
     m_ctor_SkillRoot = fastComponent.FastGetComponent <UIGridCreatorBase>("SkillRoot");
     if (null == m_ctor_SkillRoot)
     {
         Engine.Utility.Log.Error("m_ctor_SkillRoot 为空,请检查prefab是否缺乏组件");
     }
     m_trans_UIPetRideGrid = fastComponent.FastGetComponent <Transform>("UIPetRideGrid");
     if (null == m_trans_UIPetRideGrid)
     {
         Engine.Utility.Log.Error("m_trans_UIPetRideGrid 为空,请检查prefab是否缺乏组件");
     }
     m_trans_UISkillGrid = fastComponent.FastGetComponent <Transform>("UISkillGrid");
     if (null == m_trans_UISkillGrid)
     {
         Engine.Utility.Log.Error("m_trans_UISkillGrid 为空,请检查prefab是否缺乏组件");
     }
     m_trans_UIEquipGrid = fastComponent.FastGetComponent <Transform>("UIEquipGrid");
     if (null == m_trans_UIEquipGrid)
     {
         Engine.Utility.Log.Error("m_trans_UIEquipGrid 为空,请检查prefab是否缺乏组件");
     }
     if (null != fastComponent)
     {
         GameObject.Destroy(fastComponent);
     }
 }
示例#21
0
    protected override void OnAwake()
    {
        base.OnAwake();
        if (null != m_trans_OffsetContent)
        {
            startPosX       = m_trans_OffsetContent.localPosition.x;
            m_fContentWidth = NGUIMath.CalculateRelativeWidgetBounds(m_trans_OffsetContent).size.x;
        }

        m_chatManager = DataManager.Manager <ChatDataManager>();

        m_input_Input.characterLimit = GameTableManager.Instance.GetGlobalConfig <int>("ChatMaxCharacter");

        m_chatItemPrefab = UIManager.GetResGameObj(GridID.Uichatitemgrid) as UnityEngine.GameObject;

        m_panel        = m_scrollview_ChatScrollView.GetComponent <UIPanel>();
        m_btnSendLable = m_btn_BtnSend.GetComponentInChildren <UILabel>();

        GameObject btnShowMsg = m_trans_newmessage_warning.Find("btnShowMsg").gameObject;

        UIEventListener.Get(btnShowMsg).onClick = OnClickRefreshMsg;

        UIToggle[] toggles = m_trans_ChanelTabs.GetComponentsInChildren <UIToggle>();
        for (int i = 0; i < toggles.Length; i++)
        {
            var     item        = toggles[i];
            var     channelName = item.name;
            BtnType btntype     = (BtnType)System.Enum.Parse(typeof(BtnType), channelName);
            EventDelegate.Add(item.onChange, () =>
            {
                if (btntype != BtnType.TabRed)
                {
                    if (item.value)
                    {
                        this.OnToggleValueChange(channelName);
                    }
                }
            });

            if (btntype == BtnType.TabTeam)
            {
                m_teamLable = item.GetComponentInChildren <UILabel>();
            }
            else if (btntype == BtnType.TabGhost)
            {
                m_goTabGhost = item.gameObject;
            }
            else if (btntype == BtnType.TabSystem)
            {
                m_transTabSys = item.transform;
            }
            else if (btntype == BtnType.TabRed)
            {
                m_transRedPacket = item.transform;
                UIEventListener.Get(item.gameObject).onClick = OnClickRedPacket;
            }
            item.transform.localPosition = new Vector3(-3, 320 - i * 65, 0);
        }
        m_scrollview_ChatScrollView.onStoppedMoving += OnDragPanelFinished;
        m_trans_voiceMicTips.gameObject.SetActive(false);
        UIEventListener.Get(m_btn_voice_input.gameObject).onPress = OnPreseVoice;
        UIEventListener.Get(m_btn_voice_input.gameObject).onDrag  = OnDragEnd;

        m_voiceState      = m_trans_voiceMicTips.Find("Spriteleft/Sprite").GetComponent <UISpriteEx>();
        m_voiceStateLabel = m_trans_voiceMicTips.Find("Spriteleft/Label").GetComponent <UILabel>();
    }
示例#22
0
 //初始化控件变量
 protected override void InitControls()
 {
     fastComponent = GetComponent <FastComponent>();
     fastComponent.BuildFastComponents();
     m_sprite_QuestTraceItem = fastComponent.FastGetComponent <UISprite>("QuestTraceItem");
     if (null == m_sprite_QuestTraceItem)
     {
         Engine.Utility.Log.Error("m_sprite_QuestTraceItem 为空,请检查prefab是否缺乏组件");
     }
     m_spriteEx_mutebtn = fastComponent.FastGetComponent <UISpriteEx>("mutebtn");
     if (null == m_spriteEx_mutebtn)
     {
         Engine.Utility.Log.Error("m_spriteEx_mutebtn 为空,请检查prefab是否缺乏组件");
     }
     m_btn_statebg = fastComponent.FastGetComponent <UIButton>("statebg");
     if (null == m_btn_statebg)
     {
         Engine.Utility.Log.Error("m_btn_statebg 为空,请检查prefab是否缺乏组件");
     }
     m_label_roomname = fastComponent.FastGetComponent <UILabel>("roomname");
     if (null == m_label_roomname)
     {
         Engine.Utility.Log.Error("m_label_roomname 为空,请检查prefab是否缺乏组件");
     }
     m_sprite_statearrow = fastComponent.FastGetComponent <UISprite>("statearrow");
     if (null == m_sprite_statearrow)
     {
         Engine.Utility.Log.Error("m_sprite_statearrow 为空,请检查prefab是否缺乏组件");
     }
     m_sprite_stateani = fastComponent.FastGetComponent <UISprite>("stateani");
     if (null == m_sprite_stateani)
     {
         Engine.Utility.Log.Error("m_sprite_stateani 为空,请检查prefab是否缺乏组件");
     }
     m_spriteEx_voicesetting = fastComponent.FastGetComponent <UISpriteEx>("voicesetting");
     if (null == m_spriteEx_voicesetting)
     {
         Engine.Utility.Log.Error("m_spriteEx_voicesetting 为空,请检查prefab是否缺乏组件");
     }
     m_trans_channelContainer = fastComponent.FastGetComponent <Transform>("channelContainer");
     if (null == m_trans_channelContainer)
     {
         Engine.Utility.Log.Error("m_trans_channelContainer 为空,请检查prefab是否缺乏组件");
     }
     m_btn_teamchannel = fastComponent.FastGetComponent <UIButton>("teamchannel");
     if (null == m_btn_teamchannel)
     {
         Engine.Utility.Log.Error("m_btn_teamchannel 为空,请检查prefab是否缺乏组件");
     }
     m_btn_homechannel = fastComponent.FastGetComponent <UIButton>("homechannel");
     if (null == m_btn_homechannel)
     {
         Engine.Utility.Log.Error("m_btn_homechannel 为空,请检查prefab是否缺乏组件");
     }
     m_btn_commandchannel = fastComponent.FastGetComponent <UIButton>("commandchannel");
     if (null == m_btn_commandchannel)
     {
         Engine.Utility.Log.Error("m_btn_commandchannel 为空,请检查prefab是否缺乏组件");
     }
     m_widget_btnclose = fastComponent.FastGetComponent <UIWidget>("btnclose");
     if (null == m_widget_btnclose)
     {
         Engine.Utility.Log.Error("m_widget_btnclose 为空,请检查prefab是否缺乏组件");
     }
     m_btn_btnArrow = fastComponent.FastGetComponent <UIButton>("btnArrow");
     if (null == m_btn_btnArrow)
     {
         Engine.Utility.Log.Error("m_btn_btnArrow 为空,请检查prefab是否缺乏组件");
     }
     m_trans_ArrowPosShow = fastComponent.FastGetComponent <Transform>("ArrowPosShow");
     if (null == m_trans_ArrowPosShow)
     {
         Engine.Utility.Log.Error("m_trans_ArrowPosShow 为空,请检查prefab是否缺乏组件");
     }
     m_trans_ArrowPosHide = fastComponent.FastGetComponent <Transform>("ArrowPosHide");
     if (null == m_trans_ArrowPosHide)
     {
         Engine.Utility.Log.Error("m_trans_ArrowPosHide 为空,请检查prefab是否缺乏组件");
     }
     m_widget_Offset = fastComponent.FastGetComponent <UIWidget>("Offset");
     if (null == m_widget_Offset)
     {
         Engine.Utility.Log.Error("m_widget_Offset 为空,请检查prefab是否缺乏组件");
     }
     m_spriteEx_btnMission = fastComponent.FastGetComponent <UISpriteEx>("btnMission");
     if (null == m_spriteEx_btnMission)
     {
         Engine.Utility.Log.Error("m_spriteEx_btnMission 为空,请检查prefab是否缺乏组件");
     }
     m_label_missionlabel = fastComponent.FastGetComponent <UILabel>("missionlabel");
     if (null == m_label_missionlabel)
     {
         Engine.Utility.Log.Error("m_label_missionlabel 为空,请检查prefab是否缺乏组件");
     }
     m_spriteEx_btnTeam = fastComponent.FastGetComponent <UISpriteEx>("btnTeam");
     if (null == m_spriteEx_btnTeam)
     {
         Engine.Utility.Log.Error("m_spriteEx_btnTeam 为空,请检查prefab是否缺乏组件");
     }
     m_label_TeamLbl = fastComponent.FastGetComponent <UILabel>("TeamLbl");
     if (null == m_label_TeamLbl)
     {
         Engine.Utility.Log.Error("m_label_TeamLbl 为空,请检查prefab是否缺乏组件");
     }
     m_label_TeamNum = fastComponent.FastGetComponent <UILabel>("TeamNum");
     if (null == m_label_TeamNum)
     {
         Engine.Utility.Log.Error("m_label_TeamNum 为空,请检查prefab是否缺乏组件");
     }
     m_sprite_btnTeam_warrning = fastComponent.FastGetComponent <UISprite>("btnTeam_warrning");
     if (null == m_sprite_btnTeam_warrning)
     {
         Engine.Utility.Log.Error("m_sprite_btnTeam_warrning 为空,请检查prefab是否缺乏组件");
     }
     m_widget_team = fastComponent.FastGetComponent <UIWidget>("team");
     if (null == m_widget_team)
     {
         Engine.Utility.Log.Error("m_widget_team 为空,请检查prefab是否缺乏组件");
     }
     m_trans_TeamChoiceBtn = fastComponent.FastGetComponent <Transform>("TeamChoiceBtn");
     if (null == m_trans_TeamChoiceBtn)
     {
         Engine.Utility.Log.Error("m_trans_TeamChoiceBtn 为空,请检查prefab是否缺乏组件");
     }
     m_btn_btn_createteam = fastComponent.FastGetComponent <UIButton>("btn_createteam");
     if (null == m_btn_btn_createteam)
     {
         Engine.Utility.Log.Error("m_btn_btn_createteam 为空,请检查prefab是否缺乏组件");
     }
     m_btn_btn_convenientteam = fastComponent.FastGetComponent <UIButton>("btn_convenientteam");
     if (null == m_btn_btn_convenientteam)
     {
         Engine.Utility.Log.Error("m_btn_btn_convenientteam 为空,请检查prefab是否缺乏组件");
     }
     m_trans_MemberListRoot = fastComponent.FastGetComponent <Transform>("MemberListRoot");
     if (null == m_trans_MemberListRoot)
     {
         Engine.Utility.Log.Error("m_trans_MemberListRoot 为空,请检查prefab是否缺乏组件");
     }
     m_grid_MemberListGrid = fastComponent.FastGetComponent <UIGrid>("MemberListGrid");
     if (null == m_grid_MemberListGrid)
     {
         Engine.Utility.Log.Error("m_grid_MemberListGrid 为空,请检查prefab是否缺乏组件");
     }
     m_trans_MemberGridCache = fastComponent.FastGetComponent <Transform>("MemberGridCache");
     if (null == m_trans_MemberGridCache)
     {
         Engine.Utility.Log.Error("m_trans_MemberGridCache 为空,请检查prefab是否缺乏组件");
     }
     m_trans_TeamMemberBtnRoot = fastComponent.FastGetComponent <Transform>("TeamMemberBtnRoot");
     if (null == m_trans_TeamMemberBtnRoot)
     {
         Engine.Utility.Log.Error("m_trans_TeamMemberBtnRoot 为空,请检查prefab是否缺乏组件");
     }
     m_sprite_teamMember_bg = fastComponent.FastGetComponent <UISprite>("teamMember_bg");
     if (null == m_sprite_teamMember_bg)
     {
         Engine.Utility.Log.Error("m_sprite_teamMember_bg 为空,请检查prefab是否缺乏组件");
     }
     m_btn_btn_sendmessage = fastComponent.FastGetComponent <UIButton>("btn_sendmessage");
     if (null == m_btn_btn_sendmessage)
     {
         Engine.Utility.Log.Error("m_btn_btn_sendmessage 为空,请检查prefab是否缺乏组件");
     }
     m_btn_btn_lookmessage = fastComponent.FastGetComponent <UIButton>("btn_lookmessage");
     if (null == m_btn_btn_lookmessage)
     {
         Engine.Utility.Log.Error("m_btn_btn_lookmessage 为空,请检查prefab是否缺乏组件");
     }
     m_btn_btn_addfriend = fastComponent.FastGetComponent <UIButton>("btn_addfriend");
     if (null == m_btn_btn_addfriend)
     {
         Engine.Utility.Log.Error("m_btn_btn_addfriend 为空,请检查prefab是否缺乏组件");
     }
     m_btn_btn_giveleader = fastComponent.FastGetComponent <UIButton>("btn_giveleader");
     if (null == m_btn_btn_giveleader)
     {
         Engine.Utility.Log.Error("m_btn_btn_giveleader 为空,请检查prefab是否缺乏组件");
     }
     m_btn_btn_kickedoutteam = fastComponent.FastGetComponent <UIButton>("btn_kickedoutteam");
     if (null == m_btn_btn_kickedoutteam)
     {
         Engine.Utility.Log.Error("m_btn_btn_kickedoutteam 为空,请检查prefab是否缺乏组件");
     }
     m_widget_TeamMemberBtnClose = fastComponent.FastGetComponent <UIWidget>("TeamMemberBtnClose");
     if (null == m_widget_TeamMemberBtnClose)
     {
         Engine.Utility.Log.Error("m_widget_TeamMemberBtnClose 为空,请检查prefab是否缺乏组件");
     }
     m_trans_mission = fastComponent.FastGetComponent <Transform>("mission");
     if (null == m_trans_mission)
     {
         Engine.Utility.Log.Error("m_trans_mission 为空,请检查prefab是否缺乏组件");
     }
     m_trans_ScrollViewRoot = fastComponent.FastGetComponent <Transform>("ScrollViewRoot");
     if (null == m_trans_ScrollViewRoot)
     {
         Engine.Utility.Log.Error("m_trans_ScrollViewRoot 为空,请检查prefab是否缺乏组件");
     }
     m_trans_grid = fastComponent.FastGetComponent <Transform>("grid");
     if (null == m_trans_grid)
     {
         Engine.Utility.Log.Error("m_trans_grid 为空,请检查prefab是否缺乏组件");
     }
     m_trans_QuestTraceItemRoot = fastComponent.FastGetComponent <Transform>("QuestTraceItemRoot");
     if (null == m_trans_QuestTraceItemRoot)
     {
         Engine.Utility.Log.Error("m_trans_QuestTraceItemRoot 为空,请检查prefab是否缺乏组件");
     }
     m_sprite_arrow = fastComponent.FastGetComponent <UISprite>("arrow");
     if (null == m_sprite_arrow)
     {
         Engine.Utility.Log.Error("m_sprite_arrow 为空,请检查prefab是否缺乏组件");
     }
     m_trans_copyTarget = fastComponent.FastGetComponent <Transform>("copyTarget");
     if (null == m_trans_copyTarget)
     {
         Engine.Utility.Log.Error("m_trans_copyTarget 为空,请检查prefab是否缺乏组件");
     }
     m_trans_copyTargetScrollViewRoot = fastComponent.FastGetComponent <Transform>("copyTargetScrollViewRoot");
     if (null == m_trans_copyTargetScrollViewRoot)
     {
         Engine.Utility.Log.Error("m_trans_copyTargetScrollViewRoot 为空,请检查prefab是否缺乏组件");
     }
     m_scrollview_copyTargetScrollView = fastComponent.FastGetComponent <UIScrollView>("copyTargetScrollView");
     if (null == m_scrollview_copyTargetScrollView)
     {
         Engine.Utility.Log.Error("m_scrollview_copyTargetScrollView 为空,请检查prefab是否缺乏组件");
     }
     m_trans_copyTargetGrid = fastComponent.FastGetComponent <Transform>("copyTargetGrid");
     if (null == m_trans_copyTargetGrid)
     {
         Engine.Utility.Log.Error("m_trans_copyTargetGrid 为空,请检查prefab是否缺乏组件");
     }
     m_label_copyTargetTitle = fastComponent.FastGetComponent <UILabel>("copyTargetTitle");
     if (null == m_label_copyTargetTitle)
     {
         Engine.Utility.Log.Error("m_label_copyTargetTitle 为空,请检查prefab是否缺乏组件");
     }
     m_trans_copyTargetGridCache = fastComponent.FastGetComponent <Transform>("copyTargetGridCache");
     if (null == m_trans_copyTargetGridCache)
     {
         Engine.Utility.Log.Error("m_trans_copyTargetGridCache 为空,请检查prefab是否缺乏组件");
     }
     m_trans_copyTargetEffectRoot = fastComponent.FastGetComponent <Transform>("copyTargetEffectRoot");
     if (null == m_trans_copyTargetEffectRoot)
     {
         Engine.Utility.Log.Error("m_trans_copyTargetEffectRoot 为空,请检查prefab是否缺乏组件");
     }
     m_trans_copyBattleInfo = fastComponent.FastGetComponent <Transform>("copyBattleInfo");
     if (null == m_trans_copyBattleInfo)
     {
         Engine.Utility.Log.Error("m_trans_copyBattleInfo 为空,请检查prefab是否缺乏组件");
     }
     m_trans_copyBattleInfoRoot = fastComponent.FastGetComponent <Transform>("copyBattleInfoRoot");
     if (null == m_trans_copyBattleInfoRoot)
     {
         Engine.Utility.Log.Error("m_trans_copyBattleInfoRoot 为空,请检查prefab是否缺乏组件");
     }
     m_label_shenLabel0 = fastComponent.FastGetComponent <UILabel>("shenLabel0");
     if (null == m_label_shenLabel0)
     {
         Engine.Utility.Log.Error("m_label_shenLabel0 为空,请检查prefab是否缺乏组件");
     }
     m_label_moLabel0 = fastComponent.FastGetComponent <UILabel>("moLabel0");
     if (null == m_label_moLabel0)
     {
         Engine.Utility.Log.Error("m_label_moLabel0 为空,请检查prefab是否缺乏组件");
     }
     m_label_shenLabel1 = fastComponent.FastGetComponent <UILabel>("shenLabel1");
     if (null == m_label_shenLabel1)
     {
         Engine.Utility.Log.Error("m_label_shenLabel1 为空,请检查prefab是否缺乏组件");
     }
     m_label_moLabel1 = fastComponent.FastGetComponent <UILabel>("moLabel1");
     if (null == m_label_moLabel1)
     {
         Engine.Utility.Log.Error("m_label_moLabel1 为空,请检查prefab是否缺乏组件");
     }
     m_label_shenLabel2 = fastComponent.FastGetComponent <UILabel>("shenLabel2");
     if (null == m_label_shenLabel2)
     {
         Engine.Utility.Log.Error("m_label_shenLabel2 为空,请检查prefab是否缺乏组件");
     }
     m_label_moLabel2 = fastComponent.FastGetComponent <UILabel>("moLabel2");
     if (null == m_label_moLabel2)
     {
         Engine.Utility.Log.Error("m_label_moLabel2 为空,请检查prefab是否缺乏组件");
     }
     m_label_copyBattleInfoTitle = fastComponent.FastGetComponent <UILabel>("copyBattleInfoTitle");
     if (null == m_label_copyBattleInfoTitle)
     {
         Engine.Utility.Log.Error("m_label_copyBattleInfoTitle 为空,请检查prefab是否缺乏组件");
     }
     m_trans_nvWa = fastComponent.FastGetComponent <Transform>("nvWa");
     if (null == m_trans_nvWa)
     {
         Engine.Utility.Log.Error("m_trans_nvWa 为空,请检查prefab是否缺乏组件");
     }
     m_trans_RecruitContent = fastComponent.FastGetComponent <Transform>("RecruitContent");
     if (null == m_trans_RecruitContent)
     {
         Engine.Utility.Log.Error("m_trans_RecruitContent 为空,请检查prefab是否缺乏组件");
     }
     m_label_RecruitNum = fastComponent.FastGetComponent <UILabel>("RecruitNum");
     if (null == m_label_RecruitNum)
     {
         Engine.Utility.Log.Error("m_label_RecruitNum 为空,请检查prefab是否缺乏组件");
     }
     m_trans_GuardContent = fastComponent.FastGetComponent <Transform>("GuardContent");
     if (null == m_trans_GuardContent)
     {
         Engine.Utility.Log.Error("m_trans_GuardContent 为空,请检查prefab是否缺乏组件");
     }
     m_grid_GridRoot = fastComponent.FastGetComponent <UIGrid>("GridRoot");
     if (null == m_grid_GridRoot)
     {
         Engine.Utility.Log.Error("m_grid_GridRoot 为空,请检查prefab是否缺乏组件");
     }
     m_trans_RecruitGrid1 = fastComponent.FastGetComponent <Transform>("RecruitGrid1");
     if (null == m_trans_RecruitGrid1)
     {
         Engine.Utility.Log.Error("m_trans_RecruitGrid1 为空,请检查prefab是否缺乏组件");
     }
     m_trans_RecruitGrid2 = fastComponent.FastGetComponent <Transform>("RecruitGrid2");
     if (null == m_trans_RecruitGrid2)
     {
         Engine.Utility.Log.Error("m_trans_RecruitGrid2 为空,请检查prefab是否缺乏组件");
     }
     m_trans_RecruitGrid3 = fastComponent.FastGetComponent <Transform>("RecruitGrid3");
     if (null == m_trans_RecruitGrid3)
     {
         Engine.Utility.Log.Error("m_trans_RecruitGrid3 为空,请检查prefab是否缺乏组件");
     }
     m_trans_RecruitGrid4 = fastComponent.FastGetComponent <Transform>("RecruitGrid4");
     if (null == m_trans_RecruitGrid4)
     {
         Engine.Utility.Log.Error("m_trans_RecruitGrid4 为空,请检查prefab是否缺乏组件");
     }
     m_label_MebelNum = fastComponent.FastGetComponent <UILabel>("MebelNum");
     if (null == m_label_MebelNum)
     {
         Engine.Utility.Log.Error("m_label_MebelNum 为空,请检查prefab是否缺乏组件");
     }
     m_trans_answer = fastComponent.FastGetComponent <Transform>("answer");
     if (null == m_trans_answer)
     {
         Engine.Utility.Log.Error("m_trans_answer 为空,请检查prefab是否缺乏组件");
     }
     m_trans_answerRoot = fastComponent.FastGetComponent <Transform>("answerRoot");
     if (null == m_trans_answerRoot)
     {
         Engine.Utility.Log.Error("m_trans_answerRoot 为空,请检查prefab是否缺乏组件");
     }
     m_label_JingBiNum = fastComponent.FastGetComponent <UILabel>("JingBiNum");
     if (null == m_label_JingBiNum)
     {
         Engine.Utility.Log.Error("m_label_JingBiNum 为空,请检查prefab是否缺乏组件");
     }
     m_label_PlayerNum = fastComponent.FastGetComponent <UILabel>("PlayerNum");
     if (null == m_label_PlayerNum)
     {
         Engine.Utility.Log.Error("m_label_PlayerNum 为空,请检查prefab是否缺乏组件");
     }
     m_label_reliveLbl = fastComponent.FastGetComponent <UILabel>("reliveLbl");
     if (null == m_label_reliveLbl)
     {
         Engine.Utility.Log.Error("m_label_reliveLbl 为空,请检查prefab是否缺乏组件");
     }
     m_sprite_reliveIconTrue = fastComponent.FastGetComponent <UISprite>("reliveIconTrue");
     if (null == m_sprite_reliveIconTrue)
     {
         Engine.Utility.Log.Error("m_sprite_reliveIconTrue 为空,请检查prefab是否缺乏组件");
     }
     m_sprite_reliveIconFalse = fastComponent.FastGetComponent <UISprite>("reliveIconFalse");
     if (null == m_sprite_reliveIconFalse)
     {
         Engine.Utility.Log.Error("m_sprite_reliveIconFalse 为空,请检查prefab是否缺乏组件");
     }
     m_trans_OffsetPosHide = fastComponent.FastGetComponent <Transform>("OffsetPosHide");
     if (null == m_trans_OffsetPosHide)
     {
         Engine.Utility.Log.Error("m_trans_OffsetPosHide 为空,请检查prefab是否缺乏组件");
     }
     m_trans_OffsetPosShow = fastComponent.FastGetComponent <Transform>("OffsetPosShow");
     if (null == m_trans_OffsetPosShow)
     {
         Engine.Utility.Log.Error("m_trans_OffsetPosShow 为空,请检查prefab是否缺乏组件");
     }
     if (null != fastComponent)
     {
         GameObject.Destroy(fastComponent);
     }
 }
示例#23
0
    void OnCurChapterItemUpdate()
    {
        if (data == null)
        {
            return;
        }
        if (Icon != null)
        {
            Icon.spriteName = data.icon;
            Icon.MakePixelPerfect();
        }
        if (name != null)
        {
            name.text = data.name;
        }
        if (fight != null)
        {
            fight.text = data.fighting;
        }

        bool isShow = (data.frontGate > 0 && !GameCenter.endLessTrialsMng.GetItemDataFront(data.frontGate));

        if (unShow != null)
        {
            unShow.GetComponent <UISpriteEx>().IsGray = isShow ? UISpriteEx.ColorGray.Gray : UISpriteEx.ColorGray.normal;
        }
//		BoxCollider box = gameObject.GetComponent<BoxCollider>();
//		if(box != null)box.enabled = !isShow;

        SceneRef scene = ConfigMng.Instance.GetSceneRef(data.id);

        if (scene != null)
        {
            for (int i = 0, len = items.Length; i < len; i++)
            {
                if (items[i] != null)
                {
                    if (i < scene.reward.Count)
                    {
                        items[i].FillInfo(new EquipmentInfo(scene.reward[i].eid, scene.reward[i].count, EquipmentBelongTo.PREVIEW));
                        items[i].gameObject.SetActive(true);
                    }
                    else
                    {
                        items[i].gameObject.SetActive(false);
                    }
                }
            }
        }
        for (int i = 0, len = oneItems.Length; i < len; i++)
        {
            if (oneItems[i] != null && i < data.firstAward.Count)
            {
                oneItems[i].FillInfo(new EquipmentInfo(data.firstAward[i].eid, data.firstAward[i].count, EquipmentBelongTo.PREVIEW));
                oneItems[i].gameObject.SetActive(true);
            }
            else
            {
                oneItems[i].gameObject.SetActive(false);
            }
        }

        if (btnReward != null)
        {
            UISpriteEx spEx = btnReward.GetComponentInChildren <UISpriteEx>();
            if (spEx != null)
            {
                spEx.IsGray = isShow ? UISpriteEx.ColorGray.Gray : UISpriteEx.ColorGray.normal;
            }
            UIEventListener.Get(btnReward.gameObject).onClick = delegate {
                GameCenter.endLessTrialsMng.C2S_InEndItem(GameCenter.endLessTrialsMng.CurChapterID, data.id);
            };
        }
        if (chapter != null)
        {
            chapter.text = data.chapterName;
        }
        if (isKill != null)
        {
            isKill.gameObject.SetActive(false);
        }
        if (flagSp != null)
        {
            flagSp.SetActive(false);
        }
        if (headSp != null)
        {
            headSp.SetActive(false);
        }
        EndLessTrialsDataInfo.EndLessTrialsItemData serData = GameCenter.endLessTrialsMng.GetItemData(data.id);
        if (serData == null)
        {
//			if(unShow != null)unShow.SetActive(true);
            if (killDes != null)
            {
                killDes.text = ConfigMng.Instance.GetUItext(9);
            }
            for (int i = 0, len = showStar.Length; i < len; i++)
            {
                if (showStar[i] != null)
                {
                    showStar[i].IsGray = UISpriteEx.ColorGray.Gray;
                }
            }
            if (!isShow)
            {
                if (headSp != null)
                {
                    headSp.SetActive(true);
                }
            }
            return;
        }
        if (isKill != null)
        {
            isKill.gameObject.SetActive(serData.enter > 0);
        }
        if (flagSp != null)
        {
            flagSp.SetActive(serData.star > 0 || serData.enter > 0);
        }
        if (killDes != null)
        {
            killDes.text = serData.ItemTime;
        }
        for (int i = 0, len = showStar.Length; i < len; i++)
        {
            if (showStar[i])
            {
                if (serData.star > i)
                {
                    showStar[i].IsGray = UISpriteEx.ColorGray.normal;
                }
                else
                {
                    showStar[i].IsGray = UISpriteEx.ColorGray.Gray;
                }
            }
        }
    }
示例#24
0
    /// <summary>
    /// 新添加
    /// </summary>
    /// <param name="textList"></param>
    private void OnAddText(IEnumerable <ChatInfo> textList)
    {
        if (!gameObject.activeSelf)
        {
            m_lsttextList.AddRange(textList);
            return;
        }
        var list = textList.TakeLast(MaxChatNum).ToList();

        foreach (var item in list)
        {
            if (item.IsRedPacket)
            {//红包不显示
                continue;
            }
            UIXmlRichText xmlText;
            if (!RemoveOverfloorChat(out xmlText))
            {
                GameObject go = GameObject.Instantiate(m_chatItemPrefab) as GameObject;
                xmlText = go.transform.Find("richtext").GetComponent <UIXmlRichText>();
                go.GetComponent <UIWidget>().width = (int)m_UIPanel.baseClipRegion.z - 10;
                xmlText.UrlClicked += OnClickUrl;
            }
            xmlText.fontSize = 20;
            Transform root = xmlText.transform.parent;
            root.gameObject.SetActive(true);
            xmlText.AddXml(item.Title + item.Content);
            xmlText.gameObject.SetActive(true);
            Transform t = xmlText.transform;
            root.parent        = m_trans_chatItemRoot;
            root.localPosition = Vector3.zero;
            root.localScale    = Vector3.one;
            root.localRotation = Quaternion.identity;

            UILabel[] uilabelArray = t.GetComponentsInChildren <UILabel>();
            if (uilabelArray.Length > 0)
            {
                UILabel lableTitle = uilabelArray[0];
                if (lableTitle != null)
                {
                    UISpriteEx spriteBg = root.transform.Find("titlebg").GetComponent <UISpriteEx>();

                    if (spriteBg != null)
                    {
                        spriteBg.ChangeSprite(SingleChatItem.GetChannelIndex(item.Channel));
                    }

                    // spriteBg.transform.parent = title;
                    spriteBg.pivot = lableTitle.pivot;
                    spriteBg.transform.localPosition = new Vector3(lableTitle.transform.localPosition.x - 3, lableTitle.transform.localPosition.y, 0);
                    spriteBg.height = lableTitle.height + 5;
                    spriteBg.width  = lableTitle.width + 3;
                }
            }

            float height = xmlText.GetTotalHeight() + 5;
            foreach (var moveItem in m_lstxmlText)
            {
                Vector3 pos = moveItem.transform.parent.localPosition;
                pos.y -= height;
                moveItem.transform.parent.localPosition = pos;

                xmlText.name = pos.y.ToString();
            }
            m_lstxmlText.Add(xmlText);
        }

        float offsetY = m_chatScrollview.panel.clipOffset.y + 1;

        if (offsetY < 0)
        {
            m_chatScrollview.MoveRelative(new Vector3(0, offsetY));//取反 往下相对移动
        }
    }
示例#25
0
    private void SetDemonsStar(bool showEffect = false)
    {
        StarTaskData stardata = DataManager.Manager <TaskDataManager>().GetStarTask(m_nTaskid);

        if (stardata != null)
        {
            if (showEffect)
            {
                int start       = (int)(m_sprite_star.fillAmount * 5);
                int addstartNum = (int)stardata.star - start;
                StartCoroutine(ShowEffect(start, addstartNum));
            }
            else
            {
                CreateEffect(5 - (int)stardata.star);

                m_sprite_star.fillAmount = stardata.star * 1f / 5;
            }

            int money = 0; //金币
            int coin  = 0; //元宝
            int cold  = 0; //文钱

            //const int moneyRefresTime = 3;
            GetStarTaskCost(stardata.star, ref money, ref coin, ref cold);

            Transform t = m_label_lablerefreshmoney.transform.Find("Sprite");
            if (t != null)
            {
                UISpriteEx se = t.GetComponent <UISpriteEx>();
                if (se != null)
                {
                    //se.ChangeSprite(stardata.all_refresh >= moneyRefresTime ? 2 : 1);
                    se.ChangeSprite(1);
                }
            }

            //m_label_lablerefreshmoney.text = stardata.all_refresh >= moneyRefresTime ? coin.ToString() : money.ToString();
            //刷新超过三次才要钱
            //if (stardata.all_refresh >= GameTableManager.Instance.GetGlobalConfig<uint>("StarGoldRefresh"))
            //{
            //    m_label_lablerefreshmoney.gameObject.SetActive(true);
            //    m_label_lablerefreshmoney.text = money.ToString();
            //}
            //else
            //{
            //    m_label_lablerefreshmoney.gameObject.SetActive(false);
            //}
            int leftgold = MainPlayerHelper.GetMoneyNumByType(ClientMoneyType.Gold);
            m_label_remainmoney.gameObject.SetActive(true);
            m_label_remainmoney.text       = leftgold.ToString();
            m_label_lablerefreshmoney.text = money.ToString();
            m_label_lableRefreshCoin.text  = cold.ToString();

            t = m_btn_btn_refresh.transform.Find("Label");
            if (t != null)
            {
                UILabel lable = t.GetComponent <UILabel>();
                if (lable != null)
                {
                    lable.text = "刷新";
                    //if (stardata.all_refresh >= 3)
                    //{
                    //    lable.text = "刷新";
                    //}
                    //else
                    //{
                    //    lable.text = string.Format("刷新({0})", moneyRefresTime - stardata.all_refresh);
                    //}
                }
            }
        }
    }
示例#26
0
    //void RefeshDoubleHitState()
    //{
    //if (Time.time - _lastTime < 2)
    //{
    //    if (DoubleHitNum != null)
    //    {
    //        DoubleHitNum.text = doubleHitNum.ToString();
    //        if (isNewHit)
    //        {
    //            DoubleHitNum.fontSize = 40;
    //            isNewHit = false;
    //        }
    //        else
    //        {
    //            DoubleHitNum.fontSize = 20;
    //        }
    //    }
    //    if (DoubleHitObj != null) DoubleHitObj.SetActive(true);
    //    if (progressSprite != null) progressSprite.fillAmount = (1 - (Time.time - _lastTime) / 2);
    //}
    //else
    //{
    //    doubleHitNum = 0;
    //    if (DoubleHitObj != null)
    //    {
    //        DoubleHitObj.SetActive(false);

    //    }
    //}
    //}

    void ShowNewFunctionHints(NewFunctionHintsRef _ref, bool _canGetReward)
    {
        if (NewFunctionHintsObj != null)
        {
            NewFunctionHintsObj.SetActive(true);
        }
        if (NewFunctionHintsDes != null)
        {
            string st = _ref.des.Replace("\\n", "\n");
            NewFunctionHintsDes.text = st;
        }
        if (NewFunctionHintsText != null)
        {
            NewFunctionHintsText.text = _ref.text;
        }
        if (NewFunctionHintsSprite != null)
        {
            NewFunctionHintsSprite.spriteName = _ref.Icon;
            NewFunctionHintsSprite.MakePixelPerfect();
        }
        if (title != null)
        {
            title.text = _ref.title;
        }
        if (itemGird != null)
        {
            itemGird.maxPerLine = _ref.reward.Count;
        }
        for (int i = 0; i < _ref.reward.Count; i++)
        {
            ItemValue  item = _ref.reward[i];
            GameObject go   = null;
            if (!itemDic.ContainsKey(item.eid))
            {
                go = Instantiate(oldItem) as GameObject;
                itemDic[item.eid] = go;
            }
            else
            {
                go = itemDic[item.eid];
            }
            go.transform.parent        = oldItem.transform.parent;
            go.transform.localPosition = Vector3.zero;
            go.transform.localScale    = Vector3.one;
            ItemUI itemUI = go.GetComponent <ItemUI>();
            if (itemUI != null)
            {
                itemUI.FillInfo(new EquipmentInfo(item.eid, item.count, EquipmentBelongTo.PREVIEW));
            }
            go.SetActive(true);
        }
        if (itemGird != null)
        {
            itemGird.repositionNow = true;
        }

        if (getRewardBtn != null)
        {
            UISpriteEx spEx = getRewardBtn.GetComponentInChildren <UISpriteEx>();
            if (spEx != null)
            {
                if (_canGetReward)
                {
                    spEx.IsGray = UISpriteEx.ColorGray.normal;
                    redPoint.SetActive(true);//新功能预告增加红点 By 唐源
                }
                else
                {
                    spEx.IsGray = UISpriteEx.ColorGray.Gray;
                    redPoint.SetActive(false);//新功能预告增加红点 By 唐源
                }
            }
        }
    }
示例#27
0
    /// <summary>
    /// 点击宝箱
    /// </summary>
    void OnClickTakeReward(GameObject go)
    {
        int val = (int)UIEventListener.Get(go.gameObject).parameter;

        if (takeAward != null)
        {
            takeAward.SetActive(true);
        }
        if (isTakeAwared.Count > val && isTakeAwared[val].state == 1)//已经领取
        {
            if (takeBtn != null)
            {
                takeBtn.gameObject.SetActive(false);
            }
            if (alreadyTake != null)
            {
                alreadyTake.gameObject.SetActive(true);
            }
        }
        else
        {
            if (takeBtn != null)
            {
                takeBtn.gameObject.SetActive(true);
            }
            if (alreadyTake != null)
            {
                alreadyTake.gameObject.SetActive(false);
            }
        }
        if (closeItemBtn != null)
        {
            UIEventListener.Get(closeItemBtn.gameObject).onClick = delegate { if (takeAward != null)
                                                                              {
                                                                                  takeAward.SetActive(false);
                                                                              }
            }
        }
        ;
        if (rewardDesLab != null)
        {
            rewardDesLab.text = ConfigMng.Instance.GetUItext(83, new string[1] {
                (brothers.Count * (val + 1)).ToString()
            });
        }
        for (int j = 0, max = awardsItems.Length; j < max; j++)
        {
            if (takeBtn != null && takeBtn.gameObject.activeSelf)
            {
                UISpriteEx takeEx = takeBtn.GetComponentInChildren <UISpriteEx>();
                if (data.taskNum < brothers.Count * (val + 1))//没有达到领取条件
                {
                    if (takeEx != null)
                    {
                        takeEx.IsGray = UISpriteEx.ColorGray.Gray;
                    }
                }
                else
                {
                    if (takeEx != null)
                    {
                        takeEx.IsGray = UISpriteEx.ColorGray.normal;
                    }
                    UIEventListener.Get(takeBtn.gameObject).onClick = delegate
                    {
                        if (takeAward != null)
                        {
                            takeAward.SetActive(false);
                        }
                        GameCenter.swornMng.C2S_ReqTakeBoxReward(val + 1);
                    };
                }
            }
            if (data.Reward(val).Count > j)
            {
                awardsItems[j].FillInfo(new EquipmentInfo(data.Reward(val)[j].eid, data.Reward(val)[j].count, EquipmentBelongTo.PREVIEW));
            }
            else
            {
                awardsItems[j].gameObject.SetActive(false);
            }
        }
    }

    void Refresh()
    {
        if (noSworn != null)
        {
            noSworn.SetActive(false);
        }
        if (takeAward != null)
        {
            takeAward.SetActive(false);
        }
        data = GameCenter.swornMng.data;
        if (data == null)
        {
            if (task != null)
            {
                task.SetActive(false);
            }
            if (sworn != null)
            {
                sworn.SetActive(false);
            }
            if (noSworn != null)
            {
                noSworn.SetActive(true);
            }
            if (page == 1)
            {
                GameCenter.messageMng.AddClientMsg(503);
            }
            return;
        }
        brothers = data.brothers;
        if (page == 0)//结义
        {
            if (task != null)
            {
                task.SetActive(false);
            }
            if (sworn != null)
            {
                sworn.SetActive(true);
            }
            swornL.SwornData = data;
            for (int i = 0; i < brothers.Count; i++)
            {
                if (brothers[i].uid == data.playerId)
                {
                    swornR[0].Brother = brothers[i];
                    break;
                }
            }
            for (int i = 1; i < swornR.Count; i++)
            {
                if (brothers.Count > i)
                {
                    swornR[i].Brother = brothers[i];
                }
                else
                {
                    swornR[i].gameObject.SetActive(false);
                }
            }
        }
        else//任务
        {
            RefreshSwornTask();
        }
    }

    void RefreshSwornTask()
    {
        if (sworn != null)
        {
            sworn.SetActive(false);
        }
        if (task != null)
        {
            task.SetActive(true);
        }
        for (int i = 0, max = taskUi.Count; i < max; i++)
        {
            if (GameCenter.swornMng.swornTask.Count > i)
            {
                taskUi[i].Task = GameCenter.swornMng.swornTask[i];
            }
        }
        if (integral != null)
        {
            integral.value = (float)data.taskNum / (brothers.Count * 3);
            integral.thumb.transform.localPosition = new Vector3(integral.thumb.transform.localPosition.x, -33);
        }
        if (integralVal != null)
        {
            integralVal.text = data.taskNum + "/" + brothers.Count * 3;
        }
        if (integralLab.Length > 0)
        {
            for (int i = 0; i < integralLab.Length; i++)
            {
                integralLab[i].text = (brothers.Count * (i + 1)).ToString();
                BoxOpenUi openbox = box[i].GetComponent <BoxOpenUi>();
                if (openbox != null)
                {
                    if (isTakeAwared.Count > i)
                    {
                        if (isTakeAwared[i].state == 1)//已经领取
                        {
                            openbox.show(true);
                        }
                        else
                        {
                            openbox.show(false);
                        }
                    }
                }
            }
        }
        if (box.Length > 0)
        {
            for (int i = 0; i < box.Length; i++)
            {
                UIEventListener.Get(box[i].gameObject).onClick  -= OnClickTakeReward;
                UIEventListener.Get(box[i].gameObject).onClick  += OnClickTakeReward;
                UIEventListener.Get(box[i].gameObject).parameter = i;
            }
        }
    }
}
示例#28
0
    void ShowNewFunctionHints(NewFunctionHintsRef _ref, bool _canGetReward)
    {
        canGetReward = _canGetReward;
        if (newFunctionHintsText != null)
        {
            newFunctionHintsText.text = _ref.text;
        }
        if (title != null)
        {
            title.text = _ref.title;
        }
        if (modelTexture != null)
        {
            switch (_ref.modelType)
            {
            case ObjectType.MOB:
                GameCenter.previewManager.TryPreviewSingelMonster(_ref.modelId, modelTexture, PreviewConfigType.Dialog, _ref.animName);
                break;

            case ObjectType.NPC:
                GameCenter.previewManager.TryPreviewSingelNPC(_ref.modelId, modelTexture, PreviewConfigType.Dialog, _ref.animName);
                break;

            case ObjectType.Entourage:
                GameCenter.previewManager.TryPreviewSingelEntourage(_ref.modelId, modelTexture, _ref.animName);
                break;

            case ObjectType.Mount:
                GameCenter.previewManager.TryPreviewSingelMount(_ref.modelId, modelTexture, _ref.animName);
                break;

            case ObjectType.Player:
                GameCenter.previewManager.TryPreviewSinglePlayer(GameCenter.mainPlayerMng.MainPlayerInfo, modelTexture, true, _ref.animName);
                break;

            case ObjectType.DropItem:
                EquipmentInfo info = new EquipmentInfo(_ref.modelId, EquipmentBelongTo.PREVIEW);
                GameCenter.previewManager.TryPreviewSingleEquipment(info, modelTexture);
                break;
            }
        }
        if (uiContainer != null)
        {
            exGrid.repositionNow = true;
            uiContainer.RefreshItems(_ref.reward, _ref.reward.Count, _ref.reward.Count);
            exGrid.Reposition();
        }
        if (getRewardBtn != null)
        {
            UISpriteEx spEx = getRewardBtn.GetComponentInChildren <UISpriteEx>();
            if (spEx != null)
            {
                if (_canGetReward)
                {
                    spEx.IsGray = UISpriteEx.ColorGray.normal;
                }
                else
                {
                    spEx.IsGray = UISpriteEx.ColorGray.Gray;
                }
            }
        }
    }
示例#29
0
    public void SetItem(SevenDaysRef _data)
    {
        if (_data == null)
        {
            return;
        }
        for (int i = 0; i < spList.Length; i++)
        {
            spList[i].enabled = false;
        }
        //新加贵重物品显示框
        List <int> needShow = _data.specialList;

        for (int j = 0; j < needShow.Count; j++)
        {
            if (needShow[j] <= spList.Length && needShow[j] != 0)
            {
                spList[needShow[j] - 1].enabled = true;
            }
        }
        if (dayLabel != null)
        {
            dayLabel.text = ConfigMng.Instance.GetUItext(181) + _data.day + ConfigMng.Instance.GetUItext(341);
        }
        for (int i = 0; i < rewardList.Length; i++)
        {
            if (rewardList[i] != null)
            {
                rewardList[i].FillInfo(new EquipmentInfo(_data.reward[i].eid, _data.reward[i].count, EquipmentBelongTo.PREVIEW));
            }
        }
        for (int i = 0; i < vipList.Length; i++)
        {
            if (vipList[i] != null)
            {
                vipList[i].FillInfo(new EquipmentInfo(_data.vipReward[i].eid, _data.vipReward[i].count, EquipmentBelongTo.PREVIEW));
            }
        }
        UISpriteEx normalSp = getNormalBtn.GetComponentInChildren <UISpriteEx>();
        UISpriteEx vipSp    = getVipBtn.GetComponentInChildren <UISpriteEx>();

        if (_data.day <= GameCenter.sevenDayMng.day)//可以领取奖励的天数
        {
            //新加一键全部领取
            if (GameCenter.sevenDayMng.BoolVip(_data.day))
            {
                if (GetAllReward != null)
                {
                    GetAllReward.text = ConfigMng.Instance.GetUItext(342);
                }
            }
            if (normalSp != null)
            {
                normalSp.IsGray = UISpriteEx.ColorGray.normal;
            }
            if (SevendayDic.ContainsKey(_data.day))
            {
                //普通奖励已经领取
                if (SevendayDic[_data.day].Normal == (int)RewardGetState.GETREWARD)
                {
                    getNormalBtn.gameObject.SetActive(false);
                }
                //普通奖励已经领取,vip奖励没有领取
                if (SevendayDic[_data.day].Normal == (int)RewardGetState.GETREWARD && SevendayDic[_data.day].Vip == (int)RewardGetState.NOTGETREWARD)
                {
                    getVipBtn.gameObject.SetActive(true);
                    //vip等级达到
                    if (GameCenter.sevenDayMng.BoolVip(_data.day))
                    {
                        if (vipSp != null)
                        {
                            vipSp.IsGray = UISpriteEx.ColorGray.normal;
                        }
                    }
                    else
                    {
                        if (vipSp != null)
                        {
                            vipSp.IsGray = UISpriteEx.ColorGray.Gray;
                        }
                    }
                }
                //普通奖励已经领取,vip奖励已经领取
                else if (SevendayDic[_data.day].Normal == (int)RewardGetState.GETREWARD && SevendayDic[_data.day].Vip == (int)RewardGetState.GETREWARD)
                {
                    getVipBtn.gameObject.SetActive(true);
                    getVipBtn.GetComponentInChildren <UILabel>().text = ConfigMng.Instance.GetUItext(343);
                    if (vipSp != null)
                    {
                        vipSp.IsGray = UISpriteEx.ColorGray.Gray;
                    }
                }
            }
        }
        else
        if (normalSp != null)
        {
            normalSp.IsGray = UISpriteEx.ColorGray.Gray;
        }

        if (getNormalBtn != null)
        {
            UIEventListener.Get(getNormalBtn.gameObject).onClick = delegate
            {
                if (_data.day <= GameCenter.sevenDayMng.day)
                {
                    //新加一键全部领取
                    if (GameCenter.sevenDayMng.BoolVip(_data.day))
                    {
                        GameCenter.sevenDayMng.ReqGetReward(_data.day, false);
                        GameCenter.sevenDayMng.ReqGetReward(_data.day, true);
                    }
                    else
                    {
                        GameCenter.sevenDayMng.ReqGetReward(_data.day, false);
                    }
                }
            };
        }
        if (getVipBtn != null)
        {
            UIEventListener.Get(getVipBtn.gameObject).onClick = delegate
            {
                if (GameCenter.sevenDayMng.BoolVip(_data.day))
                {
                    if (SevendayDic.ContainsKey(_data.day))
                    {
                        if (SevendayDic[_data.day].Vip == (int)RewardGetState.NOTGETREWARD)
                        {
                            GameCenter.sevenDayMng.ReqGetReward(_data.day, true);
                        }
                    }
                }
            };
        }
        //vip信息
        //if (SevendayDic.ContainsKey(_data.day) && SevendayDic[_data.day].Normal == (int)RewardGetState.GETREWARD)
        //{
        //    if (vipLabel != null) vipLabel.gameObject.SetActive(true);
        //}
        //else
        //{
        //    if (vipLabel != null) vipLabel.gameObject.SetActive(false);
        //}
        if (vipLabel != null)
        {
            vipLabel.text = ConfigMng.Instance.GetUItext(50, new string[1] {
                _data.vipLimit.ToString()
            });
        }
        if (GameCenter.vipMng.VipData.vLev >= _data.vipLimit)
        {
            if (vipLabel != null)
            {
                vipLabel.color = Color.green;
            }
        }
        else if (vipLabel != null)
        {
            vipLabel.color = Color.red;
        }
    }
示例#30
0
 //初始化控件变量
 protected override void InitControls()
 {
     fastComponent = GetComponent <FastComponent>();
     fastComponent.BuildFastComponents();
     m_label_version = fastComponent.FastGetComponent <UILabel>("version");
     if (null == m_label_version)
     {
         Engine.Utility.Log.Error("m_label_version 为空,请检查prefab是否缺乏组件");
     }
     m_trans_LoginContent = fastComponent.FastGetComponent <Transform>("LoginContent");
     if (null == m_trans_LoginContent)
     {
         Engine.Utility.Log.Error("m_trans_LoginContent 为空,请检查prefab是否缺乏组件");
     }
     m_trans_loginAccount = fastComponent.FastGetComponent <Transform>("loginAccount");
     if (null == m_trans_loginAccount)
     {
         Engine.Utility.Log.Error("m_trans_loginAccount 为空,请检查prefab是否缺乏组件");
     }
     m_btn_btnLoginAcont = fastComponent.FastGetComponent <UIButton>("btnLoginAcont");
     if (null == m_btn_btnLoginAcont)
     {
         Engine.Utility.Log.Error("m_btn_btnLoginAcont 为空,请检查prefab是否缺乏组件");
     }
     m_input_accunt = fastComponent.FastGetComponent <UIInput>("accunt");
     if (null == m_input_accunt)
     {
         Engine.Utility.Log.Error("m_input_accunt 为空,请检查prefab是否缺乏组件");
     }
     m_btn_btnNotice = fastComponent.FastGetComponent <UIButton>("btnNotice");
     if (null == m_btn_btnNotice)
     {
         Engine.Utility.Log.Error("m_btn_btnNotice 为空,请检查prefab是否缺乏组件");
     }
     m_btn_btnAccount = fastComponent.FastGetComponent <UIButton>("btnAccount");
     if (null == m_btn_btnAccount)
     {
         Engine.Utility.Log.Error("m_btn_btnAccount 为空,请检查prefab是否缺乏组件");
     }
     m_btn_btnRepare = fastComponent.FastGetComponent <UIButton>("btnRepare");
     if (null == m_btn_btnRepare)
     {
         Engine.Utility.Log.Error("m_btn_btnRepare 为空,请检查prefab是否缺乏组件");
     }
     m_btn_btnFeedback = fastComponent.FastGetComponent <UIButton>("btnFeedback");
     if (null == m_btn_btnFeedback)
     {
         Engine.Utility.Log.Error("m_btn_btnFeedback 为空,请检查prefab是否缺乏组件");
     }
     m_btn_btnback = fastComponent.FastGetComponent <UIButton>("btnback");
     if (null == m_btn_btnback)
     {
         Engine.Utility.Log.Error("m_btn_btnback 为空,请检查prefab是否缺乏组件");
     }
     m_trans_loginServer = fastComponent.FastGetComponent <Transform>("loginServer");
     if (null == m_trans_loginServer)
     {
         Engine.Utility.Log.Error("m_trans_loginServer 为空,请检查prefab是否缺乏组件");
     }
     m_sprite_ZoneInfoContent = fastComponent.FastGetComponent <UISprite>("ZoneInfoContent");
     if (null == m_sprite_ZoneInfoContent)
     {
         Engine.Utility.Log.Error("m_sprite_ZoneInfoContent 为空,请检查prefab是否缺乏组件");
     }
     m_spriteEx_status = fastComponent.FastGetComponent <UISpriteEx>("status");
     if (null == m_spriteEx_status)
     {
         Engine.Utility.Log.Error("m_spriteEx_status 为空,请检查prefab是否缺乏组件");
     }
     m_btn_btnServerList = fastComponent.FastGetComponent <UIButton>("btnServerList");
     if (null == m_btn_btnServerList)
     {
         Engine.Utility.Log.Error("m_btn_btnServerList 为空,请检查prefab是否缺乏组件");
     }
     m_label_LabelServer = fastComponent.FastGetComponent <UILabel>("LabelServer");
     if (null == m_label_LabelServer)
     {
         Engine.Utility.Log.Error("m_label_LabelServer 为空,请检查prefab是否缺乏组件");
     }
     m_btn_btnStartGame = fastComponent.FastGetComponent <UIButton>("btnStartGame");
     if (null == m_btn_btnStartGame)
     {
         Engine.Utility.Log.Error("m_btn_btnStartGame 为空,请检查prefab是否缺乏组件");
     }
     if (null != fastComponent)
     {
         GameObject.Destroy(fastComponent);
     }
 }