private void CreateTicketIcon(GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM ticketMaster, UITexture ticketTexture)
    {
        Texture2D tex = NGUIUtil.LoadTexture(ticketMaster.img);

        if (null != tex)
        {
            NGUIUtil.ChangeUITexture(ticketTexture, tex, false);
        }
        GUICollider component = ticketTexture.gameObject.GetComponent <GUICollider>();

        if (null != component)
        {
            component.onTouchEnded += delegate(Touch touch, Vector2 pos, bool flag)
            {
                if (flag)
                {
                    CMD_ticketPOP cmd_ticketPOP = GUIMain.ShowCommonDialog(delegate(int selectButton)
                    {
                        if (selectButton == 0 && null != PartsMenu.instance)
                        {
                            PartsMenu.instance.OnClickedQuestType(1);
                        }
                    }, "CMD_ticketPOP", null) as CMD_ticketPOP;
                    cmd_ticketPOP.Title      = ticketMaster.name;
                    cmd_ticketPOP.Info       = ticketMaster.description;
                    cmd_ticketPOP.BtnTextYes = StringMaster.GetString("QuestNormal");
                    cmd_ticketPOP.BtnTextNo  = StringMaster.GetString("SystemButtonClose");
                    if (null != tex)
                    {
                        NGUIUtil.ChangeUITexture(cmd_ticketPOP.txIcon, tex, false);
                    }
                }
            };
        }
    }
Exemple #2
0
 public override void ShowGUI()
 {
     base.ShowGUI();
     GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM dungeonTicketM = MasterDataMng.Instance().RespDataMA_DungeonTicketMaster.dungeonTicketM.FirstOrDefault((GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM x) => this.data.wdi.dungeons[0].dungeonTicketId == x.dungeonTicketId);
     if (dungeonTicketM != null)
     {
         Texture2D texture2D = NGUIUtil.LoadTexture(dungeonTicketM.img);
         if (texture2D != null)
         {
             NGUIUtil.ChangeUITexture(this.ngTICKET_THUMBNAIL, texture2D, false);
         }
         if (!string.IsNullOrEmpty(this.data.wdi.expireTime))
         {
             this.ngTXT_TICKET_EXPIRE_TIME.text = string.Format(StringMaster.GetString("ExchangeTimeLimit"), this.data.wdi.expireTime);
             this.isLimit = true;
         }
         else
         {
             this.ngTXT_TICKET_EXPIRE_TIME.text = string.Format(StringMaster.GetString("ExchangeTimeLimit"), StringMaster.GetString("SystemNone"));
             this.isLimit = false;
         }
         this.isFree = (dungeonTicketM.freeFlg == "1");
         if (this.ngTXT_TICKET_UPDATE_TIME != null)
         {
             string arg        = string.Empty;
             string updateTime = this.data.wdi.updateTime;
             int    num        = updateTime.IndexOf(' ', 0);
             if (num != -1)
             {
                 arg = updateTime.Substring(0, num);
             }
             else
             {
                 arg = updateTime;
             }
             this.ngTXT_TICKET_UPDATE_TIME.text = string.Format(StringMaster.GetString("TicketQuestUpdateTime2"), arg);
         }
         this.SetBGColor(false);
     }
     if (this.ngTXT_TICKET_NAME != null)
     {
         this.ngTXT_TICKET_NAME.text = this.data.worldStageM.name;
     }
     if (this.ngTXT_TICKET_NUM != null)
     {
         this.ngTXT_TICKET_NUM.text = this.Data.wdi.totalTicketNum.ToString();
     }
     this.SetStageGimmick();
 }
