public override void Dispose()
    {
        base.Dispose();

        //Debug.Log("卸载选择地图界面");
        if (m_Background != null)
        {
            UnityEngine.GameObject.Destroy(m_Background);
            m_Background = null;
        }
        if (LoadObject != null)
        {
            UnityEngine.GameObject.Destroy(LoadObject);
            LoadObject = null;
        }
        if (SelectMap_Remainder != null)
        {
            UnityEngine.GameObject.Destroy(SelectMap_Remainder.gameObject);
            SelectMap_Remainder = null;
        }
        if (Prompt_GameStart != null)
        {
            UnityEngine.GameObject.Destroy(Prompt_GameStart);
            Prompt_GameStart = null;
        }
    }
    public override void Dispose()
    {
        base.Dispose();

        //Debug.Log("卸载选择地图界面");
        UnityEngine.GameObject.Destroy(m_Background.gameObject);
        m_Background = null;
        UnityEngine.GameObject.Destroy(mapSelectControl);
        mapSelectControl = null;
        UnityEngine.GameObject.Destroy(Prompt_SelectMap);
        Prompt_SelectMap = null;
        UnityEngine.GameObject.Destroy(SelectMap_Remainder.gameObject);
        SelectMap_Remainder = null;
    }
示例#3
0
    //初始化界面UI
    public void InitUI()
    {
        m_ShowInsertCoins   = new GuiPlaneAnimationPlayer[2];
        m_ShowEnterJionGame = new GuiPlaneAnimationPlayer[2];
        m_GameCoins         = new GuiPlaneAnimationText[2];
        m_GameCoinsDeno     = new GuiPlaneAnimationText[2];
        m_WaitMeUI          = new GameObject[2];

        m_GameComLogo = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("LOGO.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationPlayer>();

        m_ShowInsertCoins[0] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("Prompt_InsertCoins_Left.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationPlayer>();
        m_ShowInsertCoins[1] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("Prompt_InsertCoins_Right.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationPlayer>();

        m_ShowEnterJionGame[0] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("Prompt_EnterJionGame_Left.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationPlayer>();
        m_ShowEnterJionGame[1] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("Prompt_EnterJionGame_Right.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationPlayer>();

        m_GameCoins[0]     = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("MainUI_Coins_Left.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationText>();
        m_GameCoins[1]     = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("MainUI_Coins_Right.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationText>();
        m_GameCoinsDeno[0] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("MainUI_Coins_Denominator_Left.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationText>();
        m_GameCoinsDeno[1] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("MainUI_Coins_Denominator_Right.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationText>();
        //m_PlayerIdBearPrefabControl[0] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("PlayerIdBearPrefab_XiongDa.prefab", GameRoot.gameResource).GetComponent<PlayerIdBearPrefabControl>();
        //m_PlayerIdBearPrefabControl[1] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("PlayerIdBearPrefab_Xiong2.prefab", GameRoot.gameResource).GetComponent<PlayerIdBearPrefabControl>();

        m_PlayerScoreControl = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("PlayerScoreControl.prefab", GameRoot.gameResource).GetComponent <PlayerScoreControl>();
        m_PlayerScoreControl.Initialization();

        m_Remainder = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("MainUI_Remainder.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationTextAdvanced>();
        m_Remainder.gameObject.SetActive(false);

        m_WaitMeUI[0] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("WaitMe_Left.prefab", GameRoot.gameResource);
        m_WaitMeUI[1] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("WaitMe_Right.prefab", GameRoot.gameResource);
        for (int i = 0; i < m_WaitMeUI.Length; i++)
        {
            m_WaitMeUI[i].SetActive(false);
        }

        StandbyProcess.UpdateCoinsUI(IParkourPlayer_Xiong.PlayerIndex.Index_P1);
        StandbyProcess.UpdateCoinsUI(IParkourPlayer_Xiong.PlayerIndex.Index_P2);
        m_GameCoins[(int)IParkourPlayer_Xiong.PlayerIndex.Index_P1].Text = StandbyProcess.CoinsNum[(int)IParkourPlayer_Xiong.PlayerIndex.Index_P1];
        m_GameCoins[(int)IParkourPlayer_Xiong.PlayerIndex.Index_P2].Text = StandbyProcess.CoinsNum[(int)IParkourPlayer_Xiong.PlayerIndex.Index_P2];

        m_GameCoinsDeno[(int)IParkourPlayer_Xiong.PlayerIndex.Index_P1].Text = UniGameOptionsDefine.StartGameCoins.ToString();
        m_GameCoinsDeno[(int)IParkourPlayer_Xiong.PlayerIndex.Index_P2].Text = UniGameOptionsDefine.StartGameCoins.ToString();
        //m_DownPrompt_GameOverProcess.Play();
        //m_DownPrompt_GameRaceProcess.gameObject.SetActive(false);
        //m_DownPrompt_GameContinueProcess.gameObject.SetActive(false);
    }
    private void InitUI()
    {
        m_Background  = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("SelectMapBackground.prefab", GameRoot.gameResource);
        LoadObject    = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("SelecetMapLoadgame.prefab", GameRoot.gameResource);
        progressBar   = GameObject.Find("/UICamera(Clone)/SelecetMapLoadgame(Clone)/bar").GetComponent <GuiPlaneAnimationProgressBar>();
        loadAnimation = GameObject.Find("/UICamera(Clone)/SelecetMapLoadgame(Clone)/X_PlayerRun").GetComponent <Animation>();
        leftposition  = GameObject.Find("/UICamera(Clone)/SelecetMapLoadgame(Clone)/leftposition").GetComponent <Transform>();
        rightposition = GameObject.Find("/UICamera(Clone)/SelecetMapLoadgame(Clone)/rightposition").GetComponent <Transform>();
        //设置进度值
        progressBar.SetProgressBar(currentProgressValue);
        //设置动画
        loadAnimation.wrapMode = WrapMode.Loop;
        loadAnimation.CrossFade("X_PlayerRun");

        SelectMap_Remainder  = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("SelectMap_Remainder.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationTextAdvanced>();
        currentRemainderTime = RemainderTime;
        UpdateTime();
        SoundEffectPlayer.Play("loadgame.wav");
    }
    //显示开始游戏
    private void ShowGameStart()
    {
        if (LoadObject != null)
        {
            UnityEngine.GameObject.Destroy(LoadObject);
            LoadObject = null;
        }
        if (SelectMap_Remainder != null)
        {
            UnityEngine.GameObject.Destroy(SelectMap_Remainder.gameObject);
            SelectMap_Remainder = null;
        }
        Prompt_GameStart = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("Prompt_GameStart.prefab", GameRoot.gameResource);
        GuiPlaneAnimationPlayer ani = GameObject.Find("/UICamera(Clone)/Prompt_GameStart(Clone)/text").GetComponent <GuiPlaneAnimationPlayer>();

        ani.DelegateOnPlayEndEvent += PromptGameStartPlayEnd;
        ani.Play();
        SoundEffectPlayer.Play("startgame.wav");
    }
    private void InitUI()
    {
        m_Background          = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("SelectMapBackground.prefab", GameRoot.gameResource).GetComponent <Transform>();
        mapSelectControl      = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("SelecetMapControl.prefab", GameRoot.gameResource);
        LeftMap               = GameObject.Find("/UICamera(Clone)/SelecetMapControl(Clone)/PlanAnimation1");
        RightMap              = GameObject.Find("/UICamera(Clone)/SelecetMapControl(Clone)/PlanAnimation2");
        currentSelectMapIndex = 0;
        UpdateMap();

        switch (handlePlayerIndex)
        {
        case IParkourPlayer_Xiong.PlayerIndex.Index_P1:
            Prompt_SelectMap = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("Prompt_SelectMap_Left.prefab", GameRoot.gameResource);
            break;

        case IParkourPlayer_Xiong.PlayerIndex.Index_P2:
            Prompt_SelectMap = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("Prompt_SelectMap_Right.prefab", GameRoot.gameResource);
            break;
        }
        SelectMap_Remainder  = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("SelectMap_Remainder.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationTextAdvanced>();
        currentRemainderTime = RemainderTime;
        UpdateTime();
    }