public void Initialize() { health = 100; playerRigidBody2D = this.gameObject.GetComponent <Rigidbody2D> (); anim = this.gameObject.GetComponent <Animator> (); spriteRenderer = this.gameObject.GetComponent <SpriteRenderer> (); rangedWeapon = gameObject.AddComponent <RangedWeapon> (); OnDamaged = new OnDamaged(); OnDead = new OnDead(); OnAttacked = new OnAttacked(); OnDamaged.AddListener(DebugHealth); }
public void AddAfterDamageListener(UnityAction <IDamageable, Damager> listener) { afterDamaged.AddListener(listener); }
//**************************listener****************************** public void AddBeforeDamageListener(UnityAction <IDamageable, Damager> listener) { beforeDamaged.AddListener(listener); }