Exemplo n.º 1
0
        protected void OnEnable()
        {
            titleContent       = new GUIContent("Node Explorer", EditorGUIUtility.Load("React/ReactIcon.png") as Texture2D);
            categories["Core"] = new List <SearchResult>();

            foreach (var registeredType in ReactTypeRegister.AllTypes)
            {
                var type = registeredType.type;
                if (ReactTypeRegister.IsCoreNode(type) || ReactTypeRegister.IsCoreDecorator(type))
                {
                    categories["Core"].Add(new SearchResult()
                    {
                        niceName = registeredType.niceName, type = registeredType.type, signature = registeredType.signature
                    });
                }
                else
                {
                    var parts = registeredType.menuPath.Split('/');
                    List <SearchResult> results;
                    if (!categories.TryGetValue(parts[0], out results))
                    {
                        results = categories[parts[0]] = new List <SearchResult>();
                    }
                    results.Add(new SearchResult()
                    {
                        niceName = registeredType.niceName, type = registeredType.type, signature = registeredType.signature
                    });
                }
            }
            view = position;
        }
Exemplo n.º 2
0
        public void LoadDefaultResults()
        {
            foreach (var registeredType in ReactTypeRegister.AllTypes)
            {
                var type = registeredType.type;
                if (ReactTypeRegister.IsCoreNode(type) || ReactTypeRegister.IsCoreDecorator(type))
                {
                    if (target.IsValidParent(registeredType.type, target.reactor.hotNode))
                    {
                        searchResults.Add(new SearchResult()
                        {
                            niceName = registeredType.niceName, type = registeredType.type, signature = registeredType.signature
                        });
                    }
                }
            }
            searchResults.Sort((A, B) => A.niceName.CompareTo(B.niceName));

            titleContent = new GUIContent("Node Search", EditorGUIUtility.Load("React/ReactIcon.png") as Texture2D);
        }