public void Serialize(ref global::Utf8Json.JsonWriter writer, global::UnityEngine.AI.NavMeshBuildSettings value, global::Utf8Json.IJsonFormatterResolver formatterResolver)
        {
            writer.WriteRaw(this.____stringByteKeys[0]);
            writer.WriteInt32(value.agentTypeID);
            writer.WriteRaw(this.____stringByteKeys[1]);
            writer.WriteSingle(value.agentRadius);
            writer.WriteRaw(this.____stringByteKeys[2]);
            writer.WriteSingle(value.agentHeight);
            writer.WriteRaw(this.____stringByteKeys[3]);
            writer.WriteSingle(value.agentSlope);
            writer.WriteRaw(this.____stringByteKeys[4]);
            writer.WriteSingle(value.agentClimb);
            writer.WriteRaw(this.____stringByteKeys[5]);
            writer.WriteSingle(value.minRegionArea);
            writer.WriteRaw(this.____stringByteKeys[6]);
            writer.WriteBoolean(value.overrideVoxelSize);
            writer.WriteRaw(this.____stringByteKeys[7]);
            writer.WriteSingle(value.voxelSize);
            writer.WriteRaw(this.____stringByteKeys[8]);
            writer.WriteBoolean(value.overrideTileSize);
            writer.WriteRaw(this.____stringByteKeys[9]);
            writer.WriteInt32(value.tileSize);

            writer.WriteEndObject();
        }
Esempio n. 2
0
        private static void WriterUtf8JsonBasic(ReadOnlySpan <int> data)
        {
            global::Utf8Json.JsonWriter json = new global::Utf8Json.JsonWriter();

            json.WriteBeginObject();
            json.WritePropertyName("age");
            json.WriteInt32(42);
            json.WriteValueSeparator();
            json.WritePropertyName("first");
            json.WriteString("John");
            json.WriteValueSeparator();
            json.WritePropertyName("last");
            json.WriteString("Smith");
            json.WriteValueSeparator();
            json.WritePropertyName("phoneNumbers");
            json.WriteBeginArray();
            json.WriteString("425-000-1212");
            json.WriteValueSeparator();
            json.WriteString("425-000-1213");
            json.WriteEndArray();
            json.WriteValueSeparator();
            json.WritePropertyName("address");
            json.WriteBeginObject();
            json.WritePropertyName("street");
            json.WriteString("1 Microsoft Way");
            json.WriteValueSeparator();
            json.WritePropertyName("city");
            json.WriteString("Redmond");
            json.WriteValueSeparator();
            json.WritePropertyName("zip");
            json.WriteInt32(98052);
            json.WriteEndObject();
            json.WriteValueSeparator();

            json.WritePropertyName("ExtraArray");
            json.WriteBeginArray();
            for (var i = 0; i < data.Length - 1; i++)
            {
                json.WriteInt32(data[i]);
                json.WriteValueSeparator();
            }
            if (data.Length > 0)
            {
                json.WriteInt32(data[data.Length - 1]);
            }
            json.WriteEndArray();

            json.WriteEndObject();
        }
        public override void Serialize(ref global::Utf8Json.JsonWriter writer, global::UGF.Utf8Json.Runtime.Tests.TestAssembly.TestTarget2 value, global::Utf8Json.IJsonFormatterResolver formatterResolver)
        {
            if (value == null)
            {
                writer.WriteNull();
                return;
            }


            writer.WriteRaw(this.____stringByteKeys[0]);
            writer.WriteString(value.Name);
            writer.WriteRaw(this.____stringByteKeys[1]);
            writer.WriteBoolean(value.BoolValue);
            writer.WriteRaw(this.____stringByteKeys[2]);
            writer.WriteSingle(value.FloatValue);
            writer.WriteRaw(this.____stringByteKeys[3]);
            writer.WriteInt32(value.IntValue);
            writer.WriteRaw(this.____stringByteKeys[4]);
            global::Utf8Json.JsonFormatterResolverExtensions.GetFormatterWithVerify <global::UnityEngine.Vector2>(formatterResolver).Serialize(ref writer, value.Vector2, formatterResolver);
            writer.WriteRaw(this.____stringByteKeys[5]);
            global::Utf8Json.JsonFormatterResolverExtensions.GetFormatterWithVerify <global::UnityEngine.Bounds>(formatterResolver).Serialize(ref writer, value.Bounds, formatterResolver);
            writer.WriteRaw(this.____stringByteKeys[6]);
            global::Utf8Json.JsonFormatterResolverExtensions.GetFormatterWithVerify <global::UnityEngine.HideFlags>(formatterResolver).Serialize(ref writer, value.Flags, formatterResolver);

            writer.WriteEndObject();
        }
