예제 #1
0
    private void OnTriggerEnter(Collider other)
    {
        AmeliaStats player = other.GetComponent <AmeliaStats>();

        if (player != null)
        {
            player.ItemCollect(gameObject);
            Destroy(gameObject);
        }
    }
예제 #2
0
    private void OnTriggerEnter(Collider other)
    {
        AmeliaStats player = other.GetComponent <AmeliaStats>();

        if (player != null)
        {
            print("Hit Player!!!!");
            player.TakeDamage(1);
        }
    }
예제 #3
0
    private void OnTriggerEnter(Collider other)
    {
        AmeliaStats player = other.GetComponent <AmeliaStats>();

        if (player != null)
        {
            //add key to inventroy
            player.ItemCollect(gameObject);
            //remove key from world
            gameObject.SetActive(false);
        }
    }
예제 #4
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);
        }
    }