void RpcGrabLocalObject(NetworkInstanceId netId) { //GameObject localObj = NetworkServer.FindLocalObject(netId); GameObject localObj = ClientScene.FindLocalObject(netId); if (localObj == null) { return; } IGrabable grab = localObj.GetComponent <IGrabable>(); if (grab == null) { return; } _grabbedObject = grab; _grabbedObject.OnGrab(this); }
void CmdAttemptGrab() { // TODO: Check and grab Transform grabTransform = _grabArea.GetClosestGrabable(); if (grabTransform == null) { return; } IGrabable grab = grabTransform.GetComponent <IGrabable>(); if (grab == null) { return; } _grabbedObject = grab; _grabbedObject.OnGrab(this); RpcGrabLocalObject(grab.GetNetId()); }