EasyTouchMenu.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. using UnityEngine;
  2. using UnityEditor;
  3. using System.Collections;
  4. using UnityEngine.EventSystems;
  5. using HedgehogTeam.EasyTouch;
  6. public static class EasyTouchMenu{
  7. [MenuItem ("GameObject/EasyTouch/EasyTouch", false, 0)]
  8. static void AddEasyTouch(){
  9. Selection.activeObject = EasyTouch.instance.gameObject;
  10. }
  11. }
  12. /*
  13. [MenuItem ("Window/GameAnalytics/Folder Structure/Revert to original", false, 601)]
  14. static void RevertFolders ()
  15. {
  16. if (!Directory.Exists(Application.dataPath + "/Plugins/GameAnalytics/"))
  17. {
  18. Debug.LogWarning("Folder structure incompatible, are you already using original folder structure, or have you manually changed the folder structure?");
  19. return;
  20. }
  21. if (!Directory.Exists(Application.dataPath + "/GameAnalytics/"))
  22. AssetDatabase.CreateFolder("Assets", "GameAnalytics");
  23. if (!Directory.Exists(Application.dataPath + "/GameAnalytics/Plugins"))
  24. AssetDatabase.CreateFolder("Assets/GameAnalytics", "Plugins");
  25. AssetDatabase.MoveAsset("Assets/Plugins/GameAnalytics/Android", "Assets/GameAnalytics/Plugins/Android");
  26. AssetDatabase.MoveAsset("Assets/Plugins/GameAnalytics/Components", "Assets/GameAnalytics/Plugins/Components");
  27. AssetDatabase.MoveAsset("Assets/Plugins/GameAnalytics/Examples", "Assets/GameAnalytics/Plugins/Examples");
  28. AssetDatabase.MoveAsset("Assets/Plugins/GameAnalytics/Framework", "Assets/GameAnalytics/Plugins/Framework");
  29. AssetDatabase.MoveAsset("Assets/Plugins/GameAnalytics/iOS", "Assets/GameAnalytics/Plugins/iOS");
  30. AssetDatabase.MoveAsset("Assets/Plugins/GameAnalytics/Playmaker", "Assets/GameAnalytics/Plugins/Playmaker");
  31. AssetDatabase.MoveAsset("Assets/Plugins/GameAnalytics/WebPlayer", "Assets/GameAnalytics/Plugins/WebPlayer");
  32. AssetDatabase.MoveAsset("Assets/Editor/GameAnalytics", "Assets/GameAnalytics/Editor");
  33. AssetDatabase.DeleteAsset("Assets/Plugins/GameAnalytics");
  34. AssetDatabase.DeleteAsset("Assets/Editor/GameAnalytics");
  35. Debug.Log("Project must be reloaded when reverting folder structure.");
  36. EditorApplication.OpenProject(Application.dataPath.Remove(Application.dataPath.Length - "Assets".Length, "Assets".Length));
  37. }
  38. */
  39. /*
  40. #if true
  41. #endif*/
  42. /*
  43. [MenuItem ("Window/Easy Touch/Folder Structure/Switch to JS", false, 100)]
  44. static void JsFolders(){
  45. // EasyTouch is here
  46. if (!Directory.Exists(Application.dataPath + "/EasyTouchBundle/EasyTouch/Plugins/")){
  47. Debug.LogWarning("Folder structure incompatible, did you already switch to JS folder structure, or have you manually changed the folder structure?");
  48. return;
  49. }
  50. // Create Structure
  51. if (!Directory.Exists(Application.dataPath + "/Plugins/"))
  52. AssetDatabase.CreateFolder("Assets", "Plugins");
  53. if (!Directory.Exists(Application.dataPath + "/Plugins/EasyTouch"))
  54. AssetDatabase.CreateFolder("Assets/Plugins", "EasyTouch");
  55. AssetDatabase.MoveAsset("Assets/EasyTouchBundle/EasyTouch/Plugins/Components","Assets/Plugins/EasyTouch/Components");
  56. AssetDatabase.MoveAsset("Assets/EasyTouchBundle/EasyTouch/Plugins/Engine","Assets/Plugins/EasyTouch/Engine");
  57. // Refresh database
  58. AssetDatabase.Refresh();
  59. }
  60. [MenuItem ("Window/EasyTouch/Folder Structure/Revert to original", false, 200)]
  61. static void CFolders(){
  62. if (!Directory.Exists(Application.dataPath + "/Plugins/EasyTouch/")){
  63. Debug.LogWarning("Folder structure incompatible, are you already using original folder structure, or have you manually changed the folder structure?");
  64. return;
  65. }
  66. AssetDatabase.MoveAsset("Assets/Plugins/EasyTouch/Components","Assets/EasyTouchBundle/EasyTouch/Plugins/Components");
  67. AssetDatabase.MoveAsset("Assets/Plugins/EasyTouch/Engine","Assets/EasyTouchBundle/EasyTouch/Plugins/Engine");
  68. AssetDatabase.DeleteAsset("Assets/Plugins/EasyTouch");
  69. Debug.Log("Project must be reloaded when reverting folder structure.");
  70. EditorApplication.OpenProject(Application.dataPath.Remove(Application.dataPath.Length - "Assets".Length, "Assets".Length));
  71. }*/