Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.0 KiB

  1. // Amplify Shader Editor - Visual Shader Editing Tool
  2. // Copyright (c) Amplify Creations, Lda <info@amplify.pt>
  3. using UnityEngine;
  4. using UnityEditor;
  5. namespace AmplifyShaderEditor
  6. {
  7. public class About : EditorWindow
  8. {
  9. private const string AboutImageGUID = "8aba6bb20faf8824d9d81946542f1ce1";
  10. private Vector2 m_scrollPosition = Vector2.zero;
  11. private Texture2D m_aboutImage;
  12. [MenuItem( "Window/Amplify Shader Editor/About...", false, 2001 )]
  13. static void Init()
  14. {
  15. About window = (About)GetWindow( typeof( About ), true, "About Amplify Shader Editor" );
  16. window.minSize = new Vector2( 502, 290 );
  17. window.maxSize = new Vector2( 502, 290 );
  18. window.Show();
  19. }
  20. [MenuItem( "Window/Amplify Shader Editor/Manual", false, 2000 )]
  21. static void OpenManual()
  22. {
  23. Application.OpenURL( "http://wiki.amplify.pt/index.php?title=Unity_Products:Amplify_Shader_Editor/Manual" );
  24. }
  25. private void OnEnable()
  26. {
  27. m_aboutImage = AssetDatabase.LoadAssetAtPath<Texture2D>( AssetDatabase.GUIDToAssetPath( AboutImageGUID ) );
  28. }
  29. public void OnGUI()
  30. {
  31. m_scrollPosition = GUILayout.BeginScrollView( m_scrollPosition );
  32. GUILayout.BeginVertical();
  33. GUILayout.Space( 10 );
  34. GUILayout.BeginHorizontal();
  35. GUILayout.FlexibleSpace();
  36. GUILayout.Box( m_aboutImage, GUIStyle.none );
  37. if( Event.current.type == EventType.MouseUp && GUILayoutUtility.GetLastRect().Contains( Event.current.mousePosition ) )
  38. Application.OpenURL( "http://www.amplify.pt" );
  39. GUILayout.FlexibleSpace();
  40. GUILayout.EndHorizontal();
  41. GUIStyle labelStyle = new GUIStyle( EditorStyles.label );
  42. labelStyle.alignment = TextAnchor.MiddleCenter;
  43. labelStyle.wordWrap = true;
  44. GUILayout.Label( "\nAmplify Shader Editor " + VersionInfo.StaticToString(), labelStyle, GUILayout.ExpandWidth( true ) );
  45. GUILayout.Label( "\nCopyright (c) Amplify Creations, Lda. All rights reserved.\n", labelStyle, GUILayout.ExpandWidth( true ) );
  46. GUILayout.EndVertical();
  47. GUILayout.EndScrollView();
  48. }
  49. }
  50. }