Ejemplo n.º 1
0
 void OnTriggerEnter2D(Collider2D col)
 {
     if (electrified)
     {
         IShockable shockableObject = col.gameObject.GetComponent <IShockable>();
         if (shockableObject != null)
         {
             shockableObject.ReceiveShock(shockStrength);
         }
     }
 }
Ejemplo n.º 2
0
    void OnTriggerEnter2D(Collider2D col)
    {
        IShockable shockableComponent = col.GetComponent <IShockable>();

        if (shockableComponent != null)
        {
            shockableComponent.ReceiveShock(shockStrength);
        }
        if (col.gameObject.tag != "Checkpoint")
        {
            Dissappear();
        }
    }