Ejemplo n.º 1
0
 protected virtual void DropObject()
 {
     if (objectInHand)
     {
         objectInHand.Drop();
         objectInHand.transform.parent = null;
         objectInHand = null;
     }
 }
Ejemplo n.º 2
0
    private void DropRandomObject()
    {
        int objectCount = _objectsInInventory.Count;

        // Don't execute if 0 objects
        if (objectCount <= 0)
        {
            return;
        }

        int dropIndex = Random.Range(0, objectCount);

        PickableObject objToDrop = _objectsInInventory[dropIndex];

        objToDrop.Drop();
        RemoveFromInventory(objToDrop);

        //Vector3 RandomPos = GetRandomPosition();
        //objToDrop.Drop(RandomPos);
    }