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.

58 lines
1.8 KiB

4 years ago
  1. using UnityEngine;
  2. using System.Collections;
  3. #if UNITY_EDITOR
  4. using UnityEditor;
  5. public class LeanTweenDocumentationEditor : Editor {
  6. [MenuItem ("Help/LeanTween Documentation")]
  7. static void openDocumentation()
  8. {
  9. #if !UNITY_3_5 && !UNITY_4_0 && !UNITY_4_0_1 && !UNITY_4_1 && !UNITY_4_2 && !UNITY_4_3
  10. // Loops through all items in case the user has moved the default installation directory
  11. string[] guids = AssetDatabase.FindAssets ("LeanTween", null);
  12. string documentationPath = "";
  13. foreach (string guid in guids){
  14. string path = AssetDatabase.GUIDToAssetPath(guid);
  15. if(path.IndexOf("classes/LeanTween.html")>=0){
  16. documentationPath = path;
  17. break;
  18. }
  19. }
  20. documentationPath = documentationPath.Substring(documentationPath.IndexOf("/"));
  21. string browserPath = "file://" + Application.dataPath + documentationPath + "#index";
  22. Application.OpenURL(browserPath);
  23. #else
  24. // assumes the default installation directory
  25. string documentationPath = "file://"+Application.dataPath + "/LeanTween/Documentation/classes/LeanTween.html#index";
  26. Application.OpenURL(documentationPath);
  27. #endif
  28. }
  29. [MenuItem ("Help/LeanTween Forum (ask questions)")]
  30. static void openForum()
  31. {
  32. Application.OpenURL("http://forum.unity3d.com/threads/leantween-a-tweening-engine-that-is-up-to-5x-faster-than-competing-engines.161113/");
  33. }
  34. [MenuItem ("Help/LeanTween GitHub (contribute code)")]
  35. static void openGit()
  36. {
  37. Application.OpenURL("https://github.com/dentedpixel/LeanTween");
  38. }
  39. [MenuItem ("Help/LeanTween Support (donate)")]
  40. static void openLTDonate()
  41. {
  42. Application.OpenURL("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YJPUT3RAK5VL8");
  43. }
  44. [MenuItem ("Help/Dented Pixel News")]
  45. static void openDPNews()
  46. {
  47. Application.OpenURL("http://dentedpixel.com/category/developer-diary/");
  48. }
  49. }
  50. #endif