예제 #1
0
    /// <summary>
    /// Creates the brush.
    /// </summary>
    /// <returns>The new brush.</returns>
    /// <param name="stroke">Stroke.</param>
    /// <param name="name">Name.</param>
    /// <param name="options">Options.</param>
    public static IBrush CreateBrush(Stroke stroke, BrushType type, Dictionary <string, object> newOptions)
    {
        // if unable to instantiate, return LineBrush with default options by default
        // prerequisite: enum BrushType is constant with Brush class name
        IBrush o = (ScriptableObject.CreateInstance(type.ToString()) as IBrush) ?? ScriptableObject.CreateInstance <LineBrush> ();

        o.Initialize(stroke, newOptions);
        return(o);
    }