Esempio n. 1
0
    private void ParseToolTip()
    {
        string    path      = NrTSingleton <UIDataManager> .Instance.FilePath + "TextPreloading/LoadingToolTip";
        TextAsset textAsset = (TextAsset)CResources.Load(path);

        if (null == textAsset)
        {
            TsLog.Log("Failed TextPreloading/LoadingToolTip", new object[0]);
            return;
        }
        char[] separator = new char[]
        {
            '\t'
        };
        string[] array = textAsset.text.Split(new char[]
        {
            '\n'
        });
        for (int i = 1; i < array.Length; i++)
        {
            if (!(string.Empty == array[i]))
            {
                string[]       array2         = array[i].Split(separator);
                NewLoadingText newLoadingText = new NewLoadingText();
                newLoadingText.m_szTextKey = array2[0];
                newLoadingText.m_nMinLV    = int.Parse(array2[1]);
                newLoadingText.m_nMaxLV    = int.Parse(array2[2]);
                if (UIDataManager.IsUse256Texture())
                {
                    newLoadingText.m_szBundlePath = array2[4];
                }
                else
                {
                    newLoadingText.m_szBundlePath = array2[3];
                }
                newLoadingText.m_nShowType = int.Parse(array2[5]);
                this.m_LoadingText.Add(newLoadingText);
            }
        }
        Resources.UnloadAsset(textAsset);
        CResources.Delete(path);
    }
    private void LoadChar(string strfilename)
    {
        if (this.pCharPrefab != null)
        {
            UnityEngine.Object.DestroyImmediate(this.pCharPrefab);
            this.pCharPrefab = null;
        }
        this.pCharPrefab = (CResources.LoadClone(NrTSingleton <UIDataManager> .Instance.FilePath + strfilename) as GameObject);
        CResources.Delete(NrTSingleton <UIDataManager> .Instance.FilePath + strfilename);
        GameObject gameObject = GameObject.Find("UI Camera");

        if (gameObject != null)
        {
            Camera componentInChildren = gameObject.GetComponentInChildren <Camera>();
            if (componentInChildren != null)
            {
                Vector3 location = this.m_txTouchArea.GetLocation();
                location.x = this.m_txTouchArea.GetLocation().x + this.m_txTouchArea.GetSize().x / 2f;
                location.y = -(this.m_txTouchArea.GetLocationY() + this.m_txTouchArea.GetSize().y / 2f);
                location.z = 560f;
                this.pCharPrefab.transform.position = location;
                Transform transform = this.pCharPrefab.transform.Find("Loding Char");
                if (transform != null)
                {
                    this.pRealChar = transform.gameObject;
                }
                Collider[] componentsInChildren = this.pCharPrefab.GetComponentsInChildren <Collider>();
                Collider[] array = componentsInChildren;
                for (int i = 0; i < array.Length; i++)
                {
                    Collider collider = array[i];
                    collider.enabled = false;
                }
                NkUtil.SetAllChildLayer(this.pCharPrefab, GUICamera.UILayer);
            }
        }
    }
