public ComponentFactory(Type component, ComponentInfo info) { Info = info; Component = component; //parse name and create GUIContent Name = Info == null || string.IsNullOrEmpty(Info.Name)? Utils.ParseCamelCase(Component.Name.Replace(typeof(T).Name, "")) : Info.Name; if (Info != null && !string.IsNullOrEmpty(Info.Description)) { Label = new GUIContent(Name, Info.Description); } else { Label = new GUIContent(Name); } //make generic factory method Create = (Factory)Delegate .CreateDelegate(typeof(Factory), this, GetType() .GetMethod("CreateComponent", BindingFlags.Instance | BindingFlags.NonPublic) .MakeGenericMethod(Component)); }
public FloatCondition(ComponentInfo info) : base(info) { Error.Value = 0.1f; }
public MacroNode(ComponentInfo info) : this() { if(!string.IsNullOrEmpty(info.Name)) Name = info.Name; Label = new GUIContent(Name, info.Description); }