| | |
| | | |
| | | public GameObject SettlementUI; |
| | | |
| | | public GameObject EffectPrefabObject; |
| | | |
| | | private GameObject effectObj; |
| | | |
| | | public void Init() |
| | | { |
| | | LazyLoad(); |
| | |
| | | /// </summary> |
| | | public void ReturnToMainMenu() |
| | | { |
| | | if (GameConfig.IsNewbieGuideCompleted) |
| | | GameConfig.IsNewbie = false; |
| | | |
| | | // 清空所有Tween数据: |
| | | DOTween.Clear(); |
| | | EndlessUIStart.bFirstLoaded = false; |
| | |
| | | if (EndlessGameUI.instance.state == EndlessGameUI.State.Building) |
| | | EndlessGameUI.instance.CancelGhostPlacement(); |
| | | |
| | | GameObject go = Instantiate(Resources.Load<GameObject>("UI/Final/FinalPanel"), GameObject.Find("MainUI").transform); |
| | | FinalPanel panelUI = go.GetComponent<FinalPanel>(); |
| | | panelUI.SetData($"成绩 {EndlessLevelManager.instance.CurrentLevel}关 {EndlessLevelManager.instance.WaveManager.CurrentWaveIndex}波", EndlessScoreData.CurrentSocre); |
| | | |
| | | GameObject.Find("BottomUI").GetComponent<Canvas>().enabled = false; |
| | | return; |
| | | |
| | | RefreshFinalWave(); |
| | | RefreshPropList(); |
| | | SettlementUI.SetActive(true); |
| | | PlayEffect(); |
| | | } |
| | | |
| | | private void PlayEffect() |
| | | { |
| | | if (effectObj == null) |
| | | { |
| | | effectObj = Instantiate(EffectPrefabObject); |
| | | GameObject particleSystemObject = GameObject.Find("ParticleSystemObject"); |
| | | effectObj.transform.SetParent(particleSystemObject.transform, false); |
| | | effectObj.transform.localPosition = new Vector3(0, 0, 36.6f); |
| | | effectObj.transform.localScale = new Vector3(3, 3, 3); |
| | | } |
| | | |
| | | ParticleSystem ps = effectObj.transform.GetChild(0).GetComponent<ParticleSystem>(); |
| | | ps.Play(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | protected void Victory() |
| | | { |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessLevelCompleted); |
| | | EndlessUIStart.instance.Pause(); |
| | | |
| | | int showFavorite = PlayerPrefs.GetInt("GemBattleFavorite"); |
| | | |
| | | if (showFavorite == 0) |
| | | { |
| | | GameObject go = Instantiate(Resources.Load<GameObject>("UI/Favorite/FavoritePanel"), this.transform.root); |
| | | FavoritePanelUI panelUI = go.GetComponent<FavoritePanelUI>(); |
| | | panelUI.SetAC(ShowPanel); |
| | | |
| | | } |
| | | else |
| | | { |
| | | ShowPanel(); |
| | | } |
| | | } |
| | | |
| | | private void ShowPanel() |
| | | { |
| | | OpenEndGameScreen(true); |
| | | if (VictoryAudio != null && AudioSource != null) |
| | | AudioSource.PlayOneShot(VictoryAudio); |
| | | // if (VictoryAudio != null && AudioSource != null) |
| | | // AudioSource.PlayOneShot(VictoryAudio); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | int level = EndlessLevelManager.instance.CurrentLevel; |
| | | int wave = EndlessLevelManager.instance.WaveManager.CurrentWaveIndex; |
| | | |
| | | FinalWaveText.text = $"最终波次:第{level}关,第{wave}波"; |
| | | FinalWaveText.text = $"第{level}关,第{wave}波"; |
| | | } |
| | | |
| | | private void RefreshPropList() |