示例#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));
    }
示例#2
0
    public void Shoot(Vector3 force, BallThrower thrower, bool isOnFireEffect)
    {
        //enable the gravity on the entity when the user decide to stops the interaction with this entity.
        m_EntityRb.useGravity = true;

        //add the stored force to the entity.
        m_EntityRb.AddRelativeForce(force, ForceMode.Impulse);

        m_CurrentThrowScore.thrower  = thrower;
        m_CurrentThrowScore.status   = ShotStatus.NONE;
        m_CurrentThrowScore.isOnFire = isOnFireEffect;
    }
示例#3
0
    public void CreateThrower()
    {
        if (_thrower != null)
        {
            Destroy(_thrower.gameObject);
        }

        _throwerExistingTime = 0;
        _deviationFactor     = 0.1f;
        _thrower             = _SpawnThrower();
        dataProcessor.theHighestPerformaceAchived = 1000;
        Time.timeScale = timeScale;
    }
 private void Awake()
 {
     Instance = this;
 }
示例#5
0
 public BallShotData(BallThrower thrower, ShotStatus status, bool isOnFire)
 {
     this.thrower  = thrower;
     this.status   = status;
     this.isOnFire = isOnFire;
 }
 // Use this for initialization
 void Start()
 {
     _target = GameObject.Find ("BowlingBall"); // Follow the ball
     ballScript = _target.GetComponent<BallThrower> ();
 }
示例#7
0
 // Use this for initialization
 void Start()
 {
     _target    = GameObject.Find("Ball");       // Follow the ball
     ballScript = _target.GetComponent <BallThrower> ();
 }
示例#8
0
 public ScoreData(BallThrower thrower, int nCurrentShotScore, int nTotalThrowerScore)
 {
     this.thrower            = thrower;
     this.nCurrentShotScore  = nCurrentShotScore;
     this.nTotalThrowerScore = nTotalThrowerScore;
 }