Exemplo n.º 1
0
    private void SetDrawTexture(ItemTexture tex, string imageKey)
    {
        Texture2D texture = NrTSingleton <UIImageBundleManager> .Instance.GetTexture(imageKey);

        if (null != texture)
        {
            tex.SetTexture(texture);
        }
        else
        {
            string  str     = string.Format("{0}{1}", imageKey, NrTSingleton <UIDataManager> .Instance.AddFilePath);
            WWWItem wWWItem = Holder.TryGetOrCreateBundle(str + Option.extAsset, NkBundleCallBack.UIBundleStackName);
            wWWItem.SetItemType(ItemType.USER_ASSETB);
            wWWItem.SetCallback(new PostProcPerItem(this.SetImage), tex);
            TsImmortal.bundleService.RequestDownloadCoroutine(wWWItem, DownGroup.RUNTIME, true);
        }
    }
Exemplo n.º 2
0
    private void SetImage(WWWItem _item, object _param)
    {
        if (_item.GetSafeBundle() == null)
        {
            return;
        }
        if (_item.GetSafeBundle().mainAsset == null)
        {
            return;
        }
        Texture2D texture2D = _item.GetSafeBundle().mainAsset as Texture2D;

        if (texture2D != null && _param is ItemTexture)
        {
            ItemTexture itemTexture = _param as ItemTexture;
            itemTexture.SetTexture(texture2D);
        }
    }
Exemplo n.º 3
0
    public void UpdateFloor(short floor)
    {
        NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;
        short        num         = floor / 5;

        if (floor % 5 != 0)
        {
            num += 1;
        }
        short       num2        = (floor - 1) % 5;
        NewListItem newListItem = this.CreateItem(num);

        if (newListItem != null)
        {
            bool flag = this.GuildBossRewardCheck();
            if (flag)
            {
                this.m_dtNotice.Visible = true;
            }
            for (int i = 0; i < this.m_lbFloor.Count; i++)
            {
                IUIListObject item = this.m_lbFloor.GetItem(i);
                if (item != null && (short)item.Data == num)
                {
                    NEWGUILD_MY_BOSS_ROOMINFO guildBossMyRoomInfo = kMyCharInfo.GetGuildBossMyRoomInfo(floor);
                    bool        guildBossRoomStateInfo            = kMyCharInfo.GetGuildBossRoomStateInfo(floor);
                    DrawTexture drawTexture = ((UIListItemContainer)item).GetElement((int)(51 + num2)) as DrawTexture;
                    if (guildBossMyRoomInfo != null && guildBossMyRoomInfo.byRoomState != 0)
                    {
                        drawTexture.Visible = guildBossRoomStateInfo;
                        drawTexture.SetTexture("Win_I_Notice04");
                    }
                    UIButton    uIButton     = ((UIListItemContainer)item).GetElement((int)(num2 + 1)) as UIButton;
                    DrawTexture drawTexture2 = ((UIListItemContainer)item).GetElement((int)(56 + num2 * 2)) as DrawTexture;
                    if (drawTexture2 != null)
                    {
                        drawTexture2.Visible = false;
                    }
                    ItemTexture itemTexture = ((UIListItemContainer)item).GetElement((int)(56 + num2 * 2 + 1)) as ItemTexture;
                    if (itemTexture != null)
                    {
                        itemTexture.Visible = false;
                    }
                    if (guildBossMyRoomInfo != null)
                    {
                        if (guildBossMyRoomInfo.i64PlayPersonID > 0L)
                        {
                            if (drawTexture2 != null)
                            {
                                drawTexture2.Visible = true;
                            }
                            if (itemTexture != null)
                            {
                                itemTexture.Visible = true;
                            }
                            NewGuildMember memberInfoFromPersonID = NrTSingleton <NewGuildManager> .Instance.GetMemberInfoFromPersonID(guildBossMyRoomInfo.i64PlayPersonID);

                            if (memberInfoFromPersonID != null)
                            {
                                if (memberInfoFromPersonID.GetPortrait() != null)
                                {
                                    itemTexture.SetTexture(memberInfoFromPersonID.GetPortrait());
                                    itemTexture.AddValueChangedDelegate(new EZValueChangedDelegate(this.BtnClickMemberInfo));
                                    itemTexture.Data = guildBossMyRoomInfo.i64PlayPersonID;
                                }
                                else
                                {
                                    itemTexture.SetSolImageTexure(eCharImageType.SMALL, new NkListSolInfo
                                    {
                                        SolCharKind = memberInfoFromPersonID.GetFaceCharKind(),
                                        SolGrade    = -1,
                                        SolLevel    = memberInfoFromPersonID.GetLevel()
                                    }, false);
                                    itemTexture.AddValueChangedDelegate(new EZValueChangedDelegate(this.BtnClickMemberInfo));
                                    itemTexture.Data = guildBossMyRoomInfo.i64PlayPersonID;
                                }
                            }
                        }
                        string effectKey = string.Empty;
                        if (guildBossMyRoomInfo != null)
                        {
                            effectKey = this.GetRoomStateEffect(guildBossMyRoomInfo.byRoomState);
                        }
                        else
                        {
                            effectKey = this.GetRoomStateEffect(0);
                        }
                        if (uIButton != null)
                        {
                            uIButton.DeleteChildEffect();
                            NrTSingleton <FormsManager> .Instance.AttachEffectKey(effectKey, uIButton, uIButton.GetSize());
                        }
                    }
                    break;
                }
            }
        }
    }