コード例 #1
0
        /// <summary>
        /// Broadcasts a uLink_OnNetworkInstantiate message. This is used by
        /// <see cref="o:uLink.Network.Instantiate"/>'s default instantiator to broadcast the message.
        /// </summary>
        /// <param name="networkView">The NetworkView that you want to broadcast the message for</param>
        /// <param name="message"></param>
        /// <param name="info"></param>
        public static void BroadcastOnNetworkInstantiate(NetworkView networkView, string message, NetworkMessageInfo info)
        {
            // We have to create a new NetworkMessageInfo which includes the NetworkView.
            var instanceInfo = new NetworkMessageInfo(info, networkView);

            // Call the event on every MonoBehaviour in this game object or any of its children.
            networkView.BroadcastMessage(NetworkUnity.EVENT_INSTANTIATE, instanceInfo, SendMessageOptions.DontRequireReceiver);
        }
コード例 #2
0
 void SendStartGame(GameObject g)
 {
     obj = g;
     lobbyObj.BroadcastMessage("StartGameS", SendMessageOptions.DontRequireReceiver);
     running = true;
 }