Exemplo n.º 1
0
        /// <summary>
        /// 设置胜者
        /// </summary>
        /// <param name="player"></param>
        public void SetWinner(Player player, DuelEndReason duelEndReason)
        {
            duelSceneScript.ShowDuelResultPanel(player, duelEndReason);

            TimerFunction timerFunction = new TimerFunction();

            timerFunction.SetFunction(2, () =>
            {
                Thread.Sleep(2000);
                GameManager.GetSingleInstance().CleanDuelScene();
                GameManager.GetSingleInstance().EnterMainScene();
            });

            GameManager.AddTimerFunction(timerFunction);
            startDuel = false;
        }
Exemplo n.º 2
0
        /// <summary>
        /// 显示决斗结果面板
        /// </summary>
        /// <param name="winnerPlayer"></param>
        /// <param name="duelEndReason"></param>
        public void ShowDuelResultPanel(Player winnerPlayer, DuelEndReason duelEndReason)
        {
            duelResultPanel.SetActive(true);
            StringResConfig stringResConfig = ConfigManager.GetConfigByName("StringRes") as StringResConfig;
            string          resultText      = "";

            if (winnerPlayer == null)
            {
                resultText = stringResConfig.GetRecordById(16).value;
            }
            else if (winnerPlayer == duelScene.GetMyPlayer())
            {
                resultText = stringResConfig.GetRecordById(17).value;
            }
            else
            {
                resultText = stringResConfig.GetRecordById(18).value;
            }
            duelResultPanel.transform.GetChild(1).GetComponent <Text>().text = resultText;

            DuelEndReasonConfig duelEndReasonConfig = ConfigManager.GetConfigByName("DuelEndReason") as DuelEndReasonConfig;

            duelResultPanel.transform.GetChild(3).GetComponent <Text>().text = duelEndReasonConfig.GetRecordById((int)duelEndReason).value;
        }