Esempio n. 3
0
        public bool LoadUIEmoticonDictionary()
        {
            if (this.bLoad)
            {
                return(false);
            }
            string    path      = NrTSingleton <UIDataManager> .Instance.FilePath + "UIEmoticonDictionary" + NrTSingleton <UIDataManager> .Instance.AddFilePath;
            TextAsset textAsset = (TextAsset)CResources.Load(path);

            if (null == textAsset)
            {
                TsLog.Log("Failed LoadUIEmoticonDictionary", new object[0]);
                return(false);
            }
            char[] separator = new char[]
            {
                '\t'
            };
            string a  = "1:1";
            string a2 = "1:3";
            string a3 = "3:1";
            string a4 = "3:3";

            string[] array = textAsset.text.Split(new char[]
            {
                '\n'
            });
            for (int i = 0; i < array.Length; i++)
            {
                string[]       array2         = array[i].Split(separator);
                UIEmoticonInfo uIEmoticonInfo = new UIEmoticonInfo();
                uIEmoticonInfo.infoLoader.Material = NrTSingleton <UIDataManager> .Instance.GetString(NrTSingleton <UIDataManager> .Instance.FilePath, "Material/", array2[4]);

                uIEmoticonInfo.infoLoader.UVs = new Rect(float.Parse(array2[5]), float.Parse(array2[6]), float.Parse(array2[7]), float.Parse(array2[8]));
                if (a == array2[9].TrimEnd(new char[0]))
                {
                    uIEmoticonInfo.infoLoader.Tile = SpriteTile.SPRITE_TILE_MODE.STM_MIN;
                }
                else if (a2 == array2[10].TrimEnd(new char[0]))
                {
                    uIEmoticonInfo.infoLoader.Tile = SpriteTile.SPRITE_TILE_MODE.STM_1x3;
                }
                else if (a3 == array2[11].TrimEnd(new char[0]))
                {
                    uIEmoticonInfo.infoLoader.Tile = SpriteTile.SPRITE_TILE_MODE.STM_3x1;
                }
                else if (a4 == array2[12].TrimEnd(new char[0]))
                {
                    uIEmoticonInfo.infoLoader.Tile = SpriteTile.SPRITE_TILE_MODE.STM_3x3;
                }
                else
                {
                    TsLog.Log("Don't Set  " + i, new object[0]);
                }
                uIEmoticonInfo.infoLoader.ButtonCount = byte.Parse(array2[10]);
                if (0 >= uIEmoticonInfo.infoLoader.ButtonCount)
                {
                    TsLog.Log(string.Concat(new object[]
                    {
                        "Wrong Value ButtonCount :",
                        array2[10],
                        "/",
                        i
                    }), new object[0]);
                    uIEmoticonInfo.infoLoader.ButtonCount = 4;
                }
                uIEmoticonInfo.delays[0] = float.Parse(array2[11]);
                uIEmoticonInfo.delays[1] = float.Parse(array2[12]);
                uIEmoticonInfo.delays[2] = float.Parse(array2[13]);
                if (!this.uiEmoticonDictionary.ContainsKey("^" + MsgHandler.HandleReturn <string>("GetTextFromInterface", new object[]
                {
                    array2[0]
                })))
                {
                    this.uiEmoticonDictionary.Add("^" + MsgHandler.HandleReturn <string>("GetTextFromInterface", new object[]
                    {
                        array2[0]
                    }), uIEmoticonInfo);
                    this._EmoticonENGName.Add(array2[2], array2[0]);
                }
                else
                {
                    TsLog.Log(string.Concat(new object[]
                    {
                        "Ű���� �ߺ��Դϴ� = ",
                        array2[0],
                        " ",
                        Time.time
                    }), new object[0]);
                }
            }
            Resources.UnloadAsset(textAsset);
            CResources.Delete(path);
            this.bLoad = true;
            return(true);
        }
    public override void InitializeComponent()
    {
        UIBaseFileManager instance = NrTSingleton <UIBaseFileManager> .Instance;
        Form form = this;

        instance.LoadFile(ref form, "stage/dlg_preloadingpage", G_ID.PREDOWNLOAD_DLG, false);
        instance.CreateControl(ref this.textureBG_Img, "DrawTexture_DrawTexture0");
        instance.CreateControl(ref this.textureBG_Img1, "DrawTexture_DrawTexture1");
        instance.CreateControl(ref this.ProgressBar_ProgressBar1, "DrawTexture1");
        instance.CreateControl(ref this.ProgressBar_ProgressBar2, "DrawTexture2");
        instance.CreateControl(ref this.m_Percent, "Label_Label3");
        instance.CreateControl(ref this.m_FilePercent, "Label_Label4");
        instance.CreateControl(ref this.m_Text, "Label_text");
        instance.CreateControl(ref this.btnGameStart, "Button_GameStart");
        instance.CreateControl(ref this.Drawtexture_DTBG03, "DT_BG03");
        instance.CreateControl(ref this.DT_Portrait01, "DT_Portrait01");
        instance.CreateControl(ref this.DT_Portrait02, "DT_Portrait02");
        instance.CreateControl(ref this.DT_Portrait03, "DT_Portrait03");
        instance.CreateControl(ref this.DT_CharVoice01, "DT_CharVoice01");
        instance.CreateControl(ref this.DT_CharView, "DT_CharView");
        instance.CreateControl(ref this.DT_DrawTexture_DrawTexture29, "DrawTexture_DrawTexture29");
        instance.CreateControl(ref this.LB_CharName01, "LB_CharName01");
        instance.CreateControl(ref this.LB_CVName01, "LB_CVName01");
        instance.CreateControl(ref this.LB_CVName02, "LB_CVName02");
        instance.CreateControl(ref this.BT_PlayVoice, "BT_PlayVoice");
        instance.CreateControl(ref this.LB_Charinfo01, "LB_Charinfo01");
        instance.CreateControl(ref this.m_txTouchArea, "TouchArea");
        instance.CreateControl(ref this.DrawTexture_NameLine, "DrawTexture_NameLine");
        instance.CreateControl(ref this.Toggle_Portrait01, "Toggle_Portrait01");
        instance.CreateControl(ref this.Toggle_Portrait02, "Toggle_Portrait02");
        instance.CreateControl(ref this.Toggle_Portrait03, "Toggle_Portrait03");
        this.Toggle_Portrait01.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickTabControl));
        this.Toggle_Portrait02.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickTabControl));
        this.Toggle_Portrait03.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickTabControl));
        instance.CreateControl(ref this.BT_PlayMovie, "BT_PlayMovie");
        instance.CreateControl(ref this.DT_IntroMovie, "DT_IntroMovie");
        instance.CreateControl(ref this.LB_Open, "Label_Opening");
        this.BT_PlayMovie.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClickPlayMovie));
        this.ProgressBar_ProgressBar1.transform.localScale = new Vector3(1.2f, 1f, 1f);
        this.m_fSize    = this.ProgressBar_ProgressBar1.GetSize().x;
        this.m_fMaxSize = this.ProgressBar_ProgressBar1.GetSize().x * 1.2f;
        this.ProgressBar_ProgressBar1.SetTextureUVs(new Vector2(0f, 943f), new Vector2(0f, 30f));
        this.ProgressBar_ProgressBar2.transform.localScale = new Vector3(1.2f, 1f, 1f);
        this.m_fSize    = this.ProgressBar_ProgressBar2.GetSize().x;
        this.m_fMaxSize = this.ProgressBar_ProgressBar2.GetSize().x * 1.2f;
        this.ProgressBar_ProgressBar2.SetTextureUVs(new Vector2(0f, 943f), new Vector2(0f, 30f));
        NrMainSystem.CheckAndSetReLoginMainCamera();
        this.BgColor = Camera.main.backgroundColor;
        if (Scene.CurScene == Scene.Type.PREDOWNLOAD || Scene.CurScene == Scene.Type.NPATCH_DOWNLOAD)
        {
            Camera.main.backgroundColor = this.BgColor;
        }
        this.SetTotalProgress(0f, 0f, string.Empty);
        this.m_Percent.Visible                = false;
        this.m_FilePercent.Visible            = false;
        this.m_Text.Visible                   = false;
        this.textureBG_Img.Visible            = false;
        this.textureBG_Img1.Visible           = false;
        this.ProgressBar_ProgressBar1.Visible = false;
        this.ProgressBar_ProgressBar2.Visible = false;
        base.ShowSceneType      = FormsManager.FORM_TYPE_MAIN;
        this.pTouchEffectPrefab = (CResources.LoadClone(NrTSingleton <UIDataManager> .Instance.FilePath + "Prefabs/fx_fingerpoint_ui") as GameObject);
        CResources.Delete(NrTSingleton <UIDataManager> .Instance.FilePath + "Prefabs/fx_fingerpoint_ui");
        this.pTouchVoiceObject = new GameObject("TouchVoiceObject");
        this.pTouchVoiceObject.transform.position = new Vector3(0f, 0f, -10f);
        this.pTouchVoiceObject.AddComponent <AudioSource>();
        this.m_txTouchArea.AddValueChangedDelegate(new EZValueChangedDelegate(this.On_Click_Ani));
        this.btnGameStart.SetLocation(GUICamera.width / 2f - this.btnGameStart.GetSize().x / 2f, GUICamera.height - 110f, -1f);
        this.btnGameStart.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromPreloadText("2014"));
        this.btnGameStart.AddValueChangedDelegate(new EZValueChangedDelegate(this.On_Click_GameStart));
        this.btnGameStart.Visible = false;
    }
