Пример #1
0
        public void Unsense(EnnemyController ennemy)
        {
            ennemiesInSight.Remove(ennemy);

            ennemy.GetComponent <Health>().OnDeath -= OnDeath;

            NotifyEnnemySightUnsensed(ennemy);
        }
Пример #2
0
        public void Sense(EnnemyController ennemy)
        {
            if (!ennemiesInSight.Contains(ennemy))
            {
                ennemiesInSight.Add(ennemy);

                ennemy.GetComponent <Health>().OnDeath += OnDeath;

                NotifyEnnemySensed(ennemy);
            }
        }
Пример #3
0
    // Use this for initialization
    protected new void Start()
    {
        base.Start();

        localIdInFile    = Helper.GetObjectLocalIdInFile(this);
        ennemyController = GetComponent <EnnemyController>();
        animator         = ennemyController.GetComponent <Animator>();
        target           = FindObjectOfType <PlayerController>().gameObject;

        animatorBaseSpeed = animator.speed;
    }
 private void OnDestroy()
 {
     ennemySensor.OnEnnemySeen      -= OnEnnemySeen;
     ennemySensor.OnEnnemySightLost -= OnEnnemySightLost;
     currentEnnemyTarget.GetComponent <Health>().OnDeath -= OnTargetDied;
 }