static SyncVS() { EditorUserBuildSettings.activeBuildTargetChanged += new System.Action(SyncVS.SyncVisualStudioProjectIfItAlreadyExists); try { SyncVS.InstalledVisualStudios = SyncVS.GetInstalledVisualStudios() as Dictionary <VisualStudioVersion, string>; } catch (Exception ex) { Console.WriteLine("Error detecting Visual Studio installations: {0}{1}{2}", (object)ex.Message, (object)Environment.NewLine, (object)ex.StackTrace); SyncVS.InstalledVisualStudios = new Dictionary <VisualStudioVersion, string>(); } SyncVS.SetVisualStudioAsEditorIfNoEditorWasSet(); UnityVSSupport.Initialize(); }
static SyncVS() { SyncVS.Synchronizer = new SolutionSynchronizer(Directory.GetParent(Application.dataPath).FullName, new SyncVS.SolutionSynchronizationSettings()); try { SyncVS.InstalledVisualStudios = (SyncVS.GetInstalledVisualStudios() as Dictionary <VisualStudioVersion, VisualStudioPath[]>); } catch (Exception ex) { Console.WriteLine("Error detecting Visual Studio installations: {0}{1}{2}", ex.Message, Environment.NewLine, ex.StackTrace); SyncVS.InstalledVisualStudios = new Dictionary <VisualStudioVersion, VisualStudioPath[]>(); } SyncVS.SetVisualStudioAsEditorIfNoEditorWasSet(); UnityVSSupport.Initialize(); }
static SyncVS() { EditorUserBuildSettings.activeBuildTargetChanged = (Action)Delegate.Combine(EditorUserBuildSettings.activeBuildTargetChanged, new Action(SyncVS.SyncVisualStudioProjectIfItAlreadyExists)); try { InstalledVisualStudios = GetInstalledVisualStudios() as Dictionary <VisualStudioVersion, string>; } catch (Exception exception) { Console.WriteLine("Error detecting Visual Studio installations: {0}{1}{2}", exception.Message, Environment.NewLine, exception.StackTrace); InstalledVisualStudios = new Dictionary <VisualStudioVersion, string>(); } SetVisualStudioAsEditorIfNoEditorWasSet(); UnityVSSupport.Initialize(); }
static SyncVS() { SyncVS.Synchronizer = new SolutionSynchronizer(Directory.GetParent(Application.dataPath).FullName, new SyncVS.SolutionSynchronizationSettings()); EditorUserBuildSettings.activeBuildTargetChanged = (Action)Delegate.Combine(EditorUserBuildSettings.activeBuildTargetChanged, new Action(SyncVS.SyncVisualStudioProjectIfItAlreadyExists)); try { SyncVS.InstalledVisualStudios = (SyncVS.GetInstalledVisualStudios() as Dictionary <VisualStudioVersion, string>); } catch (Exception ex) { Console.WriteLine("Error detecting Visual Studio installations: {0}{1}{2}", ex.Message, Environment.NewLine, ex.StackTrace); SyncVS.InstalledVisualStudios = new Dictionary <VisualStudioVersion, string>(); } SyncVS.SetVisualStudioAsEditorIfNoEditorWasSet(); UnityVSSupport.Initialize(); }
public static ScriptEditor GetScriptEditorFromPath(string path) { string lowerCasePath = path.ToLower(); if (lowerCasePath == CodeEditor.SystemDefaultPath) { return(ScriptEditor.SystemDefault); } // Disable internal Visual Studio if the package is loaded. if (!UnityVSSupport.IsDefaultExternalCodeEditor()) { return(ScriptEditor.Other); } if (lowerCasePath.Contains("monodevelop") || lowerCasePath.Contains("xamarinstudio") || lowerCasePath.Contains("xamarin studio")) { return(ScriptEditor.MonoDevelop); } if (lowerCasePath.EndsWith("devenv.exe")) { return(ScriptEditor.VisualStudio); } if (lowerCasePath.EndsWith("vcsexpress.exe") || lowerCasePath.EndsWith("wdexpress.exe")) { return(ScriptEditor.VisualStudioExpress); } // Visual Studio for Mac is based on MonoDevelop if (IsVisualStudioForMac(path)) { return(ScriptEditor.MonoDevelop); } return(ScriptEditor.Other); }
public void OnGUI() { AboutWindow.LoadLogos(); GUILayout.Space(10f); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.Space(5f); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUILayout.Label(AboutWindow.s_Header, GUIStyle.none, new GUILayoutOption[0]); this.ListenForSecretCodes(); string text = string.Empty; if (InternalEditorUtility.HasFreeLicense()) { text = " Personal"; } if (InternalEditorUtility.HasEduLicense()) { text = " Edu"; } GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.Space(52f); string text2 = this.FormatExtensionVersionString(); this.m_ShowDetailedVersion |= Event.current.alt; if (this.m_ShowDetailedVersion) { int unityVersionDate = InternalEditorUtility.GetUnityVersionDate(); DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0); string unityBuildBranch = InternalEditorUtility.GetUnityBuildBranch(); string text3 = string.Empty; if (unityBuildBranch.Length > 0) { text3 = "Branch: " + unityBuildBranch; } EditorGUILayout.SelectableLabel(string.Format("Version {0}{1}{2}\n{3:r}\n{4}", new object[] { InternalEditorUtility.GetFullUnityVersion(), text, text2, dateTime.AddSeconds((double)unityVersionDate), text3 }), new GUILayoutOption[] { GUILayout.Width(400f), GUILayout.Height(42f) }); this.m_TextInitialYPos = 108f; } else { GUILayout.Label(string.Format("Version {0}{1}{2}", Application.unityVersion, text, text2), new GUILayoutOption[0]); } if (Event.current.type == EventType.ValidateCommand) { return; } GUILayout.EndHorizontal(); GUILayout.Space(4f); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); float creditsWidth = base.position.width - 10f; float num = this.m_TextYPos; GUI.BeginGroup(GUILayoutUtility.GetRect(10f, this.m_TextInitialYPos)); string[] nameChunks = AboutWindowNames.nameChunks; for (int i = 0; i < nameChunks.Length; i++) { string nameChunk = nameChunks[i]; num = AboutWindow.DoCreditsNameChunk(nameChunk, creditsWidth, num); } num = AboutWindow.DoCreditsNameChunk("Thanks to Forest 'Yoggy' Johnson, Graham McAllister, David Janik-Jones, Raimund Schumacher, Alan J. Dickins and Emil 'Humus' Persson", creditsWidth, num); this.m_TotalCreditsHeight = num - this.m_TextYPos; GUI.EndGroup(); GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.Label(AboutWindow.s_MonoLogo, new GUILayoutOption[0]); GUILayout.Label("Scripting powered by The Mono Project.\n\n(c) 2011 Novell, Inc.", "MiniLabel", new GUILayoutOption[] { GUILayout.Width(200f) }); GUILayout.Label(AboutWindow.s_AgeiaLogo, new GUILayoutOption[0]); GUILayout.Label("Physics powered by PhysX.\n\n(c) 2011 NVIDIA Corporation.", "MiniLabel", new GUILayoutOption[] { GUILayout.Width(200f) }); GUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.Space(5f); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.FlexibleSpace(); string aboutWindowLabel = UnityVSSupport.GetAboutWindowLabel(); if (aboutWindowLabel.Length > 0) { GUILayout.Label(aboutWindowLabel, "MiniLabel", new GUILayoutOption[0]); } GUILayout.Label(InternalEditorUtility.GetUnityCopyright(), "MiniLabel", new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.Space(10f); GUILayout.FlexibleSpace(); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUILayout.Label(InternalEditorUtility.GetLicenseInfo(), "AboutWindowLicenseLabel", new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.Space(5f); GUILayout.EndHorizontal(); GUILayout.Space(5f); }
public void OnGUI() { LoadLogos(); GUILayout.Space(10); GUILayout.BeginHorizontal(); GUILayout.Space(5); GUILayout.BeginVertical(); GUILayout.FlexibleSpace(); GUILayout.Label(s_Header, GUIStyle.none); ListenForSecretCodes(); var licenseTypeString = ""; if (InternalEditorUtility.HasFreeLicense()) { licenseTypeString = " Personal"; } if (InternalEditorUtility.HasEduLicense()) { licenseTypeString = " Edu"; } GUILayout.BeginHorizontal(); GUILayout.Space(52f); // Ident version information string extensionVersion = FormatExtensionVersionString(); m_ShowDetailedVersion |= Event.current.alt; if (m_ShowDetailedVersion) { int t = InternalEditorUtility.GetUnityVersionDate(); DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0, 0); string branch = InternalEditorUtility.GetUnityBuildBranch(); string branchString = ""; if (branch.Length > 0) { branchString = "Branch: " + branch; } EditorGUILayout.SelectableLabel( string.Format("Version {0}{1}{2}\n{3:r}\n{4}", InternalEditorUtility.GetFullUnityVersion(), licenseTypeString, extensionVersion, dt.AddSeconds(t), branchString), GUILayout.Width(550), GUILayout.Height(42)); m_TextInitialYPos = 120 - 12; } else { GUILayout.Label(string.Format("Version {0}{1}{2}", Application.unityVersion, licenseTypeString, extensionVersion)); } if (Event.current.type == EventType.ValidateCommand) { return; } GUILayout.EndHorizontal(); GUILayout.Space(4); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); float creditsWidth = position.width - 10; float chunkOffset = m_TextYPos; Rect scrollAreaRect = GUILayoutUtility.GetRect(10, m_TextInitialYPos); GUI.BeginGroup(scrollAreaRect); foreach (string nameChunk in AboutWindowNames.Names(null, true)) { chunkOffset = DoCreditsNameChunk(nameChunk, creditsWidth, chunkOffset); } chunkOffset = DoCreditsNameChunk(kSpecialThanksNames, creditsWidth, chunkOffset); m_TotalCreditsHeight = chunkOffset - m_TextYPos; GUI.EndGroup(); HandleScrollEvents(scrollAreaRect); GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(); GUILayout.Label(s_MonoLogo); GUILayout.Label("Scripting powered by The Mono Project.\n\n(c) 2011 Novell, Inc.", "MiniLabel", GUILayout.Width(200)); GUILayout.Label(s_AgeiaLogo); GUILayout.Label("Physics powered by PhysX.\n\n(c) 2011 NVIDIA Corporation.", "MiniLabel", GUILayout.Width(200)); GUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(); GUILayout.Space(5); GUILayout.BeginVertical(); GUILayout.FlexibleSpace(); var VSTUlabel = UnityVSSupport.GetAboutWindowLabel(); if (VSTUlabel.Length > 0) { GUILayout.Label(VSTUlabel, "MiniLabel"); } GUILayout.Label(InternalEditorUtility.GetUnityCopyright(), "MiniLabel"); GUILayout.EndVertical(); GUILayout.Space(10); GUILayout.FlexibleSpace(); GUILayout.BeginVertical(); GUILayout.FlexibleSpace(); GUILayout.Label(InternalEditorUtility.GetLicenseInfo(), "AboutWindowLicenseLabel"); GUILayout.EndVertical(); GUILayout.Space(5); GUILayout.EndHorizontal(); GUILayout.Space(5); }
public void OnGUI() { LoadLogos(); GUILayout.Space(10f); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.Space(5f); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUILayout.Label(s_Header, GUIStyle.none, new GUILayoutOption[0]); this.ListenForSecretCodes(); string str = string.Empty; if (InternalEditorUtility.HasFreeLicense()) { str = " Personal"; } if (InternalEditorUtility.HasEduLicense()) { str = " Edu"; } GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.Space(52f); string str2 = this.FormatExtensionVersionString(); this.m_ShowDetailedVersion |= Event.current.alt; if (this.m_ShowDetailedVersion) { int unityVersionDate = InternalEditorUtility.GetUnityVersionDate(); DateTime time = new DateTime(0x7b2, 1, 1, 0, 0, 0, 0); string unityBuildBranch = InternalEditorUtility.GetUnityBuildBranch(); string str4 = string.Empty; if (unityBuildBranch.Length > 0) { str4 = "Branch: " + unityBuildBranch; } object[] args = new object[] { InternalEditorUtility.GetFullUnityVersion(), str, str2, time.AddSeconds((double)unityVersionDate), str4 }; GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.Width(400f), GUILayout.Height(42f) }; EditorGUILayout.SelectableLabel(string.Format("Version {0}{1}{2}\n{3:r}\n{4}", args), options); this.m_TextInitialYPos = 108f; } else { GUILayout.Label(string.Format("Version {0}{1}{2}", Application.unityVersion, str, str2), new GUILayoutOption[0]); } if (Event.current.type != EventType.ValidateCommand) { GUILayout.EndHorizontal(); GUILayout.Space(4f); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); GUI.BeginGroup(GUILayoutUtility.GetRect(10f, this.m_TextInitialYPos)); float width = base.position.width - 10f; float height = EditorStyles.wordWrappedLabel.CalcHeight(GUIContent.Temp(this.kCreditsNames), width); Rect position = new Rect(5f, this.m_TextYPos, width, height); GUI.Label(position, this.kCreditsNames, EditorStyles.wordWrappedLabel); float num4 = EditorStyles.wordWrappedMiniLabel.CalcHeight(GUIContent.Temp("Thanks to Forest 'Yoggy' Johnson, Graham McAllister, David Janik-Jones, Raimund Schumacher, Alan J. Dickins and Emil 'Humus' Persson"), width); Rect rect2 = new Rect(5f, this.m_TextYPos + height, width, num4); GUI.Label(rect2, "Thanks to Forest 'Yoggy' Johnson, Graham McAllister, David Janik-Jones, Raimund Schumacher, Alan J. Dickins and Emil 'Humus' Persson", EditorStyles.wordWrappedMiniLabel); GUI.EndGroup(); this.m_TotalCreditsHeight = height + num4; GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.Label(s_MonoLogo, new GUILayoutOption[0]); GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.Width(200f) }; GUILayout.Label("Scripting powered by The Mono Project.\n\n(c) 2011 Novell, Inc.", "MiniLabel", optionArray2); GUILayout.Label(s_AgeiaLogo, new GUILayoutOption[0]); GUILayoutOption[] optionArray3 = new GUILayoutOption[] { GUILayout.Width(200f) }; GUILayout.Label("Physics powered by PhysX.\n\n(c) 2011 NVIDIA Corporation.", "MiniLabel", optionArray3); GUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.Space(5f); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.FlexibleSpace(); string aboutWindowLabel = UnityVSSupport.GetAboutWindowLabel(); if (aboutWindowLabel.Length > 0) { GUILayout.Label(aboutWindowLabel, "MiniLabel", new GUILayoutOption[0]); } GUILayout.Label(InternalEditorUtility.GetUnityCopyright(), "MiniLabel", new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.Space(10f); GUILayout.FlexibleSpace(); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUILayout.Label(InternalEditorUtility.GetLicenseInfo(), "AboutWindowLicenseLabel", new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.Space(5f); GUILayout.EndHorizontal(); GUILayout.Space(5f); } }