public void interact(GameObject obj)
        {
            ThrowableItem item = obj.GetComponent <ThrowableItem>();

            if (item && item.nutrition > 0)
            {
                catchFood(item.gameObject);
            }
            else
            {
                brushOffJunk(item.gameObject);
            }
        }
Exemplo n.º 2
0
        private void pickObject(Vector3 pixelCoord)
        {
            GameObject obj = clickObject(pixelCoord);

            if (obj)
            {
                selectedObject = obj;
                selectedObject.transform.position = Camera.main.transform.position + Camera.main.transform.forward * holdDist;
                ThrowableItem comp = selectedObject.GetComponent <ThrowableItem>();
                if (comp)
                {
                    comp.holded = true;
                }
            }
        }