Esempio n. 4
0
        private static void WriterUtf8JsonArrayOnly(ReadOnlySpan <int> data, byte[] output)
        {
            global::Utf8Json.JsonWriter json = new global::Utf8Json.JsonWriter(output);

            json.WriteBeginArray();
            json.WritePropertyName("ExtraArray");
            for (var i = 0; i < data.Length - 1; i++)
            {
                json.WriteInt32(data[i]);
                json.WriteValueSeparator();
            }
            if (data.Length > 0)
            {
                json.WriteInt32(data[data.Length - 1]);
            }
            json.WriteEndArray();
        }
        public override void Serialize(ref global::Utf8Json.JsonWriter writer, global::UGF.Utf8Json.Runtime.Tests.Formatters.Typed.TestTypedFormatter.Target2 value, global::Utf8Json.IJsonFormatterResolver formatterResolver)
        {
            if (value == null)
            {
                writer.WriteNull();
                return;
            }


            writer.WriteRaw(this.____stringByteKeys[0]);
            writer.WriteInt32(value.IntValue);

            writer.WriteEndObject();
        }
        public void Serialize(ref global::Utf8Json.JsonWriter writer, global::UGF.Utf8Json.Runtime.Tests.TestAssembly.TestTarget3 value, global::Utf8Json.IJsonFormatterResolver formatterResolver)
        {
            if (value == null)
            {
                writer.WriteNull();
                return;
            }


            writer.WriteRaw(this.____stringByteKeys[0]);
            writer.WriteString(value.Name);
            writer.WriteRaw(this.____stringByteKeys[1]);
            writer.WriteBoolean(value.BoolValue);
            writer.WriteRaw(this.____stringByteKeys[2]);
            writer.WriteSingle(value.FloatValue);
            writer.WriteRaw(this.____stringByteKeys[3]);
            writer.WriteInt32(value.IntValue);
            writer.WriteRaw(this.____stringByteKeys[4]);
            global::Utf8Json.JsonFormatterResolverExtensions.GetFormatterWithVerify <global::UnityEngine.Vector2>(formatterResolver).Serialize(ref writer, value.Vector2, formatterResolver);
            writer.WriteRaw(this.____stringByteKeys[5]);
            global::Utf8Json.JsonFormatterResolverExtensions.GetFormatterWithVerify <global::UnityEngine.Bounds>(formatterResolver).Serialize(ref writer, value.Bounds, formatterResolver);
            writer.WriteRaw(this.____stringByteKeys[6]);
            global::Utf8Json.JsonFormatterResolverExtensions.GetFormatterWithVerify <global::UnityEngine.HideFlags>(formatterResolver).Serialize(ref writer, value.Flags, formatterResolver);
            writer.WriteRaw(this.____stringByteKeys[7]);
            global::Utf8Json.JsonFormatterResolverExtensions.GetFormatterWithVerify <int[]>(formatterResolver).Serialize(ref writer, value.ArrayInt, formatterResolver);
            writer.WriteRaw(this.____stringByteKeys[8]);
            global::Utf8Json.JsonFormatterResolverExtensions.GetFormatterWithVerify <global::System.Collections.Generic.List <int> >(formatterResolver).Serialize(ref writer, value.ListInt, formatterResolver);
            writer.WriteRaw(this.____stringByteKeys[9]);
            global::Utf8Json.JsonFormatterResolverExtensions.GetFormatterWithVerify <global::UGF.Utf8Json.Runtime.Tests.TestAssembly.TestTarget2[]>(formatterResolver).Serialize(ref writer, value.ArrayTarget, formatterResolver);
            writer.WriteRaw(this.____stringByteKeys[10]);
            global::Utf8Json.JsonFormatterResolverExtensions.GetFormatterWithVerify <global::System.Collections.Generic.List <global::UGF.Utf8Json.Runtime.Tests.TestAssembly.TestTarget2> >(formatterResolver).Serialize(ref writer, value.ListTarget, formatterResolver);
            writer.WriteRaw(this.____stringByteKeys[11]);
            global::Utf8Json.JsonFormatterResolverExtensions.GetFormatterWithVerify <global::UnityEngine.Keyframe[]>(formatterResolver).Serialize(ref writer, value.ArrayFrames, formatterResolver);
            writer.WriteRaw(this.____stringByteKeys[12]);
            global::Utf8Json.JsonFormatterResolverExtensions.GetFormatterWithVerify <int[, ]>(formatterResolver).Serialize(ref writer, value.ArrayInt2, formatterResolver);

            writer.WriteEndObject();
        }
 public void Serialize(ref global::Utf8Json.JsonWriter writer, global::UnityEngine.HideFlags value, global::Utf8Json.IJsonFormatterResolver formatterResolver)
 {
     writer.WriteInt32((Int32)value);
 }