Beispiel #1
0
    public void OnGetShot(GameObject from, float damage)
    {
        if (health != null)
        {
            health.Add(-damage);
            if (health.IsDead())
            {
                gameObject.SetActive(false);
                if (Diagnostic.Instance.enemyReference == gameObject)
                {
                    Diagnostic.Instance.enemyReference = null;
                }
            }
        }
        Diagnostic.Instance.UpdateHealth(this.gameObject, health.GetHealth());

        if (personality != null)
        {
            personality.OnGetShot(from);
        }
    }