Ejemplo n.º 1
0
    private void OnTriggerEnter(Collider other)
    {
        AmeliaStats player = other.GetComponent <AmeliaStats>();

        if (player != null)
        {
            print("Hit Player!!!!");
            player.TakeDamage(1);
        }
    }
Ejemplo n.º 2
0
    private void OnTriggerEnter(Collider other)
    {
        AmeliaStats player = other.GetComponent <AmeliaStats>();

        if (player != null)
        {
            print("Hit Player!!!!");
            player.TakeDamage(1);
            Destroy(gameObject);
            return;
        }


        Destructable target = other.GetComponent <Destructable>();

        print("Hit something:" + target.name);

        if (target != null)
        {
            target.TakeDamage(1f);
            Destroy(gameObject);
        }
    }