示例#1
0
        public static ColliderShapeCapsule __colliderGroups_ITEM__colliders_ITEM__shape_Deserialize_Capsule(JsonNode parsed)
        {
            var value = new ColliderShapeCapsule();

            foreach (var kv in parsed.ObjectItems())
            {
                var key = kv.Key.GetString();

                if (key == "offset")
                {
                    value.Offset = __colliderGroups_ITEM__colliders_ITEM__shape__capsule_Deserialize_Offset(kv.Value);
                    continue;
                }

                if (key == "radius")
                {
                    value.Radius = kv.Value.GetSingle();
                    continue;
                }

                if (key == "tail")
                {
                    value.Tail = __colliderGroups_ITEM__colliders_ITEM__shape__capsule_Deserialize_Tail(kv.Value);
                    continue;
                }
            }
            return(value);
        }
示例#2
0
        public static void __colliders_ITEM__shape_Serialize_Capsule(JsonFormatter f, ColliderShapeCapsule value)
        {
            f.BeginMap();


            if (value.Offset != null && value.Offset.Count() >= 3)
            {
                f.Key("offset");
                __colliders_ITEM__shape__capsule_Serialize_Offset(f, value.Offset);
            }

            if (value.Radius.HasValue)
            {
                f.Key("radius");
                f.Value(value.Radius.GetValueOrDefault());
            }

            if (value.Tail != null && value.Tail.Count() >= 3)
            {
                f.Key("tail");
                __colliders_ITEM__shape__capsule_Serialize_Tail(f, value.Tail);
            }

            f.EndMap();
        }