示例#1
0
        private void AppendNewTypeFormatter(ReorderableList listTarget)
        {
            Action <string> SubmitCallback = (string data) =>
            {
                Type type = QuantumParser.ParseType(data);
                if (type == null)
                {
                    throw new ArgumentException($"No type of name '{data}' could be found. Are you missing a namespace?");
                }

                Undo.RecordObject(_themeInstance, "Added a new Type Formatter");
                _themeInstance.TypeFormatters.Add(new TypeColorFormatter(type));
                EditorUtility.SetDirty(_themeInstance);
            };

            PopupWindow.Show(new Rect(5, 5, 0, 0), new DataEntryPopup("Type Name", "Create Type Formatter", SubmitCallback));
        }
示例#2
0
 public override Type Parse(string value)
 {
     return(QuantumParser.ParseType(value));
 }
示例#3
0
 [Command] public static void Remove(string name) => QuantumParser.RemoveNamespace(name);
示例#4
0
 [Command] public static void Add(string name) => QuantumParser.AddNamespace(name);
示例#5
0
 [Command] public static void Reset() => QuantumParser.ResetNamespaceTable();
示例#6
0
 [Command] public static void List() => QuantumParser.GetAllNamespaces();