Esempio n. 1
0
        private void DrawContents()
        {
            var updateSearch = false;

            using (new EditorGUILayout.HorizontalScope())
            {
                GUILayout.FlexibleSpace();

                var before = searchText;
                var after  = EditorGUILayout.DelayedTextField(string.Empty, before, "SearchTextField", GUILayout.Width(200f));

                if (before != after)
                {
                    searchText   = after;
                    updateSearch = true;
                }

                if (GUILayout.Button(string.Empty, "SearchCancelButton", GUILayout.Width(18f)))
                {
                    searchText = string.Empty;
                    GUIUtility.keyboardControl = 0;
                    updateSearch = true;
                }
            }

            GUILayout.Space(2f);

            switch (selection)
            {
            case ViewType.Dependencies:
            {
                if (updateSearch)
                {
                    dependencyScrollView.ScrollPosition = Vector2.zero;
                    dependencyScrollView.Contents       = GetListOfDependentInfos();
                }

                dependencyScrollView.Draw();
            }
            break;

            case ViewType.Reference:
            {
                if (updateSearch)
                {
                    referenceScrollView.ScrollPosition = Vector2.zero;
                    referenceScrollView.Contents       = GetListOfReferenceInfos();
                }

                referenceScrollView.Draw();
            }
            break;
            }
        }
Esempio n. 2
0
        private void DrawDependencies()
        {
            if (selection != ViewType.Dependencies)
            {
                return;
            }

            using (new EditorGUILayout.HorizontalScope())
            {
                GUILayout.FlexibleSpace();

                var before = searchText;
                var after  = EditorGUILayout.TextField(string.Empty, before, "SearchTextField", GUILayout.Width(200f));

                if (before != after)
                {
                    searchText = after;

                    dependencyScrollView.ScrollPosition = Vector2.zero;
                    dependencyScrollView.Contents       = GetListOfDependentInfos();
                }

                if (GUILayout.Button(string.Empty, "SearchCancelButton", GUILayout.Width(18f)))
                {
                    searchText = string.Empty;
                    GUIUtility.keyboardControl = 0;

                    dependencyScrollView.ScrollPosition = Vector2.zero;
                    dependencyScrollView.Contents       = GetListOfDependentInfos();
                }
            }

            GUILayout.Space(2f);

            dependencyScrollView.Draw();
        }