void RegisterComponent(Component component)
        {
            const BindingFlags flags = BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly;

            FieldInfo[] fields = component.GetType().GetFields(flags);

            // Find the fields that are marked for exposition
            OssiaEnabledComponent ossia_c = null;

            foreach (FieldInfo field in fields)
            {
                if (Attribute.IsDefined(field, typeof(Ossia.Expose)))
                {
                    // Get the type of the field
                    ossia_type t;
                    try { t = Ossia.Value.GetOssiaType(field.FieldType); } catch { continue; }

                    // Create a node for the component
                    if (ossia_c == null)
                    {
                        ossia_c = makeComponent(component);
                    }

                    // Create an attribute to bind the field.
                    var attr = (Ossia.Expose)Attribute.GetCustomAttribute(field, typeof(Ossia.Expose));

                    var oep = new OssiaEnabledField(field, attr.ExposedName, ossia_c, t);
                    ossia_c.fields.Add(oep);
                    controller.Register(oep);
                }
            }

            foreach (PropertyInfo prop in component.GetType().GetProperties())
            {
                if (Attribute.IsDefined(prop, typeof(Ossia.Expose)))
                {
                    // Get the type of the property;
                    ossia_type t;
                    try { t = Ossia.Value.GetOssiaType(prop.PropertyType); } catch { continue; }

                    // Create a node for the component
                    if (ossia_c == null)
                    {
                        ossia_c = makeComponent(component);
                    }

                    var attr = (Ossia.Expose)Attribute.GetCustomAttribute(prop, typeof(Ossia.Expose));

                    // Create an attribute to bind the property.
                    var oep = new OssiaEnabledProperty(prop, attr.ExposedName, ossia_c, t);
                    ossia_c.properties.Add(oep);
                    controller.Register(oep);
                }
            }
        }
        void RegisterTransform()
        {
            var component = this.transform;
            var ossia_c   = new OssiaEnabledComponent(component, child_node.AddChild("transform"));

            ossia_components.Add(ossia_c);

            foreach (PropertyInfo prop in component.GetType().GetProperties())
            {
                if (validTransformType(prop.PropertyType))
                {
                    // Get the type of the property;
                    ossia_type t;
                    try { t = Ossia.Value.GetOssiaType(prop.PropertyType); } catch { continue; }

                    // Create an attribute to bind the property.
                    var oep = new OssiaEnabledProperty(prop, prop.Name, ossia_c, t);
                    ossia_c.properties.Add(oep);
                    controller.Register(oep);
                }
            }
        }
        void RegisterComponent(Component component, Ossia.Node node)
        {
            var flags      = BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly;
            var fields     = component.GetType().GetFields(flags);
            var properties = component.GetType().GetProperties();

            if (fields.Length == 0 && properties.Length == 0)
            {
                return;
            }

            // Create a node for the component
            var ossia_c = new OssiaEnabledComponent(component, node);

            ossia_components.Add(ossia_c);

            // Create nodes for all the fields that were exposed
            foreach (var field in fields)
            {
                // Get the type of the field
                ossia_type t;
                try {
                    t = Ossia.Value.GetOssiaType(field.FieldType);
                } catch {
                    continue;
                }

                // Create an attribute to bind the field.
                var oep = new OssiaEnabledField(field, field.Name, ossia_c, t);
                ossia_c.fields.Add(oep);
                controller.Register(oep);
            }


            // Create nodes for all the fields that were exposed
            foreach (PropertyInfo prop in properties)
            {
                var prop_t = prop.PropertyType;
                Debug.Log("Prop: " + prop.Name + " => " + prop.PropertyType.ToString());
                if (prop_t == typeof(UnityEngine.Transform))
                {
                    // TODO
                }
                else if (prop_t == typeof(UnityEngine.Component))
                {
                    try {
                        var subcomp = (Component)prop.GetValue(component, null);
                        var subnode = node.AddChild(prop.Name);
                        RegisterComponent(subcomp, subnode);
                    } catch {
                    }
                }
                else
                {
                    // Get the type of the field
                    ossia_type t;
                    try {
                        t = Ossia.Value.GetOssiaType(prop_t);
                    } catch {
                        continue;
                    }

                    var oep = new OssiaEnabledProperty(prop, prop.Name, ossia_c, t);
                    ossia_c.properties.Add(oep);
                    controller.Register(oep);
                }
            }
        }