예제 #1
0
        public static ColliderShape __colliderGroups_ITEM__colliders_ITEM_Deserialize_Shape(JsonNode parsed)
        {
            var value = new ColliderShape();

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

                if (key == "extensions")
                {
                    value.Extensions = new glTFExtensionImport(kv.Value);
                    continue;
                }

                if (key == "extras")
                {
                    value.Extras = new glTFExtensionImport(kv.Value);
                    continue;
                }

                if (key == "sphere")
                {
                    value.Sphere = __colliderGroups_ITEM__colliders_ITEM__shape_Deserialize_Sphere(kv.Value);
                    continue;
                }

                if (key == "capsule")
                {
                    value.Capsule = __colliderGroups_ITEM__colliders_ITEM__shape_Deserialize_Capsule(kv.Value);
                    continue;
                }
            }
            return(value);
        }
예제 #2
0
        public static void __colliders_ITEM_Serialize_Shape(JsonFormatter f, ColliderShape value)
        {
            f.BeginMap();


            if (value.Extensions != null)
            {
                f.Key("extensions");
                (value.Extensions as glTFExtension).Serialize(f);
            }

            if (value.Extras != null)
            {
                f.Key("extras");
                (value.Extras as glTFExtension).Serialize(f);
            }

            if (value.Sphere != null)
            {
                f.Key("sphere");
                __colliders_ITEM__shape_Serialize_Sphere(f, value.Sphere);
            }

            if (value.Capsule != null)
            {
                f.Key("capsule");
                __colliders_ITEM__shape_Serialize_Capsule(f, value.Capsule);
            }

            f.EndMap();
        }