public JSScriptClassPathHint(string sourceFile, string modulePath, string className, JSScriptClassType classType)
 {
     this.sourceFile = sourceFile;
     this.modulePath = modulePath;
     this.className  = className;
     this.classPath  = JSScriptRef.ToClassPath(modulePath, className);
     this.classType  = classType;
 }
 private void OnModuleSourceChanged(string modulePath, JSScriptClassType classTypes)
 {
     if ((classTypes & JSScriptClassType.Editor) != 0)
     {
         if (_runtime != null && _runtime.isValid && !EditorApplication.isCompiling)
         {
             _runtime.ResolveModule(modulePath);
         }
     }
 }
        public static bool Show(Rect rect, string searchString, JSScriptClassType searchType, Action <JSScriptClassPathHint> selectCallback)
        {
            CloseAllOpenWindows <JSScriptSearchWindow>();
            var window = ScriptableObject.CreateInstance <JSScriptSearchWindow>();

            window._searchString   = searchString;
            window._selectCallback = selectCallback;
            window._searchType     = searchType;
            window.Init(rect);
            return(true);
        }
Exemple #4
0
        public bool Search(string pattern, JSScriptClassType classType, List <JSScriptClassPathHint> results)
        {
            foreach (var pair in _scriptClassPaths)
            {
                //TODO: need optimization
                if (pair.Value.classType == classType && (string.IsNullOrEmpty(pattern) || pair.Key.Contains(pattern)))
                {
                    results.Add(pair.Value);
                }
            }

            return(true);
        }
 void Awake()
 {
     _target    = target as T;
     _classType = GetScriptClassType();
 }
Exemple #6
0
 public bool Search(JSScriptClassType classType, List <JSScriptClassPathHint> results)
 {
     return(Search(null, classType, results));
 }