Exemplo n.º 1
0
    void OnCollisionEnter2D(Collision2D col)
    {
        switch (materialType)
        {
        case Material.Wood:
            resourcesManager.Wood(material);
            break;

        case Material.Stone:
            resourcesManager.Stone(material);
            break;

        case Material.Gold:
            resourcesManager.Gold(material);
            break;

        case Material.Gems:
            resourcesManager.Gems(material);
            break;

        case Material.Schrooms:
            resourcesManager.Shrooms(material);
            break;

        default:
            Debug.Log("No material assigned");
            break;
        }

        resourcesOnLevelCounter.ResourceRemoved();
        Destroy(col.gameObject);
        dwarfShooter.DwarfDead();
        Destroy(gameObject);
    }
Exemplo n.º 2
0
 void OnCollisionEnter2D(Collision2D col)
 {
     Destroy(col.gameObject);
     dwarfShooter.DwarfDead();
     hitpoints--;
     if (hitpoints <= 0)
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 3
0
 void OnCollisionEnter2D(Collision2D col)
 {
     Destroy(col.gameObject);
     dwarfShooter.DwarfDead();
 }