예제 #1
0
        public void SetAction(PedestrianAction action, bool force)
        {
            if (_currentAction == action)
            {
                return;
            }
            if (_currentSequence != null && !_currentSequence.Collide && !force)
            {
                return;
            }
            if (action == null)
            {
                return;
            }
            _currentAction = action;
            SetSequence(Behaviour.Sequences[_currentAction.Sequences[0].SequenceIndex]);

            if (_currentAction.Sounds.Length > 0)
            {
                SoundCache.Play(_currentAction.Sounds[Engine.Random.Next(_currentAction.Sounds.Length)], Race.Current.PlayerVehicle, true);
            }
        }
예제 #2
0
        public void SetAction(PedestrianAction action, bool force)
        {
            if (_currentAction == action) return;
            if (_currentSequence != null && !_currentSequence.Collide && !force) return;
            if (action == null) return;
            _currentAction = action;
            SetSequence(Behaviour.Sequences[_currentAction.Sequences[0].SequenceIndex]);

            if (_currentAction.Sounds.Length > 0)
                SoundCache.Play(_currentAction.Sounds[Engine.Random.Next(_currentAction.Sounds.Length)], Race.Current.PlayerVehicle, true);
        }