GetDefaultOptions() 공개 정적인 메소드

public static GetDefaultOptions ( string brushName ) : object>.Dictionary
brushName string
리턴 object>.Dictionary
예제 #1
0
    //===================================================
    void Start()
    {
        // Allocate space for strokes list
        strokes = new List <Stroke> ();
        // Allocaate space for options dictionary
        options = new Dictionary <BrushType, Dictionary <string, object> > ();

        //Debug.Log (BrushManager.AvailableBrushes.Count);

        // Load all default options for all available brushes
        foreach (var type in BrushManager.AvailableBrushes)
        {
            Dictionary <string, object> defaultOpt = BrushManager.GetDefaultOptions(type);
            // TODO: catch exception
            Dictionary <string, object> opt = new Dictionary <string, object> ();
            // loop through default options for specific brush type and add to temp opt
            foreach (var item in defaultOpt)
            {
                opt.Add(item.Key, item.Value);
            }

            options.Add(type, opt);
        }

        // Initialize selected brush with line brush
        SelectedBrush = BrushType.LineBrush;

        // Initialize curStroke with empty
        CurStroke = null;
        Debug.Log("CurStroke initialize: " + CurStroke);
        curStrokeIndex = 0;
        Debug.Log("CurStrokeIndex initialize: " + curStrokeIndex);
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        strokes = new List <Stroke>();

        options = new Dictionary <string, Dictionary <string, object> >();

        foreach (string name in BrushManager.AvailableBrushes)
        {
            Dictionary <string, object> defaultOpt = BrushManager.GetDefaultOptions(name);
            Dictionary <string, object> opt        = new Dictionary <string, object>();
            foreach (KeyValuePair <string, object> pair in defaultOpt)
            {
                opt.Add(pair.Key, pair.Value);
            }
            options.Add(name, opt);
        }
    }