Exemple #1
0
        /// <summary>
        /// 序列化对象
        /// </summary>
        /// <param name="encoder">对象编码器.</param>
        public override void serialization(LuaObjectEncoder encoder)
        {
            base.serialization(encoder);

            encoder.writeInt64(_objRef.referenceId);
            encoder.writeString(luaObjectId != null ? luaObjectId : "");
        }
        /// <summary>
        /// 序列化对象
        /// </summary>
        /// <param name="encoder">对象编码器.</param>
        public override void serialization(LuaObjectEncoder encoder)
        {
            base.serialization(encoder);

            IntPtr ptr = Marshal.GetIUnknownForObject(obj);

            encoder.writeInt64(ptr.ToInt64());
            encoder.writeString(luaObjectId != null ? luaObjectId : "");
        }
        /// <summary>
        /// 序列化对象
        /// </summary>
        /// <param name="encoder">对象编码器.</param>
        public override void serialization(LuaObjectEncoder encoder)
        {
            base.serialization(encoder);

            encoder.writeInt64(_objRef.referenceId);
            encoder.writeString(luaObjectId);

            //写入自定义数据
            encoder.writeInt32(1);
            encoder.writeString("NativeClass");
            encoder.writeString(this.obj.GetType().FullName);
        }
Exemple #4
0
        /// <summary>
        /// 序列化对象
        /// </summary>
        /// <param name="encoder">对象编码器.</param>
        public override void serialization(LuaObjectEncoder encoder)
        {
            base.serialization(encoder);

            encoder.writeInt64(_objRef.referenceId);
            encoder.writeString(luaObjectId);

            //写入本地类型标识
            int nativeTypeId = encoder.context.exportsTypemanager.getNativeTypeId(_objRef.target.GetType());

            encoder.writeInt32(nativeTypeId);

            //写入自定义数据
            encoder.writeInt32(1);
            encoder.writeString("NativeClass");
            encoder.writeString(this.obj.GetType().FullName);
        }
Exemple #5
0
 /// <summary>
 /// 序列化对象
 /// </summary>
 /// <param name="encoder">对象编码器.</param>
 public override void serialization(LuaObjectEncoder encoder)
 {
     base.serialization(encoder);
     encoder.writeInt64(_objReference.referenceId);
 }