/* * Attach cube to remote player */ public void AttachCubeToRemotePlayer(RemoteAvatar avatar, RemoteAvatar.HandData hand, int clientIndex) { Assert.IsTrue(clientIndex != m_context.GetClientIndex()); DetachCubeFromPlayer(); hand.gripObject = gameObject; var rigidBody = gameObject.GetComponent <Rigidbody>(); rigidBody.isKinematic = true; rigidBody.detectCollisions = false; gameObject.transform.SetParent(hand.transform, true); m_remoteAvatar = avatar; m_remoteHand = hand; m_holdClientIndex = clientIndex; m_authorityIndex = clientIndex + 1; avatar.CubeAttached(ref hand); }
public bool IsHeldByRemotePlayer(RemoteAvatar remoteAvatar, RemoteAvatar.HandData hand) { return(m_remoteAvatar == remoteAvatar && m_remoteHand == hand); }