예제 #1
0
    public void GameEnd(float gameScore, float theirScore, bool won)
    {
        if (won)
        {
            if (gameScore == theirScore)
            {
                wonState.text = "Draw";
            }
            else
            {
                wonState.text = "You Won";
            }
        }
        else
        {
            wonState.text = "You Lost";
        }

        scoreText.text = gameScore + "-" + theirScore;

        ourTimer.StopTimer();
        theirTimer.StopTimer();

        turnsText.text = "";

        restartButton.SetActive(true);
        forfeitButton.SetActive(false);
        passButton.SetActive(false);
    }
예제 #2
0
    public static void StopWithArg(Action <object> onTimerWithArgCallback)
    {
        if (onTimerWithArgCallback == null)
        {
            Debug.LogError("定时回调不能为空");
            return;
        }
        TimerObject timerObject = null;

        if (!Instance.m_TimerWithArgDic.TryGetValue(onTimerWithArgCallback, out timerObject))
        {
            return;
        }
        timerObject.StopTimer();
        Instance.m_TimerWithArgDic.Remove(onTimerWithArgCallback);
        Instance.m_TimerPool.Remove(timerObject);
    }