コード例 #1
0
 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));
 }
コード例 #2
0
 public FloatCondition(ComponentInfo info) : base(info)
 {
     Error.Value = 0.1f;
 }
コード例 #3
0
 public MacroNode(ComponentInfo info) : this()
 {
     if(!string.IsNullOrEmpty(info.Name)) Name = info.Name;
     Label = new GUIContent(Name, info.Description);
 }