public static CheckedRet <object> Deserial(ByteList bytes) { try { var size = bytes.DropInt32(); var data = System.Text.Encoding.UTF8.GetString(bytes.DropRange(0, size)); return(CheckedRet <object> .Gen(true, data)); } catch (Exception e) { Debug.Log("parse error" + e); return(CheckedRet <object> .Fail()); } }
public static CheckedRet <object> Deserial(ByteList bytes) { try { var size = bytes.DropInt32(); var data = BitConverter.ToSingle(bytes.DropRange(0, size), 0); return(CheckedRet <object> .Gen(true, data)); } catch (Exception e) { Debug.Log("parse error" + e); return(CheckedRet <object> .Fail()); } }