public void Drop() { if (!ControlledObject) { return; } //drop held item ControlledObject.GetComponent <InteractableObject>().OnDrop(this); AllControlledObjects.Remove(ControlledObject); ControlledObject = null; }
public void Grab() { if (ControlledObject) { return; } if (!NearestObject) { return; } //grab nearest object ControlledObject = NearestObject; AllControlledObjects.Add(ControlledObject); ControlledObject.GetComponent <InteractableObject>().OnGrab(this); }