private void CreatePackageDirectories() { GUILayout.Label("Create a package:", EditorStyles.boldLabel); GUILayout.BeginHorizontal(); m_packageInformation = (PackageBuildInformationObject)EditorGUILayout.ObjectField(m_packageInformation, typeof(PackageBuildInformationObject)); // RenameAsset(); GUILayout.EndHorizontal(); if (m_packageInformation != null) { PackageBuildInformation package = m_packageInformation.m_data; UnityPackageEditorDrawer.DrawPackageEditor(ref m_gitLinkedToSelectedAsset, package); } if (m_packageInformation == null) { if (GUILayout.Button("Create Default")) { m_packageInformation = (PackageBuildInformationObject)ScriptableUtility.CreateScritableAsset <PackageBuildInformationObject>(m_gitfolderName + "/" + m_whereToCreateScritpable, "Package_" + m_gitfolderName, false); if (m_fullPackage) { m_fullPackage.m_package = m_packageInformation; } } } if (m_fullPackage && m_packageInformation) { m_fullPackage.m_package = m_packageInformation; } }
public override void OnInspectorGUI() { DrawDefaultInspector(); ManifestFromWeb myScript = (ManifestFromWeb)target; GUILayout.BeginHorizontal(); if (GUILayout.Button("Reload")) { myScript.DownloadWebManifest(); } if (GUILayout.Button("Merge")) { Utility_ManifestJson manifest = UnityPackageUtility.GetManifest(); manifest.Add(myScript.m_manifest.dependencies); UnityPackageUtility.SetManifest(manifest); AssetDatabase.Refresh(); } if (GUILayout.Button("Override")) { UnityPackageUtility.SetManifest(myScript.m_manifest); AssetDatabase.Refresh(); } GUILayout.EndHorizontal(); UnityPackageEditorDrawer.DrawManifrest(ref myScript.m_manifest, ref myScript.m_toAddName, ref myScript.m_toAddValue, ref myScript.m_scollState, false); }
void OnGUI() { DrawPackageManager(); m_currentManifest = EditorGUILayout.Foldout(m_currentManifest, "Current manifest"); if (m_currentManifest) { UnityPackageEditorDrawer.DrawManifrest(ref m_manifestInfo, ref m_manifestaddNamespace, ref m_manifestaddgitlink, ref scollrPackagePosition); } EditorGUILayout.HelpBox("Reminder: Git must be install and Git.exe must be add in System Variable Path.", MessageType.Warning, true); }
void OnGUI() { GUILayout.Label("Manifest Configuration", EditorStyles.boldLabel); UnityPackageEditorDrawer.DrawManifrest(ref m_info.m_manifestInfo, ref m_info.m_manifestaddNamespace, ref m_info.m_manifestaddgitlink, ref m_info.m_scollValue); m_info.m_windowScrollValue = EditorGUILayout.BeginScrollView(m_info.m_windowScrollValue, false, false); GUILayout.Label("Copy past gits", EditorStyles.boldLabel); EditorGUILayout.HelpBox("Copy/past your git links split by a line return '\\n'", MessageType.Info); if (GUILayout.Button("Load in the manifest")) { string[] lines = m_info.m_pastSeveralLinks.Split('\n'); for (int i = 0; i < lines.Length; i++) { string l = lines[i]; l = l.Trim(); string nameId; bool found; DownloadInfoFromGitServer.LoadNamespaceFromProjectGitLink(l, out found, out nameId); if (found) { if (l.ToLower().IndexOf(".git") < 0) { l += ".git"; } m_info.m_manifestInfo.Add(nameId, l); } } m_info.m_pastSeveralLinks = ""; } GUILayout.BeginHorizontal(); //https://raw.githubusercontent.com/EloiStree/UnityToolbox/master/CopyPast/GitLinks/TestGroup.md List <string> urlsFound; if (GUILayout.Button("Extract gits")) { DownloadInfoFromGitServer.LoadGitClassicGitLinksInUrl(m_info.givenUrlLink, out urlsFound); for (int i = 0; i < urlsFound.Count; i++) { m_info.m_pastSeveralLinks += urlsFound[i].Trim() + '\n'; } } m_info.givenUrlLink = GUILayout.TextField(m_info.givenUrlLink); GUILayout.EndHorizontal(); //be.eloistree.teleportvirtualrealityuser m_info.m_pastSeveralLinks = GUILayout.TextArea(m_info.m_pastSeveralLinks, GUILayout.MinHeight(200)); EditorGUILayout.EndScrollView(); }
void OnGUI() { EditorGUILayout.BeginHorizontal(); GUILayout.Label("Back-up:", EditorStyles.boldLabel); if (GUILayout.Button("Save")) { WindowPlayerPref.Save("PackageBasicBuilderBackup", JsonUtility.ToJson(m_info)); } if (WindowPlayerPref.Has("PackageBasicBuilderBackup") && GUILayout.Button("Load")) { try { string json = WindowPlayerPref.Load("PackageBasicBuilderBackup"); Info i = JsonUtility.FromJson <Info>(json); if (i != null) { m_info = i; } } catch (Exception) { } } EditorGUILayout.EndHorizontal(); m_info.m_selector = null; m_info.m_targetedGit = null; UnityPathSelectionInfo.Get(out m_info.m_selectorpathFound, out m_info.m_selector); AccessGitWithPathSelector.GetAffectedGit(m_info.m_selector, out m_info.m_targetedGit); if (m_info.m_targetedGit != null) { string p = m_info.m_targetedGit.GetRelativeDirectoryPath(); m_info.m_selector = new UnityPathSelectionInfo(p); } EditorGUILayout.HelpBox("Reminder: Git must be install and Git.exe must be add in System Variable Path.", MessageType.Warning, true); m_info.m_packageTargeted = PackageJsonUtility.GetPackageFile(m_info.m_selector); if (GUILayout.Button("Select: " + m_info.m_selector.GetSelectName(false))) { m_info.m_selector.Open(); } if (m_info.m_targetedGit == null) { string path = m_info.m_selector.GetAbsolutePath(true); if (GUILayout.Button("Git Init. in " + m_info.m_selector.GetSelectName(true))) { QuickGit.CreateLocal(path); } GitForFacilitationEditor.ProposeCloneProject(m_info.m_selector, ref m_info.m_tmpCloneProposed); GitForFacilitationEditor.ProposeToCreateFolder(m_info.m_selector, ref m_info.m_tmpFolderToCreate); } else { if (!m_info.m_targetedGit.IsHosted()) { GitForFacilitationEditor.PushLocalGitToOnlineAccount(m_info.m_targetedGit, ref m_info.m_userNameToCreateGit, ref m_info.m_projectNameToCreate, ref m_info.m_dropDownSelectionServer, ref m_info.m_hideGitUtilitary); } GUILayout.Space(20); if (GUILayout.Button("Git: " + m_info.m_selector.GetSelectName(true), EditorStyles.boldLabel)) { Application.OpenURL(m_info.m_selector.GetAbsolutePath(false)); } if (QuickGit.IsPathHasGitRootFolder(m_info.m_selector.GetAbsolutePath(true))) { GitEditorDrawer.DisplayGitCommands(m_info.m_targetedGit); UnityPackageEditorDrawer.DrawPackageDownUpButton(m_info.m_targetedGit, true); } PackageJsonEditor.DrawEditorDefaultInterface(m_info.m_selector, m_info.m_packageTargeted, ref m_info.m_packageBuilder, ref m_info.m_tmpPackageJsonProposition, ref m_info.m_tmp_rawDisplayJsonPackage, ref m_info.m_hidePackageBuilder);; } }