public void OnAfterDeserialize(object self) { if (string.IsNullOrEmpty(typeName)) { refType_ = null; #if UNITY_EDITOR instance = null; #endif return; } if (refType_ == null || refType_.Instance == null || refType_.FullName != typeName) { refType_ = new RefType(typeName); } #if !CloseNested if (anyValue != null && !string.IsNullOrEmpty(anyValue.dataKey)) { // 数据因为预置体嵌套被修改了,不完整了,使用TypeSerialize数据来初始化 MonoSerialize.MergeFrom(refType_.Instance, anyValue); } else { #endif MonoSerialize.MergeFrom(refType_.Instance, bytes, objs); #if !CloseNested } #endif refType_.TrySetProperty("csObj", self); #if UNITY_EDITOR instance = refType_.Instance; #endif }
public void OnAfterDeserialize(object self) { if (string.IsNullOrEmpty(typeName)) { return; } refType_ = new RefType(typeName, self); MonoSerialize.MergeFrom(refType_.Instance, bytes, objs); }
public void BytesToAnyValue() { if (string.IsNullOrEmpty(typeName)) { return; } var rt = new RefType(typeName); MonoSerialize.MergeFrom(rt.Instance, bytes, objs); anyValue = MonoSerialize.WriteToTS(rt.Instance); }
public void SaveToTS() { if (string.IsNullOrEmpty(typeName)) { return; } var rt = new RefType(typeName); MonoSerialize.MergeFrom(rt.Instance, bytes, objs); anyValue = MonoSerialize.WriteToTS(rt.Instance); bytesCrc32 = Crc32.To(bytes); bytesLength = bytes.Length; }
public void AnyValueToBytes() { if (string.IsNullOrEmpty(typeName)) { return; } var rt = new RefType(typeName); MonoSerialize.MergeFrom(rt.Instance, anyValue); var ms = MonoSerialize.WriteTo(rt.Instance); bytes = ms.GetBytes(); objs = ms.objs; }
void Init() { if (string.IsNullOrEmpty(typeName)) { return; } if (refType == null) { refType = new RefType(typeName, this); } MonoSerialize.MergeFrom(refType.Instance, bytes, objs); #if UNITY_EDITOR instance = refType.Instance; #endif }
public void OnAfterDeserialize(object self) { if (string.IsNullOrEmpty(typeName)) { refType_ = null; return; } if (refType_ == null || refType_.Instance == null || refType_.FullName != typeName) { refType_ = new RefType(typeName); } MonoSerialize.MergeFrom(refType_.Instance, bytes, objs); refType_.TrySetProperty("csObj", self); #if UNITY_EDITOR instance = refType_.Instance; #endif }