コード例 #1
0
    private void SetTextureBundle()
    {
        if (NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(this.m_pkSolinfo.GetCharKind()) == null)
        {
            return;
        }
        this.SetGui();
        string costumePortraitPath = NrTSingleton <NrCharCostumeTableManager> .Instance.GetCostumePortraitPath(this.m_pkSolinfo);

        string text = MsgHandler.HandleReturn <string>("PortraitFileName", new object[]
        {
            this.m_pkSolinfo.GetCharKind(),
            (int)(this.m_bBaseGrade - 1)
        });

        if (string.Empty == text)
        {
            return;
        }
        if (!string.IsNullOrEmpty(costumePortraitPath))
        {
            string text2 = MsgHandler.HandleReturn <string>("PortraitCostumeFileName", new object[]
            {
                this.m_pkSolinfo.GetCharKind(),
                (int)(this.m_bBaseGrade - 1),
                costumePortraitPath
            });
            if (!string.IsNullOrEmpty(text2))
            {
                text = text2;
            }
        }
        if (UIDataManager.IsUse256Texture())
        {
            this.FaceImageKey = text + "_256";
        }
        else
        {
            this.FaceImageKey = text + "_512";
        }
        this.BaseRankImageKey   = "rankl" + this.m_bBaseGrade.ToString();
        this.ChangeRankImageKey = "rankm" + this.m_bChangeGrade.ToString();
        if (null == NrTSingleton <UIImageBundleManager> .Instance.GetTexture(this.BaseRankImageKey))
        {
            string  str     = string.Format("{0}", "UI/Soldier/" + this.BaseRankImageKey + NrTSingleton <UIDataManager> .Instance.AddFilePath);
            WWWItem wWWItem = Holder.TryGetOrCreateBundle(str + Option.extAsset, NkBundleCallBack.UIBundleStackName);
            wWWItem.SetItemType(ItemType.USER_ASSETB);
            wWWItem.SetCallback(new PostProcPerItem(this.SetBundleImage), this.BaseRankImageKey);
            TsImmortal.bundleService.RequestDownloadCoroutine(wWWItem, DownGroup.RUNTIME, true);
        }
        if (null == NrTSingleton <UIImageBundleManager> .Instance.GetTexture(this.ChangeRankImageKey))
        {
            string  str2     = string.Format("{0}", "UI/Soldier/" + this.ChangeRankImageKey + NrTSingleton <UIDataManager> .Instance.AddFilePath);
            WWWItem wWWItem2 = Holder.TryGetOrCreateBundle(str2 + Option.extAsset, NkBundleCallBack.UIBundleStackName);
            wWWItem2.SetItemType(ItemType.USER_ASSETB);
            wWWItem2.SetCallback(new PostProcPerItem(this.SetBundleImage), this.ChangeRankImageKey);
            TsImmortal.bundleService.RequestDownloadCoroutine(wWWItem2, DownGroup.RUNTIME, true);
        }
        this.eBUNDLEDOWN = Myth_Evolution_Success_DLG.eBUNDLEDOWNSTATE.eBUNDLE_DOWNING;
    }
コード例 #2
0
 private void ClickCloseButton(IUIObject obj)
 {
     if (this.eBUNDLEDOWN == Myth_Evolution_Success_DLG.eBUNDLEDOWNSTATE.eBUNDLE_OK)
     {
         this.eBUNDLEDOWN = Myth_Evolution_Success_DLG.eBUNDLEDOWNSTATE.eBUNDLE_NONE;
         this.CloseForm(null);
     }
 }
