Ejemplo n.º 1
0
            public void SyncSetting()
            {
                var json = JsonUtility.ToJson(this);

                if (NetworkServer.active)
                {
                    NetworkMessageManager.SendNetworkMessageToAll(LoadSettingFromJson, NetworkMessageManager.GetStringMessage(json));
                }
            }
Ejemplo n.º 2
0
            void SyncSettingToClient(NetworkConnection conn)
            {
                var json = JsonUtility.ToJson(this);

                NetworkMessageManager.SendNetworkMessage(conn, LoadSettingFromJson, NetworkMessageManager.GetStringMessage(json));
            }
Ejemplo n.º 3
0
 public void SetSyncable()
 {
     sync = true;
     NetworkMessageManager.AddHandler(LoadSettingFromJson);
     NetworkManager.Instance.onServerConnect.AddListener(SyncSettingToClient);
 }