示例#1
0
    private void OnBallScore(BallShotData scoreInformation)
    {
        int nShotScore = GetScoreFromStatus(scoreInformation.status);

        if (scoreInformation.isOnFire)
        {
            nShotScore *= Constant.ON_FIRE_SCORE_MULTIPLIER;
        }

        BallThrower thrower = scoreInformation.thrower;

        int nThrowerTotalScore = 0;

        if (thrower.GetType() == typeof(UserBallThrower))
        {
            m_Score.playerScore += nShotScore;
            nThrowerTotalScore   = m_Score.playerScore;
        }
        else
        {
            m_Score.AIScore   += nShotScore;
            nThrowerTotalScore = m_Score.AIScore;
        }

        CallEvent(OnScoreDataSet, new ScoreData(thrower, nShotScore, nThrowerTotalScore));
    }