| | |
| | | |
| | | 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; |
| | |
| | | |
| | | RefreshFinalWave(); |
| | | RefreshPropList(); |
| | | EndlessMaskUI.instance.Show(); |
| | | 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); |
| | |
| | | int level = EndlessLevelManager.instance.CurrentLevel; |
| | | int wave = EndlessLevelManager.instance.WaveManager.CurrentWaveIndex; |
| | | |
| | | FinalWaveText.text = $"最终波次:第{level}关,第{wave}波"; |
| | | FinalWaveText.text = $"第{level}关,第{wave}波"; |
| | | } |
| | | |
| | | private void RefreshPropList() |