Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if UNITY_EDITOR
- using UnityEditor;
- using UnityEngine;
- public static class InputSystemExtension
- {
- public static bool CheckForInputSystemAsset()
- {
- bool inputSystemAssetFound;
- string[] assets = AssetDatabase.FindAssets("t:ScriptableObject InputSettings");
- if (assets.Length > 0)
- {
- inputSystemAssetFound = true;
- Debug.Log("Input System Asset found.");
- }
- else
- {
- inputSystemAssetFound = false;
- Debug.Log("No Input System Assets found.");
- }
- return inputSystemAssetFound;
- }
- public static bool CheckForInputSystem()
- {
- var inputSystemPackageInstalled = false;
- var inputSystemPackage = UnityEditor.PackageManager.PackageInfo.GetAllRegisteredPackages();
- var length = inputSystemPackage.Length;
- for (int i = 0; i < length; i++)
- {
- if (inputSystemPackage[i].name == "com.unity.inputsystem")
- {
- inputSystemPackageInstalled = true;
- }
- }
- if (inputSystemPackageInstalled) { Debug.Log("Input System package is installed"); }
- else { Debug.Log("Input System package is not installed"); }
- return inputSystemPackageInstalled;
- }
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment