Beispiel #1
0
    private void OnDeath()
    {
        if (m_bDeathTriggered == false)
        {
            m_bDeathTriggered = true;
            GetAnimator().SetBool("Investigate", false);
            GetAnimator().SetBool("Attack", false);
            GetAnimator().SetBool("Moving", false);
            GetAIAttack().Cleanup();
            if (m_SmokeVFX != null)
            {
                m_SmokeVFX.Cleanup();
            }
            TryResetPath();
            if (GetAgent().enabled == true)
            {
                GetAgent().isStopped = true;
                GetAgent().enabled   = false;
            }
            Destroy(GetAgent());

            CAIManager.RemoveAI_BothLists(this);
            CAIManager.RemoveFromCombatList(this);
            CAIManager.RemoveFromInvestigateList(this);
        }
        else
        {
            m_fDeathTimer += Time.deltaTime;
            if (m_fDeathTimer > m_fDestroyAfterDuration)
            {
                Destroy(gameObject);
            }
        }
    }
Beispiel #2
0
 public void ResetPOI()
 {
     m_fInvestigateTimer = 0.0f; ///
     m_vPointOfInterest  = Vector3.zero;
     CAIManager.RemoveFromInvestigateList(this);
 }