Exemplo n.º 1
0
    void OnCollisionEnter(Collision collision)
    {
        Debug.Log("YYY OnCollisionEnter");
        ContactPoint contact = collision.contacts[0];

        Debug.LogFormat("ZZZ oncollisionenter {0}", collision.gameObject.name);
        Destructable destructable = collision.gameObject.GetComponent <Destructable>();
        Holdable     holdable     = collision.gameObject.GetComponent <Holdable>();

        if (holdable != null)
        {
            holdable.PickUp(gameObject);
            heldObject = holdable.gameObject;
        }
    }