diff --git a/.github/README.md b/.github/README.md index 21f3775..3457d96 100644 --- a/.github/README.md +++ b/.github/README.md @@ -35,6 +35,16 @@ There are 5 ways to install this plugin: - *(via [OpenUPM](https://openupm.com))* after installing [openupm-cli](https://github.com/openupm/openupm-cli), run the following command: - `openupm add com.yasirkula.imagecropper` +## FAQ + +- **New Input System isn't supported on Unity 2019.2.5 or earlier** + +Add `ENABLE_INPUT_SYSTEM` compiler directive to **Player Settings/Scripting Define Symbols** (these symbols are platform specific, so if you change the active platform later, you'll have to add the compiler directive again). + +- **"Unity.InputSystem" assembly can't be resolved on Unity 2018.4 or earlier** + +Remove `Unity.InputSystem` assembly from **ImageCropper.Runtime** Assembly Definition File's *Assembly Definition References* list. + ## HOW TO ImageCropper is a singleton object that can be accessed via `ImageCropper.Instance`. To start cropping a *Texture* object, you can call the following function: diff --git a/Plugins/ImageCropper/ImageCropper.Runtime.asmdef b/Plugins/ImageCropper/ImageCropper.Runtime.asmdef index 29a7a28..40dc714 100644 --- a/Plugins/ImageCropper/ImageCropper.Runtime.asmdef +++ b/Plugins/ImageCropper/ImageCropper.Runtime.asmdef @@ -1,3 +1,6 @@ { - "name": "ImageCropper.Runtime" -} + "name": "ImageCropper.Runtime", + "references": [ + "Unity.InputSystem" + ] +} \ No newline at end of file diff --git a/Plugins/ImageCropper/README.pdf b/Plugins/ImageCropper/README.pdf deleted file mode 100644 index 873ff14..0000000 Binary files a/Plugins/ImageCropper/README.pdf and /dev/null differ diff --git a/Plugins/ImageCropper/README.txt b/Plugins/ImageCropper/README.txt new file mode 100644 index 0000000..ccdeb49 --- /dev/null +++ b/Plugins/ImageCropper/README.txt @@ -0,0 +1,6 @@ += Image Cropper (v1.0.7) = + +Documentation: https://github.com/yasirkula/UnityImageCropper +FAQ: https://github.com/yasirkula/UnityImageCropper#faq +Example code: https://github.com/yasirkula/UnityImageCropper#example-code +E-mail: yasirkula@gmail.com \ No newline at end of file diff --git a/Plugins/ImageCropper/README.pdf.meta b/Plugins/ImageCropper/README.txt.meta similarity index 53% rename from Plugins/ImageCropper/README.pdf.meta rename to Plugins/ImageCropper/README.txt.meta index 3c1ab3e..07d56ce 100644 --- a/Plugins/ImageCropper/README.pdf.meta +++ b/Plugins/ImageCropper/README.txt.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: b2da761de37a41b49b4a6129a4a50529 -timeCreated: 1523880450 +guid: f2524c1e4c1b07d4892037793e8a9404 +timeCreated: 1563307881 licenseType: Free -DefaultImporter: +TextScriptImporter: userData: assetBundleName: assetBundleVariant: diff --git a/Plugins/ImageCropper/Scripts/EventSystemHandler.cs b/Plugins/ImageCropper/Scripts/EventSystemHandler.cs index 2fcda2c..29bea07 100644 --- a/Plugins/ImageCropper/Scripts/EventSystemHandler.cs +++ b/Plugins/ImageCropper/Scripts/EventSystemHandler.cs @@ -1,6 +1,9 @@ using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.SceneManagement; +#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER +using UnityEngine.InputSystem.UI; +#endif namespace ImageCropperNamespace { @@ -13,6 +16,18 @@ public class EventSystemHandler : MonoBehaviour private GameObject embeddedEventSystem; #pragma warning restore 0649 +#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER + private void Awake() + { + StandaloneInputModule legacyInputModule = embeddedEventSystem.GetComponent(); + if( legacyInputModule ) + { + DestroyImmediate( legacyInputModule ); + embeddedEventSystem.AddComponent(); + } + } +#endif + private void OnEnable() { SceneManager.sceneLoaded -= OnSceneLoaded; diff --git a/package.json b/package.json index 7fdf1b5..17d747e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.yasirkula.imagecropper", "displayName": "Image Cropper", - "version": "1.0.6", + "version": "1.0.7", "documentationUrl": "https://github.com/yasirkula/UnityImageCropper", "changelogUrl": "https://github.com/yasirkula/UnityImageCropper/releases", "licensesUrl": "https://github.com/yasirkula/UnityImageCropper/blob/master/LICENSE.txt",