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);
            }
        }
    }
示例#2
0
    public void ShowDestPosition(bool bShow)
    {
        GameObject gameObject = GameObject.Find("ShowDestPosition");

        if (null == gameObject)
        {
            if (!bShow)
            {
                return;
            }
            gameObject = new GameObject("ShowDestPosition");
            ICollection gateInfo_Col = NrTSingleton <NrBaseTableManager> .Instance.GetGateInfo_Col();

            foreach (GATE_INFO gATE_INFO in gateInfo_Col)
            {
                if (this.CurrentMapIndex == gATE_INFO.DST_MAP_IDX)
                {
                    GameObject gameObject2 = (GameObject)CResources.LoadClone(NrTSingleton <UIDataManager> .Instance.FilePath + "Common/Prefabs/ToolArrow");
                    if (!(null == gameObject2))
                    {
                        GameObject gameObject3 = new GameObject(string.Format("DestPos_{0}", gATE_INFO.GATE_IDX));
                        gameObject2.transform.parent        = gameObject3.transform;
                        gameObject2.transform.localRotation = Quaternion.Euler(90f, 90f, 0f);
                        gameObject3.transform.parent        = gameObject.transform;
                        Vector3 localPosition = gameObject3.transform.localPosition;
                        localPosition.x = gATE_INFO.DST_POSX;
                        localPosition.y = gATE_INFO.DST_POSY;
                        localPosition.z = gATE_INFO.DST_POSZ;
                        gameObject3.transform.localPosition = localPosition;
                        gameObject3.transform.localRotation = Quaternion.Euler(0f, gATE_INFO.DST_ANGLE, 0f);
                    }
                }
            }
        }
        gameObject.SetActive(bShow);
    }
    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;
    }