void SendEvent()
    {
        switch (_damageResultType)
        {
        case DamageResultType.INJURY:
            if (_eventDeath != null)
            {
                _eventDeath.Release();
                _eventDeath = null;
            }
            SendInjuryEvent();
            break;

        case DamageResultType.DEATH:
            if (_eventInjury != null)
            {
                _eventInjury.Release();
                _eventInjury = null;
            }
            SendDeathEvent();
            break;

        default:
            return;
        }
    }
Пример #2
0
    void InitializeNext(FSMEvent ev)
    {
        _eventInjury = ev as AnimFSMEventInjuryBoss;
        string animName = Agent.AnimSet.GetInjuryPhaseAnim(++_curInjuryPhaseIDX);

        Tools.PlayAnimation(Agent.AnimEngine, animName, 0.1f);
        _endOfStateTime             = Agent.AnimEngine[animName].length + Time.timeSinceLevelLoad;
        Agent.BlackBoard.motionType = MotionType.NONE;
    }
Пример #3
0
    protected override void Initialize(FSMEvent ev = null)
    {
        _eventInjury = ev as AnimFSMEventInjuryBoss;

        _curInjuryPhaseIDX = 0;
        string animName = Agent.AnimSet.GetInjuryPhaseAnim(_curInjuryPhaseIDX);

        AnimationTools.PlayAnim(Agent.AnimEngine, animName, 0.1f);
        _endOfStateTime             = Agent.AnimEngine[animName].length + Time.timeSinceLevelLoad;
        Agent.BlackBoard.motionType = MotionType.NONE;
    }
 public override void Reset()
 {
     base.Reset();
     _injuryPhrase        = 0;
     _eventInjury         = null;
     _eventDeath          = null;
     _eventAttack         = null;
     _attacker            = null;
     _attackerRepeatCount = 0;
     _damageResultType    = DamageResultType.NONE;
     _startTrailTimer     = 0;
 }
    void SendInjuryEvent()
    {
        if (++_injuryPhrase > maxInjuryPhrase) // 只有3种受伤阶段
        {
            return;
        }

        if (_eventInjury != null)
        {
            _eventInjury.IsFinished = true;
            _eventInjury.Release();
        }
        _eventInjury            = AnimFSMEventInjuryBoss.pool.Get();
        _eventInjury.damageType = Agent.BlackBoard.damageType;
        _eventInjury.fromWeapon = Agent.BlackBoard.attackerWeapon;
        _eventInjury.attacker   = Agent.BlackBoard.Attacker;
        _eventInjury.impuls     = Agent.BlackBoard.impuls;
        Agent.FSMComponent.SendEvent(_eventInjury);
    }
 public override void OnExit(Phenix.Unity.AI.WorldState ws)
 {
     Agent.BlackBoard.invulnerable = false;
     if (_eventInjury != null)
     {
         _eventInjury.Release();
         _eventInjury = null;
     }
     if (_eventDeath != null)
     {
         _eventDeath.Release();
         _eventDeath = null;
     }
     if (_eventAttack != null)
     {
         _eventAttack.Release();
         _eventAttack = null;
     }
     base.OnExit(ws);
 }