コード例 #3
0
    public override void Update()
    {
        if (this.bEffectUpdate && null != this.rootEffectGameObject)
        {
            if (this.eBUNDLEDOWN == Myth_Evolution_Success_DLG.eBUNDLEDOWNSTATE.eBUNDLE_DOWNING)
            {
                if (NrTSingleton <UIImageBundleManager> .Instance.GetTexture(this.FaceImageKey) != null && NrTSingleton <UIImageBundleManager> .Instance.GetTexture(this.BaseRankImageKey) != null && NrTSingleton <UIImageBundleManager> .Instance.GetTexture(this.ChangeRankImageKey) != null)
                {
                    GameObject gameObject = NkUtil.GetChild(this.rootEffectGameObject.transform, "fx_card01").gameObject;
                    if (null != gameObject)
                    {
                        GameObject gameObject2 = NkUtil.GetChild(gameObject.transform, "fx_plan_face").gameObject;
                        if (null != gameObject2)
                        {
                            Texture2D texture = NrTSingleton <UIImageBundleManager> .Instance.GetTexture(this.FaceImageKey);

                            if (null != texture)
                            {
                                Material material = new Material(Shader.Find("Transparent/Vertex Colored" + NrTSingleton <UIDataManager> .Instance.AddFilePath));
                                if (null != material)
                                {
                                    material.mainTexture = texture;
                                    if (null != gameObject2.renderer)
                                    {
                                        gameObject2.renderer.sharedMaterial = material;
                                    }
                                }
                            }
                        }
                        GameObject gameObject3 = NkUtil.GetChild(gameObject.transform, "fx_card_rank").gameObject;
                        if (null != gameObject3)
                        {
                            Texture2D texture2 = NrTSingleton <UIImageBundleManager> .Instance.GetTexture(this.BaseRankImageKey);

                            if (null != texture2)
                            {
                                Material material2 = new Material(Shader.Find("Transparent/Vertex Colored" + NrTSingleton <UIDataManager> .Instance.AddFilePath));
                                if (null != material2)
                                {
                                    material2.mainTexture = texture2;
                                    if (null != gameObject3.renderer)
                                    {
                                        gameObject3.renderer.sharedMaterial = material2;
                                    }
                                }
                            }
                        }
                    }
                    gameObject = NkUtil.GetChild(this.rootEffectGameObject.transform, "fx_card03").gameObject;
                    if (null != gameObject)
                    {
                        GameObject gameObject2 = NkUtil.GetChild(gameObject.transform, "fx_plan_face").gameObject;
                        if (null != gameObject2)
                        {
                            Texture2D texture3 = NrTSingleton <UIImageBundleManager> .Instance.GetTexture(this.FaceImageKey);

                            if (null != texture3)
                            {
                                Material material3 = new Material(Shader.Find("Transparent/Vertex Colored" + NrTSingleton <UIDataManager> .Instance.AddFilePath));
                                if (null != material3)
                                {
                                    material3.mainTexture = texture3;
                                    if (null != gameObject2.renderer)
                                    {
                                        gameObject2.renderer.sharedMaterial = material3;
                                    }
                                }
                            }
                        }
                        GameObject gameObject3 = NkUtil.GetChild(gameObject.transform, "fx_card_rank").gameObject;
                        if (null != gameObject3)
                        {
                            Texture2D texture4 = NrTSingleton <UIImageBundleManager> .Instance.GetTexture(this.ChangeRankImageKey);

                            if (null != texture4)
                            {
                                Material material4 = new Material(Shader.Find("Transparent/Vertex Colored" + NrTSingleton <UIDataManager> .Instance.AddFilePath));
                                if (null != material4)
                                {
                                    material4.mainTexture = texture4;
                                    if (null != gameObject3.renderer)
                                    {
                                        gameObject3.renderer.sharedMaterial = material4;
                                    }
                                }
                            }
                        }
                    }
                    this.eBUNDLEDOWN = Myth_Evolution_Success_DLG.eBUNDLEDOWNSTATE.eBUNDLE_DOWNCOMPLTE;
                    if (TsPlatform.IsMobile && TsPlatform.IsEditor)
                    {
                        NrTSingleton <NkClientLogic> .Instance.SetEditorShaderConvert(ref this.rootEffectGameObject);
                    }
                }
            }
            else if (this.eBUNDLEDOWN == Myth_Evolution_Success_DLG.eBUNDLEDOWNSTATE.eBUNDLE_DOWNCOMPLTE)
            {
                Animation componentInChildren = this.rootEffectGameObject.GetComponentInChildren <Animation>();
                if (componentInChildren != null && !componentInChildren.isPlaying)
                {
                    this.bEffectUpdate         = false;
                    this.closeUIButton.Visible = true;
                    this.eBUNDLEDOWN           = Myth_Evolution_Success_DLG.eBUNDLEDOWNSTATE.eBUNDLE_OK;
                }
            }
        }
    }