Пример #1
0
    public void OnTriggerEnter2D(Collider2D other)
    {
        DamageInput di = other.gameObject.GetComponent <DamageInput> ();

        if (di != null)
        {
            di.TakeHit(attack);
            SelfDestruct();
        }
    }
Пример #2
0
 void Awake()
 {
     ri          = GetComponent <RigidbodyInterface>();
     billboard   = GetComponentInChildren <Floater> ();
     damageInput = GetComponentInChildren <DamageInput> ();
     if (attackTransmitter == null)
     {
         attackTransmitter = GetComponentInChildren <AttackTransmitter> ();
     }
     damageInput.SetUp(this);
     attackTransmitter.SetUp(this);
 }