using System; using UnityEditor; using UnityEngine; namespace AmplifyBloom { public class About : EditorWindow { private const string AboutImagePath = "AmplifyBloom/Textures/About.png"; private Vector2 m_scrollPosition = Vector2.zero; private Texture2D m_aboutImage; [MenuItem("Window/Amplify Bloom/About...", false, 20)] private static void Init() { About expr_1A = (About)EditorWindow.GetWindow(typeof(About), true, "About Amplify Bloom"); expr_1A.minSize=(new Vector2(502f, 290f)); expr_1A.maxSize=(new Vector2(502f, 290f)); expr_1A.Show(); } public void OnFocus() { string[] arg_10_0 = AssetDatabase.FindAssets("About t:Texture"); string text = ""; string[] array = arg_10_0; for (int i = 0; i < array.Length; i++) { string text2 = AssetDatabase.GUIDToAssetPath(array[i]); if (text2.EndsWith("AmplifyBloom/Textures/About.png")) { text = text2; break; } } if (!string.IsNullOrEmpty(text)) { TextureImporter textureImporter = AssetImporter.GetAtPath(text) as TextureImporter; if (textureImporter.textureType != (TextureImporterType)2) { textureImporter.textureType=((TextureImporterType)2); AssetDatabase.ImportAsset(text); } this.m_aboutImage = (AssetDatabase.LoadAssetAtPath(text, typeof(Texture2D)) as Texture2D); return; } Debug.LogWarning("[AmplifyBloom] About image not found at AmplifyBloom/Textures/About.png"); } public void OnGUI() { this.m_scrollPosition = GUILayout.BeginScrollView(this.m_scrollPosition, new GUILayoutOption[0]); GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.Space(10f); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUILayout.Box(this.m_aboutImage, GUIStyle.none, new GUILayoutOption[0]); if (Event.current.type == (EventType)1 && GUILayoutUtility.GetLastRect().Contains(Event.current.mousePosition)) { Application.OpenURL("http://www.amplify.pt"); } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUIStyle gUIStyle = new GUIStyle(EditorStyles.label); gUIStyle.alignment=(TextAnchor)(4); gUIStyle.wordWrap=(true); GUILayout.Label("\nAmplify Bloom " + VersionInfo.StaticToString(), gUIStyle, new GUILayoutOption[] { GUILayout.ExpandWidth(true) }); GUILayout.Label("\nCopyright (c) Amplify Creations, Lda. All rights reserved.\n", gUIStyle, new GUILayoutOption[] { GUILayout.ExpandWidth(true) }); GUILayout.EndVertical(); GUILayout.EndScrollView(); } } }