コード例 #1
0
        private static void PreferenceOnGUI()
        {
            EditorUIHelper.BeginHorizontal();
            {
                EditorUIHelper.Button("读取", () =>
                {
                    _externalSo = null;
                });

                EditorUIHelper.Button("保存", SaveScriptableObject);

                EditorUIHelper.Button("增加", () =>
                {
                    ExternalSo.ToolList.Add(new ExternalScriptableObject.ExternalTool());
                });
            }
            EditorUIHelper.EndHorizontal();

            _scroll = EditorUIHelper.BeginScrollView(_scroll);
            {
                foreach (var externalTool in ExternalSo.ToolList)
                {
                    EditorUIHelper.Space();
                    externalTool.ToolPath = EditorUIHelper.TextField("路径:", externalTool.ToolPath);

                    externalTool.Extension = EditorUIHelper.TextField("后缀:", externalTool.Extension);

                    var tool = externalTool;
                    EditorUIHelper.Button("删", () =>
                    {
                        EditorApplication.delayCall += () =>
                        {
                            ExternalSo.ToolList.Remove(tool);
                        };
                    });
                }
            }
            EditorUIHelper.EndScrollView();
        }
コード例 #2
0
        protected override void CustomOnGUI()
        {
            EditorUIHelper.BeginHorizontal();
            {
                _searchType = EditorUIHelper.SearchCancelTextField(_searchType);
                EditorUIHelper.Button("Caculate", Calculate);
                EditorUIHelper.Button("CaculateAll", CaulateAll);
            }
            EditorUIHelper.EndHorizontal();

            _scroll = EditorUIHelper.BeginScrollView(_scroll);
            {
                foreach (var keyValue in _monoFieldDict)
                {
                    EditorUIHelper.DrawLine();
                    EditorUIHelper.TextField("Type:", keyValue.Key);

                    foreach (var method in keyValue.Value)
                    {
                        EditorUIHelper.TextField("Field:", method);
                    }
                }

                EditorUIHelper.Space();
                foreach (var keyValue in _monoMethodDict)
                {
                    EditorUIHelper.DrawLine();
                    EditorUIHelper.TextField("Type:", keyValue.Key);

                    foreach (var method in keyValue.Value)
                    {
                        EditorUIHelper.TextField("Method:", method);
                    }
                }
            }
            EditorUIHelper.EndScrollView();
        }
コード例 #3
0
 protected virtual void ShowSettingPanel(V setting)
 {
     setting.Match = EditorUIHelper.EnumPopup <MatchType>(setting.Match, "Match");
     setting.Path  = EditorUIHelper.TextField("Path", setting.Path);
 }