Exemple #1
0
 void UpdateTargets(object sender, TargetControllerHitEventArgs e)
 {
     for (int i = 0; i < _targetsList.Count; i++)
     {
         if (int.Equals(e.gameObjectID, _targetsList[i].GetInstanceID()))
         {
             SwapToTargetType(i, _targetDefense);
         }
     }
 }
Exemple #2
0
        void Count(object sender, TargetControllerHitEventArgs e)
        {
            if (_curSessionTime == 0 && _score == 0)
            {
                // Start session on first hit
                _sessionTimer0  = Time.time;
                _curSessionTime = 0;
                _actionTimer0   = Time.time;
                _isPlaying      = true;
            }

            _nAttackAction++;
            _score++;

            if (_nAttackAction >= _sessionTimes[_curSessionTime].nAttack)
            {
                _nAttackAction = 0;

                // Start defense coroutine
                float _elapsCurTimeAction = Time.time - _actionTimer0;
                float dlyDefense_         = 60.0f / _sessionTimes[_curSessionTime].rythm - _elapsCurTimeAction;
                StartCoroutine(TrigDefenseAction(dlyDefense_, _sessionTimes[_curSessionTime].nDefense));
            }
        }