예제 #1
0
    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);
    }
예제 #2
0
 public void AddAfterDamageListener(UnityAction <IDamageable, Damager> listener)
 {
     afterDamaged.AddListener(listener);
 }
예제 #3
0
 //**************************listener******************************
 public void AddBeforeDamageListener(UnityAction <IDamageable, Damager> listener)
 {
     beforeDamaged.AddListener(listener);
 }