public void RpcStartHumanoid(
            int nwId, int humanoidId,
            string name, string avatarPrefabName,
            Vector3 position, Quaternion rotation,
            bool physics)
        {
#if hPHOTON2
            if (nwId != photonView.ViewID)
#else
            if (nwId != photonView.viewID)
#endif
            { return; }

            HumanoidControl remoteHumanoid = HumanoidNetworking.FindRemoteHumanoid(humanoids, humanoidId);
            if (remoteHumanoid != null)
            {
                // This remote humanoid already exists
                return;
            }

            humanoids.Add(HumanoidNetworking.StartHumanoid(nwId, humanoidId, name, avatarPrefabName, position, rotation, physics));
        }
Example #2
0
        [ClientRpc] // @ remote client
        private void RpcClientStartHumanoid(
            int nwId,
            int humanoidId,
            string name,
            string avatarPrefabName,
            Vector3 position, Quaternion rotation,
            bool physics
            )
        {
            if (isLocalPlayer && !createLocalRemotes)
            {
                return;
            }

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

            if (remoteHumanoid != null)
            {
                // This remote humanoid already exists
                return;
            }

            humanoids.Add(HumanoidNetworking.StartHumanoid(nwId, humanoidId, name, avatarPrefabName, position, rotation, physics));
        }