All pastes #618274 Raw Edit

Untitled

public text v1 · immutable
·published 2007-07-13 21:22 UTC
rendered paste body
			GCHandle instance_handle = GCHandle.Alloc (instance);
			IntPtr plugin_wrapper = create_scriptable_object_wrapper ();
			Type t = instance.GetType();

			
			foreach (PropertyInfo pi in type.GetProperties ()) {
				if (pi.GetCustomAttributes (typeof (ScriptableAttribute), false).Length == 0)
					continue;

				TypeCode tc = Type.GetTypeCode (pi.PropertyType);

				scriptable_object_add_property (plugin_wrapper,
								pi.Name,
								tc,
								pi.CanRead,
								pi.CanWrite);
			}