コード例 #1
0
        public void RpcLetGo(int humanoidId, bool isLeft)
        {
            if (debug <= HumanoidNetworking.Debug.Info)
            {
                PhotonLog("RpcLetGo");
            }

            HumanoidControl humanoid = HumanoidNetworking.FindRemoteHumanoid(humanoids, humanoidId);

            if (humanoid == null)
            {
                if (debug <= HumanoidNetworking.Debug.Warning)
                {
                    PhotonLogWarning("Could not find humanoid: " + humanoidId);
                }
                return;
            }

            HandTarget handTarget = isLeft ? humanoid.leftHandTarget : humanoid.rightHandTarget;

            if (handTarget != null)
            {
                HandInteraction.LocalLetGo(handTarget);
            }
        }
コード例 #2
0
        [ClientRpc] // @ remote client
        public void RpcClientLetGo(int nwId, int humanoidId, bool leftHanded)
        {
            if (debug <= HumanoidNetworking.Debug.Info)
            {
                Debug.Log(netId + ": RpcLetGo " + humanoidId);
            }

            HumanoidControl humanoid = HumanoidNetworking.FindRemoteHumanoid(humanoids, humanoidId);

            if (humanoid == null)
            {
                if (debug <= HumanoidNetworking.Debug.Warning)
                {
                    Debug.LogWarning(netId.Value + ": Could not find humanoid: " + humanoidId);
                }
                return;
            }

            HandTarget handTarget = leftHanded ? humanoid.leftHandTarget : humanoid.rightHandTarget;

            HandInteraction.LocalLetGo(handTarget);
        }