Пример #1
0
    public void OnTriggerEnter2D(Collider2D collision)
    {
        DeepCreature creature = collision.gameObject.GetComponent <DeepCreature>();

        if (creature != null && !creature.IsDead())
        {
            creature.TakeDamage(attack);
            if (creature.IsDead())
            {
                dude.EarnBones(creature.GetBones());
            }
            KillProjectile();
        }

        DeepTile tile = collision.gameObject.GetComponent <DeepTile>();

        if (tile != null && !tile.isAir && !tile.isWater)
        {
            KillProjectile();
        }
    }