Esempio n. 5
0
        private bool LoadUIImageDictionary()
        {
            if (this.bLoad)
            {
                return(false);
            }
            string    path      = NrTSingleton <UIDataManager> .Instance.FilePath + "UIImageDictionary" + NrTSingleton <UIDataManager> .Instance.AddFilePath;
            TextAsset textAsset = (TextAsset)CResources.Load(path);

            if (null == textAsset)
            {
                TsLog.Log("Failed UIImageDictionary", new object[0]);
                return(false);
            }
            char[] separator = new char[]
            {
                '\t'
            };
            string a  = "1:1";
            string a2 = "1:3";
            string a3 = "3:1";
            string a4 = "3:3";

            string[] array = textAsset.text.Split(new char[]
            {
                '\n'
            });
            for (int i = 0; i < array.Length; i++)
            {
                if (array[i].Length != 0)
                {
                    string[] array2 = array[i].Split(separator);
                    if (array2.Length > 1)
                    {
                        UIBaseInfoLoader uIBaseInfoLoader = new UIBaseInfoLoader();
                        uIBaseInfoLoader.Material = NrTSingleton <UIDataManager> .Instance.GetString(NrTSingleton <UIDataManager> .Instance.FilePath, "Material/", array2[1]);

                        uIBaseInfoLoader.UVs = new Rect(float.Parse(array2[2]), float.Parse(array2[3]), float.Parse(array2[4]), float.Parse(array2[5]));
                        if (a == array2[6].TrimEnd(new char[0]))
                        {
                            uIBaseInfoLoader.Tile = SpriteTile.SPRITE_TILE_MODE.STM_MIN;
                        }
                        else if (a2 == array2[6].TrimEnd(new char[0]))
                        {
                            uIBaseInfoLoader.Tile = SpriteTile.SPRITE_TILE_MODE.STM_1x3;
                        }
                        else if (a3 == array2[6].TrimEnd(new char[0]))
                        {
                            uIBaseInfoLoader.Tile = SpriteTile.SPRITE_TILE_MODE.STM_3x1;
                        }
                        else if (a4 == array2[6].TrimEnd(new char[0]))
                        {
                            uIBaseInfoLoader.Tile = SpriteTile.SPRITE_TILE_MODE.STM_3x3;
                        }
                        else
                        {
                            TsLog.Log("Don't Set : {0} / {1}", new object[]
                            {
                                array2[0],
                                i
                            });
                        }
                        uIBaseInfoLoader.ButtonCount = byte.Parse(array2[7]);
                        if (0 >= uIBaseInfoLoader.ButtonCount)
                        {
                            TsLog.Log(string.Concat(new object[]
                            {
                                "Wrong Value ButtonCount :",
                                array2[7],
                                "/",
                                i
                            }), new object[0]);
                            uIBaseInfoLoader.ButtonCount = 4;
                        }
                        if (array2.Length > 8)
                        {
                            uIBaseInfoLoader.Pattern = (int.Parse(array2[8]) > 0);
                        }
                        string text = array2[0].Trim();
                        uIBaseInfoLoader.StyleName = text;
                        if (!this.uiImageDictionary.ContainsKey(text))
                        {
                            this.uiImageDictionary.Add(text, uIBaseInfoLoader);
                        }
                        else
                        {
                            TsLog.Log(string.Concat(new object[]
                            {
                                "This Key Value Is Overlap = ",
                                text,
                                " ",
                                Time.time
                            }), new object[0]);
                        }
                    }
                }
            }
            Resources.UnloadAsset(textAsset);
            CResources.Delete(path);
            this.bLoad = true;
            return(true);
        }