コード例 #1
0
ファイル: Character.cs プロジェクト: mghazian/game-bot
    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);
 }