// Start is called before the first frame update void Start() { livingThing = gameObject.GetComponent <LivingThing>(); livingThing.OnDeathEvent.AddListener(OnDeath); Rend = gameObject.GetComponent <Renderer>(); AttackTimer = 0; player = GlobalData.GetPlayerAndAddListener(this); if (player != null) { player.livingThing.OnDeathEvent.AddListener(PlayerDied); } GlobalData.AddEnemy(this); }