private static void DialogCallback()
        {
            //Debug.Log("Adding style declaration for: " + className);

            // 1. reference declarations
            SerializedProperty declarations = GetDeclarations(_serializedObject);

            // 2. increase number of items
            declarations.arraySize += 1;

            // 3. get last (just created) item
            SerializedProperty declaration = declarations.GetArrayElementAtIndex(declarations.arraySize - 1);

            // 4. update serialized property
            _data.UpdateSerializedProperty(declaration);

            // 5. expand it
            declaration.isExpanded = true; // expand

            /*if (EditorSettings.LiveStyling)
             *  MediaQueryManager.Instance.Rescan();*/

            // process styles - live
            if (EditorSettings.LiveStyling)
            {
                Gui.ProcessStyles();
            }
        }
Exemplo n.º 2
0
        private static void DialogCallback()
        {
            _data.UpdateSerializedProperty(_declaration); // only this line is needed

            /*if (EditorSettings.LiveStyling)
             *  MediaQueryManager.Instance.Rescan();*/

            // process styles - live
            if (EditorSettings.LiveStyling)
            {
                Gui.ProcessStyles();
            }
        }