Пример #1
0
 /// <summary>
 /// Called on every NetworkBehaviour when it is activated on a client.
 /// <para>Objects on the host have this function called, as there is a local client on the host. The values of SyncVars on object are guaranteed to be initialized correctly with the latest state from the server when this function is called on the client.</para>
 /// </summary>
 public override void OnStartClient()
 {
     Instance = this;
     LoadPrefabs();
 }
Пример #2
0
        /// <summary>
        /// This is invoked for NetworkBehaviour objects when they become active on the server.
        /// <para>This could be triggered by NetworkServer.Listen() for objects in the scene, or by NetworkServer.Spawn() for objects that are dynamically created.</para>
        /// <para>This will be called for objects on a "host" as well as for object on a dedicated server.</para>
        /// </summary>
        public override void OnStartServer()
        {
            Instance = this;

            LoadPrefabs();
        }