GetProjectBrowserIfExists() private static method

private static GetProjectBrowserIfExists ( ) : ProjectBrowser
return ProjectBrowser
        internal static void FrameObjectInProjectWindow(int instanceID)
        {
            ProjectBrowser projectBrowserIfExists = ProjectWindowUtil.GetProjectBrowserIfExists();

            if (projectBrowserIfExists)
            {
                projectBrowserIfExists.FrameObject(instanceID, false);
            }
        }
Beispiel #2
0
        internal static string GetActiveFolderPath()
        {
            ProjectBrowser projectBrowserIfExists = ProjectWindowUtil.GetProjectBrowserIfExists();

            if (projectBrowserIfExists == null)
            {
                return("Assets");
            }
            return(projectBrowserIfExists.GetActiveFolderPath());
        }
        internal static void FrameObjectInProjectWindow(int instanceID)
        {
            ProjectBrowser projectBrowserIfExists = ProjectWindowUtil.GetProjectBrowserIfExists();

            if (!(bool)((UnityEngine.Object)projectBrowserIfExists))
            {
                return;
            }
            projectBrowserIfExists.FrameObject(instanceID, false);
        }
        internal static string GetActiveFolderPath()
        {
            ProjectBrowser projectBrowserIfExists = ProjectWindowUtil.GetProjectBrowserIfExists();
            string         result;

            if (projectBrowserIfExists == null)
            {
                result = "Assets";
            }
            else
            {
                result = projectBrowserIfExists.GetActiveFolderPath();
            }
            return(result);
        }
        public static void StartNameEditingIfProjectWindowExists(int instanceID, EndNameEditAction endAction, string pathName, Texture2D icon, string resourceFile)
        {
            ProjectBrowser projectBrowserIfExists = ProjectWindowUtil.GetProjectBrowserIfExists();

            if (projectBrowserIfExists)
            {
                projectBrowserIfExists.Focus();
                projectBrowserIfExists.BeginPreimportedNameEditing(instanceID, endAction, pathName, icon, resourceFile);
                projectBrowserIfExists.Repaint();
            }
            else
            {
                if (!pathName.StartsWith("assets/", StringComparison.CurrentCultureIgnoreCase))
                {
                    pathName = "Assets/" + pathName;
                }
                ProjectWindowUtil.EndNameEditAction(endAction, instanceID, pathName, resourceFile);
                Selection.activeObject = EditorUtility.InstanceIDToObject(instanceID);
            }
        }