private void OnTriggerEnter(Collider other) { IForkable forkable = other.GetComponent <IForkable>(); if (MyGrabObject.Grabbed && _grabbedObject == null && forkable != null) { other.enabled = false; _grabbedObject = (GrabObject)forkable; _grabbedObject.Grab(); } }
void Grab() { _isGrabbing = true; if (_grabables.Count == 0) { StartAnimateOpen(1); return; } _grabbedObject = _nearestObject; _nearestObject.GetComponent <Outline>().color = 0; _grabbedObject.Grab(); StartAnimateOpen(0.17f); // eventually base this number on a value in GrabObject }