예제 #1
0
 void OnEnable()
 {
     if (autocompleteSearchField == null)
     {
         autocompleteSearchField = new AutocompleteSearchField();
     }
     autocompleteSearchField.onInputChanged = OnInputChanged;
     autocompleteSearchField.onConfirm      = OnConfirm;
 }
예제 #2
0
            public Drawer(SerializedProperty property)
            {
                _targetProperty = property.FindPropertyRelative("_assemblyQualifiedName");
                _selectedType   = Type.GetType(_targetProperty.stringValue);

                _assemblySearch = new AutocompleteSearchField();
                _assemblySearch.searchString     = _selectedType != null ? _selectedType.FullName : "";
                _assemblySearch.inPropertyDrawer = true;
                _assemblySearch.maxResults       = 25;
                _assemblySearch.onInputChanged  += OnInputChanged;
                _assemblySearch.onConfirm       += OnConfirm;
            }
 void OnEnable()
 {
     if (EditorPrefs.HasKey("ObjectPath"))
     {
         string objectPath = EditorPrefs.GetString("ObjectPath");
         languageListObj = AssetDatabase.LoadAssetAtPath(objectPath, typeof(LanguageList)) as LanguageList;
     }
     if (autocompleteSearchField == null)
     {
         autocompleteSearchField = new AutocompleteSearchField();
     }
     autocompleteSearchField.onInputChanged = OnInputChanged;
     autocompleteSearchField.onConfirm      = OnConfirm;
 }
예제 #4
0
        public override void OnOpen()
        {
            if (nodeSearchField == null)
            {
                nodeSearchField = new AutocompleteSearchField();
                nodeSearchField.onInputChanged = OnNodeSearchFieldInputChanged;
                nodeSearchField.onConfirm      = OnNodeSearchFieldConfirm;
            }

            nodeSearchPaths.Clear();
            for (int i = 0; i < BTEditorDefine.NodeCfgs.Count; ++i)
            {
                FTNodeCfg cfgNode = BTEditorDefine.NodeCfgs[i];
                nodeSearchPaths.Add(cfgNode.path);
            }

            toolbarRect = new Rect(0, 0, Screen.width, TOOLBAR_HEIGHT);
            // NodeEditorWindow.current.blockMouseAreas.Add(toolbarRect);
        }
예제 #5
0
    void Setup(List <string> available_options, string existing_value = null)
    {
        if (existing_value != null)
        {
            existing_value = existing_value.Trim();
            textInput      = existing_value;
        }

        autocompleteSearchField = new AutocompleteSearchField();
        autocompleteSearchField.searchString   = textInput;
        autocompleteSearchField.onInputChanged = OnInputChanged;
        autocompleteSearchField.onConfirm      = OnConfirm;

        searchPaths = new List <string>(available_options);

        searchPaths.Sort((s1, s2) => s1.CompareTo(s2));
        matches = new List <SearchMatch>(searchPaths.Count);

        OnInputChanged(autocompleteSearchField.searchString);
    }