mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 10:46:17 +00:00
提交帧同步案例
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#if !BESTHTTP_DISABLE_SOCKETIO
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BestHTTP.SocketIO.JsonEncoders
|
||||
{
|
||||
/*using Newtonsoft.Json;
|
||||
|
||||
/// <summary>
|
||||
/// This class uses Newtonsoft's Json encoder (JSON .NET For Unity - http://u3d.as/5q2).
|
||||
/// </summary>
|
||||
public sealed class JsonDotNetEncoder : IJsonEncoder
|
||||
{
|
||||
public List<object> Decode(string json)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<List<object>>(json);
|
||||
}
|
||||
|
||||
public string Encode(List<object> obj)
|
||||
{
|
||||
return JsonConvert.SerializeObject(obj);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
#endif
|
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c2d9c71662df0b641980b51cd68443fa
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,30 @@
|
||||
#if !BESTHTTP_DISABLE_SOCKETIO
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
using LitJson;
|
||||
|
||||
namespace BestHTTP.SocketIO.JsonEncoders
|
||||
{
|
||||
/// <summary>
|
||||
/// This IJsonEncoder implementation uses the LitJson library located in the Examples\LitJson directory.
|
||||
/// </summary>
|
||||
public sealed class LitJsonEncoder : IJsonEncoder
|
||||
{
|
||||
public List<object> Decode(string json)
|
||||
{
|
||||
JsonReader reader = new JsonReader(json);
|
||||
return JsonMapper.ToObject<List<object>>(reader);
|
||||
}
|
||||
|
||||
public string Encode(List<object> obj)
|
||||
{
|
||||
JsonWriter writer = new JsonWriter();
|
||||
JsonMapper.ToJson(obj, writer);
|
||||
|
||||
return writer.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0329bd6a6be04394b9da7576fc41d1dc
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user