EndNameEditAction() static private method

static private EndNameEditAction ( UnityEditor action, int instanceId, string pathName, string resourceFile ) : void
action UnityEditor
instanceId int
pathName string
resourceFile string
return void
Example #1
0
        public void EndNewAssetCreation(string name)
        {
            string            pathName  = this.folder + "/" + name + this.extension;
            EndNameEditAction endAction = this.m_EndAction;
            int    instanceID           = this.m_InstanceID;
            string resourceFile         = this.m_ResourceFile;

            this.Clear();
            ProjectWindowUtil.EndNameEditAction(endAction, instanceID, pathName, resourceFile);
        }
        public void EndNewAssetCreationCanceled(string name)
        {
            string path = folder + "/" + name;

            if ((!String.IsNullOrEmpty(extension)) && (!path.EndsWith(extension, System.StringComparison.OrdinalIgnoreCase)))
            {
                path = path + extension;
            }
            ProjectWindowUtil.EndNameEditAction(m_EndAction, m_InstanceID, path, m_ResourceFile, false);
        }
Example #3
0
        // The asset is created here
        public void EndNewAssetCreation(string name)
        {
            string            path      = folder + "/" + name + extension;
            EndNameEditAction endAction = m_EndAction;
            int    instanceID           = m_InstanceID;
            string resourceFile         = m_ResourceFile;

            Clear(); // Ensure clear if anything goes bad in EndNameEditAction and gui is exited.

            ProjectWindowUtil.EndNameEditAction(endAction, instanceID, path, resourceFile);
        }
        // The asset is created here
        public void EndNewAssetCreation(string name)
        {
            string path = folder + "/" + name;

            if ((!String.IsNullOrEmpty(extension)) && (!path.EndsWith(extension, System.StringComparison.OrdinalIgnoreCase)))
            {
                path = path + extension;
            }
            EndNameEditAction endAction = m_EndAction;
            int    instanceID           = m_InstanceID;
            string resourceFile         = m_ResourceFile;

            Clear(); // Ensure clear if anything goes bad in EndNameEditAction and gui is exited.

            ProjectWindowUtil.EndNameEditAction(endAction, instanceID, path, resourceFile, true);
        }
        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);
            }
        }
        public void EndNewAssetCreationCanceled(string name)
        {
            string path = folder + "/" + name + extension;

            ProjectWindowUtil.EndNameEditAction(m_EndAction, m_InstanceID, path, m_ResourceFile, false);
        }