コード例 #1
0
 static void InputSystemPage()
 {
     GUILayout.Label("Input System package detected", Styles.title);
     GUILayout.Space(12);
     GUILayout.Label(@"It seems that you have the Input System configured for your project. In order to make it work with the UI Event Manager, we can create a configured prefab for you.", Styles.body);
     GUILayout.Space(12);
     if (GUILayout.Button("Create/Replace", GUILayout.Width(180), GUILayout.Height(32)))
     {
         if (AssetDatabase.LoadAssetAtPath <GameObject>("Assets/Resources/UIEventManager.prefab") == null ||
             EditorUtility.DisplayDialog("Prefab already present", "UIEventManager already exists, overwrite?", "Yes", "No"))
         {
             var go     = UIEventManager.CreateManagerObject();
             var prefab = PrefabUtility.SaveAsPrefabAsset(go, "Assets/Resources/UIEventManager.prefab");
             DestroyImmediate(go);
             Selection.activeObject = prefab;
         }
     }
 }