protected virtual void DropObject() { if (objectInHand) { objectInHand.Drop(); objectInHand.transform.parent = null; objectInHand = null; } }
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); }