Exemple #3
0
    public void SetMonsterIcon(PicturebookItem.TextureData textureData, string growStep, bool isUnknown)
    {
        if (null == this.txCHAR.material)
        {
            Shader iconShader = GUIMonsterIcon.GetIconShader();
            this.txCHAR.material = new Material(iconShader);
        }
        if (!textureData._isMainTexture)
        {
            this.txCHAR.material.SetTexture("_MaskTex", textureData._monsterAlphaTexture);
            this.txCHAR.material.SetTexture("_MainTex", textureData._monsterTexture);
        }
        else
        {
            NGUIUtil.ChangeUITexture(this.txCHAR, textureData._monsterTexture, false);
            this.txCHAR.material.SetTexture("_MaskTex", Texture2D.whiteTexture);
        }
        int growStep2 = int.Parse(growStep);

        PicturebookMonsterIcon.SetThumbnailFrame(this.spBASE, this.spFRAME, growStep2);
        this.ngTX_IS_UNKOWN.gameObject.SetActive(isUnknown);
        MonsterIconGrayout.SetGrayout(base.gameObject, (!isUnknown) ? GUIMonsterIcon.DIMM_LEVEL.ACTIVE : GUIMonsterIcon.DIMM_LEVEL.DISABLE);
    }
Exemple #4
0
 public void ResetTex()
 {
     NGUIUtil.ChangeUITexture(this.txCHAR, null, false);
 }
Exemple #5
0
    public static void SetTextureMonsterParts(UITexture iconTexture, string resourcePath, string assetBundlePath, bool isLoadASync)
    {
        bool      flag             = false;
        Texture2D texture2D        = Resources.Load(resourcePath) as Texture2D;
        Texture2D texture2D2       = Resources.Load(resourcePath + "_alpha") as Texture2D;
        string    assetBundlePathA = assetBundlePath + "_alpha";

        if (null != texture2D && null != texture2D2 && !flag)
        {
            if (null == iconTexture.material)
            {
                Shader iconShader = GUIMonsterIcon.GetIconShader();
                iconTexture.material = new Material(iconShader);
            }
            iconTexture.material.SetTexture("_MaskTex", texture2D2);
            iconTexture.material.SetTexture("_MainTex", texture2D);
            iconTexture.mainTexture = null;
        }
        else if (isLoadASync)
        {
            NGUIUtil.ChangeUITexture(iconTexture, null, false);
            MonsterIconCacheBuffer.Instance().LoadAndCacheObj(assetBundlePath, delegate(UnityEngine.Object obj)
            {
                Texture2D tex = obj as Texture2D;
                if (null == iconTexture.material)
                {
                    Shader iconShader3   = GUIMonsterIcon.GetIconShader();
                    iconTexture.material = new Material(iconShader3);
                }
                NGUIUtil.ChangeUITexture(iconTexture, tex, false);
                if (null != iconTexture.material)
                {
                    Texture2D texture2D5 = MonsterIconCacheBuffer.Instance().LoadAndCacheObj(assetBundlePathA, null) as Texture2D;
                    if (texture2D5 != null)
                    {
                        iconTexture.material.SetTexture("_MaskTex", texture2D5);
                    }
                    else
                    {
                        iconTexture.material.SetTexture("_MaskTex", Texture2D.whiteTexture);
                    }
                }
            });
        }
        else
        {
            Texture2D texture2D3 = MonsterIconCacheBuffer.Instance().LoadAndCacheObj(assetBundlePath, null) as Texture2D;
            if (null != texture2D3)
            {
                NGUIUtil.ChangeUITexture(iconTexture, texture2D3, false);
                if (null == iconTexture.material)
                {
                    Shader iconShader2 = GUIMonsterIcon.GetIconShader();
                    iconTexture.material = new Material(iconShader2);
                }
                if (null != iconTexture.material)
                {
                    Texture2D texture2D4 = MonsterIconCacheBuffer.Instance().LoadAndCacheObj(assetBundlePathA, null) as Texture2D;
                    if (texture2D4 != null)
                    {
                        iconTexture.material.SetTexture("_MaskTex", texture2D4);
                    }
                    else
                    {
                        iconTexture.material.SetTexture("_MaskTex", Texture2D.whiteTexture);
                    }
                }
            }
        }
    }