/// <summary> /// 产生一圈比赛结算的预置体 /// </summary> public void SpwanAllGameResult() { //在每次产生之前先删除之前的预置体 GameResultPrefab[] prefab = AllGameResult.transform.GetComponentsInChildren <GameResultPrefab>(); if (prefab.Length > 0) { for (int i = 0; i < prefab.Length; i++) { Destroy(prefab[i].gameObject); } } for (int i = 1; i < 5; i++) { GameObject go = Instantiate(Resources.Load <GameObject>("Game/GameResult/AllGameReult")); go.transform.SetParent(AllGameResult.transform); go.transform.SetSiblingIndex(i); go.transform.localScale = Vector3.one; go.transform.localEulerAngles = Vector3.zero; go.transform.localPosition = new Vector3(go.transform.localPosition.x, go.transform.localPosition.y, 0); GameResultPrefab gameRes = go.GetComponent <GameResultPrefab>(); gameRes.iseatNum = i; gameRes.UpdatePlayerMessage(); } if (GameData.Instance.GameResultPanelData.isWinner) { SystemMgr.Instance.AudioSystem.PlayManual(AudioSystem.AudioMenel.Win, false, false); } else { SystemMgr.Instance.AudioSystem.PlayManual(AudioSystem.AudioMenel.Lose, false, false); } }
/// <summary> /// 产生四家的结算的预置体 /// </summary> public void SpwanGameReult_Round() { GameResultPanelData grpd = GameData.Instance.GameResultPanelData; //在每次产生之前先删除之前的预置体 GameResultPrefab[] prefab = RoundGameReult.transform.GetComponentsInChildren <GameResultPrefab>(); if (prefab.Length > 0) { for (int i = 0; i < prefab.Length; i++) { Destroy(prefab[i].gameObject); } } for (int i = 1; i < 5; i++) { GameObject go = null; //通过座位号判断玩家信息是否是赢家 if (grpd.byaWinSrat[i - 1] > 0) { go = Instantiate(Resources.Load <GameObject>("Game/GameResult/RoundPlayerResult_Win")); go.transform.SetParent(RoundGameReult.transform); go.transform.SetAsFirstSibling(); } else { go = Instantiate(Resources.Load <GameObject>("Game/GameResult/RoundPlayerResult_Normal")); go.transform.SetParent(RoundGameReult.transform); } go.transform.localScale = Vector3.one; go.transform.localEulerAngles = Vector3.zero; go.transform.localPosition = new Vector3(go.transform.localPosition.x, go.transform.localPosition.y, 0); GameResultPrefab gameRes = go.GetComponent <GameResultPrefab>(); gameRes.iseatNum = i; gameRes.MessageVlaue(); gameRes.SpwanPlayerCard(); } bool isHuangZhuang = true; //如果本次是荒庄,产生荒庄的图标 for (int i = 0; i < 4; i++) { if (grpd.byaWinSrat[i] > 0) { isHuangZhuang = false; } } //在这里处理如果玩家处于托管状态,30s后自动准备 PlayerPlayingPanelData pppd = GameData.Instance.PlayerPlayingPanelData; pppd.isAllAutoStatus = true; //是否是四个人的托管状态 for (int i = 0; i < pppd.iAllPlayerHostStatus.Length; i++) { if (pppd.iAllPlayerHostStatus[i] == 0) { pppd.isAllAutoStatus = false; break; } } if (!pppd.isAllAutoStatus) { AutoReady(); } if (isHuangZhuang) { UIMainView.Instance.PlayerPlayingPanel.SpwanSpeaiclTypeRemind(4, 9, false); } }