public static Dictionary <string, object> GetDefaultOptions(string brushName) { IBrush o = (ScriptableObject.CreateInstance(brushName) as IBrush); if (o == null) { return(null); } return(o.GetOptions()); }
/// <summary> /// Gets the default options. /// </summary> /// <returns>The default options.</returns> /// <param name="brushName">Brush name.</param> public static Dictionary <string, object> GetDefaultOptions(BrushType type) { // prerequisite: enum BrushType is constant with Brush class name string name = type.ToString(); // create temporary instance of brush object IBrush o = (ScriptableObject.CreateInstance(name) as IBrush); // TODO: try catch "could not create instance exception" if (o == null) { return(null); } // TODO: release temporary object o return(o.GetOptions()); }