Exemple #1
0
    public void ZombieModelDied(DamageInfo damageInfo)
    {
//        Debug.Log("ZombieController " + _instanceId.ToString() + " OnZombieModelDied 1");
        _lifeState = ZombieLifeState.Dead;
        OnStateChanged();
        _view.OnZombieDied(_model);
        _view.PlayDieFX(damageInfo.DieFX);
        _collection.OnZombieDied(this, _model);

        _animationQueue.Clear();
        _onProfileAddGoldSignal.Fire(damageInfo.Damage);
        _deathAnimation = GetDeathAnimation(damageInfo.DamageType);

        _actionList.Clear();
        if (_moveState == ZombieMoveState.Moving)
        {
            _actionList.Add(ZombieAction.DieOnGround);
        }
        else
        {
            _actionList.Add(ZombieAction.DieInFly);
        }

        PlayNextAction(damageInfo);
    }
Exemple #2
0
 private void Awake()
 {
     IgnoreRaycastLayer = LayerMask.NameToLayer("Ignore Raycast");
     _target            = _mapData.ZombieTarget;
     _instanceId        = gameObject.GetInstanceID();
     _moveState         = ZombieMoveState.Moving;
     _lifeState         = ZombieLifeState.Alive;
     _lastForceType     = ForceType.Unknown;
     _stateTimer        = 0;
 }
Exemple #3
0
    public void Reset()
    {
        _stateTimer            = 0;
        _rigidBody.useGravity  = true;
        _moveState             = ZombieMoveState.Moving;
        _lifeState             = ZombieLifeState.Alive;
        _rigidBody.constraints = DefaultConstraints;
        _transform.rotation    = Quaternion.identity;
        _target        = _mapData.ZombieTarget;
        _currentAction = ZombieAction.None;

        if (_animationQueue != null)
        {
            _animationQueue.Reset();
        }
    }