Exemplo n.º 1
0
 void OnGUI()
 {
     _method = (ModifyMethod)EditorGUILayout.EnumPopup(new GUIContent("功能"), _method, new GUILayoutOption[0]);
     if (_method == ModifyMethod.Replace)
     {
         DrawReplaceWindow();
     }
     else if (_method == ModifyMethod.Find)
     {
         DrawFindWindow();
     }
 }
Exemplo n.º 2
0
        public Function Modify(ModifyMethod method, double value)
        {
            switch (method)
            {
            case ModifyMethod.Minimum:
                return(new Function(Name, x =>
                {
                    var calc = _func(x);
                    return calc > value ? value : calc;
                }, From, To));

            case ModifyMethod.Production:
                return(new Function(Name, x => value * _func(x), From, To));

            default:
                return(null);
            }
        }