コード例 #1
0
        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
        }
コード例 #2
0
        public void SetInstance(object instance, object self)
        {
            refType_ = new RefType(instance);
            typeName = refType_.FullName;

            refType_.TrySetProperty("csObj", self);

#if UNITY_EDITOR
            this.instance = refType_.Instance;
#endif
        }
コード例 #3
0
ファイル: CustomizeData.cs プロジェクト: qq21/XIL
        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
        }