diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager.meta b/EintooAR/Assets/Editor/ExternalDependencyManager.meta new file mode 100644 index 00000000..4d7b5ef2 --- /dev/null +++ b/EintooAR/Assets/Editor/ExternalDependencyManager.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e08fb507e0b034036b8cc7edd9deeb68 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor.meta b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor.meta new file mode 100644 index 00000000..2a07fb5d --- /dev/null +++ b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 60eed25df4a46427aa405831f8a1c54a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183.meta b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183.meta new file mode 100644 index 00000000..8165a97a --- /dev/null +++ b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5467eebe589ed445d8de6152fa6beb06 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.IOSResolver.dll b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.IOSResolver.dll new file mode 100644 index 00000000..e7568472 Binary files /dev/null and b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.IOSResolver.dll differ diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.IOSResolver.dll.meta b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.IOSResolver.dll.meta new file mode 100644 index 00000000..f04bec07 --- /dev/null +++ b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.IOSResolver.dll.meta @@ -0,0 +1,38 @@ +fileFormatVersion: 2 +guid: a366c71c93ae411ea1ece423e8b1538f +labels: +- gvh +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.IOSResolver.dll +- gvhp_targets-editor +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.JarResolver.dll b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.JarResolver.dll new file mode 100644 index 00000000..736956c7 Binary files /dev/null and b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.JarResolver.dll differ diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.JarResolver.dll.meta b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.JarResolver.dll.meta new file mode 100644 index 00000000..616b02e2 --- /dev/null +++ b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.JarResolver.dll.meta @@ -0,0 +1,38 @@ +fileFormatVersion: 2 +guid: 9cab53159f0a43b68c16552c892bd579 +labels: +- gvh +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.JarResolver.dll +- gvhp_targets-editor +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.PackageManagerResolver.dll b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.PackageManagerResolver.dll new file mode 100644 index 00000000..7aec9fc4 Binary files /dev/null and b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.PackageManagerResolver.dll differ diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.PackageManagerResolver.dll.meta b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.PackageManagerResolver.dll.meta new file mode 100644 index 00000000..ce89a0a5 --- /dev/null +++ b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.PackageManagerResolver.dll.meta @@ -0,0 +1,38 @@ +fileFormatVersion: 2 +guid: 06f4aa8c065049e5970eedec5f52600f +labels: +- gvh +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.PackageManagerResolver.dll +- gvhp_targets-editor +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.VersionHandlerImpl.dll b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.VersionHandlerImpl.dll new file mode 100644 index 00000000..ec5f0114 Binary files /dev/null and b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.VersionHandlerImpl.dll differ diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.VersionHandlerImpl.dll.meta b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.VersionHandlerImpl.dll.meta new file mode 100644 index 00000000..9d894e78 --- /dev/null +++ b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/1.2.183/Google.VersionHandlerImpl.dll.meta @@ -0,0 +1,38 @@ +fileFormatVersion: 2 +guid: ad4fd0d2f20345839aa31291c8c0c285 +labels: +- gvh +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.VersionHandlerImpl.dll +- gvhp_targets-editor +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/CHANGELOG.md b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/CHANGELOG.md new file mode 100644 index 00000000..9a1fb126 --- /dev/null +++ b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/CHANGELOG.md @@ -0,0 +1,1417 @@ +# Version 1.2.183 - Sep 17, 2024 +* Android Resolver - Handle package paths that don't include a version hash, + which is no longer present with Unity 6. Fixes #697 +* Android Resolver - Handle packages referenced using local file paths. + Fixes #701 + +# Version 1.2.182 - Aug 2, 2024 +* General - Check for gradle version instead of Unity version when determining + the template files to modify. + +# Version 1.2.181 - Jun 26, 2024 +* General - Disable `EditorMeasurement` reporting that relied on the + Measurement Protocol for Universal Analytics. + +# Version 1.2.180 - Jun 4, 2024 +* General - Fix project settings resetting on domain reload. + Fixes #524 + +# Version 1.2.179 - Feb 12, 2024 +* Android Resolver - Added logic to automatically turn on `mainTemplate.gradle` + for new projects, and prompt users to enable it on projects that have previously + had the resolver run. + +# Version 1.2.178 - Dec 20, 2023 +* Added [OpenUPM support](https://openupm.com/packages/com.google.external-dependency-manager/). + +# Version 1.2.177 - Aug 14, 2023 +* iOS Resolver - Added `/opt/homebrew/bin` to Cocoapod executable search path. + Fixes #627 + +# Version 1.2.176 - Apr 27, 2023 +* Android Resolver - Added two Android Resolver settings to determine whether + EDM4U injects custom local Maven repo path as a relative path or full path. + Fixes #537 +* Android Resolver - Inject Maven Repo to `settingTemplate.gradle` from + Unity 2022.2+ + Fixes #594 +* Android Resolver - Jetifier option is enabled by default now. +* Android Resolver - `Explode Aar` option applies to all cases, whether the + project will be exported or not. + Fixes #584 + Fixes #287 + +# Version 1.2.175 - Nov 16, 2022 +* General - Added tvOS podfile support to the iOS resolver. + +# Version 1.2.174 - Oct 06, 2022 +* General - Added tvOS support to the iOS resolver. +* General - Fixed #484 - Changed `EditorMeasurement` to use secure connection. +* Android Resolver - Fixed Android Resolver unable to resolve + `mainTemplate.gradle` in Unity `2022.2+` or `2023.1+`. + +# Version 1.2.173 - Sep 28, 2022 +* General - Added tvOS library support to the export unity package scripts. + +# Version 1.2.172 - Jun 23, 2022 +* iOS Resolver - Stop forcing `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` to `YES`, + which seems to cause problem for some when submitting apps. See #526 for more + information. + +# Version 1.2.171 - May 11, 2022 +* iOS Resolver - Change `Enable Swift Framework Support Workaround` setting to + be `ON` by default since more pods are using Swift Framework now. + +# Version 1.2.170 - Apr 4, 2022 +* Android Resolver - Fixes #498 - Fix the path separator of the Maven repo + injected to `mainTemplate.gradle`. +* iOS Resolver - Fixes #470 - Switch default Cocoapods master repo from Github + to CDN. +* iOS Resolver - `Link Framework Statically` setting is now default to `true`. + That is, `use_frameworks! :linkage => static` will be added to `Podfile` by + default instead of `use_frameworks!`. This can be changed in iOS Resolver + settings. This fixes odd behaviors when pods include static libraries, ex. + Firebase Analytics. +* iOS Resolver - Added a workaround when app crashes on launch due to + `Library not loaded: @rpath/libswiftCore.dylib` when some pods includes Swift + framework. This is turned `OFF` by default and can be changed in iOS Resolver + settings. + +# Version 1.2.169 - Jan 20, 2022 +* General - Fixes #425 - Change to save `GvhProjectSettings.xml` without + Unicode byte order mark (BoM). +* Android Resolver - Remove reference to `jcenter()` +* iOS Resolver - Force setting `LANG` when executing Cocoapods in shell mode on + Mac. + +# Version 1.2.168 - Dec 9, 2021 +* All - Fixes #472 by removing the use of `System.Diagnostics.Debug.Assert` +* All - Fixed #477 by properly enabling EDM4U libraries for Unity 2021.2+ when + the package is installed through `.tgz` + +# Version 1.2.167 - Oct 6, 2021 +* All - Moved versioned `.dll` in EDM4U to a versioned folder and remove their + version postfix in their filename. For instance, `IOSResolver.dll` will be + placed at `ExternalDependencyManager/Editor/1.2.167/Google.IOSResolver.dll`. +* Android Resolver - Fixed #243 by only using the highest version in + `mainTemplate.gradle` when duplicated dependencies are presented. +* Android Resolver - Added supports to x86_64 to ABI list for Android apps on + Chrome OS. + +# Version 1.2.166 - Jun 30, 2021 +* All - Fixed #440 and fixed #447 by specifying the parameter type while calling + `GetApplicationIdentifier()` Unity API using reflection, due to a new + overloaded method introduced in Unity 2021.2. +* Android Resolver - Fixed #442 by patching `Dependency.IsGreater()` when the + version strings end '+'. + +# Version 1.2.165 - Apr 28, 2021 +## Bug Fixes +* Version Handler - Fixed #431 by replacing the use of `HttpUtility.UrlEncode()` + which causes NullReferenceException in certain version of Unity. +* Android Resolver - Check that androidSdkRootPath directory exists before using + as sdkPath. +* Android Resolver - Fixed Android Resolver integration tests with Unity + 2019.3+. + +# Version 1.2.164 - Feb 4, 2021 +## New Features +* Android Resolver - Added support for Android packages with classifier in their + namespaces. +* iOS Resolver - Added new settings in iOS Resolver to configure generated + Podfile. +* iOS Resolver - Added a new attribute `addToAllTargets` in Dependencies.xml. + +## Bug Fixes +* iOS Resolver - Fixed XML parsing for `bitcodeEnabled` attribute in + Dependencies.xml. + +# Version 1.2.163 - Dec 15, 2020 +## Bug Fixes +* Version Handler - Fixed measurement reporting + +# Version 1.2.162 - Nov 19, 2020 +## Bug Fixes +* Version Handler - Improved #413 by preventing Version Handler from running + from static constructor when it is disabled. +* Package Manager Resolver - Remove GPR + +# Version 1.2.161 - Oct 12, 2020 +## Bug Fixes +* Android Resolver - Fixed the issue that Android Resolver does not resolve + again before build in Unity 2020 if it failed to resolve previously. + +# Version 1.2.160 - Sep 30, 2020 +## Bug Fixes +* Android Resolver - Fixed a regression that gradleResolver can be null until + Initialize() is called. +* Android Resolver - Fixed a regression that Android Resolver failed in Unity + 2019.3+ due to `gradleTemplate.properties` not enabled when + `mainTemplate.gradle` is not enabled at all. + +# Version 1.2.159 - Sep 11, 2020 +## Bug Fixes +* Android Resolver - Fixed #322 where the Unity editor will lose its target SDK + setting between Unity restarts if `>28` is selected in 2019. This is due to + Unity AndroidSdkVersions enum does not contain values above 28. +* Android Resolver - Fixed #360 where building Android app with Untiy 2019.3+ + may fail due to Jetifier and AndroidX not enabled properly in generated + Gradle project. This fix requires the user to enable + `Custom Gradle Properties Template` found under + `Player Settings > Settings for Android > Publishing Settings`. + +# Version 1.2.158 - Sep 3, 2020 +## Bug Fixes +* Version Handler: Fixed editor freeze when `-executeMethod` is used in + non-batch mode. +* Android Resolver: Normalized file paths when generating local Maven repo + since the path may contains a mix of forward and backward slash on Windows. +* Export Unity Package: Fixed generation of .unitypackage with tarfile on + Windows. + +# Version 1.2.157 - Aug 6, 2020 +## Bug Fixes +* Android Resolver: Delay initialization until active build target is Android + and the editor is not in play mode. +* iOS Resolver: Delay initialization until active build target is iOS + and the editor is not in play mode. +* Export Unity Package: Workaround directory creation racy if multiple export + operations are spawned at the same time. + +# Version 1.2.156 - June 10, 2020 +## Bug Fixes +* Android Resolver: Fixed that the generated local repo assets contains + redundent labels which are causing Version Handler to failed while + uninstalling packages. +* Android Resolver: Fixed that the repo url injected into mainTemplate.gradle + is incorrect when Unity is configured to export gradle project. +* Android Resolver: Limited to only create local Maven repo when the source + repo contains ".srcaar" file. + +## Changes +* All: Described EDM4U analytics data usage in readme. + +# Version 1.2.155 - May 14, 2020 +## Bug Fixes +* All: Fixed compiler error when build with Unity 5.4 or below due to the + usage of Rect.zero. +* All: Ignore cases when checking command line arguments. + +# Version 1.2.154 - May 14, 2020 +## Bug Fixes +* All: Make each MultiSelectWindow for different purposes to have its own + unique window. + +## Changes +* All: Replace all dialog with DialogWindow which is implemented from + EditorWindow. +* Package Manager Resolver: Clarify how manifest.json will be changed in Package + Manager Resolver window. + +# Version 1.2.153 - Apr 24, 2020 +## Bug Fixes +* Android Resolver: Fixed an exception when repainting the Android resolution + window in Unity 2019.3.x. + +# Version 1.2.152 - Apr 17, 2020 +## Bug Fixes +* Version Handler: Fixed exception when waiting for enabled editor DLLs to + load. +* Android Resolver: Fixed regression when using a Custom Gradle Template + on Windows. + +# Version 1.2.151 - Apr 16, 2020 +## Bug Fixes +* Version Handler: When waiting for newly enabled editor DLLs to load, ignore + all DLLs that do not have a file-system location. +* Android Resolver: Fixed resolution when using a Custom Gradle Template with + libraries stored in a local maven repository distributed with a plugin + installed with the Unity Package Manager. + +# Version 1.2.150 - Apr 9, 2020 +## Bug Fixes +* All: The new packaging script when run on MacOS was generating a + .unitypackage archive that could not be read by Unity on Windows. + This release simply repackages the plugin with tar/gzip to fix the problem. + +# Version 1.2.149 - Apr 8, 2020 +## Bug Fixes +* Package Manager Resolver: Fixed spurious error message when resuming + migration after installing a UPM package. + +# Version 1.2.148 - Apr 8, 2020 +## Bug Fixes +* Package Manager Resolver: Fixed an exception when resuming migration + after installing a UPM package. + +# Version 1.2.147 - Apr 8, 2020 +## Bug Fixes +* Version Handler: Fixed alias traversal bug which caused problems when + migrating from installed .unitypackage files to UPM packages. + +# Version 1.2.146 - Apr 8, 2020 +## Bug Fixes +* Version Handler: Fixed exception in manifest parsing when a manifest is + detected with no aliases. + +# Version 1.2.145 - Apr 2, 2020 +## New Features +* Package Manager Resolver: Added a method to migrate Version Handler + managed packages installed via `.unitypackage` to Unity Package Manager + packages. This is initially used to migrate the External Dependency Manager + to UPM. + +## Changes +* All: Verbose logging is now no longer automatically enabled in batch mode + across all components. Instead logging can be configured using each + component's verbose logging setting or by using the `-gvh_log_debug` command + line flag when starting Unity. +* Version Handler: Sped up version handler updates when the app domain isn't + reloaded. + +## Bug Fixes +* Version Handler: Fixed the display of the obsolete files clean up dialog + when the asset database refreshes. +* Version Handler: Improved reliability of callback from + the VersionHandler.UpdateCompleteMethods event when an asset database + refresh occurs. +* Version Handler: Fixed duplicate exportPath labels when 'Assets/' is the + root of paths assigned to files. +* Version Handler: Handle empty lines in manifest files. + +# Version 1.2.144 - Mar 23, 2020 +## Changed +* iOS Resolver: Removed the ability to configure the Xcode target a Cocoapod + is added to. + +## Bug Fixes +* iOS Resolver: Reverted support for adding Cocoapods to multiple targets as + it caused a regression (exception thrown during post-build step) in some + versions of Unity. + +# Version 1.2.143 - Mar 20, 2020 +## Bug Fixes +* Android Resolver: Fixed caching of resolution state which was causing + the resolver to always run when no dependencies had changed. + +# Version 1.2.142 - Mar 19, 2020 +## Changes +* Package Manager Resolver: Enabled auto-add by default. + +# Version 1.2.141 - Mar 19, 2020 +## Bug Fixes +* Fixed a bug when retrieving project settings. If a plugin was configured + to fetch project settings, if a setting was fetched (e.g "foo") and this + setting existed in the system settings but not the project settings the + system value would override the default value leading to unexpected + behavior. +* Fixed a warning when caching web request classes in Unity 5.6. + +# Version 1.2.140 - Mar 19, 2020 +## Bug Fixes +* Fixed measurement reporting in Unity 5.x. +* Version Handler: Fixed NullReferenceException when an asset doesn't have + an AssetImporter. + +# Version 1.2.139 - Mar 18, 2020 +## Changed +* Added documentation to the built plugin. + +# Version 1.2.138 - Mar 17, 2020 +## New Features +* Package Manager Resolver: Added the Package Manager Resolver + component that allows developers to easily boostrap Unity Package Manager + (UPM) registry addition using unitypackage plugins. +* Version Handler: Added a window that allows plugins to managed by the + Version Handler to be uninstalled. +* Version Handler: Added support for displaying installed plugins. +* Version Handler: Added support for moving files in plugins to their install + locations (if the plugin has been configured to support this). +* iOS Resolver: Added the ability to configure the Xcode target a Cocoapod is + added to. + +## Bug Fixes +* Fixed upgrade from version 1.2.137 and below after the plugin rename to + EDM4U broke the upgrade process. +* Android Resolver: Worked around PlayerSettings.Android.targetSdkVersion + returning empty names for some values in 2019.x. +* Version Handler: Fixed the display of the obsolete files clean up window. +* Version Handler: Fixed managed file check when assets are modified in the + project after plugin import. + +# Version 1.2.137 - Mar 6, 2020 +## Changed +* Renamed package to External Package Manager for Unity (EDM4U). + We changed this to reflect what this plugin is doing today which is far more + than the original scope which just consisted of importing jar files from the + Android SDK maven repository. + Scripts that used to pull `play-services-resolver*.unitypackage` will now have + to request `external-dependency-manager*.unitypackage` instead. + We'll still be shipping a `play-services-resolver*_manifest.txt` file to + handle upgrading from older versions of the plugin. + +## New Features +* All Components: Added reporting of usage so that we can remotely detect + errors and target improvements. +* Android Resolver: Added support for *Dependencies.xml files in Unity Package + Manager packages. +* iOS Resolver: Added support for *Dependencies.xml files in Unity Package + Manager packages. + +## Bug Fixes +* Version Handler: Disabled attempts to disable asset metadata modification + when assets are in a Unity Package Manager managed package. + +# Version 1.2.136 - Feb 19, 2019 +## Bug Fixes +* Android Resolver: Fixed OpenJDK path discovery in Unity 2019.3.1. + +# Version 1.2.135 - Dec 5, 2019 +## Bug Fixes +* All Components: Fixed stack overflow when loading project settings. + +# Version 1.2.134 - Dec 4, 2019 +## Bug Fixes +* All Components: Fixed an issue which caused project settings to be cleared + when running in batch mode. + +# Version 1.2.133 - Nov 18, 2019 +## Bug Fixes +* All Components: Failure to save project settings will now report an error + to the log rather than throwing an exception. + +# Version 1.2.132 - Nov 11, 2019 +## Bug Fixes +* Android Resolver: Worked around expansion of DIR_UNITYPROJECT on Windows + breaking Gradle builds when used as part of a file URI. +* Android Resolver: mainTemplate.gradle is only written if it needs to be + modified. + +# Version 1.2.131 - Oct 29, 2019 +## Bug Fixes +* Version Handler: Improved execution of events on the main thread in batch + mode. +* Version Handler: Improved log level configuration at startup. +* Version Handler: Improved performance of class lookup in deferred method + calls. +* Version Handler: Fixed rename to enable / disable for editor assets. +* iOS Resolver: Improved log level configuration at startup. +* Android Resolver: Improved local maven repo path reference in + mainTemplate.gradle using DIR_UNITYPROJECT. DIR_UNITYPROJECT by Unity + to point to the local filesystem path of the Unity project when Unity + generates the Gradle project. + +# Version 1.2.130 - Oct 23, 2019 +## New Features +* iOS Resolver: Added support for modifying the Podfile before `pod install` + is executed. + +## Bug Fixes +* Version Handler: Fixed invalid classname error when calling + `VersionHandler.UpdateVersionedAssets()`. + +# Version 1.2.129 - Oct 2, 2019 +## Bug Fixes +* iOS Resolver: Changed Cocoapod integration in Unity 2019.3+ to + only add Pods to the UnityFramework target. + +# Version 1.2.128 - Oct 1, 2019 +## Bug Fixes +* iOS Resolver: Fixed Cocoapod project integration mode with Unity + 2019.3+. + +# Version 1.2.127 - Sep 30, 2019 +## Changes +* Android Resolver: All Android Resolver settings File paths are now + serialized with POSIX directory separators. + +# Version 1.2.126 - Sep 27, 2019 +## Changes +* Android Resolver: File paths are now serialized with POSIX directory + separators. +## Bug Fixes +* Android Resolver: Fixed resolution when the parent directory of a Unity + project contains a Gradle project (i.e `settings.gradle` file). + +# Version 1.2.125 - Sep 23, 2019 +## Bug Fixes +* All components: Silenced a warning about not being able to set the console + encoding to UTF8. +* Android Resolver: Worked around broken AndroidSDKTools class in some + versions of Unity. +* iOS Resolver: Fixed iOS target SDK version check +* Version Handler: Changed clean up obsolete files window so that it doesn't + exceed the screen size. + +# Version 1.2.124 - Jul 28, 2019 +## Bug Fixes +* All components: Fixed regression with source control integration when using + Unity 2019.1+. + +# Version 1.2.123 - Jul 23, 2019 +## New Features +* All components: Source control integration for project settings. +## Changes +* Android Resolver: Removed AAR cache as it now makes little difference to + incremental resolution performance. +* Android Resolver: Improved embedded resource management so that embedded + resources should upgrade when the plugin is updated without restarting + the Unity editor. +## Bug Fixes +* Version Handler: Fixed InvokeMethod() and InvokeStaticMethod() when calling + methods that have interface typed arguments. + +# Version 1.2.122 - Jul 2, 2019 +## Bug Fixes +* iOS Resolver: Worked around Unity not loading the iOS Resolver DLL as it + referenced the Xcode extension in a public interface. The iOS Resolver + DLL still references the Xcode extension internally and just handles + missing type exceptions dynamically. + +# Version 1.2.121 - Jun 27, 2019 +## Bug Fixes +* Android Resolver: Fixed warning about missing Packages folder when loading + XML dependencies files in versions of Unity without the package manager. +* Android Resolver: Fixed resolution window progress bar exceeding 100%. +* Android Resolver: If AndroidX is detected in the set of resolved libraries, + the user will be prompted to enable the Jetifier. +* Android Resolver: Improved text splitting in text area windows. +* iOS Resolver: Added support for Unity's breaking changes to the Xcode API + in 2019.3.+. Cocoapods are now added to build targets, Unity-iPhone and + UnityFramework in Unity 2019.3+. + +# Version 1.2.120 - Jun 26, 2019 +## New Features +* Android Resolver: Added support for loading *Dependencies.xml files from + Unity Package Manager packages. +* Android Resolver: Resolution window is now closed if resolution runs as + a pre-build step. +* iOS Resolver: Added support for loading *Dependencies.xml files from + Unity Package Manager packages. +## Bug Fixes +* Android Resolver: Fixed generation of relative repo paths when using + mainTemplate.gradle resolver. +* Android Resolver: Fixed copy of .srcaar to .aar files in repos embedded in a + project when a project path has characters (e.g whitespace) that are escaped + during conversion to URIs. +* Android Resolver: Fixed auto-resolution always running if the Android SDK + is managed by Unity Hub. + +# Version 1.2.119 - Jun 19, 2019 +## Bug Fixes +* Android Resolver: Fixed error reported when using Jetifier integration + in Unity 2018+ if the target SDK is set to "highest installed". + +# Version 1.2.118 - Jun 18, 2019 +## New Features +* Android Resolver: Added initial + [Jetifier](https://developer.android.com/studio/command-line/jetifier) + integration which simplifies + [migration](ttps://developer.android.com/jetpack/androidx/migrate) + to Jetpack ([AndroidX](https://developer.android.com/jetpack/androidx)) + libraries in cases where all dependencies are managed by the Android + Resolver. + This can be enabled via the `Use Jetifier` option in the + `Assets > Play Services Resolver > Android Resolver > Settings` menu. + Caveats: + - If your project contains legacy Android Support Library .jar and .aar + files, these files will need to be removed and replaced with references to + artifacts on Maven via `*Dependencies.xml` files so that the Jetifier + can map them to Jetpack (AndroidX) libraries. + For example, remove the file `support-v4-27.0.2.jar` and replace it with + `` in a + `*Dependencies.xml` file. + - If your project contains .jar or .aar files that use the legacy Android + Support Libraries, these will need to be moved into a local Maven repo + [See this guide](https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html) + and then these files should be removed from your Unity project and instead + referenced via `*Dependencies.xml` files so that the Jetifier can + patch them to reference the Jetpack lirbaries. + +## Bug Fixes +* Android Resolver: Disabled version locking of com.android.support:multidex + does not use the same versioning scheme as other legacy Android support + libraries. +* Version Handler: Made Google.VersionHandler.dll's asset GUID stable across + releases. This faciliates error-free import into projects where + Google.VersionHandler.dll is moved from the default install location. + +# Version 1.2.117 - Jun 12, 2019 +## Bug Fixes +* Android Resolver: Fix copying of .srcaar to .aar files for + mainTemplate.gradle resolution. PluginImporter configuration was previously + not being applied to .aar files unless the Unity project was saved. + +# Version 1.2.116 - Jun 7, 2019 +## Bug Fixes +* Android Resolver: Fixed resolution of Android dependencies without version + specifiers. +* Android Resolver: Fixed Maven repo not found warning in Android Resolver. +* Android Resolver: Fixed Android Player directory not found exception in + Unity 2019.x when the Android Player isn't installed. + +# Version 1.2.115 - May 28, 2019 +## Bug Fixes +* Android Resolver: Fixed exception due to Unity 2019.3.0a4 removing + x86 from the set of supported ABIs. + +# Version 1.2.114 - May 27, 2019 +## New Features +* Android Resolver: Added support for ABI stripping when using + mainTemplate.gradle. This only works with AARs stored in repos + on the local filesystem. + +# Version 1.2.113 - May 24, 2019 +## New Features +* Android Resolver: If local repos are moved, the plugin will search the + project for matching directories in an attempt to correct the error. +* Version Handler: Files can be now targeted to multiple build targets + using multiple "gvh_" asset labels. +## Bug Fixes +* Android Resolver: "implementation" or "compile" are now added correctly + to mainTemplate.gradle in Unity versions prior to 2019. + +# Version 1.2.112 - May 22, 2019 +## New Features +* Android Resolver: Added option to disable addition of dependencies to + mainTemplate.gradle. + See `Assets > Play Services Resolver > Android Resolver > Settings`. +* Android Resolver: Made paths to local maven repositories in + mainTemplate.gradle relative to the Unity project when a project is not + being exported. +## Bug Fixes +* Android Resolver: Fixed builds with mainTemplate.gradle integration in + Unity 2019. +* Android Resolver: Changed dependency inclusion in mainTemplate.gradle to + use "implementation" or "compile" depending upon the version of Gradle + included with Unity. +* Android Resolver: Gracefully handled exceptions if the console encoding + can't be modified. +* Android Resolver: Now gracefully fails if the AndroidPlayer directory + can't be found. + +# Version 1.2.111 - May 9, 2019 +## Bug Fixes +* Version Handler: Fixed invocation of methods with named arguments. +* Version Handler: Fixed occasional hang when the editor is compiling + while activating plugins. + +# Version 1.2.110 - May 7, 2019 +## Bug Fixes +* Android Resolver: Fixed inclusion of some srcaar artifacts in builds with + Gradle builds when using mainTemplate.gradle. + +# Version 1.2.109 - May 6, 2019 +## New Features: +* Added links to documentation from menu. +* Android Resolver: Added option to auto-resolve Android libraries on build. +* Android Resolver: Added support for packaging specs of Android libraries. +* Android Resolver: Pop up a window when displaying Android dependencies. + +## Bug Fixes +* Android Resolver: Support for Unity 2019 Android SDK and JDK install locations +* Android Resolver: e-enable AAR explosion if internal builds are enabled. +* Android Resolver: Gracefully handle exceptions on file deletion. +* Android Resolver: Fixed Android Resolver log spam on load. +* Android Resolver: Fixed save of Android Resolver PromptBeforeAutoResolution + setting. +* Android Resolver: Fixed AAR processing failure when an AAR without + classes.jar is found. +* Android Resolver: Removed use of EditorUtility.DisplayProgressBar which + was occasionally left displayed when resolution had completed. +* Version Handler: Fixed asset rename to disable when a disabled file exists. + +# Version 1.2.108 - May 3, 2019 +## Bug Fixes: +* Version Handler: Fixed occasional hang on startup. + +# Version 1.2.107 - May 3, 2019 +## New Features: +* Version Handler: Added support for enabling / disabling assets that do not + support the PluginImporter, based upon build target selection. +* Android Resolver: Added support for the global specification of maven repos. +* iOS Resolver: Added support for the global specification of Cocoapod sources. + +# Version 1.2.106 - May 1, 2019 +## New Features +* iOS Resolver: Added support for development pods in Xcode project integration + mode. +* iOS Resolver: Added support for source pods with resources in Xcode project + integration mode. + +# Version 1.2.105 - Apr 30, 2019 +## Bug fixes +* Android Resolver: Fixed reference to Java tool path in logs. +* Android and iOS Resolvers: Changed command line execution to emit a warning + rather than throwing an exception and failing, when it is not possible to + change the console input and output encoding to UTF-8. +* Android Resolver: Added menu option and API to delete resolved libraries. +* Android Resolver: Added menu option and API to log the repos and libraries + currently included in the project. +* Android Resolver: If Plugins/Android/mainTemplate.gradle file is present and + Gradle is selected as the build type, resolution will simply patch the file + with Android dependencies specified by plugins in the project. + +# Version 1.2.104 - Apr 10, 2019 +## Bug Fixes +* Android Resolver: Changed Android ABI selection method from using whitelisted + Unity versions to type availability. This fixes an exception on resolution + in some versions of Unity 2017.4. + +# Version 1.2.103 - Apr 2, 2019 +## Bug Fixes +* Android Resolver: Whitelisted Unity 2017.4 and above with ARM64 support. +* Android Resolver: Fixed Java version check to work with Java SE 12 and above. + +# Version 1.2.102 - Feb 13, 2019 +## Bug Fixes +* Android Resolver: Fixed the text overflow on the Android Resolver + prompt before initial run to fit inside the buttons for + smaller screens. + +# Version 1.2.101 - Feb 12, 2019 +## New Features +* Android Resolver: Prompt the user before the resolver runs for the + first time and allow the user to elect to disable from the prompt. +* Android Resolver: Change popup warning when resolver is disabled + to be a console warning. + +# Version 1.2.100 - Jan 25, 2019 +## Bug Fixes +* Android Resolver: Fixed AAR processing sometimes failing on Windows + due to file permissions. + +# Version 1.2.99 - Jan 23, 2019 +## Bug Fixes +* Android Resolver: Improved performance of project property polling. +* Version Handler: Fixed callback of VersionHandler.UpdateCompleteMethods + when the update process is complete. + +# Version 1.2.98 - Jan 9, 2019 +## New Features +* iOS Resolver: Pod declaration properties can now be set via XML pod + references. For example, this can enable pods for a subset of build + configurations. +## Bug Fixes +* iOS Resolver: Fixed incremental builds after local pods support caused + regression in 1.2.96. + +# Version 1.2.97 - Dec 17, 2018 +## Bug Fixes +* Android Resolver: Reduced memory allocation for logic that monitors build + settings when auto-resolution is enabled. If auto-resolution is disabled, + almost all build settings are no longer polled for changes. + +# Version 1.2.96 - Dec 17, 2018 +## Bug Fixes +* Android Resolver: Fixed repacking of AARs to exclude .meta files. +* Android Resolver: Only perform auto-resolution on the first scene while + building. +* Android Resolver: Fixed parsing of version ranges that include whitespace. +* iOS Resolver: Added support for local development pods. +* Version Handler: Fixed Version Handler failing to rename some files. + +# Version 1.2.95 - Oct 23, 2018 +## Bug Fixes: +* Android Resolver: Fixed auto-resolution running in a loop in some scenarios. + +# Version 1.2.94 - Oct 22, 2018 +## Bug Fixes +* iOS Resolver: Added support for PODS_TARGET_SRCROOT in source Cocoapods. + +# Version 1.2.93 - Oct 22, 2018 +## Bug Fixes +* Android Resolver: Fixed removal of Android libraries on auto-resolution when + `*Dependencies.xml` files are deleted. + +# Version 1.2.92 - Oct 2, 2018 +## Bug Fixes +* Android Resolver: Worked around auto-resolution hang on Windows if + resolution starts before compilation is finished. + +# Version 1.2.91 - Sep 27, 2018 +## Bug Fixes +* Android Resolver: Fixed Android Resolution when the selected build target + isn't Android. +* Added C# assembly symbols the plugin to simplify debugging bug reports. + +# Version 1.2.90 - Sep 21, 2018 +## Bug Fixes +* Android Resolver: Fixed transitive dependency selection of version locked + packages. + +# Version 1.2.89 - Aug 31, 2018 +## Bug Fixes +* Fixed FileLoadException in ResolveUnityEditoriOSXcodeExtension an assembly + can't be loaded. + +# Version 1.2.88 - Aug 29, 2018 +## Changed +* Improved reporting of resolution attempts and conflicts found in the Android + Resolver. +## Bug Fixes +* iOS Resolver now correctly handles sample code in CocoaPods. Previously it + would add all sample code to the project when using project level + integration. +* Android Resolver now correctly handles Gradle conflict resolution when the + resolution results in a package that is compatible with all requested + dependencies. + +# Version 1.2.87 - Aug 23, 2018 +## Bug Fixes +* Fixed Android Resolver "Processing AARs" dialog getting stuck in Unity 5.6. + +# Version 1.2.86 - Aug 22, 2018 +## Bug Fixes +* Fixed Android Resolver exception in OnPostProcessScene() when the Android + platform isn't selected. + +# Version 1.2.85 - Aug 17, 2018 +## Changes +* Added support for synchronous resolution in the Android Resolver. + PlayServicesResolver.ResolveSync() now performs resolution synchronously. +* Auto-resolution in the Android Resolver now results in synchronous resolution + of Android dependencies before the Android application build starts via + UnityEditor.Callbacks.PostProcessSceneAttribute. + +# Version 1.2.84 - Aug 16, 2018 +## Bug Fixes +* Fixed Android Resolver crash when the AndroidResolverDependencies.xml + file can't be written. +* Reduced log spam when a conflicting Android library is pinned to a + specific version. + +# Version 1.2.83 - Aug 15, 2018 +## Bug Fixes +* Fixed Android Resolver failures due to an in-accessible AAR / JAR explode + cache file. If the cache can't be read / written the resolver now continues + with reduced performance following recompilation / DLL reloads. +* Fixed incorrect version number in plugin manifest on install. + This was a minor issue since the version handler rewrote the metadata + after installation. + +# Version 1.2.82 - Aug 14, 2018 +## Changed +* Added support for alphanumeric versions in the Android Resolver. + +## Bug Fixes +* Fixed Android Resolver selection of latest duplicated library. +* Fixed Android Resolver conflict resolution when version locked and non-version + locked dependencies are specified. +* Fixed Android Resolver conflict resolution when non-existent artifacts are + referenced. + +# Version 1.2.81 - Aug 9, 2018 +## Bug Fixes +* Fixed editor error that would occur when when + `PlayerSettings.Android.targetArchitectures` was set to + `AndroidArchitecture.All`. + +# Version 1.2.80 - Jul 24, 2018 +## Bug Fixes +* Fixed project level settings incorrectly falling back to system wide settings + when default property values were set. + +# Version 1.2.79 - Jul 23, 2018 +## Bug Fixes +* Fixed AndroidManifest.xml patching on Android Resolver load in Unity 2018.x. + +# Version 1.2.78 - Jul 19, 2018 +## Changed +* Added support for overriding conflicting dependencies. + +# Version 1.2.77 - Jul 19, 2018 +## Changed +* Android Resolver now supports Unity's 2018 ABI filter (i.e arm64-v8a). +* Reduced Android Resolver build option polling frequency. +* Disabled Android Resolver auto-resolution in batch mode. Users now need + to explicitly kick off resolution through the API. +* All Android Resolver and Version Handler dialogs are now disabled in batch + mode. +* Verbose logging for all plugins is now enabled by default in batch mode. +* Version Handler bootstrapper has been improved to no longer call + UpdateComplete multiple times. However, since Unity can still reload the + app domain after plugins have been enabled, users still need to store their + plugin state to persistent storage to handle reloads. + +## Bug Fixes +* Android Resolver no longer incorrectly adds MANIFEST.MF files to AARs. +* Android Resolver auto-resolution jobs are now unscheduled when an explicit + resolve job is started. + +# Version 1.2.76 - Jul 16, 2018 +## Bug Fixes +* Fixed variable replacement in AndroidManifest.xml files in the Android + Resolver. + Version 1.2.75 introduced a regression which caused all variable replacement + to replace the *entire* property value rather than the component of the + property that referenced a variable. For example, + given "applicationId = com.my.app", "${applicationId}.foo" would be + incorrectly expanded as "com.my.app" rather than "com.my.app.foo". This + resulted in numerous issues for Android builds where content provider + initialization would fail and services may not start. + +## Changed +* Gradle prebuild experimental feature has been removed from the Android + Resolver. The feature has been broken for some time and added around 8MB + to the plugin size. +* Added better support for execution of plugin components in batch mode. + In batch mode UnityEditor.update is sometimes never called - like when a + single method is executed - so the new job scheduler will execute all jobs + synchronously from the main thread. + +# Version 1.2.75 - Jun 20, 2018 +## New Features +* Android Resolver now monitors the Android SDK path when + auto-resolution is enabled and triggers resolution when the path is + modified. + +## Changed +* Android auto-resolution is now delayed by 3 seconds when the following build + settings are changed: + - Target ABI. + - Gradle build vs. internal build. + - Project export. +* Added a progress bar display when AARs are being processed during Android + resolution. + +## Bug Fixes +* Fixed incorrect Android package version selection when a mix of + version-locked and non-version-locked packages are specified. +* Fixed non-deterministic Android package version selection to select + the highest version of a specified package rather than the last + package specification passed to the Gradle resolution script. + +# Version 1.2.74 - Jun 19, 2018 +## New Features +* Added workaround for broken AndroidManifest.xml variable replacement in + Unity 2018.x. By default ${applicationId} variables will be replaced by + the bundle ID in the Plugins/Android/AndroidManifest.xml file. The + behavior can be disabled via the Android Resolver settings menu. + +# Version 1.2.73 - May 30, 2018 +## Bug Fixes +* Fixed spurious warning message about missing Android plugins directory on + Windows. + +# Version 1.2.72 - May 23, 2018 +## Bug Fixes +* Fixed spurious warning message about missing Android plugins directory. + +# Version 1.2.71 - May 10, 2018 +## Bug Fixes +* Fixed resolution of Android dependencies when the `Assets/Plugins/Android` + directory is named in a different case e.g `Assets/plugins/Android`. + +# Version 1.2.70 - May 7, 2018 +## Bug Fixes +* Fixed bitcode flag being ignored for iOS pods. + +# Version 1.2.69 - May 7, 2018 +## Bug Fixes +* Fixed escaping of local repository paths in Android Resolver. + +# Version 1.2.68 - May 3, 2018 +## Changes +* Added support for granular builds of Google Play Services. + +# Version 1.2.67 - May 1, 2018 +## Changes +* Improved support for iOS source-only pods in Unity 5.5 and below. + +# Version 1.2.66 - April 27, 2018 +## Bug Fixes +* Fixed Version Handler renaming of Linux libraries with hyphens in filenames. + Previously, libraries named Foo-1.2.3.so were not being renamed to + libFoo-1.2.3.so on Linux which could break native library loading on some + versions of Unity. + +# Version 1.2.65 - April 26, 2018 +## Bug Fixes +* Fix CocoaPods casing in logs and comments. + +# Version 1.2.64 - Mar 16, 2018 +## Bug Fixes +* Fixed bug in download_artifacts.gradle (used by Android Resolver) which + reported a failure if required artifacts already exist. + +# Version 1.2.63 - Mar 15, 2018 +## Bug Fixes +* Fixed iOS Resolver include search paths taking precedence over system headers + when using project level resolution. +* Fixed iOS Resolver includes relative to library root, when using project level + resolution. + +# Version 1.2.62 - Mar 12, 2018 +## Changes +* Improved error reporting when a file can't be moved to trash by the + Version Handler. +## Bug Fixes +* Fixed Android Resolver throwing NullReferenceException when the Android SDK + path isn't set. +* Fixed Version Handler renaming files with underscores if the + "Rename to Canonical Filenames" setting is enabled. + +# Version 1.2.61 - Jan 22, 2018 +## Bug Fixes +* Fixed Android Resolver reporting non-existent conflicting dependencies when + Gradle build system is enabled. + +# Version 1.2.60 - Jan 12, 2018 +## Changes +* Added support for Maven / Ivy version specifications for Android packages. +* Added support for Android SNAPSHOT packages. + +## Bug Fixes +* Fixed Openjdk version check. +* Fixed non-deterministic Android package resolution when two packages contain + an artifact with the same name. + +# Version 1.2.59 - Oct 19, 2017 +## Bug Fixes +* Fixed execution of Android Gradle resolution script when it's located + in a path with whitespace. + +# Version 1.2.58 - Oct 19, 2017 +## Changes +* Removed legacy resolution method from Android Resolver. + It is now only possible to use the Gradle or Gradle prebuild resolution + methods. + +# Version 1.2.57 - Oct 18, 2017 +## Bug Fixes +* Updated Gradle wrapper to 4.2.1 to fix issues using Gradle with the + latest Openjdk. +* Android Gradle resolution now also uses gradle.properties to pass + parameters to Gradle in an attempt to workaround problems with + command line argument parsing on Windows 10. + +# Version 1.2.56 - Oct 12, 2017 +## Bug Fixes +* Fixed Gradle artifact download with non-version locked artifacts. +* Changed iOS resolver to only load dependencies at build time. + +# Version 1.2.55 - Oct 4, 2017 +## Bug Fixes +* Force Android Resolution when the "Install Android Packages" setting changes. + +# Version 1.2.54 - Oct 4, 2017 +## Bug Fixes +* Fixed execution of command line tools on Windows when the path to the tool + contains a single quote (apostrophe). In this case we fallback to executing + the tool via the system shell. + +# Version 1.2.53 - Oct 2, 2017 +## New Features +* Changed Android Resolver "resolution complete" dialog so that it now displays + failures. +* Android Resolver now detects conflicting libraries that it does not manage + warning the user if they're newer than the managed libraries and prompting + the user to clean them up if they're older or at the same version. + +## Bug Fixes +* Improved Android Resolver auto-resolution speed. +* Fixed bug in the Gradle Android Resolver which would result in resolution + succeeding when some dependencies are not found. + +# Version 1.2.52 - Sep 25, 2017 +## New Features +* Changed Android Resolver's Gradle resolution to resolve conflicting + dependencies across Google Play services and Android Support library packages. + +# Version 1.2.51 - Sep 20, 2017 +## Changes +* Changed iOS Resolver to execute the CocoaPods "pod" command via the shell + by default. Some developers customize their shell environment to use + custom ssh certs to access internal git repositories that host pods so + executing "pod" via the shell will work for these scenarios. + The drawback of executing "pod" via the shell could potentially cause + users problems if they break their shell environment. Though users who + customize their shell environments will be able to resolve these issues. + +# Version 1.2.50 - Sep 18, 2017 +## New Features +* Added option to disable the Gradle daemon in the Android Resolver. + This daemon is now disabled by default as some users are getting into a state + where multiple daemon instances are being spawned when changing dependencies + which eventually results in Android resolution failing until all daemon + processes are manually killed. + +## Bug Fixes +* Android resolution is now always executed if the user declines the update + of their Android SDK. This ensure users can continue to use out of date + Android SDK packages if they desire. + +# Version 1.2.49 - Sep 18, 2017 +## Bug Fixes +* Removed modulemap parsing in iOS Resolver. + The framework *.modulemap did not need to be parsed by the iOS Resolver + when injecting Cocoapods into a Xcode project. Simply adding a modular + framework to a Xcode project results in Xcode's Clang parsing the associated + modulemap and injecting any compile and link flags into the build process. + +# Version 1.2.48 - Sep 12, 2017 +## New Features +* Changed settings to be per-project by default. + +## Bug Fixes +* Added Google maven repository to fix GradlePrebuild resolution with Google + components. +* Fixed Android Resolution failure with spaces in paths. + +# Version 1.2.47 - Aug 29, 2017 +## New Features +* Android and iOS dependencies can now be specified using *Dependencies.xml + files. This is now the preferred method for registering dependencies, + we may remove the API for dependency addition in future. +* Added "Reset to Defaults" button to each settings dialog to restore default + settings. +* Android Resolver now validates the configured JDK is new enough to build + recently released Android libraries. +## Bug Fixes +* Fixed a bug that caused dependencies with the "LATEST" version specification + to be ignored when using the Gradle mode of the Android Resolver. +* Fixed a race condition when running Android Resolution. +* Fixed Android Resolver logging if a PlayServicesSupport instance is created + with no logging enabled before the Android Resolver is initialized. +* Fixed iOS resolver dialog in Unity 4. +* Fixed iOS Cocoapod Xcode project integration in Unity 4. + +# Version 1.2.46 - Aug 22, 2017 +## Bug Fixes +* GradlePrebuild Android resolver on Windows now correctly locates dependent + data files. + +# Version 1.2.45 - Aug 22, 2017 +## Bug Fixes +* Improved Android package auto-resolution and fixed clean up of stale + dependencies when using Gradle dependency resolution. + +# Version 1.2.44 - Aug 21, 2017 +## Bug Fixes +* Enabled autoresolution for Gradle Prebuild. +* Made the command line dialog windows have selectable text. +* Fixed incorrect "Android Settings" dialog disabled groups. +* Updated PlayServicesResolver android platform detection to use the package + manager instead of the 'android' tool. +* UnityCompat reflection methods 'GetAndroidPlatform' and + 'GetAndroidBuildToolsVersion' are now Obsolete due to dependence on the + obsolete 'android' build tool. + +# Version 1.2.43 - Aug 18, 2017 +## Bug Fixes +* Fixed Gradle resolution in the Android Resolver when running + PlayServicesResolver.Resolve() in parallel or spawning multiple + resolutions before the previous resolve completed. + +# Version 1.2.42 - Aug 17, 2017 +## Bug Fixes +* Fixed Xcode project level settings not being applied by IOS Resolver when + Xcode project pod integration is enabled. + +# Version 1.2.41 - Aug 15, 2017 +## Bug Fixes +* IOS Resolver's Xcode workspace pod integration is now disabled when Unity + Cloud Build is detected. Unity Cloud Build does not follow the same build + process as the Unity editor and fails to open the generated xcworkspace at + this time. + +# Version 1.2.40 - Aug 15, 2017 +## Bug Fixes +* Moved Android Resolver Gradle Prebuild scripts into Google.JarResolver.dll. + They are now extracted from the DLL when required. +* AARs / JARs are now cleaned up when switching the Android resolution + strategy. + +# Version 1.2.39 - Aug 10, 2017 +## New Features +* Android Resolver now supports resolution with Gradle. This enables support + for non-local artifacts. +## Bug Fixes +* Android Resolver's Gradle Prebuild now uses Android build tools to determine + the Android platform tools version rather than relying upon internal Unity + APIs. +* Android Resolver's Gradle Prebuild now correctly strips binaries that are + not required for the target ABI. + +# Version 1.2.38 - Aug 7, 2017 +## Bug Fixes +* Fixed an issue in VersionHandler where disabled targets are ignored if + the "Any Platform" flag is set on a plugin DLL. + +# Version 1.2.37 - Aug 3, 2017 +## New Features +* Exposed GooglePlayServices.PlayServicesResolver.Resolve() so that it's + possible for a script to be notified when AAR / Jar resolution is complete. + This makes it easier to setup a project to build from the command line. + +# Version 1.2.36 - Aug 3, 2017 +## New Features +* VersionHandler.UpdateCompleteMethods allows a user to provide a list of + methods to be called when VersionHandlerImpl has completed an update. + This makes it easier to import a plugin and wait for VersionHandler to + execute prior executing a build. + +# Version 1.2.35 - Jul 28, 2017 +## New Features +* VersionHandler will now rename Linux libraries so they can target Unity + versions that require different file naming. Libraries need to be labelled + gvh_linuxlibname-${basename} in order to be considered for renaming. + e.g gvh\_linuxlibname-MyLib will be named MyLib.so in Unity 5.5 and below and + libMyLib.so in Unity 5.6 and above. + +# Version 1.2.34 - Jul 28, 2017 +## Bug Fixes +* Made VersionHandler bootstrap module more robust when calling static + methods before the implementation DLL is loaded. + +# Version 1.2.33 - Jul 27, 2017 +## New Features +* Added a bootstrap module for VersionHandler so the implementation + of the VersionHandler module can be versioned without resulting in + a compile error when imported at different versions across multiple + plugins. + +# Version 1.2.32 - Jul 20, 2017 +## New Features +* Added support for build target selection based upon .NET framework + version in the VersionHandler. + When applying either gvh\_dotnet-3.5 or gvh\_dotnet-4.5 labels to + assets, the VersionHandler will only enable the asset for the + specified set of build targets when the matching .NET framework version + is selected in Unity 2017's project settings. This allows assets + to be provided in a plugin that need to differ based upon .NET version. + +# Version 1.2.31 - Jul 5, 2017 +## Bug Fixes +* Force expansion of AARs with native components when using Unity 2017 + with the internal build system. In contrast to Unity 5.x, Unity 2017's + internal build system does not include native libraries included in AARs. + Forcing expansion of AARs with native components generates an + Ant / Eclipse project for each AAR which is correctly included by Unity + 2017's internal build system. + +# Version 1.2.30 - Jul 5, 2017 +## Bug Fixes +* Fixed Cocoapods being installed when the build target isn't iOS. +* Added support for malformed AARs with missing classes.jar. + +# Version 1.2.29 - Jun 16, 2017 +## New Features +* Added support for the Android sdkmanager tool. + +# Version 1.2.28 - Jun 8, 2017 +## Bug Fixes +* Fixed non-shell command line execution (regression from + Cocoapod installation patch). + +# Version 1.2.27 - Jun 7, 2017 +## Bug Fixes +* Added support for stdout / stderr redirection when executing + commands in shell mode. + This fixes CocoaPod tool installation when shell mode is + enabled. +* Fixed incremental builds when additional sources are specified + in the Podfile. + +# Version 1.2.26 - Jun 7, 2017 +## Bug Fixes +* Fixed a crash when importing Version Handler into Unity 4.7.x. + +# Version 1.2.25 - Jun 7, 2017 +## Bug Fixes +* Fixed an issue in the Jar Resolver which incorrectly notified + event handlers of bundle ID changes when the currently selected + (not active) build target changed in Unity 5.6 and above. + +# Version 1.2.24 - Jun 6, 2017 +## New Features +* Added option to control file renaming in Version Handler settings. + Disabling file renaming (default option) significantly increases + the speed of file version management operations with the downside + that any files that are referenced directly by canonical filename + rather than asset ID will no longer be valid. +* Improved logging in the Version Handler. +## Bug Fixes +* Fixed an issue in the Version Handler which caused it to not + re-enable plugins when re-importing a custom package with disabled + version managed files. + +# Version 1.2.23 - May 26, 2017 +## Bug Fixes +* Fixed a bug with gradle prebuild resolver on windows. + +# Version 1.2.22 - May 19, 2017 +## Bug Fixes +* Fixed a bug in the iOS resolver with incremental builds. +* Fixed misdetection of Cocoapods support with Unity beta 5.6. + +# Version 1.2.21 - May 8, 2017 +## Bug Fixes +* Fix for https://github.com/googlesamples/unity-jar-resolver/issues/48 + Android dependency version number parsing when "-alpha" (etc.) are + included in dependency (AAR / JAR) versions. + +# Version 1.2.20 - May 8, 2017 +## Bug Fixes +* Attempted to fix + https://github.com/googlesamples/unity-jar-resolver/issues/48 + where a NullReferenceException could occur if a target file does not + have a valid version string. + +# Version 1.2.19 - May 4, 2017 +## Bug Fixes +* Fixed Jar Resolver exploding and deleting AAR files it isn't managing. + +# Version 1.2.18 - May 4, 2017 +## New Features +* Added support for preserving Unity pods such as when GVR is enabled. + +# Version 1.2.17 - Apr 20, 2017 +## Bug Fixes +* Fixed auto-resolution when an Android application ID is modified. + +# Version 1.2.16 - Apr 17, 2017 +## Bug Fixes +* Fixed Unity version number parsing on machines with a locale that uses + "," for decimal points. +* Fixed null reference exception if JDK path isn't set. + +# Version 1.2.15 - Mar 17, 2017 +## New Features +* Added warning when the Jar Resolver's background resolution is disabled. +## Bug Fixes +* Fixed support of AARs with native libraries when using Gradle. +* Fixed extra repository paths when resolving dependencies. + +# Version 1.2.14 - Mar 7, 2017 +## New Features +* Added experimental Android resolution using Gradle. + This alternative resolver supports proguard stripping with Unity's + internal build system. +* Added Android support for single ABI builds when using AARs include + native libraries. +* Disabled Android resolution on changes to all .cs and .js files. + File patterns that are monitored for auto-resolution can be added + using PlayServicesResolver.AddAutoResolutionFilePatterns(). +* Added tracking of resolved AARs and JARs so they can be cleaned up + if they're no longer referenced by a project. +* Added persistence of AAR / JAR version replacement for each Unity + session. +* Added settings dialog to the iOS resolver. +* Integrated Cocoapod tool installation in the iOS resolver. +* Added option to run pod tool via the shell. +## Bug Fixes +* Fixed build of some source Cocoapods (e.g Protobuf). +* VersionHandler no longer prompts to delete obsolete manifests. +* iOS resolver handles Cocoapod installation when using Ruby < 2.2.2. +* Added workaround for package version selection when including + Google Play Services on Android. +* Fixed support for pods that reference static libraries. +* Fixed support for resource-only pods. + +# Version 1.2.12 - Feb 14, 2017 +## Bug Fixes +* Fixed re-explosion of AARs when the bundle ID is modified. + +# Version 1.2.11 - Jan 30, 2017 +## New Features +* Added support for Android Studio builds. +* Added support for native (C/C++) shared libraries in AARs. + +# Version 1.2.10 - Jan 11, 2017 +## Bug Fixes +* Fixed SDK manager path retrieval. +* Also, report stderr when it's not possible to run the "pod" tool. +* Handle exceptions thrown by Unity.Cecil on asset rename +* Fixed IOSResolver to handle PlayerSettings.iOS.targetOSVersionString + +# Version 1.2.9 - Dec 7, 2016 +## Bug Fixes +* Improved error reporting when "pod repo update" fails. +* Added detection of xml format xcode projects generated by old Cocoapods + installations. + +# Version 1.2.8 - Dec 6, 2016 +## Bug Fixes +* Increased speed of JarResolver resolution. +* Fixed JarResolver caches getting out of sync with requested dependencies + by removing the caches. +* Fixed JarResolver explode cache always being rewritten even when no + dependencies change. + +# Version 1.2.7 - Dec 2, 2016 +## Bug Fixes +* Fixed VersionHandler build errors with Unity 5.5, due to the constantly + changing BuildTarget enum. +* Added support for Unity configured JDK Path rather than requiring + JAVA_HOME to be set in the Jar Resolver. + +# Version 1.2.6 - Nov 15, 2016 +## Bug Fixes +* Fixed IOSResolver errors when iOS support is not installed. +* Added fallback to "pod" executable search which queries the Ruby Gems + package manager for the binary install location. + +# Version 1.2.5 - Nov 3, 2016 +## Bug Fixes +* Added crude support for source only Cocoapods to the IOSResolver. + +# Version 1.2.4 - Oct 27, 2016 +## Bug Fixes +* Automated resolution of out of date pod repositories. + +# Version 1.2.3 - Oct 25, 2016 +## Bug Fixes +* Fixed exception when reporting conflicting dependencies. + +# Version 1.2.2 - Oct 17, 2016 +## Bug Fixes +* Fixed issue working with Unity 5.5 +* Fixed issue with PlayServicesResolver corrupting other iOS dependencies. +* Updated build script to use Unity distributed tools for building. + +# Version 1.2.1 - Jul 25, 2016 +## Bug Fixes +* Removed 1.2 Resolver and hardcoded whitelist of AARs to expand. +* Improved error reporting when the "jar" executable can't be found. +* Removed the need to set JAVA_HOME if "jar" is in the user's path. +* Fixed spurious copying of partially matching AARs. +* Changed resolver to only copy / expand when source AARs change. +* Auto-resolution of dependencies is now performed when the Android + build target is selected. + +## New Features +* Expand AARs that contain manifests with variable expansion like + ${applicationId}. +* Added optional logging in the JarResolverLib module. +* Integration with the Android SDK manager for dependencies that + declare required Android SDK packages. + +# Version 1.2.0 - May 11 2016 +## Bug Fixes +* Handles resolving dependencies when the artifacts are split across 2 repos. +* #4 Misdetecting version for versions like 1.2-alpha. These are now string + compared if alphanumeric +* Removed resolver creation via reflection since it did not work all the time. + Now a resolver needs to be loaded externally (which is existing behavior). + +## New Features +* Expose PlayServicesResolver properties to allow for script access. +* Explodes firebase-common and firebase-measurement aar files to support + ${applicationId} substitution. + +# Version 1.1.1 - 25 Feb 2016 +## Bug Fixes +* #1 Spaces in project path not handled when exploding Aar file. +* #2 Script compilation error: TypeLoadException. + +# Version 1.1.0 - 5 Feb 2016 +## New Features +* Adds friendly alert when JAVA_HOME is not set on Windows platforms. +* Adds flag for disabling background resolution. +* Expands play-services-measurement and replaces ${applicationId} with the + bundle Id. + + ## Bug Fixes +* Fixes infinite loop of resolution triggered by resolution. diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/CHANGELOG.md.meta b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/CHANGELOG.md.meta new file mode 100644 index 00000000..fbcd006a --- /dev/null +++ b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/CHANGELOG.md.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2b4957d4e158489ca7b410312d84e001 +labels: +- gvh +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/CHANGELOG.md +timeCreated: 1584567712 +licenseType: Store +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll new file mode 100644 index 00000000..d313c623 Binary files /dev/null and b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll differ diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll.meta b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll.meta new file mode 100644 index 00000000..fa372ec6 --- /dev/null +++ b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll.meta @@ -0,0 +1,36 @@ +fileFormatVersion: 2 +guid: 164f2f671ce9410dadebde5826bc0b51 +labels: +- gvh +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/Google.VersionHandler.dll +- gvhp_targets-editor +timeCreated: 1480838400 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/LICENSE b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/LICENSE new file mode 100644 index 00000000..6258cc47 --- /dev/null +++ b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/LICENSE @@ -0,0 +1,245 @@ +Copyright (C) 2014 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +==================================================================================================== +This package uses MiniJSON + +Copyright (c) 2013 Calvin Rien + +Based on the JSON parser by Patrick van Bergen +http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html + +Simplified it so that it doesn't throw exceptions +and can be used in Unity iPhone with maximum code stripping. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/LICENSE.meta b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/LICENSE.meta new file mode 100644 index 00000000..80c30d4f --- /dev/null +++ b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/LICENSE.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 805e2c2846dd44248246ef896b03c176 +labels: +- gvh +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/LICENSE +timeCreated: 1584567712 +licenseType: Store +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/README.md b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/README.md new file mode 100644 index 00000000..3a7a5a26 --- /dev/null +++ b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/README.md @@ -0,0 +1,897 @@ +# External Dependency Manager for Unity + +[![openupm](https://img.shields.io/npm/v/com.google.external-dependency-manager?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.google.external-dependency-manager/) +[![openupm](https://img.shields.io/badge/dynamic/json?color=brightgreen&label=downloads&query=%24.downloads&suffix=%2Fmonth&url=https%3A%2F%2Fpackage.openupm.com%2Fdownloads%2Fpoint%2Flast-month%2Fcom.google.external-dependency-manager)](https://openupm.com/packages/com.google.external-dependency-manager/) + +## Overview + +The External Dependency Manager for Unity (EDM4U) (formerly Play Services +Resolver/Jar Resolver) is intended to be used by any Unity package or user that +requires: + +* Android specific libraries (e.g + [AARs](https://developer.android.com/studio/projects/android-library.html)) + +* iOS [CocoaPods](https://cocoapods.org/) + +* Version management of transitive dependencies + +* Management of Package Manager (PM) Registries + +If you want to add and use iOS/Android dependencies directly in your project, +then you should to install EDM4U in your project. + +If you are a package user and the plugin you are using depends on EDM4U, *and* +the package does not include EDM4U as a package dependency already, then you +should to install EDM4U in your project. + +If you are a UPM package maintainer and your package requires EDM4U, then you +should add EDM4U as a +[package dependency](https://docs.unity3d.com/2019.3/Documentation/Manual/upm-dependencies.html) +in your package manifest (`package.json`): + +```json +{ + "dependencies": { + "com.google.external-dependency-manager": "1.2.178" + } +} +``` + +You should still install EDM4U to test out the package during development. + +If you are a legacy `.unitypackage` package maintainer and your package requires +EDM4U, please ask the user to install EDM4U separately. You should install EDM4U +to test out the package during development. + +Updated releases are available on +[GitHub](https://github.com/googlesamples/unity-jar-resolver) + +## Requirements + +The *Android Resolver* and *iOS Resolver* components of the plugin only work +with Unity version 4.6.8 or higher. + +The *Version Handler* component only works with Unity 5.x or higher as it +depends upon the `PluginImporter` UnityEditor API. + +The *Package Manager Resolver* component only works with Unity 2018.4 or above, +when [scoped registry](https://docs.unity3d.com/Manual/upm-scoped.html) support +was added to the Package Manager. + +## Getting Started + +Check out [troubleshooting](troubleshooting-faq.md) if you need help. + +### Install via OpenUPM + +EDM4U is available on +[OpenUPM](https://openupm.com/packages/com.google.external-dependency-manager/): + +```shell +openupm add com.google.external-dependency-manager +``` + +### Install via Google APIs for Unity + +EDM4U is available both in UPM and legacy `.unitypackage` formats on +[Google APIs for Unity](https://developers.google.com/unity/archive#external_dependency_manager_for_unity). + +You may install the UPM version (.tgz) as a +[local UPM package](https://docs.unity3d.com/Manual/upm-ui-local.html). + +You can also install EDM4U in your project as a `.unitypackage`. This is not +recommended due to potential conflicts. + +### Conflict Resolution + +For historical reasons, a package maintainer may choose to embed EDM4U in their +package for ease of installation. This will create a conflict when you try to +install EDM4U with the steps above, or with another package with embedded EDM4U. +If your project imported a `.unitypackage` that has a copy of EDM4U embedded in +it, you may safely delete it from your Assets folder. If your project depends on +another UPM package with EDM4U, please reach out to the package maintainer and +ask them to replace it with a dependency to this package. In the meantime, you +can workaround the issue by copying the package to your Packages folder (to +create an +[embedded package](https://docs.unity3d.com/Manual/upm-concepts.html#Embedded)) +and perform the steps yourself to avoid a dependency conflict. + +### Config file + +To start adding dependencies to your project, copy and rename the +[SampleDependencies.xml](https://github.com/googlesamples/unity-jar-resolver/blob/master/sample/Assets/ExternalDependencyManager/Editor/SampleDependencies.xml) +file into your plugin and add the dependencies your project requires. + +The XML file needs to be under an `Editor` directory and match the name +`*Dependencies.xml`. For example, `MyPlugin/Editor/MyPluginDependencies.xml`. + +## Usages + +### Android Resolver + +The Android Resolver copies specified dependencies from local or remote Maven +repositories into the Unity project when a user selects Android as the build +target in the Unity editor. + +For example, to add the Google Play Games library +(`com.google.android.gms:play-services-games` package) at version `9.8.0` to the +set of a plugin's Android dependencies: + +```xml + + + + + extra-google-m2repository + + + + +``` + +The version specification (last component) supports: + +* Specific versions e.g `9.8.0` + +* Partial matches e.g `9.8.+` would match 9.8.0, 9.8.1 etc. choosing the most + recent version + +* Latest version using `LATEST` or `+`. We do *not* recommend using this + unless you're 100% sure the library you depend upon will not break your + Unity plugin in future + +The above example specifies the dependency as a component of the Android SDK +manager such that the Android SDK manager will be executed to install the +package if it's not found. If your Android dependency is located on Maven +central it's possible to specify the package simply using the `androidPackage` +element: + +```xml + + + + + +``` + +#### Auto-resolution + +By default the Android Resolver automatically monitors the dependencies you have +specified and the `Plugins/Android` folder of your Unity project. The resolution +process runs when the specified dependencies are not present in your project. + +The *auto-resolution* process can be disabled via the `Assets > External +Dependency Manager > Android Resolver > Settings` menu. + +Manual resolution can be performed using the following menu options: + +* `Assets > External Dependency Manager > Android Resolver > Resolve` + +* `Assets > External Dependency Manager > Android Resolver > Force Resolve` + +#### Deleting libraries + +Resolved packages are tracked via asset labels by the Android Resolver. They can +easily be deleted using the `Assets > External Dependency Manager > Android +Resolver > Delete Resolved Libraries` menu item. + +#### Android Manifest Variable Processing + +Some AAR files (for example play-services-measurement) contain variables that +are processed by the Android Gradle plugin. Unfortunately, Unity does not +perform the same processing when using Unity's Internal Build System, so the +Android Resolver plugin handles known cases of this variable substitution by +exploding the AAR into a folder and replacing `${applicationId}` with the +`bundleID`. + +Disabling AAR explosion and therefore Android manifest processing can be done +via the `Assets > External Dependency Manager > Android Resolver > Settings` +menu. You may want to disable explosion of AARs if you're exporting a project to +be built with Gradle/Android Studio. + +#### ABI Stripping + +Some AAR files contain native libraries (.so files) for each ABI supported by +Android. Unfortunately, when targeting a single ABI (e.g x86), Unity does not +strip native libraries for unused ABIs. To strip unused ABIs, the Android +Resolver plugin explodes an AAR into a folder and removes unused ABIs to reduce +the built APK size. Furthermore, if native libraries are not stripped from an +APK (e.g you have a mix of Unity's x86 library and some armeabi-v7a libraries) +Android may attempt to load the wrong library for the current runtime ABI +completely breaking your plugin when targeting some architectures. + +AAR explosion and therefore ABI stripping can be disabled via the `Assets > +External Dependency Manager > Android Resolver > Settings` menu. You may want to +disable explosion of AARs if you're exporting a project to be built with +Gradle/Android Studio. + +#### Resolution Strategies + +By default the Android Resolver will use Gradle to download dependencies prior +to integrating them into a Unity project. This works with Unity's internal build +system and Gradle/Android Studio project export. + +It's possible to change the resolution strategy via the `Assets > External +Dependency Manager > Android Resolver > Settings` menu. + +##### Download Artifacts with Gradle + +Using the default resolution strategy, the Android resolver executes the +following operations: + +- Remove the result of previous Android resolutions. E.g Delete all files and + directories labeled with "gpsr" under `Plugins/Android` from the project. + +- Collect the set of Android dependencies (libraries) specified by a project's + `*Dependencies.xml` files. + +- Run `download_artifacts.gradle` with Gradle to resolve conflicts and, if + successful, download the set of resolved Android libraries (AARs, JARs). + +- Process each AAR/JAR so that it can be used with the currently selected + Unity build system (e.g Internal vs. Gradle, Export vs. No Export). This + involves patching each reference to `applicationId` in the + `AndroidManifest.xml` with the project's bundle ID. This means resolution + must be run again if the bundle ID has changed. + +- Move the processed AARs to `Plugins/Android` so they will be included when + Unity invokes the Android build. + +##### Integrate into mainTemplate.gradle + +Unity 5.6 introduced support for customizing the `build.gradle` used to build +Unity projects with Gradle. When the *Patch mainTemplate.gradle* setting is +enabled, rather than downloading artifacts before the build, Android resolution +results in the execution of the following operations: + +- Remove the result of previous Android resolutions. E.g Delete all files and + directories labeled with "gpsr" under `Plugins/Android` from the project and + remove sections delimited with `// Android Resolver * Start` and `// Android + Resolver * End` lines. + +- Collect the set of Android dependencies (libraries) specified by a project's + `*Dependencies.xml` files. + +- Rename any `.srcaar` files in the build to `.aar` and exclude them from + being included directly by Unity in the Android build as + `mainTemplate.gradle` will be patched to include them instead from their + local maven repositories. + +- Inject the required Gradle repositories into `mainTemplate.gradle` at the + line matching the pattern `.*apply plugin: + 'com\.android\.(application|library)'.*` or the section starting at the line + `// Android Resolver Repos Start`. If you want to control the injection + point in the file, the section delimited by the lines `// Android Resolver + Repos Start` and `// Android Resolver Repos End` should be placed in the + global scope before the `dependencies` section. + +- Inject the required Android dependencies (libraries) into + `mainTemplate.gradle` at the line matching the pattern `***DEPS***` or the + section starting at the line `// Android Resolver Dependencies Start`. If + you want to control the injection point in the file, the section delimited + by the lines `// Android Resolver Dependencies Start` and `// Android + Resolver Dependencies End` should be placed in the `dependencies` section. + +- Inject the packaging options logic, which excludes architecture specific + libraries based upon the selected build target, into `mainTemplate.gradle` + at the line matching the pattern `android +{` or the section starting at the + line `// Android Resolver Exclusions Start`. If you want to control the + injection point in the file, the section delimited by the lines `// Android + Resolver Exclusions Start` and `// Android Resolver Exclusions End` should + be placed in the global scope before the `android` section. + +#### Dependency Tracking + +The Android Resolver creates the +`ProjectSettings/AndroidResolverDependencies.xml` to quickly determine the set +of resolved dependencies in a project. This is used by the auto-resolution +process to only run the expensive resolution process when necessary. + +#### Displaying Dependencies + +It's possible to display the set of dependencies the Android Resolver would +download and process in your project via the `Assets > External Dependency +Manager > Android Resolver > Display Libraries` menu item. + +### iOS Resolver + +The iOS resolver component of this plugin manages +[CocoaPods](https://cocoapods.org/). A CocoaPods `Podfile` is generated and the +`pod` tool is executed as a post build process step to add dependencies to the +Xcode project exported by Unity. + +Dependencies for iOS are added by referring to CocoaPods. + +For example, to add the AdMob pod, version 7.0 or greater with bitcode enabled: + +```xml + + + + + +``` + +#### Integration Strategies + +The `CocoaPods` are either: + +* Downloaded and injected into the Xcode project file directly, rather than + creating a separate xcworkspace. We call this `Xcode project` integration. + +* If the Unity version supports opening a xcworkspace file, the `pod` tool is + used as intended to generate a xcworkspace which references the CocoaPods. + We call this `Xcode workspace` integration. + +The resolution strategy can be changed via the `Assets > External Dependency +Manager > iOS Resolver > Settings` menu. + +##### Appending text to generated Podfile + +In order to modify the generated Podfile you can create a script like this: + +```csharp +using System.IO; + +using UnityEditor; +using UnityEditor.Callbacks; +using UnityEngine; + +public class PostProcessIOS : MonoBehaviour +{ + // Must be between 40 and 50 to ensure that it's not overriden by Podfile generation (40) and + // that it's added before "pod install" (50). + [PostProcessBuildAttribute(45)] + private static void PostProcessBuild_iOS(BuildTarget target, string buildPath) + { + if (target == BuildTarget.iOS) + { + using (StreamWriter sw = File.AppendText(buildPath + "/Podfile")) + { + // E.g. add an app extension + sw.WriteLine("\ntarget 'NSExtension' do\n pod 'Firebase/Messaging', '6.6.0'\nend"); + } + } + } +} +``` + +### Package Manager Resolver + +Adding registries to the +[Package Manager](https://docs.unity3d.com/Manual/Packages.html) (PM) is a +manual process. The Package Manager Resolver (PMR) component of this plugin +makes it easy for plugin maintainers to distribute new PM registry servers and +easy for plugin users to manage PM registry servers. + +#### Adding Registries + +For example, to add a registry for plugins in the scope `com.coolstuff`: + +```xml + + + + com.coolstuff + + + +``` + +When PMR is loaded it will prompt the developer to add the registry to their +project if it isn't already present in the `Packages/manifest.json` file. + +For more information, see Unity's documentation on +[scoped package registries](https://docs.unity3d.com/Manual/upm-scoped.html). + +#### Managing Registries + +It's possible to add and remove registries that are specified via PMR XML +configuration files via the following menu options: + +* `Assets > External Dependency Manager > Package Manager Resolver > Add + Registries` will prompt the user with a window which allows them to add + registries discovered in the project to the Package Manager. + +* `Assets > External Dependency Manager > Package Manager Resolver > Remove + Registries` will prompt the user with a window which allows them to remove + registries discovered in the project from the Package Manager. + +* `Assets > External Dependency Manager > Package Manager Resolver > Modify + Registries` will prompt the user with a window which allows them to add or + remove registries discovered in the project. + +#### Migration + +PMR can migrate Version Handler packages installed in the `Assets` folder to PM +packages. This requires the plugins to implement the following: + +* `.unitypackage` must include a Version Handler manifests that describes the + components of the plugin. If the plugin has no dependencies the manifest + would just include the files in the plugin. + +* The PM package JSON provided by the registry must include a keyword (in the + `versions.VERSION.keyword` list) that maps the PM package to a Version + Handler package using the format `vh-name:VERSION_HANDLER_MANIFEST_NAME` + where `VERSION_HANDLER_MANIFEST_NAME` is the name of the manifest defined in + the `.unitypackage`. For more information see the description of the + `gvhp_manifestname` asset label in the [Version Handler](#version-handler) + section. + +When using the `Assets > External Dependency Manager > Package Manager +Resolver > Migrate Packages` menu option, PMR then will: + +* List all Version Handler manager packages in the project. + +* Search all available packages in the PM registries and fetch keywords + associated with each package parsing the Version Handler manifest names for + each package. + +* Map each installed Version Handler package to a PM package. + +* Prompt the user to migrate the discovered packages. + +* Perform package migration for all selected packages if the user clicks the + `Apply` button. + +#### Configuration + +PMR can be configured via the `Assets > External Dependency Manager > Package +Manager Resolver > Settings` menu option: + +* `Add package registries` when enabled, when the plugin loads or registry + configuration files change, this will prompt the user to add registries that + are not present in the Package Manager. + +* `Prompt to add package registries` will cause a developer to be prompted + with a window that will ask for confirmation before adding registries. When + this is disabled registries are added silently to the project. + +* `Prompt to migrate packages` will cause a developer to be prompted with a + window that will ask for confirmation before migrating packages installed in + the `Assets` directory to PM packages. + +* `Enable Analytics Reporting` when enabled, reports the use of the plugin to + the developers so they can make imrpovements. + +* `Verbose logging` when enabled prints debug information to the console which + can be useful when filing bug reports. + +### Version Handler + +The Version Handler component of this plugin manages: + +* Shared Unity plugin dependencies. + +* Upgrading Unity plugins by cleaning up old files from previous versions. + +* Uninstallation of plugins that are distributed with manifest files. + +* Restoration of plugin assets to their original install locations if assets + are tagged with the `exportpath` label. + +Since the Version Handler needs to modify Unity asset metadata (`.meta` files), +to enable/disable components, rename and delete asset files it does not work +with Package Manager installed packages. It's still possible to include EDM4U in +Package Manager packages, the Version Handler component simply won't do anything +to PM plugins in this case. + +#### Using Version Handler Managed Plugins + +If a plugin is imported at multiple different versions into a project, if the +Version Handler is enabled, it will automatically check all managed assets to +determine the set of assets that are out of date and assets that should be +removed. To disable automatic checking managed assets disable the `Enable +version management` option in the `Assets > External Dependency Manager > +Version Handler > Settings` menu. + +If version management is disabled, it's possible to check managed assets +manually using the `Assets > External Dependency Manager > Version Handler > +Update` menu option. + +##### Listing Managed Plugins + +Plugins managed by the Version Handler, those that ship with manifest files, can +displayed using the `Assets > External Dependency Manager > Version Handler > +Display Managed Packages` menu option. The list of plugins are written to the +console window along with the set of files used by each plugin. + +##### Uninstalling Managed Plugins + +Plugins managed by the Version Handler, those that ship with manifest files, can +be removed using the `Assets > External Dependency Manager > Version Handler > +Uninstall Managed Packages` menu option. This operation will display a window +that allows a developer to select a set of plugins to remove which will remove +all files owned by each plugin excluding those that are in use by other +installed plugins. + +Files managed by the Version Handler, those labeled with the `gvh` asset label, +can be checked to see whether anything needs to be upgraded, disabled or removed +using the `Assets > External Dependency Manager > Version Handler > Update` menu +option. + +##### Restore Install Paths + +Some developers move assets around in their project which can make it harder for +plugin maintainers to debug issues if this breaks Unity's +[special folders](https://docs.unity3d.com/Manual/SpecialFolders.html) rules. If +assets are labeled with their original install/export path (see +`gvhp_exportpath` below), Version Handler can restore assets to their original +locations when using the `Assets > External Dependency Manager > Version +Handler > Move Files To Install Locations` menu option. + +##### Settings + +Some behavior of the Version Handler can be configured via the `Assets > +External Dependency Manager > Version Handler > Settings` menu option. + +* `Enable version management` controls whether the plugin should automatically + check asset versions and apply changes. If this is disabled the process + should be run manually when installing or upgrading managed plugins using + `Assets > External Dependency Manager > Version Handler > Update`. + +* `Rename to canonical filenames` is a legacy option that will rename files to + remove version numbers and other labels from filenames. + +* `Prompt for obsolete file deletion` enables the display of a window when + obsolete files are deleted allowing the developer to select which files to + delete and those to keep. + +* `Allow disabling files via renaming` controls whether obsolete or disabled + files should be disabled by renaming them to `myfilename_DISABLED`. Renaming + to disable files is required in some scenarios where Unity doesn't support + removing files from the build via the PluginImporter. + +* `Enable Analytics Reporting` enables/disables usage reporting to plugin + developers to improve the product. + +* `Verbose logging` enables *very* noisy log output that is useful for + debugging while filing a bug report or building a new managed plugin. + +* `Use project settings` saves settings for the plugin in the project rather + than system-wide. + +#### Redistributing a Managed Plugin + +The Version Handler employs a couple of methods for managing version selection, +upgrade and removal of plugins. + +* Each plugin can ship with a manifest file that lists the files it includes. + This makes it possible for Version Handler to calculate the difference in + assets between the most recent release of a plugin and the previous release + installed in a project. If a files are removed the Version Handler will + prompt the user to clean up obsolete files. + +* Plugins can ship using assets with unique names, unique GUIDs and version + number labels. Version numbers can be attached to assets using labels or + added to the filename (e.g `myfile.txt` would be `myfile_version-x.y.z.txt). + This allows the Version Handler to determine which set of files are the same + file at different versions, select the most recent version and prompt the + developer to clean up old versions. + +Unity plugins can be managed by the Version Handler using the following steps: + +1. Add the `gvh` asset label to each asset (file) you want Version Handler to + manage. + +1. Add the `gvh_version-VERSION` label to each asset where `VERSION` is the + version of the plugin you're releasing (e.g 1.2.3). + +1. Add the `gvhp_exportpath-PATH` label to each asset where `PATH` is the + export path of the file when the `.unitypackage` is created. This is used to + track files if they're moved around in a project by developers. + +1. Optional: Add `gvh_targets-editor` label to each editor DLL in your plugin + and disable `editor` as a target platform for the DLL. The Version Handler + will enable the most recent version of this DLL when the plugin is imported. + +1. Optional: If your plugin is included in other Unity plugins, you should add + the version number to each filename and change the GUID of each asset. This + allows multiple versions of your plugin to be imported into a Unity project, + with the Version Handler component activating only the most recent version. + +1. Create a manifest text file named `MY_UNIQUE_PLUGIN_NAME_VERSION.txt` that + lists all the files in your plugin relative to the project root. Then add + the `gvh_manifest` label to the asset to indicate this file is a plugin + manifest. + +1. Optional: Add a `gvhp_manifestname-NAME` label to your manifest file to + provide a human readable name for your package. If this isn't provided the + name of the manifest file will be used as the package name. NAME can match + the pattern `[0-9]+[a-zA-Z -]` where a leading integer will set the priority + of the name where `0` is the highest priority and preferably used as the + display name. The lowest value (i.e highest priority name) will be used as + the display name and all other specified names will be aliases of the + display name. Aliases can refer to previous names of the package allowing + renaming across published versions. + +1. Redistribute EDM4U Unity plugin with your plugin. See the + [Plugin Redistribution](#plugin-redistribution) section for details. + +If you follow these steps: + +* When users import a newer version of your plugin, files referenced by the + older version's manifest are cleaned up. + +* The latest version of the plugin will be selected when users import multiple + packages that include your plugin, assuming the steps in + [Plugin Redistribution](#plugin-redistribution) are followed. + +## Background + +Many Unity plugins have dependencies upon Android specific libraries, iOS +CocoaPods, and sometimes have transitive dependencies upon other Unity plugins. +This causes the following problems: + +* Integrating platform specific (e.g Android and iOS) libraries within a Unity + project can be complex and a burden on a Unity plugin maintainer. +* The process of resolving conflicting dependencies on platform specific + libraries is pushed to the developer attempting to use a Unity plugin. The + developer trying to use your plugin is very likely to give up when faced + with Android or iOS specific build errors. +* The process of resolving conflicting Unity plugins (due to shared Unity + plugin components) is pushed to the developer attempting to use your Unity + plugin. In an effort to resolve conflicts, the developer will very likely + attempt to resolve problems by deleting random files in your plugin, report + bugs when that doesn't work and finally give up. + +EDM4U provides solutions for each of these problems. + +### Android Dependency Management + +The *Android Resolver* component of this plugin will download and integrate +Android library dependencies and handle any conflicts between plugins that share +the same dependencies. + +Without the Android Resolver, typically Unity plugins bundle their AAR and JAR +dependencies, e.g. a Unity plugin `SomePlugin` that requires the Google Play +Games Android library would redistribute the library and its transitive +dependencies in the folder `SomePlugin/Android/`. When a user imports +`SomeOtherPlugin` that includes the same libraries (potentially at different +versions) in `SomeOtherPlugin/Android/`, the developer using `SomePlugin` and +`SomeOtherPlugin` will see an error when building for Android that can be hard +to interpret. + +Using the Android Resolver to manage Android library dependencies: + +* Solves Android library conflicts between plugins. +* Handles all of the various processing steps required to use Android + libraries (AARs, JARs) in Unity 4.x and above projects. Almost all versions + of Unity have - at best - partial support for AARs. +* (Experimental) Supports minification of included Java components without + exporting a project. + +### iOS Dependency Management + +The *iOS Resolver* component of this plugin integrates with +[CocoaPods](https://cocoapods.org/) to download and integrate iOS libraries and +frameworks into the Xcode project Unity generates when building for iOS. Using +CocoaPods allows multiple plugins to utilize shared components without forcing +developers to fix either duplicate or incompatible versions of libraries +included through multiple Unity plugins in their project. + +### Package Manager Registry Setup + +The [Package Manager](https://docs.unity3d.com/Manual/Packages.html) (PM) makes +use of [NPM](https://www.npmjs.com/) registry servers for package hosting and +provides ways to discover, install, upgrade and uninstall packages. This makes +it easier for developers to manage plugins within their projects. + +However, installing additional package registries requires a few manual steps +that can potentially be error prone. The *Package Manager Resolver* component of +this plugin integrates with [PM](https://docs.unity3d.com/Manual/Packages.html) +to provide a way to auto-install PM package registries when a `.unitypackage` is +installed which allows plugin maintainers to ship a `.unitypackage` that can +provide access to their own PM registry server to make it easier for developers +to manage their plugins. + +### Unity Plugin Version Management + +Finally, the *Version Handler* component of this plugin simplifies the process +of managing transitive dependencies of Unity plugins and each plugin's upgrade +process. + +For example, without the Version Handler plugin, if: + +* Unity plugin `SomePlugin` includes `EDM4U` plugin at version 1.1. +* Unity plugin `SomeOtherPlugin` includes `EDM4U` plugin at version 1.2. + +The version of `EDM4U` included in the developer's project depends upon the +order the developer imports `SomePlugin` or `SomeOtherPlugin`. + +This results in: + +* `EDM4U` at version 1.2, if `SomePlugin` is imported then `SomeOtherPlugin` + is imported. +* `EDM4U` at version 1.1, if `SomeOtherPlugin` is imported then `SomePlugin` + is imported. + +The Version Handler solves the problem of managing transitive dependencies by: + +* Specifying a set of packaging requirements that enable a plugin at different + versions to be imported into a Unity project. +* Providing activation logic that selects the latest version of a plugin + within a project. + +When using the Version Handler to manage `EDM4U` included in `SomePlugin` and +`SomeOtherPlugin`, from the prior example, version 1.2 will always be the +version activated in a developer's Unity project. + +Plugin creators are encouraged to adopt this library to ease integration for +their customers. For more information about integrating EDM4U into your own +plugin, see the [Plugin Redistribution](#plugin-redistribution) section of this +document. + +## Analytics + +The External Dependency Manager for Unity plugin by default logs usage to Google +Analytics. The purpose of the logging is to quantitatively measure the usage of +functionality, to gather reports on integration failures and to inform future +improvements to the developer experience of the External Dependency Manager +plugin. Note that the analytics collected are limited to the scope of the EDM4U +plugin’s usage. + +For details of what is logged, please refer to the usage of +`EditorMeasurement.Report()` in the source code. + +## Plugin Redistribution + +If you are a package maintainer and your package depends on EDM4U, it is highly +recommended to use the UPM format and add EDM4U as a dependency. If you must +include it in your `.unitypackage`, redistributing `EDM4U` inside your own +plugin might ease the integration process for your users. + +If you wish to redistribute `EDM4U` inside your plugin, you **must** follow +these steps when importing the `external-dependency-manager-*.unitypackage`, and +when exporting your own plugin package: + +1. Import the `external-dependency-manager-*.unitypackage` into your plugin + project by + [running Unity from the command line](https://docs.unity3d.com/Manual/CommandLineArguments.html), + ensuring that you add the `-gvh_disable` option. +1. Export your plugin by + [running Unity from the command line](https://docs.unity3d.com/Manual/CommandLineArguments.html), + ensuring that you: + - Include the contents of the `Assets/PlayServicesResolver` and + `Assets/ExternalDependencyManager` directory. + - Add the `-gvh_disable` option. + +You **must** specify the `-gvh_disable` option in order for the Version Handler +to work correctly! + +For example, the following command will import the +`external-dependency-manager-1.2.46.0.unitypackage` into the project +`MyPluginProject` and export the entire Assets folder to +`MyPlugin.unitypackage`: + +```shell +Unity -gvh_disable \ + -batchmode \ + -importPackage external-dependency-manager-1.2.46.0.unitypackage \ + -projectPath MyPluginProject \ + -exportPackage Assets MyPlugin.unitypackage \ + -quit +``` + +### Background + +The *Version Handler* component relies upon deferring the load of editor DLLs so +that it can run first and determine the latest version of a plugin component to +activate. The build of `EDM4U` plugin has Unity asset metadata that is +configured so that the editor components are not initially enabled when it's +imported into a Unity project. To maintain this configuration when importing the +`external-dependency-manager.unitypackage` into a Unity plugin project, you +*must* specify the command line option `-gvh_disable` which will prevent the +Version Handler component from running and changing the Unity asset metadata. + +## Building from Source + +To build this plugin from source you need the following tools installed: * Unity +2021 and below (with iOS and Android modules installed) * Java 11 + +You can build the plugin by running the following from your shell (Linux / OSX): + +```shell +./gradlew build + +``` + +or Windows: + +```shell +./gradlew.bat build +``` + +If Java 11 is not your default Java command, add +`-Dorg.gradle.java.home=` to the command above. + +## Testing + +You can run the tests by running the following from your shell (Linux / OSX): + +```shell +./gradlew test +``` + +or Windows: + +```shell +./gradlew.bat test +``` + +The following properties can be set to narrow down the tests to run or change +the test run behavior. + +* `INTERACTIVE_MODE_TESTS_ENABLED` - Default to `1`. Set to `1` to enable + interactive mode tests, which requires GPU on the machine. Otherwise, only + run tests in the batch mode. +* `INCLUDE_TEST_TYPES` - Default to empty string, which means to include every + type of the test. To narrow down the types of test to run, set this + properties with a list of case-insensitive type strings separated by comma. + For instance, `-PINCLUDE_TEST_TYPES="Python,NUnit"` means to include only + Python tests and NUnit tests. See `TestTypeEnum` in `build.gradle` for + available options. +* `EXCLUDE_TEST_TYPES` - Default to empty string, which means to exclude none. + To add types of tests to exclude, set this properties with a list of + case-insensitive type strings separated by comma. For instance, + `-PEXCLUDE_TEST_TYPES="Python,NUnit"` means to exclude Python tests and + NUnit tests. See `TestTypeEnum` in `build.gradle` for available options. +* `INCLUDE_TEST_MODULES` - Default to empty string, which means to include the + tests for every modules. To narrow down modules to test, set this properties + with a list of case-insensitive module strings separated by comma. For + instance, `-PINCLUDE_TEST_MODULES="Tool,AndroidResolver"` means to run tests + for tools and Android Resolver only. See `TestModuleEnum` in `build.gradle` + for available options. +* `EXCLUDE_TEST_MODULES` - Default to empty string, which means to exclude + none. To add modules to exclude, set this properties with a list of + case-insensitive module strings separated by comma. For instance, + `-PEXCLUDE_TEST_MODULES="Tool,AndroidResolver"` means to run tests for any + modules other than tools and Android Resolver. See `TestModuleEnum` in + `build.gradle` for available options. +* `EXCLUDE_TESTS` - Default to empty string, which means to exclude none. To + add tests to exclude, set this properties with a list of case-insensitive + test names separated by comma. For instance, + `-PEXCLUDE_TESTS="testGenGuids,testDownloadArtifacts"` means to run tests + except the tests with name of `testGenGuids` and `testDownloadArtifacts`. +* `CONTINUE_ON_FAIL_FOR_TESTS_ENABLED` - Default to `1`. Set to `1` to + continue running the next test when the current one fails. Otherwise, the + build script stops whenever any test fails. + +For instance, by running the following command, it only runs the Unity +integration tests that does not requires GPU, but exclude tests for Android +Resolver module and iOS Resolver module. + +```shell +./gradlew test \ + -PINTERACTIVE_MODE_TESTS_ENABLED=0 \ + -PINCLUDE_TEST_TYPES="Integration" \ + -PEXCLUDE_TEST_MODULES="AndroidResolver,iOSResolver" +``` + +## Releasing + +Each time a new build of this plugin is checked into the source tree you need to +do the following: + +* Bump the plugin version variable `pluginVersion` in `build.gradle` +* Update `CHANGELOG.md` with the new version number and changes included in + the release. +* Build the release using `./gradlew release` which performs the following: + * Updates `external-dependency-manager-*.unitypackage` + * Copies the unpacked plugin to the `exploded` directory. + * Updates template metadata files in the `plugin` directory. The GUIDs of + all asset metadata is modified due to the version number change. Each + file within the plugin is versioned to allow multiple versions of the + plugin to be imported into a Unity project which allows the most recent + version to be activated by the Version Handler component. +* Create release commit using `./gradlew gitCreateReleaseCommit` which + performs `git commit -a -m "description from CHANGELOG.md"` +* Once the release commit is merge, tag the release using `./gradlew + gitTagRelease` which performs the following: + * `git tag -a pluginVersion -m "version RELEASE"` to tag the release. +* Update tags on remote branch using `git push --tag REMOTE HEAD:master` diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/README.md.meta b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/README.md.meta new file mode 100644 index 00000000..770682d0 --- /dev/null +++ b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/README.md.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 48c105d983344236ba7fd1e7d7208fca +labels: +- gvh +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/README.md +timeCreated: 1584567712 +licenseType: Store +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.183_manifest.txt b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.183_manifest.txt new file mode 100644 index 00000000..d2b057ed --- /dev/null +++ b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.183_manifest.txt @@ -0,0 +1,13 @@ +Assets/ExternalDependencyManager/Editor/1.2.183/Google.IOSResolver.dll +Assets/ExternalDependencyManager/Editor/1.2.183/Google.IOSResolver.pdb +Assets/ExternalDependencyManager/Editor/1.2.183/Google.JarResolver.dll +Assets/ExternalDependencyManager/Editor/1.2.183/Google.JarResolver.pdb +Assets/ExternalDependencyManager/Editor/1.2.183/Google.PackageManagerResolver.dll +Assets/ExternalDependencyManager/Editor/1.2.183/Google.PackageManagerResolver.pdb +Assets/ExternalDependencyManager/Editor/1.2.183/Google.VersionHandlerImpl.dll +Assets/ExternalDependencyManager/Editor/1.2.183/Google.VersionHandlerImpl.pdb +Assets/ExternalDependencyManager/Editor/CHANGELOG.md +Assets/ExternalDependencyManager/Editor/Google.VersionHandler.dll +Assets/ExternalDependencyManager/Editor/Google.VersionHandler.pdb +Assets/ExternalDependencyManager/Editor/LICENSE +Assets/ExternalDependencyManager/Editor/README.md diff --git a/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.183_manifest.txt.meta b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.183_manifest.txt.meta new file mode 100644 index 00000000..ff7d1507 --- /dev/null +++ b/EintooAR/Assets/Editor/ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.183_manifest.txt.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 98518d47e8b1473f8055106d5eb931c7 +labels: +- gvh +- gvh_manifest +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.183_manifest.txt +- gvhp_manifestname-0External Dependency Manager +- gvhp_manifestname-play-services-resolver +timeCreated: 1474401009 +licenseType: Store +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/GameScripts/HotFix/GameLogic/GameLogic.asmdef b/EintooAR/Assets/GameScripts/HotFix/GameLogic/GameLogic.asmdef index 98820ad8..443db87e 100644 --- a/EintooAR/Assets/GameScripts/HotFix/GameLogic/GameLogic.asmdef +++ b/EintooAR/Assets/GameScripts/HotFix/GameLogic/GameLogic.asmdef @@ -31,7 +31,8 @@ "GUID:dc960734dc080426fa6612f1c5fe95f3", "GUID:66c2eb417c67ad849907d0769db96dbf", "GUID:2289059ddf1745b4d80a0f184af99d6b", - "GUID:448b0b55421917e4784a8f2f7449081f" + "GUID:448b0b55421917e4784a8f2f7449081f", + "GUID:bfb3a80268dac420ab25cd26e09e4475" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/EintooAR/Assets/Plugins/VoxelBusters.meta b/EintooAR/Assets/Plugins/VoxelBusters.meta new file mode 100644 index 00000000..83fbe258 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d715a94341ea2409e8dc90d116c23ded +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary.meta new file mode 100644 index 00000000..a0d394b1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5317c4912d76a48828be99991f62fe81 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor.meta new file mode 100644 index 00000000..9ab0992f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2815bd3aec8ef4cdda0dd09e8ad737d2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary.meta new file mode 100644 index 00000000..c4297233 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b00880799a9f24f7b8a4c2e44c84138e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers.meta new file mode 100644 index 00000000..ce0fe896 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 36aa8feca9d884ed09e68d46a2a8a7b0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers/DomainReloadManager.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers/DomainReloadManager.cs new file mode 100644 index 00000000..b536855f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers/DomainReloadManager.cs @@ -0,0 +1,136 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using UnityEngine; + +// Credits: https://github.com/joshcamas/unity-domain-reload-helper +namespace VoxelBusters.CoreLibrary.Editor +{ + public static class DomainReloadManager + { + #region Static fields + + private const BindingFlags kDefaultBindingAttr = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; + + #endregion + + #region Static methods + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + private static void OnRuntimeLoad() + { + TypeCache.Rebuild(); + + SendReloadMessageToMembers(); + SendReloadMessageToMethods(); + } + + private static void SendReloadMessageToMembers() + { + var members = TypeCache.GetMembersWithAttribute( + memberTypes: MemberTypes.Field | MemberTypes.Property | MemberTypes.Event, + bindingAttr: kDefaultBindingAttr); + + foreach (var item in members) + { + var member = item.Key; + var attribute = item.Value; + if (member is FieldInfo) + { + ClearField(member as FieldInfo, attribute); + } + else if (member is PropertyInfo) + { + ClearProperty(member as PropertyInfo, attribute); + } + else if (member is EventInfo) + { + ClearEvent(member as EventInfo, attribute); + } + } + } + + private static void SendReloadMessageToMethods() + { + foreach (var item in TypeCache.GetMethodsWithAttribute(kDefaultBindingAttr)) + { + var methodInfo = item.Key; + if (methodInfo.IsGenericMethod) continue; + + DebugLogger.Log(CoreLibraryDomain.Default, $"Invoking reload method: {methodInfo.Name}."); + methodInfo.Invoke(null, new object[] { }); + } + } + + private static void ClearField(FieldInfo fieldInfo, ClearOnReloadAttribute clearAttribute) + { + var fieldType = fieldInfo.FieldType; + if (fieldType.IsGenericParameter || fieldInfo.DeclaringType.ContainsGenericParameters) + { + return; + } + + // Access attribute parameters + object resetValue = FindMemberResetValue(fieldType, clearAttribute); + + try + { + DebugLogger.Log(CoreLibraryDomain.Default, $"Clearing field {fieldInfo.Name} to value {resetValue} for type {fieldType}."); + fieldInfo.SetValue(null, resetValue); + } + catch(Exception e) + { + DebugLogger.LogWarning(CoreLibraryDomain.Default, $"Unable to clear field {fieldInfo.Name}." + e); + } + } + + private static void ClearProperty(PropertyInfo propertyInfo, ClearOnReloadAttribute clearAttribute) + { + if (!propertyInfo.CanWrite) return; + + // Access attribute parameters + var propertyType = propertyInfo.PropertyType; + object resetValue = FindMemberResetValue(propertyType, clearAttribute); + + try + { + DebugLogger.Log(CoreLibraryDomain.Default, $"Clearing property {propertyInfo.Name} to value {resetValue}."); + propertyInfo.SetValue(null, resetValue); + } + catch + { + DebugLogger.LogWarning(CoreLibraryDomain.Default, $"Unable to clear property {propertyInfo.Name}."); + } + } + + private static void ClearEvent(EventInfo eventInfo, ClearOnReloadAttribute clearAttribute) + { + var fieldInfo = eventInfo.DeclaringType.GetField(eventInfo.Name, kDefaultBindingAttr); + if ((fieldInfo == null) || fieldInfo.FieldType.IsGenericParameter) return; + + DebugLogger.Log(CoreLibraryDomain.Default, $"Clearing event {eventInfo.Name}."); + fieldInfo.SetValue(null, null); + } + + private static object FindMemberResetValue(Type target, ClearOnReloadAttribute clearAttribute) + { + object finalValue = null; + if (ClearOnReloadOption.Custom == clearAttribute.Option) + { + finalValue = Convert.ChangeType(clearAttribute.CustomValue, target); + if (finalValue == null) + { + Debug.LogWarning("Unable to assign value of type {valueToAssign.GetType()} to field {field.Name} of type {fieldType}."); + } + } + else if (target.IsValueType || (ClearOnReloadOption.Default == clearAttribute.Option)) + { + finalValue = Activator.CreateInstance(target); + } + return finalValue; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers/DomainReloadManager.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers/DomainReloadManager.cs.meta new file mode 100644 index 00000000..aee50c4f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers/DomainReloadManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ec2658a60321e44fe81b86a95e54bd8f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers/SettingsObjectEditorManager.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers/SettingsObjectEditorManager.cs new file mode 100644 index 00000000..aa118cd0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers/SettingsObjectEditorManager.cs @@ -0,0 +1,23 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public class SettingsObjectEditorManager + { + [InitializeOnLoadMethod] + private static void OnEditorReload() + { + var settingsObjects = AssetDatabaseUtility.FindAssetObjects(); + foreach (var obj in settingsObjects) + { + if(obj != null) + { + obj.OnEditorReload(); + } + } + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers/SettingsObjectEditorManager.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers/SettingsObjectEditorManager.cs.meta new file mode 100644 index 00000000..4e55afeb --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Controllers/SettingsObjectEditorManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 668d41341e45a44ed8ea4d6145939d4b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors.meta new file mode 100644 index 00000000..98241d09 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1207f43c46f3944158e30563ec0a499c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/CustomEditorStyles.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/CustomEditorStyles.cs new file mode 100644 index 00000000..69568465 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/CustomEditorStyles.cs @@ -0,0 +1,228 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public static class CustomEditorStyles + { + #region Properties + + public static Color BorderColor => new Color(0.15f, 0.15f, 0.15f, 1f); + + #endregion + + #region Label styles + + public static GUIStyle Heading1Label() + { + return CreateLabel(baseStyle: EditorStyles.boldLabel, + fontSize: 18, + wordWrap: true, + richText: true, + alignment: TextAnchor.MiddleLeft); + } + + public static GUIStyle Heading2Label() + { + return CreateLabel(baseStyle: EditorStyles.boldLabel, + fontSize: 16, + wordWrap: true, + richText: true, + alignment: TextAnchor.MiddleLeft); + } + + public static GUIStyle Heading3Label() + { + return CreateLabel(baseStyle: EditorStyles.boldLabel, + fontSize: 14, + wordWrap: true, + richText: true, + alignment: TextAnchor.MiddleLeft); + } + + public static GUIStyle NormalLabel() + { + return CreateLabel(baseStyle: EditorStyles.label, + fontSize: 14, + wordWrap: true, + richText: true); + } + + public static GUIStyle OptionsLabel(bool wordWrap = true) + { + return CreateLabel(baseStyle: EditorStyles.label, + fontSize: 12, + wordWrap: wordWrap, + richText: true, + textClipping: TextClipping.Clip); + } + + public static GUIStyle LinkLabel() + { + return CreateLabel(baseStyle: "LinkLabel", + fontSize: 12, + wordWrap: true, + richText: true); + } + + public static GUIStyle MiniLabel(bool wordWrap = true) + { + return CreateLabel(baseStyle: EditorStyles.miniLabel, + fontSize: 12, + wordWrap: wordWrap, + richText: true); + } + + + public static GUIStyle SelectableLabel(FontStyle? fontStyle = null, + int? fontSize = null, + Color? textColor = null) + { + var normal = EditorStyles.label; + var baseStyle = new GUIStyle() + { + border = new RectOffset(0, 0, 0, 0), + font = normal.font, + alignment = normal.alignment, + active = normal.active, + onActive = normal.onActive, + focused = normal.focused, + onFocused = normal.onFocused, + normal = normal.normal, + onNormal = normal.onNormal, + hover = normal.hover, + onHover = normal.onHover, + }; + return CreateLabel(baseStyle, + fontStyle: fontStyle, + fontSize: fontSize ?? 14, + textColor: textColor); + } + + #endregion + + #region Button styles + + public static GUIStyle Button() + { + return CreateButton(baseStyle: "Button", + fontSize: 14); + } + + public static GUIStyle InvisibleButton() + { + return CreateButton(baseStyle: "InvisibleButton"); + } + + #endregion + + #region Background styles + + public static GUIStyle ItemBackground() + { + return CreateBackground(baseStyle: "AnimItemBackground"); + } + + public static GUIStyle GroupBackground() + { + GUIStyle baseStyle = "FrameBox"; + var baseMargin = baseStyle.margin; + return CreateBackground(baseStyle: baseStyle, + border: new RectOffset(0, 0, 0, 0), + margin: new RectOffset(baseMargin.left, baseMargin.right, baseMargin.top, 5)); + } + + #endregion + + #region Static methods + + public static GUIStyle CreateLabel(GUIStyle baseStyle, + FontStyle? fontStyle = null, + int? fontSize = null, + Color? textColor = null, + bool? wordWrap = null, + bool? richText = null, + TextAnchor? alignment = null, + TextClipping? textClipping = null) + { + var newStyle = new GUIStyle(baseStyle); + if (fontSize != null) + { + newStyle.fontSize = fontSize.Value; + } + if (fontStyle != null) + { + newStyle.fontStyle = fontStyle.Value; + } + if (textColor != null) + { + newStyle.normal.textColor = textColor.Value; + newStyle.onNormal.textColor = textColor.Value; + newStyle.active.textColor = textColor.Value; + newStyle.onActive.textColor = textColor.Value; + newStyle.focused.textColor = textColor.Value; + newStyle.onFocused.textColor = textColor.Value; + newStyle.hover.textColor = textColor.Value; + newStyle.onHover.textColor = textColor.Value; + } + if (wordWrap != null) + { + newStyle.wordWrap = wordWrap.Value; + } + if (richText != null) + { + newStyle.richText = richText.Value; + } + if (alignment != null) + { + newStyle.alignment = alignment.Value; + } + if (textClipping != null) + { + newStyle.clipping = textClipping.Value; + } + return newStyle; + } + + public static GUIStyle CreateButton(GUIStyle baseStyle, + int? fontSize = null, + int? fixedHeight = null, + TextAnchor? alignment = null) + { + var newStyle = new GUIStyle(baseStyle); + if (fontSize != null) + { + newStyle.fontSize = fontSize.Value; + } + if (fixedHeight != null) + { + newStyle.fixedHeight = fixedHeight.Value; + } + if (alignment != null) + { + newStyle.alignment = alignment.Value; + } + return newStyle; + } + + public static GUIStyle CreateBackground(GUIStyle baseStyle, + RectOffset border = null, + RectOffset margin = null) + { + var newStyle = new GUIStyle(baseStyle); + if (border != null) + { + newStyle.border = border; + } + if (margin != null) + { + newStyle.margin = margin; + } + return newStyle; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/CustomEditorStyles.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/CustomEditorStyles.cs.meta new file mode 100644 index 00000000..9a668488 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/CustomEditorStyles.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1e146cad3338c4e56a70c8554ed2901c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/CustomInspector.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/CustomInspector.cs new file mode 100644 index 00000000..8ac2d82b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/CustomInspector.cs @@ -0,0 +1,52 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public class CustomInspector : UnityEditor.Editor + { + #region Unity methods + + protected virtual void OnEnable() + { } + + protected virtual void OnDisable() + { } + + public override void OnInspectorGUI() + { + EditorGUI.BeginChangeCheck(); + + DrawCustomInspector(); + + bool isDirty = EditorGUI.EndChangeCheck(); + if (isDirty || UnityEditorUtility.GetIsEditorDirty()) + { + serializedObject.ApplyModifiedProperties(); + UnityEditorUtility.SetIsEditorDirty(false); + } + } + + protected virtual void DrawCustomInspector() + { + var property = serializedObject.GetIterator(); + if (property.NextVisible(true)) + { + if (property.name == "m_Script") + { + GUI.enabled = false; + EditorGUILayout.PropertyField(property, true); + GUI.enabled = true; + } + while (property.NextVisible(false)) + { + EditorGUILayout.PropertyField(property, true); + } + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/CustomInspector.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/CustomInspector.cs.meta new file mode 100644 index 00000000..77eae4d7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/CustomInspector.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 71ff8e366aef840198f173c1b05160fc +timeCreated: 1579541126 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorLayoutBuilder.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorLayoutBuilder.cs new file mode 100644 index 00000000..e06de468 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorLayoutBuilder.cs @@ -0,0 +1,527 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using System; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public class EditorLayoutBuilder + { + #region Fields + + private SerializedObject m_serializedObject; + + private string[] m_tabs; + + private GetSectionsCallback m_getSectionsCallback; + + private DrawCallback m_drawTopBarCallback; + + private DrawTabViewCallback m_drawTabViewCallback; + + private DrawCallback m_drawFooterCallback; + + private string m_selectedTab; + + private EditorSectionInfo[] m_selectedTabSections; + + private EditorSectionInfo m_focusSection; + + private Vector2 m_tabBarScrollPosition; + + private Texture2D m_toggleOnIcon; + + private Texture2D m_toggleOffIcon; + + private GUIStyle m_backgroundStyle; + + private GUIStyle m_titleLabelStyle; + + private GUIStyle m_subtitleLabelStyle; + + private GUIStyle m_tabBarLabelNormalStyle; + + private GUIStyle m_tabBarLabelSelectedStyle; + + private GUIStyle m_selectableLabelStyle; + + private GUIStyle m_invisibleButtonStyle; + + #endregion + + #region Delegates + + public delegate EditorSectionInfo[] GetSectionsCallback(string tab); + + public delegate void DrawCallback(string tab); + + public delegate bool DrawTabViewCallback(string tab); + + #endregion + + #region Events + + public event Callback OnSectionStatusChange; + + public event Callback OnFocusSectionValueChange; + + #endregion + + #region Constructors + + public EditorLayoutBuilder(SerializedObject serializedObject, + string[] tabs, + GetSectionsCallback getSectionsCallback, + DrawCallback drawTopBarCallback, + DrawTabViewCallback drawTabViewCallback, + DrawCallback drawFooterCallback, + Texture2D toggleOnIcon, + Texture2D toggleOffIcon) + { + // Set properties + m_serializedObject = serializedObject; + m_tabs = tabs; + m_getSectionsCallback = getSectionsCallback; + m_drawTopBarCallback = drawTopBarCallback; + m_drawTabViewCallback = drawTabViewCallback; + m_drawFooterCallback = drawFooterCallback; + m_toggleOnIcon = toggleOnIcon; + m_toggleOffIcon = toggleOffIcon; + + LoadStyles(); + SetSelectedTab(m_tabs[0]); + } + + #endregion + + #region Static methods + + public static void DrawChildProperties(SerializedProperty property, + string prefix = null, + bool indent = true, + params string[] ignoreProperties) + { + EditorGUILayout.BeginVertical(CustomEditorStyles.GroupBackground()); + try + { + float maxWidth = 0; + //Calculate max label width first + IterateThroughValidChildren(property, ignoreProperties, (eachChildProperty) => + { + var currentDisplayName = (prefix != null) ? $"{prefix} {eachChildProperty.displayName}" : eachChildProperty.displayName; + float currentLabelWidth = GUI.skin.label.CalcSize(new GUIContent(currentDisplayName)).x; + + if(maxWidth < currentLabelWidth) + { + maxWidth = currentLabelWidth; + } + + }); + + + if (indent) + { + EditorGUI.indentLevel++; + } + + var oldLabelWidth = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = ((maxWidth / 128) + 1) * 128; //Adding some extra 128 pixels buffer. + IterateThroughValidChildren(property, ignoreProperties, (eachChildProperty) => + { + // Display the property + if (prefix != null) + { + EditorGUILayout.PropertyField(eachChildProperty, new GUIContent($"{prefix} {eachChildProperty.displayName}", eachChildProperty.tooltip), true); + } + else + { + EditorGUILayout.PropertyField(eachChildProperty, true); + } + }); + EditorGUIUtility.labelWidth = oldLabelWidth; + } + finally + { + if (indent) + { + EditorGUI.indentLevel--; + } + } + EditorGUILayout.EndVertical(); + } + + private static void IterateThroughValidChildren(SerializedProperty property, string[] ignoreProperties, Action callbackOnEachChild) + { + // Move pointer to first element + var currentProperty = property.Copy(); + var endProperty = default(SerializedProperty); + + // Start iterating through the properties + bool firstTime = true; + while (currentProperty.NextVisible(enterChildren: firstTime)) + { + if (firstTime) + { + endProperty = property.GetEndProperty(); + firstTime = false; + } + if (SerializedProperty.EqualContents(currentProperty, endProperty)) + { + break; + } + + // Exclude specified properties + if ((ignoreProperties != null) && System.Array.Exists(ignoreProperties, (item) => string.Equals(item, currentProperty.name))) + { + continue; + } + + callbackOnEachChild(currentProperty); + } + } + + #endregion + + #region Public methods + + public void DoLayout() + { + if (CanShowFocusSection()) + { + DrawFocusSection(); + } + else + { + m_drawTopBarCallback?.Invoke(m_selectedTab); + DrawTabBar(); + DrawTabView(); + m_drawFooterCallback?.Invoke(m_selectedTab); + } + m_serializedObject.ApplyModifiedProperties(); + m_serializedObject.Update(); + } + + public void DrawSection(EditorSectionInfo section, + bool showDetails = true, + bool selectable = true) + { + EditorGUILayout.BeginVertical(m_backgroundStyle); + bool expanded = DrawSectionHeader(section, + selectable); + bool endGroup = true; + if (showDetails || expanded) + { + if (section.DrawStyle == EditorSectionDrawStyle.Default) + { + endGroup = false; + EditorGUILayout.EndVertical(); + } + + if (section.DrawDetailsCallback != null) + { + section.DrawDetailsCallback(section); + } + else + { + if (section.DrawStyle == EditorSectionDrawStyle.Default) + { + endGroup = true; + EditorGUILayout.BeginVertical(m_backgroundStyle); + } + DrawSectionDetails(section); + } + } + if (endGroup) + { + EditorGUILayout.EndVertical(); + } + } + + public void DrawSectionDetails(EditorSectionInfo section) + { + bool originalGUIState = GUI.enabled; + try + { + // Update edit capability + GUI.enabled = section.IsEnabled; + + // Draw section properties + DrawChildProperties(property: section.Property, + ignoreProperties: section.IgnoreProperties); + } + finally + { + // Reset gui state + GUI.enabled = originalGUIState; + } + } + + public void BeginVertical() + { + EditorGUILayout.BeginVertical(m_backgroundStyle); + } + + public void EndVertical() + { + EditorGUILayout.EndVertical(); + } + + #endregion + + #region Private methods + + private void LoadStyles() + { + m_backgroundStyle = CustomEditorStyles.GroupBackground(); + m_titleLabelStyle = CustomEditorStyles.Heading2Label(); + m_subtitleLabelStyle = CustomEditorStyles.OptionsLabel(wordWrap: false); + m_tabBarLabelNormalStyle = CustomEditorStyles.SelectableLabel(fontSize: 16, textColor: Color.gray); + m_tabBarLabelSelectedStyle = CustomEditorStyles.SelectableLabel(fontSize: 16, fontStyle: FontStyle.Bold); + m_selectableLabelStyle = CustomEditorStyles.SelectableLabel(); + m_invisibleButtonStyle = CustomEditorStyles.InvisibleButton(); + } + + private bool CanShowFocusSection() + { + return (m_focusSection != null) && (m_focusSection.DrawStyle == EditorSectionDrawStyle.Default); + } + + private void DrawTabBar() + { + if (m_tabs.Length > 1) + { + m_tabBarScrollPosition = GUILayout.BeginScrollView(m_tabBarScrollPosition, m_backgroundStyle, GUILayout.Height(30f)); + GUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); + for (int iter = 0; iter < m_tabs.Length; iter++) + { + var current = m_tabs[iter]; + var labelStyle = (current == m_selectedTab) ? m_tabBarLabelSelectedStyle : m_tabBarLabelNormalStyle; + if (GUILayout.Button(current, labelStyle, GUILayout.Width(80f))) + { + SetSelectedTab(current); + } + } + GUILayout.FlexibleSpace(); + GUILayout.EndHorizontal(); + GUILayout.EndScrollView(); + } + } + + private void DrawTabView() + { + if ((m_drawTabViewCallback == null) || !m_drawTabViewCallback(m_selectedTab)) + { + for (int iter = 0; iter < m_selectedTabSections.Length; iter++) + { + var current = m_selectedTabSections[iter]; + DrawSection(section: current, + showDetails: (current.DrawStyle == EditorSectionDrawStyle.Expand) && (current == m_focusSection)); + } + } + } + + private bool DrawSectionHeader(EditorSectionInfo section, + bool selectable = true) + { + bool isSelected = (section == m_focusSection); + bool hasSubtitle = (section.Description != null); + float headerHeight = hasSubtitle ? 52f : 30f; + + // Draw rect + var rect = EditorGUILayout.GetControlRect(false, headerHeight); + //GUI.Box(rect, GUIContent.none, HeaderButtonStyle); + + /* + // Draw expand control + if (drawStyle == PropertyGroupDrawStyle.Expand) + { + var foldOutRect = new Rect(rect.x + 5f, rect.y, 50f, rect.height); + EditorGUI.LabelField(foldOutRect, isSelected ? "-" : "+", CustomEditorStyles.Heading3); + } + */ + + // Draw text + var titleRect = new Rect(rect.x + 5f, + rect.y + 4f, + rect.width * 0.8f, + 22f); + EditorGUI.LabelField(titleRect, section.DisplayName, m_titleLabelStyle); + if (hasSubtitle) + { + var subtitleRect = new Rect(rect.x + 5f, + rect.y + 25f, + rect.width * 0.8f, + 18f); + EditorGUI.LabelField(subtitleRect, section.Description, m_subtitleLabelStyle); + } + + // Draw selectable rect + var selectableRect = new Rect(rect.x, + rect.y, + rect.width * 0.8f, + rect.height); + if (selectable && EditorLayoutUtility.TransparentButton(selectableRect)) + { + isSelected = SetFocusSection(section); + } + + // Draw toggle button + var enabledProperty = section.EnabledProperty; + if (enabledProperty != null) + { + var toggleIcon = enabledProperty.boolValue ? m_toggleOnIcon : m_toggleOffIcon; + var iconSize = new Vector2(64f, 32f); + var toggleRect = new Rect(rect.xMax - (iconSize.x * 1.2f), + titleRect.yMin + ((titleRect.height - iconSize.y/2)), + iconSize.x, + iconSize.y); + if (GUI.Button(toggleRect, toggleIcon, m_invisibleButtonStyle)) + { + enabledProperty.boolValue = !enabledProperty.boolValue; + + // Raise an event to notify others, delay is added to ensure that modified properties are serialized + EditorApplication.delayCall += () => { OnSectionStatusChange?.Invoke(section); }; + } + } + return isSelected; + } + + private void DrawFocusSection() + { + var property = m_focusSection.Property; + EditorGUILayout.BeginHorizontal(m_backgroundStyle); + if (GUILayout.Button($"{'\u2190'} Back To Main Menu", m_titleLabelStyle)) + { + SetFocusSection(null); + return; + } + GUILayout.FlexibleSpace(); + EditorGUILayout.EndHorizontal(); + + property.isExpanded = true; + DrawSection(section: m_focusSection, + selectable: false); + } + + #endregion + + #region Getter methods + + private EditorSectionInfo[] GetSections(string tab) + { + return m_getSectionsCallback(tab) ?? new EditorSectionInfo[0]; + } + + #endregion + + #region Setter methods + + private void SetSelectedTab(string tab) + { + // Update cached data + m_selectedTab = tab; + m_selectedTabSections = GetSections(tab); + } + + private bool SetFocusSection(EditorSectionInfo section) + { + var oldFocusSection = m_focusSection; + + // Set new value + m_focusSection = section; + + // Update selection state + if ((section != null) && (section == oldFocusSection)) + { + section.Property.isExpanded = !section.Property.isExpanded; + m_focusSection = null; + } + else + { + if (oldFocusSection != null) + { + oldFocusSection.Property.isExpanded = false; + } + if (section != null) + { + section.Property.isExpanded = true; + } + } + bool hasChanged = (oldFocusSection != m_focusSection); + if (hasChanged) + { + OnFocusSectionValueChange?.Invoke(m_focusSection); + } + return hasChanged; + } + + #endregion + } + + public class EditorSectionInfo + { + #region Properties + + public string DisplayName { get; private set; } + + public string Description { get; private set; } + + public bool IsEnabled => (EnabledProperty == null) || EnabledProperty.boolValue; + + public SerializedProperty Property { get; private set; } + + public SerializedProperty EnabledProperty { get; private set; } + + public EditorSectionDrawStyle DrawStyle { get; private set; } + + public DrawCallback DrawDetailsCallback { get; private set; } + + public string[] IgnoreProperties { get; private set; } + + public object Tag { get; private set; } + + #endregion + + #region Delegates + + public delegate void DrawCallback(EditorSectionInfo section); + + #endregion + + #region Constructors + + public EditorSectionInfo(string displayName, + SerializedProperty property, + SerializedProperty enabledProperty = null, + string description = null, + EditorSectionDrawStyle drawStyle = EditorSectionDrawStyle.Default, + DrawCallback drawDetailsCallback = null, + object tag = null, + params string[] ignoreProperties) + { + Assert.IsArgNotNull(displayName, nameof(displayName)); + Assert.IsArgNotNull(property, nameof(property)); + + // set properties + DisplayName = displayName; + Description = description; + Property = property; + EnabledProperty = enabledProperty ?? property.FindPropertyRelative("m_isEnabled"); + DrawStyle = drawStyle; + DrawDetailsCallback = drawDetailsCallback; + IgnoreProperties = ignoreProperties ?? new string[] { "m_isEnabled" }; + Tag = tag; + } + + #endregion + } + + public enum EditorSectionDrawStyle + { + Default, + + Expand, + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorLayoutBuilder.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorLayoutBuilder.cs.meta new file mode 100644 index 00000000..4eb0c05c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorLayoutBuilder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4019dad4610704cb38751061068b7fa8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorLayoutUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorLayoutUtility.cs new file mode 100644 index 00000000..465ae756 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorLayoutUtility.cs @@ -0,0 +1,117 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public static class EditorLayoutUtility + { + #region Static methods + + public static void DisableGUI() + { + GUI.enabled = false; + } + + public static void EnableGUI() + { + GUI.enabled = true; + } + + public static bool TransparentButton(Rect rect, + string label = "") + { + var originalColor = GUI.color; + try + { + GUI.color = Color.clear; + return GUI.Button(rect, label); + } + finally + { + GUI.color = originalColor; + } + } + + public static void StringPopup(int selectedIndex, + string[] options, + Callback onValueChange, + params GUILayoutOption[] layoutOptions) + { + int newValue = EditorGUILayout.Popup(selectedIndex, options, layoutOptions); + if (newValue != selectedIndex) + { + onValueChange?.Invoke(newValue); + } + } + + public static void StringPopup(SerializedProperty stringProperty, + ref int selectedIndex, + string[] displayedOptions, + Callback onValueChange = null, + params GUILayoutOption[] layoutOptions) + { + int newValue = EditorGUILayout.Popup(new GUIContent(stringProperty.displayName, stringProperty.tooltip), + selectedIndex, + displayedOptions, + layoutOptions); + if (newValue != selectedIndex) + { + selectedIndex = newValue; + stringProperty.stringValue = displayedOptions[newValue]; + + onValueChange?.Invoke(newValue); + } + } + + public static void Helpbox(string title, + string description, + System.Action drawFunc, + GUIStyle style) + { + GUILayout.BeginVertical(style); + GUILayout.Label(title, EditorStyles.boldLabel); + GUILayout.Label(description, EditorStyles.wordWrappedLabel); + drawFunc(); + GUILayout.EndVertical(); + } + + public static void Helpbox(string title, + string description, + string actionLabel, + System.Action onClick, + GUIStyle style) + { + Helpbox( + title: title, + description: description, + drawFunc: () => + { + if (GUILayout.Button(actionLabel)) + { + onClick?.Invoke(); + } + }, + style: style); + } + + public static void BeginBottomBar(Color? borderColor = null, + params GUILayoutOption[] options) + { + var bottomBarRect = EditorGUILayout.BeginHorizontal(options); + bottomBarRect.height = 1f; + if (borderColor != null) + { + EditorGUI.DrawRect(bottomBarRect, borderColor.Value); + } + } + + public static void EndBottomBar() + { + EditorGUILayout.EndHorizontal(); + } + + #endregion + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorLayoutUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorLayoutUtility.cs.meta new file mode 100644 index 00000000..a1ff8982 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorLayoutUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c40767cd6fb464f3b83f7e68d5e47449 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorSplitView.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorSplitView.cs new file mode 100644 index 00000000..d7be1510 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorSplitView.cs @@ -0,0 +1,185 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public class EditorSplitView + { + #region Fields + + private SplitDirection m_direction; + + private float m_splitRatio; + + private bool m_resize; + + private Vector2 m_firstContainerScrollPos; + + private Rect m_availableRect; + + #endregion + + #region Constructors + + private EditorSplitView(SplitDirection direction, float splitRatio) + { + m_splitRatio = splitRatio; + m_direction = direction; + } + + #endregion + + #region Static methods + + public static EditorSplitView CreateHorizontalSplitView(float splitRatio = 0.3f) + { + return new EditorSplitView(SplitDirection.Horizontal, splitRatio); + } + + public static EditorSplitView CreateVerticalSplitView(float splitRatio = 0.3f) + { + return new EditorSplitView(SplitDirection.Vertical, splitRatio); + } + + #endregion + + #region Private methods + + public void BeginArea() + { + Rect tempRect = Rect.zero; + if (m_direction == SplitDirection.Horizontal) + { + tempRect = EditorGUILayout.BeginHorizontal(); + } + else if (m_direction == SplitDirection.Vertical) + { + tempRect = EditorGUILayout.BeginVertical(); + } + if (tempRect.width > 0.0f) + { + m_availableRect = tempRect; + } + + BeginContainer(); + if (m_direction == SplitDirection.Horizontal) + { + m_firstContainerScrollPos = EditorGUILayout.BeginScrollView(m_firstContainerScrollPos, GUILayout.Width(m_availableRect.width * m_splitRatio)); + } + else if (m_direction == SplitDirection.Vertical) + { + m_firstContainerScrollPos = EditorGUILayout.BeginScrollView(m_firstContainerScrollPos, GUILayout.Height(m_availableRect.height * m_splitRatio)); + } + } + + public void Split() + { + // firstly mark that first container has ended + EditorGUILayout.EndScrollView(); + EndContainer(); + ResizeFirstContainer(); + + // initiate rendering second container + BeginContainer(); + } + + public void EndArea() + { + EndContainer(); + + if (m_direction == SplitDirection.Horizontal) + { + EditorGUILayout.EndHorizontal(); + } + else if (m_direction == SplitDirection.Vertical) + { + EditorGUILayout.EndVertical(); + } + } + + private Rect BeginContainer() + { + if (m_direction == SplitDirection.Horizontal) + { + return EditorGUILayout.BeginVertical(); + } + else if (m_direction == SplitDirection.Vertical) + { + return EditorGUILayout.BeginHorizontal(); + } + else + { + return Rect.zero; + } + } + + private void EndContainer() + { + if (m_direction == SplitDirection.Horizontal) + { + EditorGUILayout.EndVertical(); + } + else if (m_direction == SplitDirection.Vertical) + { + EditorGUILayout.EndHorizontal(); + } + } + + private void ResizeFirstContainer() + { + Rect resizeHandleRect; + if (m_direction == SplitDirection.Horizontal) + { + resizeHandleRect = new Rect(m_availableRect.width * m_splitRatio, m_availableRect.y, 1f, m_availableRect.height); + } + else + { + resizeHandleRect = new Rect(m_availableRect.x, m_availableRect.height * m_splitRatio, m_availableRect.width, 1f); + } + EditorGUI.DrawRect(resizeHandleRect, CustomEditorStyles.BorderColor); + if (m_direction == SplitDirection.Horizontal) + { + EditorGUIUtility.AddCursorRect(resizeHandleRect, MouseCursor.ResizeHorizontal); + } + else + { + EditorGUIUtility.AddCursorRect(resizeHandleRect, MouseCursor.ResizeVertical); + } + + if (Event.current.type == EventType.MouseDown && resizeHandleRect.Contains(Event.current.mousePosition)) + { + m_resize = true; + } + if (m_resize) + { + if (m_direction == SplitDirection.Horizontal) + { + m_splitRatio = Event.current.mousePosition.x / m_availableRect.width; + } + else + { + m_splitRatio = Event.current.mousePosition.y / m_availableRect.height; + } + } + if (Event.current.type == EventType.MouseUp) + { + m_resize = false; + } + } + + #endregion + + #region Nested types + + private enum SplitDirection + { + Horizontal, + + Vertical + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorSplitView.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorSplitView.cs.meta new file mode 100644 index 00000000..634a071b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorSplitView.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a20197bdbee5a44b196d137503bca990 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorWindowZ.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorWindowZ.cs new file mode 100644 index 00000000..12f8516b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorWindowZ.cs @@ -0,0 +1,41 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public class EditorWindowZ : EditorWindow + { + #region Fields + + [System.NonSerialized] + private bool m_isInitialized; + + #endregion + + #region Unity methods + + protected virtual void OnGUI() + { + EnsureInitialized(); + } + + #endregion + + #region Private methods + + protected virtual void Init() + { } + + protected void EnsureInitialized() + { + if (m_isInitialized) return; + + m_isInitialized = true; + Init(); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorWindowZ.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorWindowZ.cs.meta new file mode 100644 index 00000000..f96959db --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EditorWindowZ.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a0757cac8d21f499e80db0e955801000 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EnumMaskFieldDrawer.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EnumMaskFieldDrawer.cs new file mode 100644 index 00000000..efe41550 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EnumMaskFieldDrawer.cs @@ -0,0 +1,49 @@ +using System; +using UnityEngine; +using UnityEditor; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.Editor +{ + [CustomPropertyDrawer(typeof(EnumMaskFieldAttribute))] + public class EnumMaskFieldDrawer : PropertyDrawer + { + #region Drawer Methods + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + label = EditorGUI.BeginProperty(position, label, property); + if (IsEnum()) + { + UnityEditorUtility.EnumFlagsField(position, label, property, GetEnumType()); + } + else + { + base.OnGUI(position, property, label); + } + + EditorGUI.EndProperty(); + } + + #endregion + + #region Private methods + + private Type GetEnumType() + { + return ((EnumMaskFieldAttribute)attribute).EnumType; + } + + private bool IsEnum() + { + Type type = GetEnumType(); + #if NETFX_CORE + return type.GetTypeInfo().IsEnum; + #else + return type.IsEnum; + #endif + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EnumMaskFieldDrawer.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EnumMaskFieldDrawer.cs.meta new file mode 100644 index 00000000..373cfe58 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/EnumMaskFieldDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 11e33d767c33a4a10bc1e378ed17ef72 +timeCreated: 1579074419 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/FileBrowserAttributeDrawer.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/FileBrowserAttributeDrawer.cs new file mode 100644 index 00000000..0e6d620a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/FileBrowserAttributeDrawer.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using UnityEngine; +using UnityEditor; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.Editor +{ + [CustomPropertyDrawer(typeof(FileBrowserAttribute))] + public class FileBrowserAttributeDrawer : PropertyDrawer + { + #region Base class methods + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, label, property); + + // draw property + var valueRect = new Rect(position.x, position.y, position.width - 50, position.height); + var buttonRect = new Rect(position.xMax - 45, position.y, 45, position.height); + + EditorGUI.PropertyField(valueRect, property, label); + if (GUI.Button(buttonRect, new GUIContent("Select"))) + { + EditorApplication.delayCall += () => + { + OpenFileBrowser(property); + }; + } + + EditorGUI.EndProperty(); + } + + #endregion + + #region Private methods + + private void OpenFileBrowser(SerializedProperty property) + { + var value = EditorUtility.OpenFilePanel("Select file", IOServices.GetAbsolutePath(property.stringValue), ((FileBrowserAttribute)attribute).Extension); + if (!string.IsNullOrEmpty(value)) + { + property.stringValue = ((FileBrowserAttribute)attribute).UsesRelativePath ? IOServices.GetRelativePath(IOServices.GetAbsolutePath(""), value) : value; + UnityEditorUtility.SetIsEditorDirty(true); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/FileBrowserAttributeDrawer.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/FileBrowserAttributeDrawer.cs.meta new file mode 100644 index 00000000..7192b224 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/FileBrowserAttributeDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f924f934566204936b517248f5f8f4bd +timeCreated: 1576323713 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/FolderBrowserAttributeDrawer.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/FolderBrowserAttributeDrawer.cs new file mode 100644 index 00000000..0310cb91 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/FolderBrowserAttributeDrawer.cs @@ -0,0 +1,51 @@ +using System.Collections; +using System.Collections.Generic; +using System.IO; +using UnityEngine; +using UnityEditor; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.Editor +{ + [CustomPropertyDrawer(typeof(FolderBrowserAttribute))] + public class FolderBrowserAttributeDrawer : PropertyDrawer + { + #region Base class methods + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, label, property); + + // draw property + var valueRect = new Rect(position.x, position.y, position.width - 50, position.height); + var buttonRect = new Rect(position.xMax - 45, position.y, 45, position.height); + + EditorGUI.PropertyField(valueRect, property, label); + if (GUI.Button(buttonRect, new GUIContent("Select"))) + { + EditorApplication.delayCall += () => + { + OpenFolderBrowser(property); + }; + } + + EditorGUI.EndProperty(); + } + + #endregion + + #region Private methods + + private void OpenFolderBrowser(SerializedProperty property) + { + var value = EditorUtility.OpenFolderPanel("Select folder", IOServices.GetAbsolutePath(property.stringValue), string.Empty); + if (!string.IsNullOrEmpty(value)) + { + property.stringValue = ((FolderBrowserAttribute)attribute).UsesRelativePath ? IOServices.GetRelativePath(IOServices.GetAbsolutePath(""), value) : value; + UnityEditorUtility.SetIsEditorDirty(true); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/FolderBrowserAttributeDrawer.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/FolderBrowserAttributeDrawer.cs.meta new file mode 100644 index 00000000..897f7224 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/FolderBrowserAttributeDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: cafbc9653f53348559d4e088e2014b44 +timeCreated: 1576323712 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/InterfaceFieldAttributeDrawer.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/InterfaceFieldAttributeDrawer.cs new file mode 100644 index 00000000..fb222def --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/InterfaceFieldAttributeDrawer.cs @@ -0,0 +1,38 @@ +using System.Collections; +using System.Collections.Generic; +using System.IO; +using UnityEngine; +using UnityEditor; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.Editor +{ + [CustomPropertyDrawer(typeof(InterfaceFieldAttribute))] + public class InterfaceFieldAttributeDrawer : PropertyDrawer + { + #region Base class methods + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, label, property); + + // draw property + EditorGUI.BeginChangeCheck(); + EditorGUI.PropertyField(position, property, label); + if (EditorGUI.EndChangeCheck()) + { + var reference = property.objectReferenceValue; + var interfaceType = ((InterfaceFieldAttribute)attribute).InterfaceType; + if (reference && !interfaceType.IsAssignableFrom(reference.GetType())) + { + DebugLogger.LogError(CoreLibraryDomain.Default, $"Object does not implement interface of type: {interfaceType}."); + property.objectReferenceValue = null; + } + } + + EditorGUI.EndProperty(); + } + } + + #endregion +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/InterfaceFieldAttributeDrawer.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/InterfaceFieldAttributeDrawer.cs.meta new file mode 100644 index 00000000..e90015f7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/InterfaceFieldAttributeDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9c5bbe7cdfcd444908de802817480fbf +timeCreated: 1577514657 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/ReadOnlyAttributeDrawer.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/ReadOnlyAttributeDrawer.cs new file mode 100644 index 00000000..1e846a8d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/ReadOnlyAttributeDrawer.cs @@ -0,0 +1,66 @@ +using UnityEngine; +using UnityEditor; + +namespace VoxelBusters.CoreLibrary.Editor +{ + [CustomPropertyDrawer(typeof(ReadOnlyAttribute), true)] + public class ReadOnlyAttributeDrawer : PropertyDrawer + { + private const float m_padding = 10f; + + #region Base class methods + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + var offset = GetMessageHeight(); + var fieldHeight = EditorGUI.GetPropertyHeight(property, label, true); + var fieldRect = new Rect(position.x, position.y + m_padding, position.width, fieldHeight); + var messageRect = new Rect(position.x, position.y + fieldHeight + m_padding + 2f, position.width, offset); + + GUI.enabled = false; + EditorGUI.PropertyField(fieldRect, property, label, true); + if (HasMessage()) + { + EditorGUI.LabelField(messageRect, GetMessage(), GetMessageStyle()); + } + GUI.enabled = true; + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return EditorGUI.GetPropertyHeight(property, label, true) + GetMessageHeight() + m_padding * 2f; + } + + #endregion + + #region Utility methods + + private GUIStyle GetMessageStyle() + { + return CustomEditorStyles.MiniLabel(wordWrap: false); //TODO: Using false as calcSize is not working properly with wordwrap on. + } + + private bool HasMessage() + { + return !string.IsNullOrEmpty(GetMessage()); + } + + private string GetMessage() + { + var message = ((ReadOnlyAttribute)attribute).Message; + return message; + } + + private float GetMessageHeight() + { + var message = GetMessage(); + + if (string.IsNullOrEmpty(message)) + return 0f; + + return GetMessageStyle().CalcSize(new GUIContent(message)).y; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/ReadOnlyAttributeDrawer.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/ReadOnlyAttributeDrawer.cs.meta new file mode 100644 index 00000000..c44132ca --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/ReadOnlyAttributeDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb5b59ba618cd4d3a97f3f6a1f7ec0c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/RuntimePlatformConstantDrawer.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/RuntimePlatformConstantDrawer.cs new file mode 100644 index 00000000..8dafedd9 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/RuntimePlatformConstantDrawer.cs @@ -0,0 +1,38 @@ +using UnityEngine; +using UnityEditor; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.Editor +{ + [CustomPropertyDrawer(typeof(RuntimePlatformConstant))] + public class RuntimePlatformConstantDrawer : PropertyDrawer + { + #region Unity methods + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return EditorGUIUtility.singleLineHeight; + } + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + // show property name label + label = EditorGUI.BeginProperty(position, label, property); + position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); + + // show property attributes + Rect platformRect = new Rect(position.x, position.y, 60f, position.height); + Rect idRect = new Rect(position.x + 65f, position.y, position.width - 65f, position.height); + int indentLevel = EditorGUI.indentLevel; + + EditorGUI.indentLevel = 0; + EditorGUI.PropertyField(platformRect, property.FindPropertyRelative("m_platform"), GUIContent.none); + EditorGUI.PropertyField(idRect, property.FindPropertyRelative("m_value"), GUIContent.none); + EditorGUI.indentLevel = indentLevel; + + EditorGUI.EndProperty(); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/RuntimePlatformConstantDrawer.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/RuntimePlatformConstantDrawer.cs.meta new file mode 100644 index 00000000..c09abc82 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/RuntimePlatformConstantDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f8345dac92c6c4d8e813c3a6cc3bd585 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/SettingsObjectInspector.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/SettingsObjectInspector.cs new file mode 100644 index 00000000..dbf05ac7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/SettingsObjectInspector.cs @@ -0,0 +1,244 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public abstract class SettingsObjectInspector : UnityEditor.Editor + { + #region Constants + + private static readonly ButtonMeta[] s_emptyButtonArray = new ButtonMeta[0]; + + private static readonly string[] s_ignoredProperties = new string[] { "m_Script" }; + + #endregion + + #region Fields + + private string m_productName; + + private string m_productVersion; + + // Assets + private Texture2D m_logoIcon; + + #endregion + + #region Properties + + public EditorLayoutBuilder LayoutBuilder { get; private set; } + + protected GUIStyle CustomMarginStyle { get; private set; } + + protected GUIStyle GroupBackgroundStyle { get; private set; } + + protected GUIStyle ProductNameStyle { get; private set; } + + protected GUIStyle NormalLabelStyle { get; private set; } + + protected GUIStyle OptionsLabelStyle { get; private set; } + + #endregion + + #region Abstract methods + + protected abstract UnityPackageDefinition GetOwner(); + + protected abstract string[] GetTabNames(); + + protected abstract EditorSectionInfo[] GetSectionsForTab(string tab); + + #endregion + + #region Unity methods + + protected virtual void OnEnable() + { } + + public override void OnInspectorGUI() + { + EnsurePropertiesAreSet(); + + EditorGUILayout.BeginVertical(CustomMarginStyle); + LayoutBuilder.DoLayout(); + EditorGUILayout.EndVertical(); + } + + public override bool UseDefaultMargins() + { + return false; + } + + #endregion + + #region Draw methods + + protected virtual void DrawTopBar(string tab) + { + GUILayout.BeginHorizontal(GroupBackgroundStyle); + + // logo section + GUILayout.BeginVertical(); + GUILayout.Space(2f); + GUILayout.Label(m_logoIcon, GUILayout.Height(64f), GUILayout.Width(64f)); + GUILayout.Space(2f); + GUILayout.EndVertical(); + + // product info + GUILayout.BeginVertical(); + GUILayout.Label(m_productName, ProductNameStyle); + GUILayout.Label(m_productVersion, NormalLabelStyle); + GUILayout.Label("Copyright © 2024 Voxel Busters Interactive LLP.", OptionsLabelStyle); + GUILayout.EndVertical(); + + GUILayout.FlexibleSpace(); + GUILayout.EndHorizontal(); + } + + protected virtual bool DrawTabView(string tab) + { + return false; + } + + protected virtual void DrawFooter(string tab) + { } + + protected virtual void DrawButtonList(ButtonMeta[] buttons) + { + GUILayout.BeginVertical(); + foreach (var item in buttons) + { + if (GUILayout.Button(item.Label, GUILayout.MinHeight(80f))) + { + item?.OnClick(); + } + } + GUILayout.EndVertical(); + } + + #endregion + + #region Private methods + + private void EnsurePropertiesAreSet() + { + if (LayoutBuilder != null) return; + + LoadCustomStyles(); + LoadAssets(); + + // Set properties + var commonResourcePath = CoreLibrarySettings.Package.GetEditorResourcesPath(); + var ownerPackage = GetOwner(); + m_productName = ownerPackage.DisplayName; + m_productVersion = $"v{ownerPackage.Version}"; + LayoutBuilder = new EditorLayoutBuilder(serializedObject: serializedObject, + tabs: GetTabNames(), + getSectionsCallback: GetSectionsForTab, + drawTopBarCallback: DrawTopBar, + drawTabViewCallback: DrawTabView, + drawFooterCallback: DrawFooter, + toggleOnIcon: AssetDatabase.LoadAssetAtPath(commonResourcePath + "/Textures/toggle-on.png"), + toggleOffIcon: AssetDatabase.LoadAssetAtPath(commonResourcePath + "/Textures/toggle-off.png")); + LayoutBuilder.OnSectionStatusChange += OnSectionStatusChange; + LayoutBuilder.OnFocusSectionValueChange += OnFocusSectionValueChange; + } + + private void LoadCustomStyles() + { + CustomMarginStyle = new GUIStyle(EditorStyles.inspectorFullWidthMargins) + { + margin = new RectOffset(2, 2, 0, 0), + }; + GroupBackgroundStyle = CustomEditorStyles.GroupBackground(); + ProductNameStyle = CustomEditorStyles.Heading1Label(); + NormalLabelStyle = CustomEditorStyles.NormalLabel(); + OptionsLabelStyle = CustomEditorStyles.OptionsLabel(); + } + + private void LoadAssets() + { + // load custom assets + var ownerResourcePath = GetOwner().GetEditorResourcesPath(); + m_logoIcon = AssetDatabase.LoadAssetAtPath(ownerResourcePath + "/Textures/logo.png"); + } + + protected void EnsureChangesAreSerialized() + { + EditorUtility.SetDirty(target); + serializedObject.ApplyModifiedProperties(); + serializedObject.Update(); + } + + protected void TryApplyModifiedProperties() + { + if (EditorGUI.EndChangeCheck()) + { + serializedObject.ApplyModifiedProperties(); + serializedObject.Update(); + } + } + + #endregion + + #region Misc methods +#if NATIVE_PLUGINS_SHOW_UPM_MIGRATION + protected void ShowMigrateToUpmOption() + { + EditorLayoutUtility.Helpbox(title: "UPM Support", + description: "You can install the package on UPM.", + actionLabel: "Migrate To UPM", + onClick: GetOwner().MigrateToUpm, + style: GroupBackgroundStyle); + } +#endif + #endregion + + #region Event handler methods + + protected virtual void OnSectionStatusChange(EditorSectionInfo section) + { } + + protected virtual void OnFocusSectionValueChange(EditorSectionInfo section) + { } + + #endregion + + #region Nested types + + protected class ButtonMeta + { + #region Properties + + public string Label { get; private set; } + + public System.Action OnClick { get; private set; } + + #endregion + + #region Constructors + + public ButtonMeta(string label, System.Action onClick) + { + // set properties + Label = label; + OnClick = onClick; + } + + #endregion + } + + protected class DefaultTabs + { + public const string kGeneral = "General"; + + public const string kServices = "Services"; + + public const string kMisc = "Help"; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/SettingsObjectInspector.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/SettingsObjectInspector.cs.meta new file mode 100644 index 00000000..0521c330 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/SettingsObjectInspector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b40748a9ae9854787b64a0c8ccc993a9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/SettingsProviderZ.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/SettingsProviderZ.cs new file mode 100644 index 00000000..c0e0d841 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/SettingsProviderZ.cs @@ -0,0 +1,89 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +#if UNITY_2019_1_OR_NEWER +using UnityEngine.UIElements; +#else +using UnityEngine.Experimental.UIElements; +#endif + +namespace VoxelBusters.CoreLibrary.Editor +{ + public class SettingsProviderZ : SettingsProvider + { + #region Fields + + private SettingsObject m_settingsObject; + + private SettingsObjectInspector m_settingsObjectInspector; + + #endregion + + #region Constructors + + private SettingsProviderZ(SettingsObject settingsObject, string path, SettingsScope scopes) + : base(path, scopes) + { + // set properties + keywords = GetSearchKeywordsFromSerializedObject(new SerializedObject(settingsObject)); + m_settingsObject = settingsObject; + m_settingsObjectInspector = null; + } + + #endregion + + #region Create methods + + public static SettingsProviderZ Create(SettingsObject settingsObject, string path, SettingsScope scopes) + { + return new SettingsProviderZ(settingsObject, path, scopes); + } + + #endregion + + #region Base class methods + + public override void OnActivate(string searchContext, VisualElement rootElement) + { + base.OnActivate(searchContext, rootElement); + + m_settingsObjectInspector = UnityEditor.Editor.CreateEditor(m_settingsObject) as SettingsObjectInspector; + } + + public override void OnTitleBarGUI() + { + EditorGUILayout.InspectorTitlebar(false, m_settingsObject); + } + + public override void OnGUI(string searchContext) + { + if (m_settingsObjectInspector == null) + { + return; + } + + EditorGUILayout.BeginHorizontal(); + GUILayout.Space(10f); + EditorGUILayout.BeginVertical(); + m_settingsObjectInspector.OnInspectorGUI(); + EditorGUILayout.EndVertical(); + GUILayout.Space(10f); + EditorGUILayout.EndHorizontal(); + } + + public override void OnDeactivate() + { + base.OnDeactivate(); + + if (m_settingsObjectInspector) + { + Object.DestroyImmediate(m_settingsObjectInspector); + m_settingsObjectInspector = null; + } + } + + #endregion + + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/SettingsProviderZ.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/SettingsProviderZ.cs.meta new file mode 100644 index 00000000..dead65fc --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/SettingsProviderZ.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 82c92451806c941888c94130f02c1a18 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/StringPopupAttributeDrawer.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/StringPopupAttributeDrawer.cs new file mode 100644 index 00000000..7d82f5f2 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/StringPopupAttributeDrawer.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.Editor +{ + [CustomPropertyDrawer(typeof(StringPopupAttribute), true)] + public class StringPopupAttributeDrawer : PropertyDrawer + { + #region Base class methods + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + label = EditorGUI.BeginProperty(position, label, property); + + // determine whether popup is required + bool canShowPopup = true; + var popupAttribute = (StringPopupAttribute)attribute; + if (popupAttribute.PreferencePropertyName != null) + { + var preferencePropertyPath = property.propertyPath.Replace(property.name, popupAttribute.PreferencePropertyName); + var preferenceProperty = property.serializedObject.FindProperty(preferencePropertyPath); + canShowPopup = (preferenceProperty != null) && (preferenceProperty.boolValue == popupAttribute.PreferencePropertyValue); + } + + // draw property as per preference + if (canShowPopup) + { + var options = popupAttribute.Options; + int selectedIndex = Array.FindIndex(options, (item) => string.Equals(item, property.stringValue)); + selectedIndex = EditorGUI.Popup(position, label.text, selectedIndex, options); + + // assign value + property.stringValue = (selectedIndex == -1) ? string.Empty : options[selectedIndex]; + } + else + { + EditorGUI.PropertyField(position, property); + } + + EditorGUI.EndProperty(); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/StringPopupAttributeDrawer.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/StringPopupAttributeDrawer.cs.meta new file mode 100644 index 00000000..bc2a5e09 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/StringPopupAttributeDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a787cc0f93bc1438c845ec658e1ce1d5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/UnityEditorUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/UnityEditorUtility.cs new file mode 100644 index 00000000..67d67133 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/UnityEditorUtility.cs @@ -0,0 +1,105 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public static class UnityEditorUtility + { + #region Static methods + + public static bool ShowFoldableHeader(string prefKeyName, string content, string tooltip = null) + { + bool isExpanded = EditorGUILayout.Foldout(EditorPrefs.GetBool(prefKeyName, false), new GUIContent(content, tooltip)); + EditorPrefs.SetBool(prefKeyName, isExpanded); + + return isExpanded; + } + + public static bool ShowFoldableHeader(SerializedProperty property, string displayName = null) + { + bool isExpanded = EditorGUILayout.Foldout(property.isExpanded, new GUIContent(displayName ?? property.displayName, property.tooltip)); + property.isExpanded = isExpanded; + + return isExpanded; + } + + public static void SetIsEditorDirty(bool value) + { + EditorPrefs.SetBool("editor-is-dirty", value); + } + + public static bool GetIsEditorDirty() + { + return EditorPrefs.GetBool("editor-is-dirty", false); + } + + #endregion + + #region Mask field methods + + public static void EnumFlagsField(Rect position, GUIContent label, SerializedProperty property, Type type) + { + property.intValue = EnumFlagsField(position, label, property.intValue, type); + } + + public static int EnumFlagsField(Rect position, GUIContent label, int value, Type type) + { + EditorGUI.BeginChangeCheck(); +#if UNITY_2017_3_OR_NEWER + Enum newValue = EditorGUI.EnumFlagsField(position, label, GetValueAsEnum(value, type)); +#else + Enum newValue = EditorGUI.EnumMaskField(position, label, GetValueAsEnum(value, type)); +#endif + if (EditorGUI.EndChangeCheck()) + { + return GetEnumAsInt(newValue, type); + } + return value; + } + + public static T EnumFlagsField(Rect position, string label, T value) + { + return (T)(object)EnumFlagsField(position, new GUIContent(label), (int)(object)value, typeof(T)); + } + + #endregion + + #region Private static methods + + private static Array GetEnumValues(Type type) + { + return Enum.GetValues(type); + } + + private static Enum GetValueAsEnum(int value, Type type) + { + return (Enum)Enum.ToObject(type, value); + } + + private static int GetEnumAsInt(Enum value, Type type) + { + int newValueInt = Convert.ToInt32(value); + + // if "Everything" is set, force Unity to unset the extra bits by iterating through them + if (newValueInt < 0) + { + int bits = 0; + foreach (var enumValue in GetEnumValues(type)) + { + int checkBit = newValueInt & (int)enumValue; + if (checkBit != 0) + { + bits |= (int)enumValue; + } + } + newValueInt = bits; + } + return newValueInt; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/UnityEditorUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/UnityEditorUtility.cs.meta new file mode 100644 index 00000000..666315dc --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Inspectors/UnityEditorUtility.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8a74bb08ae57c4ca79d5d452cffa4c63 +timeCreated: 1576323712 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Misc.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Misc.meta new file mode 100644 index 00000000..0a386d8b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Misc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f1aed5f1786094c25bd1a7e0d9ebaffb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Misc/AddUnityPackageOperation.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Misc/AddUnityPackageOperation.cs new file mode 100644 index 00000000..e7235364 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Misc/AddUnityPackageOperation.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using UnityEditor.PackageManager; +using UnityEditor.PackageManager.Requests; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public class AddUnityPackageOperation + { + #region Fields + + private string m_package; + + private Action m_callback; + + private AddRequest m_addPackageRequest; + + private ListRequest m_getPackagesRequest; + + #endregion + + #region Constructors + + public AddUnityPackageOperation(string package, System.Action callback) + { + // set properties + m_package = package; + m_callback = callback; + m_getPackagesRequest = null; + m_addPackageRequest = null; + } + + #endregion + + #region Public methods + + public void Start() + { + m_getPackagesRequest = Client.List(); + + // register for routine callbacks + EditorApplication.update += EditorUpdate; + } + + #endregion + + #region Private methods + + private void EditorUpdate() + { + // check whether dependency packages are already installed + if (m_getPackagesRequest != null) + { + if (m_getPackagesRequest.IsCompleted) + { + bool packageInstalled = false; + foreach (var item in m_getPackagesRequest.Result) + { + if (string.Equals(item.name, m_package)) + { + packageInstalled = true; + break; + } + } + + // reset state + m_getPackagesRequest = null; + + // create add request, incase if package is not installed + if (!packageInstalled) + { + Debug.LogFormat("[VoxelBusters] Creating request to add package {0}", m_package); + m_addPackageRequest = Client.Add(m_package); + } + else + { + SendCompletionCallback(); + } + } + return; + } + + // import resources after required packages are installed + if (m_addPackageRequest != null) + { + if (m_addPackageRequest.IsCompleted) + { + SendCompletionCallback(); + } + } + } + + private void SendCompletionCallback() + { + try + { + m_callback(); + } + finally + { + // reset state + m_package = null; + m_callback = null; + m_addPackageRequest = null; + m_getPackagesRequest = null; + EditorApplication.update -= EditorUpdate; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Misc/AddUnityPackageOperation.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Misc/AddUnityPackageOperation.cs.meta new file mode 100644 index 00000000..44d9582e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Misc/AddUnityPackageOperation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7a35410a8a14c41b3ae3d22ba17a44fe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Misc/ScriptingDefinesManager.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Misc/ScriptingDefinesManager.cs new file mode 100644 index 00000000..feab53c2 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Misc/ScriptingDefinesManager.cs @@ -0,0 +1,152 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEditor; +using UnityEditor.Build; +using UnityEngine; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public static class ScriptingDefinesManager + { + #region Static fields + + private static Dictionary> s_addDefinesCollection; + + private static Dictionary> s_removeDefinesCollection; + + private static BuildTargetGroup[] s_supportedTargetGroups; + + + #endregion + + #region Static methods + + public static void AddDefine(string define, params BuildTargetGroup[] targetGroups) + { + EnsureInitialized(); + + AddDefineToCollection( + definesCollection: s_addDefinesCollection, + define: define, + targetGroups: GetBuildTargetGroupsOrDefault(targetGroups)); + UpdateDefineSymbolsDelayed(); + } + + public static void RemoveDefine(string define, params BuildTargetGroup[] targetGroups) + { + EnsureInitialized(); + + AddDefineToCollection( + definesCollection: s_removeDefinesCollection, + define: define, + targetGroups: GetBuildTargetGroupsOrDefault(targetGroups)); + UpdateDefineSymbolsDelayed(); + } + + private static void EnsureInitialized() + { + if (s_addDefinesCollection != null) return; + + // set properties + s_addDefinesCollection = new Dictionary>(); + s_removeDefinesCollection = new Dictionary>(); + s_supportedTargetGroups = GetSupportedBuildTargetGroups(); + } + + private static BuildTargetGroup[] GetSupportedBuildTargetGroups() + { + var newList = new List(); + foreach (BuildTarget buildTarget in System.Enum.GetValues(typeof(BuildTarget))) + { + var buildTargetGroup = BuildPipeline.GetBuildTargetGroup(buildTarget); + if (BuildPipeline.IsBuildTargetSupported(buildTargetGroup, buildTarget)) + { + newList.AddUnique(buildTargetGroup); + } + } + return newList.ToArray(); + } + + private static BuildTargetGroup[] GetBuildTargetGroupsOrDefault(BuildTargetGroup[] targetGroups) + { + return ((targetGroups == null) || (targetGroups.Length == 0)) + ? s_supportedTargetGroups + : targetGroups; + } + + private static void AddDefineToCollection(Dictionary> definesCollection, string define, BuildTargetGroup[] targetGroups) + { + // add define symbol for all the specified target groups + foreach (var group in targetGroups) + { + if (!System.Array.Exists(s_supportedTargetGroups, (item) => (item == group))) + { + continue; + } + + if (!definesCollection.TryGetValue(group, out List groupDefines)) + { + var newDefines = new List(); + definesCollection.Add(group, newDefines); + + groupDefines = newDefines; + } + + groupDefines.AddUnique(define); + } + } + + private static void UpdateDefineSymbolsDelayed() + { + EditorApplication.delayCall -= UpdateDefineSymbols; + EditorApplication.delayCall += UpdateDefineSymbols; + } + + private static void UpdateDefineSymbols() + { + try + { + EnsureInitialized(); + AssetDatabase.StartAssetEditing(); + + foreach (var targetGroup in s_supportedTargetGroups) + { + var existingDefines = PlayerSettings.GetScriptingDefineSymbols(NamedBuildTarget.FromBuildTargetGroup(targetGroup)).Split(';'); + var updatedDefines = new List(existingDefines); + bool isModified = false; + if (s_addDefinesCollection.TryGetValue(targetGroup, out List addDefines)) + { + foreach (var define in addDefines) + { + isModified |= updatedDefines.AddUnique(define); + } + } + if (s_removeDefinesCollection.TryGetValue(targetGroup, out List removeDefines)) + { + foreach (var define in removeDefines) + { + isModified |= updatedDefines.Remove(define); + } + } + + // set values if there are modifications + if (isModified) + { + PlayerSettings.SetScriptingDefineSymbols(NamedBuildTarget.FromBuildTargetGroup(targetGroup), string.Join(";", updatedDefines.ToArray())); + } + } + } + finally + { + AssetDatabase.StopAssetEditing(); + + // reset properties + s_addDefinesCollection.Clear(); + s_removeDefinesCollection.Clear(); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Misc/ScriptingDefinesManager.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Misc/ScriptingDefinesManager.cs.meta new file mode 100644 index 00000000..ac6b90ca --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Misc/ScriptingDefinesManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ef477a8c89c614881ab6594601f54f4b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities.meta new file mode 100644 index 00000000..755a2aea --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3046d47b6921d4f5e8210ffad4508e17 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AddUpmPackageRequest.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AddUpmPackageRequest.cs new file mode 100644 index 00000000..787009cd --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AddUpmPackageRequest.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEditor; +using UnityEditor.PackageManager; +using UnityEditor.PackageManager.Requests; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public class AddUpmPackageRequest : AsyncOperation + { + #region Fields + + private AddRequest m_request; + + #endregion + + #region Properties + + public string Identifier { get; set; } + + #endregion + + #region Constructors + + public AddUpmPackageRequest(string identifier) + { + // Set properties + Identifier = identifier; + } + + #endregion + + #region Base class methods + + protected override void OnStart() + { + m_request = Client.Add(Identifier); + } + + protected override void OnUpdate() + { + if (!m_request.IsCompleted) return; + + // Process response + if (m_request.Status == StatusCode.Success) + { + Debug.Log($"Installed package: {m_request.Result.packageId} successfully."); + SetIsCompleted(StatusCode.Success); + } + else if (m_request.Status == StatusCode.Failure) + { + Debug.Log($"Failed to install package: {m_request.Result.packageId}. Error {m_request.Error.message}."); + SetIsCompleted(error: new Error(m_request.Error.message)); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AddUpmPackageRequest.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AddUpmPackageRequest.cs.meta new file mode 100644 index 00000000..13a25911 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AddUpmPackageRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a87b7bce048e1424984e245b62107603 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssemblyDefinitionData.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssemblyDefinitionData.cs new file mode 100644 index 00000000..e8b0e7a6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssemblyDefinitionData.cs @@ -0,0 +1,61 @@ +using Newtonsoft.Json; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor +{ + + public partial class AssemblyDefinitionProxy + { + private struct AssemblyDefinitionData + { + #region Properties + + [JsonProperty("name")] + public string Name { get; set; } + + [JsonProperty("references")] + public string[] References { get; set; } + + [JsonProperty("optionalUnityReferences")] + public string[] OptionalUnityReferences { get; set; } + + [JsonProperty("includePlatforms")] + public string[] IncludePlatforms { get; set; } + + [JsonProperty("excludePlatforms")] + public string[] ExcludePlatforms { get; set; } + + [JsonProperty("allowUnsafeCode")] + public bool AllowUnsafeCode { get; set; } + + [JsonProperty("overrideReferences")] + public bool OverrideReferences { get; set; } + + [JsonProperty("precompiledReferences")] + public string[] PrecompiledReferences { get; set; } + + [JsonProperty("autoReferenced")] + public bool AutoReferenced { get; set; } + + [JsonProperty("defineConstraints")] + public string[] DefineConstraints { get; set; } + + #endregion + + #region Public methods + + public static AssemblyDefinitionData Load(string dataString) + { + return JsonConvert.DeserializeObject(dataString); + } + + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + #endregion + } + + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssemblyDefinitionData.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssemblyDefinitionData.cs.meta new file mode 100644 index 00000000..b03acc20 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssemblyDefinitionData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6f335c720b36b4411b4d54550b2e94d8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssemblyDefinitionProxy.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssemblyDefinitionProxy.cs new file mode 100644 index 00000000..c4c46748 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssemblyDefinitionProxy.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using UnityEditor; +using UnityEditor.Compilation; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor +{ + + public partial class AssemblyDefinitionProxy + { + + private AssemblyDefinitionData m_data; + private string m_directoryPath; + + public AssemblyDefinitionProxy(string assemblyDirectoryPath) + { + string asmdefFile = Directory.GetFiles(assemblyDirectoryPath, "*.asmdef").FirstOrDefault(); + + if (string.IsNullOrEmpty(asmdefFile)) + { + throw new VBException($"No .asmdef file found in {assemblyDirectoryPath} directory."); + } + + m_directoryPath = assemblyDirectoryPath; + string contents = IOServices.ReadFile(asmdefFile); + m_data = AssemblyDefinitionData.Load(contents); + } + + public void IncludeAllPlatforms() + { + m_data.ExcludePlatforms = new string[0]; + m_data.IncludePlatforms = new string[0]; + } + + public void ExcludeAllPlatforms() + { + AssemblyDefinitionPlatform[] platforms = CompilationPipeline.GetAssemblyDefinitionPlatforms(); + m_data.ExcludePlatforms = platforms.Select(platform => platform.Name).ToArray(); + m_data.IncludePlatforms = new string[0]; + } + + + public void Save() + { + IOServices.CreateFile(IOServices.CombinePath(m_directoryPath, $"{m_data.Name}.asmdef"), m_data.ToJson()); + } + + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssemblyDefinitionProxy.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssemblyDefinitionProxy.cs.meta new file mode 100644 index 00000000..c3c90e25 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssemblyDefinitionProxy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b5c04f18545af4d43bfe1034aa18a54e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssemblyDefinitionServices.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssemblyDefinitionServices.cs new file mode 100644 index 00000000..6a40f2f9 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssemblyDefinitionServices.cs @@ -0,0 +1,39 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public static class AssemblyDefinitionServices + { + #region Static methods + + public static void CreateDefinition(string path, + string name, + string[] includePlatforms = null, + string[] references = null) + { + string json = $"{{" + + $"\n\t\"name\":\"{name}\"," + + $"\n\t\"includePlatforms\":{Jsonify(includePlatforms)}," + + $"\n\t\"references\":{Jsonify(references)}" + + $"\n}}"; + + if (!IOServices.DirectoryExists(path)) + { + IOServices.CreateDirectory(path); + } + + IOServices.CreateFile(IOServices.CombinePath(path, $"{name}.asmdef"), json); + } + + private static string Jsonify(string[] array) + { + if (array == null) return "[]"; + + return $"[{string.Join(",", System.Array.ConvertAll(array, (item) => $"\"{item}\""))}]"; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssemblyDefinitionServices.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssemblyDefinitionServices.cs.meta new file mode 100644 index 00000000..c9bead51 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssemblyDefinitionServices.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3f85adcf2acaf49838d6c77837b24ca1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssetDatabaseUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssetDatabaseUtility.cs new file mode 100644 index 00000000..708a8ec6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssetDatabaseUtility.cs @@ -0,0 +1,90 @@ +using System.Collections; +using System.Collections.Generic; +using System.IO; +using UnityEditor; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public static class AssetDatabaseUtility + { + #region Resources methods + + public static void CreateFolder(string folder) + { + var pathComponents = folder.Split('/'); + + string currentPath = string.Empty; + for (int iter = 0; iter < pathComponents.Length; iter++) + { + string component = pathComponents[iter]; + string newPath = Path.Combine(currentPath, component); + if (!AssetDatabase.IsValidFolder(newPath)) + { + AssetDatabase.CreateFolder(currentPath, component); + } + + // update path + currentPath = newPath; + } + } + + public static void CreateAssetAtPath(Object asset, + string assetPath) + { + // create container folder + string parentFolder = assetPath.Substring(0, assetPath.LastIndexOf('/')); + CreateFolder(parentFolder); + + // create asset + AssetDatabase.CreateAsset(asset, assetPath); + } + + public static T CreateScriptableObject(string assetPath, + System.Func createFunc = null, + System.Action onInit = null) where T : ScriptableObject + { + var instance = (createFunc != null) + ? createFunc() + : ScriptableObject.CreateInstance(); + onInit?.Invoke(instance); + + // create file + CreateAssetAtPath(instance, assetPath); + AssetDatabase.Refresh(); + + return instance; + } + + public static T LoadScriptableObject(string assetPath, + System.Action onLoad = null, + System.Func throwErrorFunc = null) where T : ScriptableObject + { + var instance = AssetDatabase.LoadAssetAtPath(assetPath); + if (instance) + { + onLoad?.Invoke(instance); + return instance; + } + + if (throwErrorFunc != null) + { + throw throwErrorFunc(); + } + + return null; + } + + public static T[] FindAssetObjects() where T : ScriptableObject + { + var guids = AssetDatabase.FindAssets($"t:{typeof(T).Name}"); + return System.Array.ConvertAll(guids, (item) => + { + string path = AssetDatabase.GUIDToAssetPath(item); + return AssetDatabase.LoadAssetAtPath(path); + }); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssetDatabaseUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssetDatabaseUtility.cs.meta new file mode 100644 index 00000000..870fd8dc --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/AssetDatabaseUtility.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ab0d5c5a093844a80ae39b5d66ab9164 +timeCreated: 1576669974 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/DeleteAssetRequest.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/DeleteAssetRequest.cs new file mode 100644 index 00000000..5b6ce3d0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/DeleteAssetRequest.cs @@ -0,0 +1,39 @@ +using UnityEngine; +using System.Collections; +using UnityEditor; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public class DeleteAssetRequest : AsyncOperation + { + #region Properties + + public string Path { get; private set; } + + #endregion + + #region Constructors + + public DeleteAssetRequest(string path) + { + Path = path; + } + + #endregion + + #region Base class methods + + protected override void OnStart() + { + if (!AssetDatabase.DeleteAsset(Path)) + { + SetIsCompleted(new Error("File not found.")); + return; + } + SetIsCompleted(true); + } + + #endregion + + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/DeleteAssetRequest.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/DeleteAssetRequest.cs.meta new file mode 100644 index 00000000..285677f6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/DeleteAssetRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2204697bc932f4f28b4dad14e5c29724 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/EditorApplicationUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/EditorApplicationUtility.cs new file mode 100644 index 00000000..8d77c0e0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/EditorApplicationUtility.cs @@ -0,0 +1,31 @@ +using UnityEditor; +using UnityEngine; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public static class EditorApplicationUtility + { + #region Platform methods + + public static RuntimePlatform ConvertBuildTargetToRuntimePlatform(BuildTarget buildTarget) + { + switch (buildTarget) + { + case BuildTarget.iOS: + return RuntimePlatform.IPhonePlayer; + + case BuildTarget.tvOS: + return RuntimePlatform.tvOS; + + case BuildTarget.Android: + return RuntimePlatform.Android; + + default: + return (RuntimePlatform)(-1); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/EditorApplicationUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/EditorApplicationUtility.cs.meta new file mode 100644 index 00000000..9db91778 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/EditorApplicationUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f0eb0657c7f942c6a847903ed852752 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/ImportPackageRequest.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/ImportPackageRequest.cs new file mode 100644 index 00000000..7314867e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/ImportPackageRequest.cs @@ -0,0 +1,40 @@ +using UnityEngine; +using System.Collections; +using UnityEditor; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public class ImportPackageRequest : VoxelBusters.CoreLibrary.AsyncOperation + { + #region Properties + + public string Path { get; private set; } + + #endregion + + #region Constructors + + public ImportPackageRequest(string path) + { + Path = path; + } + + #endregion + + #region Base class methods + + protected override void OnStart() + { + if (!IOServices.FileExists(Path)) + { + SetIsCompleted(new Error("File not found.")); + return; + } + + AssetDatabase.ImportPackage(Path, interactive: false); + SetIsCompleted(true); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/ImportPackageRequest.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/ImportPackageRequest.cs.meta new file mode 100644 index 00000000..05a2946d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/ImportPackageRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a33d068e4b51149e08021407780741d2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/RemoveUpmPackageRequest.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/RemoveUpmPackageRequest.cs new file mode 100644 index 00000000..d36aa11e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/RemoveUpmPackageRequest.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEditor; +using UnityEditor.PackageManager; +using UnityEditor.PackageManager.Requests; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public class RemoveUpmPackageRequest : AsyncOperation + { + #region Fields + + private RemoveRequest m_request; + + #endregion + + #region Properties + + public string Identifier { get; set; } + + #endregion + + #region Constructors + + public RemoveUpmPackageRequest(string identifier) + { + // Set properties + Identifier = identifier; + } + + #endregion + + #region Base class methods + + protected override void OnStart() + { + m_request = Client.Remove(Identifier); + } + + protected override void OnUpdate() + { + if (!m_request.IsCompleted) return; + + // Process response + if (m_request.Status == StatusCode.Success) + { + Debug.Log($"Installed package: {m_request.PackageIdOrName} successfully."); + SetIsCompleted(m_request.Status); + } + else if (m_request.Status >= StatusCode.Failure) + { + Debug.Log($"Failed to install package: {m_request.PackageIdOrName}. Error {m_request.Error.message}."); + SetIsCompleted(error: new Error(m_request.Error.message)); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/RemoveUpmPackageRequest.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/RemoveUpmPackageRequest.cs.meta new file mode 100644 index 00000000..87a6e7f3 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/RemoveUpmPackageRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b5ea45e566aa3452aa8db2aa084333c4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/TypeCache.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/TypeCache.cs new file mode 100644 index 00000000..5f7ece94 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/TypeCache.cs @@ -0,0 +1,122 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Reflection; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public class TypeCache + { + #region Static fields + + private static Dictionary s_typeMap; + + private static bool s_isDirty; + + #endregion + + #region Static methods + + public static void Rebuild() + { + // Reset properties + s_isDirty = true; + s_typeMap?.Clear(); + + EnsureCacheIsUpdated(); + } + + public static Dictionary GetMembersWithAttribute(MemberTypes memberTypes, BindingFlags bindingAttr) + where TAttribute : Attribute + { + return GetMembersWithAttribute(memberTypes, bindingAttr); + } + + public static Dictionary GetFieldsWithAttribute(BindingFlags bindingAttr) where TAttribute : Attribute + { + return GetMembersWithAttribute(MemberTypes.Field, bindingAttr); + } + + public static Dictionary GetPropertiesWithAttribute(BindingFlags bindingAttr) where TAttribute : Attribute + { + return GetMembersWithAttribute(MemberTypes.Property, bindingAttr); + } + + public static Dictionary GetEventsWithAttribute(BindingFlags bindingAttr) where TAttribute : Attribute + { + return GetMembersWithAttribute(MemberTypes.Event, bindingAttr); + } + + public static Dictionary GetMethodsWithAttribute(BindingFlags bindingAttr) where TAttribute : Attribute + { + return GetMembersWithAttribute(MemberTypes.Method, bindingAttr); + } + + #endregion + + #region Private methods + + private static void EnsureCacheIsUpdated() + { + if (!s_isDirty) return; + + // Initialize object + s_isDirty = false; + if (s_typeMap == null) + { + s_typeMap = new Dictionary(capacity: 1024); + } + + // Add types to the cache + foreach (var type in ReflectionUtility.FindAllTypes()) + { + s_typeMap.Add(type, type.FullName); + } + } + + private static Dictionary GetMembersWithAttribute(MemberTypes memberTypes, BindingFlags bindingAttr) + where TMemberInfo : MemberInfo + where TAttribute : Attribute + { + EnsureCacheIsUpdated(); + + // Find all the methods with specified attribute + var attributeType = typeof(TAttribute); + var collection = new Dictionary(); + foreach (var mapItem in s_typeMap) + { + var currentType = mapItem.Key; + + AddMembersWithRequiredAttributes(currentType); + + //When we create a "concrete" class derived from a generic class, it will internally constructs a new class (replacing generic parameters with actual types). We need to query this type for required attributes as well. + if (IsConstructedClosedGenericType(currentType.BaseType)) + { + AddMembersWithRequiredAttributes(currentType.BaseType); + } + } + return collection; + + void AddMembersWithRequiredAttributes(Type type) + { + var members = type.FindMembers(memberTypes, bindingAttr, null, null); + foreach (var memberInfo in members) + { + var attributes = memberInfo.GetCustomAttributes(attributeType, false); + if (attributes.IsNullOrEmpty()) continue; + + collection.Add(memberInfo as TMemberInfo, attributes[0] as TAttribute); + } + } + + } + + private static bool IsConstructedClosedGenericType(Type type) + { + return type != null && type.IsConstructedGenericType && !type.ContainsGenericParameters; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/TypeCache.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/TypeCache.cs.meta new file mode 100644 index 00000000..42e4a00c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/TypeCache.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8d14cdf5aeeb847f0ac54ffd5c03ae1d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/UnityPackageServices.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/UnityPackageServices.cs new file mode 100644 index 00000000..200f716f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/UnityPackageServices.cs @@ -0,0 +1,89 @@ +using System.Collections; +using System.Collections.Generic; +using System.IO; +using UnityEditor; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public static class UnityPackageServices + { + #region Constants + + private static readonly string[] s_staticFolders = + { + "Essentials", + "Examples", + "Extras", + "Plugins", + "Scripts" + }; + + #endregion + + #region Static methods + + [System.Obsolete("This method is deprecated. Use MigrateToUpm instead.")] + public static void MigrateToUPM(this UnityPackageDefinition package) + { + MovePackageToUpmRecursively(package, refreshOnFinish: true); + } + + public static void MigrateToUpm(this UnityPackageDefinition package) + { + MovePackageToUpmRecursively(package, refreshOnFinish: true); + } + + private static void MovePackageToUpmRecursively(this UnityPackageDefinition package, bool refreshOnFinish) + { + try + { + // Move dependencies + foreach (var dependency in package.Dependencies) + { + MovePackageToUpmRecursively(dependency, refreshOnFinish: false); + } + + // Move main package + MovePackageToUpm(package); + } + finally + { + if (refreshOnFinish) + { + AssetDatabase.Refresh(); + } + } + } + + private static void MovePackageToUpm(UnityPackageDefinition package) + { + // Confirm that package exists in default install path + if (!package.IsInstalledWithinAssets()) return; + + // Move files and folders to new path + var sourceDirectory = new DirectoryInfo(package.DefaultInstallPath); + IOServices.CreateDirectory(package.UpmInstallPath); + foreach (var file in sourceDirectory.GetFiles()) + { + var fileName = file.Name; + if (System.Array.Exists(s_staticFolders, (item) => string.Equals(fileName, $"{item}.meta"))) + { + continue; + } + IOServices.MoveFile(file.FullName, $"{package.UpmInstallPath}/{fileName}"); + } + foreach (var subDirectory in sourceDirectory.GetDirectories()) + { + var subDirectoryName = subDirectory.Name; + if (System.Array.Exists(s_staticFolders, (item) => string.Equals(subDirectoryName, item))) + { + continue; + } + IOServices.MoveDirectory(subDirectory.FullName, $"{package.UpmInstallPath}/{subDirectoryName}"); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/UnityPackageServices.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/UnityPackageServices.cs.meta new file mode 100644 index 00000000..5ae39ed1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/Utilities/UnityPackageServices.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4667b4f0e71ec4791afd9f9d887a0c96 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/VoxelBusters.CoreLibrary.Editor.asmdef b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/VoxelBusters.CoreLibrary.Editor.asmdef new file mode 100644 index 00000000..11593388 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/VoxelBusters.CoreLibrary.Editor.asmdef @@ -0,0 +1,16 @@ +{ + "name": "VoxelBusters.CoreLibrary.Editor", + "references": [ + "VoxelBusters.CoreLibrary" + ], + "optionalUnityReferences": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [] +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/VoxelBusters.CoreLibrary.Editor.asmdef.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/VoxelBusters.CoreLibrary.Editor.asmdef.meta new file mode 100644 index 00000000..3984fd02 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/CoreLibrary/VoxelBusters.CoreLibrary.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2e305d2a5092a465db2a72838d17a500 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental.meta new file mode 100644 index 00000000..6859c8c1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3e4381b029b7441f28679a1978aee2bf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors.meta new file mode 100644 index 00000000..1f19ec2a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d402a199f95044159bdc2107cdcd3334 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors/InstallPath.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors/InstallPath.cs new file mode 100644 index 00000000..f3780112 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors/InstallPath.cs @@ -0,0 +1,25 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.Experimental +{ + public static class InstallPath + { + #region Static properties + + public static string EssentialKit { get; private set; } = "https://link.voxelbusters.com/essential-kit"; + + public static string ScreenRecorderKit { get; private set; } = "https://link.voxelbusters.com/screen-recorder-kit"; + + public static string SocialKit { get; private set; } = "https://link.voxelbusters.com/social-kit"; + + public static string MLKit { get; private set; } = "https://link.voxelbusters.com/easy-ml-kit"; + + public static string ReportingKit { get; private set; } = "https://link.voxelbusters.com/reporting-kit"; + + public static string AdsKit { get; private set; } = "https://link.voxelbusters.com/ads-kit"; + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors/InstallPath.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors/InstallPath.cs.meta new file mode 100644 index 00000000..2b07a2db --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors/InstallPath.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ccdff37e3ee3d41f794ef3d1b107b01d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors/ProxyMenuManager.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors/ProxyMenuManager.cs new file mode 100644 index 00000000..e84fe793 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors/ProxyMenuManager.cs @@ -0,0 +1,65 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace VoxelBusters.CoreLibrary.Editor.Experimental +{ + public static class ProxyMenuManager + { + #region Constants + + private const string kMenuItemPath = "Window/Voxel Busters"; + + #endregion + + #region Static methods + +#if !ENABLE_VOXELBUSTERS_ESSENTIAL_KIT + [MenuItem(kMenuItemPath + "/Essential Kit/Learn More", priority = 0)] + public static void InstallEssentialKit() + { + OpenInstallPath(InstallPath.EssentialKit); + } +#endif + +#if !ENABLE_VOXELBUSTERS_SCREEN_RECORDER_KIT + [MenuItem(kMenuItemPath + "/Screen Recorder Kit/Learn More", priority = 0)] + public static void InstallScreenRecorderKit() + { + OpenInstallPath(InstallPath.ScreenRecorderKit); + } +#endif + +#if !ENABLE_VOXELBUSTERS_SOCIAL_KIT + [MenuItem(kMenuItemPath + "/Social Kit/Learn More", priority = 0)] + public static void InstallSocialKit() + { + OpenInstallPath(InstallPath.SocialKit); + } +#endif + +#if !ENABLE_VOXELBUSTERS_ML_KIT + [MenuItem(kMenuItemPath + "/ML Kit/Learn More", priority = 0)] + public static void InstallMLKit() + { + OpenInstallPath(InstallPath.MLKit); + } +#endif + +#if !ENABLE_VOXELBUSTERS_REPORTING_KIT + [MenuItem(kMenuItemPath + "/Reporting Kit/Learn More", priority = 0)] + public static void InstallReportingKit() + { + OpenInstallPath(InstallPath.ReportingKit); + } +#endif + + private static void OpenInstallPath(string path) + { + Application.OpenURL(path); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors/ProxyMenuManager.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors/ProxyMenuManager.cs.meta new file mode 100644 index 00000000..2bce9a42 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors/ProxyMenuManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8d5313a9f9e1b4bcdb89c991f700da78 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors/ProxySettingsProvider.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors/ProxySettingsProvider.cs new file mode 100644 index 00000000..026eb27b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors/ProxySettingsProvider.cs @@ -0,0 +1,115 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.Experimental +{ + public class ProxySettingsProvider : SettingsProvider + { + #region Constants + + private const string kDefaultInstallMessageFormat = "In order to use {0} system you need to install the {0} package. Clicking the button below will install {0} package and allow you to configure."; + + private const string kDefaultProjectSettingsPathFormat = "Project/Voxel Busters/{0}"; + + #endregion + + #region Fields + + private string m_installMessage; + + private string m_installButtonLabel; + + private string m_installUrl; + + #endregion + + #region Constructors + + public ProxySettingsProvider(string name, + string installUrl, + string path = null, + SettingsScope scopes = SettingsScope.Project) + : base(path ?? string.Format(kDefaultProjectSettingsPathFormat, name), scopes) + { + // set properties + m_installMessage = string.Format(kDefaultInstallMessageFormat, name); + m_installButtonLabel = $"Install {name}"; + m_installUrl = installUrl; + } + + #endregion + + #region Create methods + +#if !ENABLE_VOXELBUSTERS_ESSENTIAL_KIT + [SettingsProvider] + private static SettingsProvider CreateEssentialKitSettingsProvider() + { + return new ProxySettingsProvider(name: "Essential Kit", + installUrl: InstallPath.EssentialKit); + } +#endif + +#if !ENABLE_VOXELBUSTERS_SCREEN_RECORDER_KIT + [SettingsProvider] + private static SettingsProvider CreateScreenRecorderKitSettingsProvider() + { + return new ProxySettingsProvider(name: "Screen Recorder Kit", + installUrl: InstallPath.ScreenRecorderKit); + } +#endif + +#if !ENABLE_VOXELBUSTERS_SOCIAL_KIT + [SettingsProvider] + private static SettingsProvider CreateSocialKitSettingsProvider() + { + return new ProxySettingsProvider(name: "Social Kit", + installUrl: InstallPath.SocialKit); + } +#endif + +#if !ENABLE_VOXELBUSTERS_ML_KIT + [SettingsProvider] + private static SettingsProvider CreateMLKitSettingsProvider() + { + return new ProxySettingsProvider(name: "ML Kit", + installUrl: InstallPath.MLKit); + } +#endif + +#if !ENABLE_VOXELBUSTERS_REPORTING_KIT + [SettingsProvider] + private static SettingsProvider CreateReportingKitSettingsProvider() + { + return new ProxySettingsProvider(name: "Reporting Kit", + installUrl: InstallPath.ReportingKit); + } +#endif + +#if !ENABLE_VOXELBUSTERS_ADS_KIT + [SettingsProvider] + private static SettingsProvider CreateAdsKitSettingsProvider() + { + return new ProxySettingsProvider(name: "Ads Kit", + installUrl: InstallPath.AdsKit); + } +#endif + + #endregion + + #region Base class methods + + public override void OnGUI(string searchContext) + { + EditorGUILayout.HelpBox(m_installMessage, MessageType.Info); + if (GUILayout.Button(m_installButtonLabel)) + { + Application.OpenURL(m_installUrl); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors/ProxySettingsProvider.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors/ProxySettingsProvider.cs.meta new file mode 100644 index 00000000..d3cd2abc --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/Inspectors/ProxySettingsProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c3cf9ccd372c74ed1a07c9da30675268 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/PackageServices.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/PackageServices.meta new file mode 100644 index 00000000..eafb076e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/PackageServices.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eb5fe327595d0453e96752fdceb6dced +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/PackageServices/AssetPackageDependencyResolver.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/PackageServices/AssetPackageDependencyResolver.cs new file mode 100644 index 00000000..c2c9604c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/PackageServices/AssetPackageDependencyResolver.cs @@ -0,0 +1,163 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using UnityEditor.Compilation; +using System.IO; +using System; + +using JsonUtility = VoxelBusters.CoreLibrary.Parser.JsonUtility; + +namespace VoxelBusters.CoreLibrary.Editor.Experimental +{ + /* + public class UnityPackageManifestKey + { + public const string kDependencies = "dependencies"; + } + + public class AssetPackageDependencyResolver : AssetPostprocessor + { + #region Constants + + private const string kMainManifestPath = "Packages/manifest.json"; + + #endregion + + #region Fields + + private static Dictionary s_mainManifestDict; + + #endregion + + #region Static methods + + [MenuItem("Window/Voxel Busters/Asset Packages/Resolve Dependency")] + public static void Resolve() + { + var assetManifestFiles = Array.FindAll( + Array.ConvertAll(AssetDatabase.FindAssets("package"), (guid) => AssetDatabase.GUIDToAssetPath(guid)), + (assetPath) => IsPackageManifest(assetPath)); + if (assetManifestFiles.Length > 0) + { + AddMissingDependencies(assetManifestFiles); + } + } + + #endregion + + #region Private static methods + + private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) + { + var assetManifestFiles = Array.FindAll( + importedAssets, + (assetPath) => IsPackageManifest(assetPath)); + AddMissingDependencies(assetManifestFiles); + } + + private static bool IsPackageManifest(string assetPath) + { + return assetPath.StartsWith("Assets") && string.Equals(Path.GetFileName(assetPath), "package.json"); + } + + private static void AddMissingDependencies(string[] assetManifestFiles) + { + // Gather all the dependencies from the packages installed in Assets + // Manually add them to project manifest file + var registeredDependencies = GetOrCreateMainManifestObject()[UnityPackageManifestKey.kDependencies] as Dictionary; + var newDependencies = new List>(); + foreach (var file in assetManifestFiles) + { + var assetManifestDict = OpenManifestAsObject(file); + if (assetManifestDict.TryGetValue(UnityPackageManifestKey.kDependencies, out object assetDependencies)) + { + var assetDependenciesDict = assetDependencies as Dictionary; + foreach (var dependency in assetDependenciesDict) + { + if (registeredDependencies.ContainsKey(dependency.Key)) continue; + + AddDependencyToList(ref newDependencies, dependency.Key, (string)dependency.Value); + } + } + } + + // Check whether we have any unregisted dependecies + if (newDependencies.Count > 0) + { + EditorApplication.delayCall += () => + { + PromptUserToMergeDependency(newDependencies); + }; + } + } + + private static void AddDependencyToList(ref List> list, string name, string versionOrPath) + { + int existingItemIndex; + if ((existingItemIndex = list.FindIndex((item) => string.Equals(item.Key, name))) == -1) + { + list.Add(new KeyValuePair(name, versionOrPath)); + } + else if (string.Compare(list[existingItemIndex].Value, versionOrPath) >= 0) + { + list[existingItemIndex] = new KeyValuePair(name, versionOrPath); + } + } + + private static Dictionary OpenManifestAsObject(string path) + { + var contents = File.ReadAllText(path); + return JsonUtility.FromJson(contents) as Dictionary; + } + + private static Dictionary GetOrCreateMainManifestObject() + { + if (s_mainManifestDict == null) + { + s_mainManifestDict = OpenManifestAsObject(kMainManifestPath); + } + return s_mainManifestDict; + } + + private static void PromptUserToMergeDependency(List> dependencies) + { + if (EditorUtility.DisplayDialog( + title: "Resolve Dependencies", + message: "System has detected that there are one or more dependecies used by the Asset-Packages that are missing from the Package-Manifest file. Do you approve adding it to the Package-Manifest file?", + ok: "Ok", + cancel: "Cancel")) + { + PerformMergeDependency(dependencies); + return; + } + } + + private static void PerformMergeDependency(List> values) + { + // Update dependency collection + var contentDict = GetOrCreateMainManifestObject(); + var dependenciesDict = contentDict[UnityPackageManifestKey.kDependencies]as Dictionary; + bool isDirty = false; + foreach (var newValue in values) + { + if (!dependenciesDict.ContainsKey(newValue.Key)) + { + dependenciesDict.Add(newValue.Key, newValue.Value); + isDirty = true; + } + } + + // Save changes + if (isDirty) + { + string jsonStr = JsonUtility.ToJson(contentDict); + File.WriteAllText(kMainManifestPath, jsonStr); + + CompilationPipeline.RequestScriptCompilation(); + } + } + + #endregion + }*/ +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/PackageServices/AssetPackageDependencyResolver.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/PackageServices/AssetPackageDependencyResolver.cs.meta new file mode 100644 index 00000000..c3ff42e3 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/PackageServices/AssetPackageDependencyResolver.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5aafeb5c45eb14356b966fa280363556 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/VoxelBusters.CoreLibrary.Editor.Experimental.asmdef b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/VoxelBusters.CoreLibrary.Editor.Experimental.asmdef new file mode 100644 index 00000000..8372c53e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/VoxelBusters.CoreLibrary.Editor.Experimental.asmdef @@ -0,0 +1,17 @@ +{ + "name": "VoxelBusters.CoreLibrary.Editor.Experimental", + "references": [ + "VoxelBusters.CoreLibrary.Parser" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/VoxelBusters.CoreLibrary.Editor.Experimental.asmdef.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/VoxelBusters.CoreLibrary.Editor.Experimental.asmdef.meta new file mode 100644 index 00000000..82be3ee1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/Experimental/VoxelBusters.CoreLibrary.Editor.Experimental.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 894a53a1f4f2e4ecd8784477b7c79b98 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins.meta new file mode 100644 index 00000000..2a4c0caa --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 522fe906ebbf249b7839e750de41a135 +folderAsset: yes +timeCreated: 1550135695 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline.meta new file mode 100644 index 00000000..4af5cc9b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 243da3205fe4a48788f0e8b05b4c2c2a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android.meta new file mode 100644 index 00000000..ddd56d99 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7d0f996992d7a46309a6a9d544415fe9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/AndroidNativePluginsManager.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/AndroidNativePluginsManager.cs new file mode 100644 index 00000000..df7afebd --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/AndroidNativePluginsManager.cs @@ -0,0 +1,48 @@ +#if UNITY_EDITOR && UNITY_ANDROID +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor.Build; +using UnityEditor; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public abstract class AndroidNativePluginsManager : NativePluginsManager + { + +#region Fields + + private AndroidNativePluginsProcessor[] m_pluginsProcessors; + +#endregion + +#region Properties + + private AndroidNativePluginsProcessor[] PluginsProcessors => m_pluginsProcessors ?? (m_pluginsProcessors = FindPluginsProcessors(this)); + +#endregion + + protected override void OnPreprocessNativePlugins() + { + // Send message to complete preprocess actions to all the NativeProcessors + var linkerFileWriter = CreateDefaultLinkXmlWriter(); + + PluginsProcessors.ForEach( + (item) => + { + item.OnCheckConfiguration(); + item.OnUpdateLinkXml(linkerFileWriter); + item.OnAddFiles(); + item.OnAddFolders(); + item.OnAddResources(); + item.OnUpdateConfiguration(); + }); + + linkerFileWriter.WriteToFile(); + } + + protected override void OnPostprocessNativePlugins() + { } + } +} +#endif diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/AndroidNativePluginsManager.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/AndroidNativePluginsManager.cs.meta new file mode 100644 index 00000000..d56b3d4f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/AndroidNativePluginsManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 25c43b475a8384fe88b39fb2a239f6ac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/AndroidNativePluginsProcessor.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/AndroidNativePluginsProcessor.cs new file mode 100644 index 00000000..48a215da --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/AndroidNativePluginsProcessor.cs @@ -0,0 +1,10 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public abstract class AndroidNativePluginsProcessor : NativePluginsProcessor + { + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/AndroidNativePluginsProcessor.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/AndroidNativePluginsProcessor.cs.meta new file mode 100644 index 00000000..0e554b47 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/AndroidNativePluginsProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f1793926f202745898b816170c7fd142 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Base.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Base.meta new file mode 100644 index 00000000..6d9ad7a0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Base.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8ded32878099642168dddc3f67e3c65c +folderAsset: yes +timeCreated: 1548444482 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Base/Attribute.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Base/Attribute.cs new file mode 100644 index 00000000..02da07a1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Base/Attribute.cs @@ -0,0 +1,27 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Attribute + { + public string Key + { + get; + private set; + } + + public string Value + { + get; + private set; + } + + public Attribute(string key, string value) + { + Key = key; + Value = value; + } + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Base/Attribute.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Base/Attribute.cs.meta new file mode 100644 index 00000000..5344afa2 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Base/Attribute.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 17400e3226cc646cdb12ab1c73a123f1 +timeCreated: 1548444608 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Base/Element.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Base/Element.cs new file mode 100644 index 00000000..dd6fb762 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Base/Element.cs @@ -0,0 +1,83 @@ +using System.Collections; +using System.Collections.Generic; +using System.Xml; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public abstract class Element + { + private readonly string DefaultNamespace = "http://schemas.android.com/apk/res/android"; + private readonly string ToolsNamespace = "http://schemas.android.com/tools"; + + private List m_attributes; + private List m_children; + + public void AddAttribute(string key, string value) + { + if (m_attributes == null) + m_attributes = new List(); + + m_attributes.Add(new Attribute(key, value)); + } + + protected virtual XmlElement ToXml(XmlDocument xmlDocument) + { + XmlElement element = xmlDocument.CreateElement(GetName()); + if(m_attributes != null) + { + foreach(Attribute attribute in m_attributes) + { + string[] components = attribute.Key.Split(':'); + + if (attribute.Key.Contains("xmlns") || components.Length == 1) + { + element.SetAttribute(attribute.Key, attribute.Value); + } + else + { + XmlAttribute newAttribute = xmlDocument.CreateAttribute(components[0], components[1], GetNamespace(components[0])); + newAttribute.Value = attribute.Value; + element.Attributes.Append(newAttribute); + } + } + } + + if (m_children != null) + { + foreach(Element eachChild in m_children) + { + XmlElement xmlElement = eachChild.ToXml(xmlDocument); + element.AppendChild(xmlElement); + } + } + + return element; + } + + protected virtual void Add(Element element) + { + if(m_children == null) + m_children = new List(); + + m_children.Add(element); + } + + protected abstract string GetName(); + + private string GetNamespace(string key) + { + switch(key) + { + case "android": + return DefaultNamespace; + + case "tools": + return ToolsNamespace; + + default: + return DefaultNamespace; + } + } + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Base/Element.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Base/Element.cs.meta new file mode 100644 index 00000000..ef29ef6d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Base/Element.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2078df9b0a3fc451697d7360ff3f57ed +timeCreated: 1548444689 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest.meta new file mode 100644 index 00000000..019461c4 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0ee003c1d097842c1983476206d2e716 +folderAsset: yes +timeCreated: 1548444490 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application.meta new file mode 100644 index 00000000..1048e33f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 99c9f2098af0f486f8e0356dc1a8e12b +folderAsset: yes +timeCreated: 1548444499 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Activity.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Activity.meta new file mode 100644 index 00000000..0463b325 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Activity.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 4622b6efb31304bff974d474f3e5b985 +folderAsset: yes +timeCreated: 1548483399 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Activity/Activity.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Activity/Activity.cs new file mode 100644 index 00000000..c59f1651 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Activity/Activity.cs @@ -0,0 +1,21 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Activity : AppComponent + { + public Layout Layout + { + get; + set; + } + + protected override string GetName() + { + return "activity"; + } + } +} + diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Activity/Activity.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Activity/Activity.cs.meta new file mode 100644 index 00000000..e2ad26ee --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Activity/Activity.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4adb85b5365824c30bebce1f978bd6e8 +timeCreated: 1548483092 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Activity/Layout.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Activity/Layout.cs new file mode 100644 index 00000000..51848ad5 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Activity/Layout.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Layout : Element + { + protected override string GetName() + { + return "layout"; + } + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Activity/Layout.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Activity/Layout.cs.meta new file mode 100644 index 00000000..4117259a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Activity/Layout.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e6cbd4f6aa11042f88eaacbaec383b24 +timeCreated: 1548483310 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/ActivityAlias.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/ActivityAlias.cs new file mode 100644 index 00000000..a915c5f1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/ActivityAlias.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class ActivityAlias : Element + { + protected override string GetName() + { + return "activity-alias"; + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/ActivityAlias.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/ActivityAlias.cs.meta new file mode 100644 index 00000000..a56437df --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/ActivityAlias.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5e9bdef9d449e4a5587b9a29db7174b2 +timeCreated: 1548483134 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/AppComponent.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/AppComponent.cs new file mode 100644 index 00000000..8b4a331d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/AppComponent.cs @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public abstract class AppComponent : Element + { + public void Add(IntentFilter element) + { + base.Add(element); + } + + public void Add(MetaData element) + { + base.Add(element); + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/AppComponent.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/AppComponent.cs.meta new file mode 100644 index 00000000..38d647d1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/AppComponent.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: cc0bee06d83824f4c8c52bc0e7f898dc +timeCreated: 1548491334 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Application.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Application.cs new file mode 100644 index 00000000..79547f10 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Application.cs @@ -0,0 +1,47 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Application : Element + { + public void Add(Activity element) + { + base.Add(element); + } + + public void Add(ActivityAlias element) + { + base.Add(element); + } + + public void Add(MetaData element) + { + base.Add(element); + } + public void Add(Service element) + { + base.Add(element); + } + public void Add(Receiver element) + { + base.Add(element); + } + + public void Add(Provider element) + { + base.Add(element); + } + + public void Add(Library element) + { + base.Add(element); + } + + protected override string GetName() + { + return "application"; + } + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Application.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Application.cs.meta new file mode 100644 index 00000000..6ee5ffc5 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Application.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2236ad04de1314d18b9cffdc19d6bf15 +timeCreated: 1548483051 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common.meta new file mode 100644 index 00000000..1c4923bf --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d86431439e58e4516b6f22c3bd435770 +folderAsset: yes +timeCreated: 1548483291 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters.meta new file mode 100644 index 00000000..eeee247b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: c6bd51876a05b485bbf0cf6fdf3cb497 +folderAsset: yes +timeCreated: 1548444591 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/Action.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/Action.cs new file mode 100644 index 00000000..34338a60 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/Action.cs @@ -0,0 +1,15 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Action : Element + { + protected override string GetName() + { + return "action"; + } + } +} + diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/Action.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/Action.cs.meta new file mode 100644 index 00000000..9fa2f634 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/Action.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b980d757d95044a1aa597f284c415618 +timeCreated: 1548483534 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/Category.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/Category.cs new file mode 100644 index 00000000..6fc88fcb --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/Category.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Category : Element + { + protected override string GetName() + { + return "category"; + } + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/Category.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/Category.cs.meta new file mode 100644 index 00000000..25a068c4 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/Category.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: baa14fb8a8b82420e813d1731048c4a3 +timeCreated: 1548483540 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/Data.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/Data.cs new file mode 100644 index 00000000..6a9c1fd0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/Data.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Data : Element + { + protected override string GetName() + { + return "data"; + } + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/Data.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/Data.cs.meta new file mode 100644 index 00000000..afbcbe59 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/Data.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: cb063e23bc367448f8102dd5dab301ee +timeCreated: 1548483545 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/IntentFilter.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/IntentFilter.cs new file mode 100644 index 00000000..a3460e95 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/IntentFilter.cs @@ -0,0 +1,30 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class IntentFilter : Element + { + public void Add(Action action) + { + base.Add(action); + } + + public void Add(Category category) + { + base.Add(category); + } + + public void Add(Data data) + { + base.Add(data); + } + + protected override string GetName() + { + return "intent-filter"; + } + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/IntentFilter.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/IntentFilter.cs.meta new file mode 100644 index 00000000..ec610a5f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/IntentFilters/IntentFilter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d9272bed66e404926959c512c79b713e +timeCreated: 1548483478 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/MetaData.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/MetaData.cs new file mode 100644 index 00000000..8a22583d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/MetaData.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class MetaData : Element + { + protected override string GetName() + { + return "meta-data"; + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/MetaData.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/MetaData.cs.meta new file mode 100644 index 00000000..e1909980 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Common/MetaData.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: af6a72eb2058445a4a233250af8b0a84 +timeCreated: 1548483301 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Library.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Library.cs new file mode 100644 index 00000000..a75e4eba --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Library.cs @@ -0,0 +1,15 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Library : Element + { + protected override string GetName() + { + return "uses-library"; + } + } +} + diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Library.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Library.cs.meta new file mode 100644 index 00000000..699cfcf3 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Library.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b7deaaef3d971425a8a32b8650f21568 +timeCreated: 1548483114 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider.meta new file mode 100644 index 00000000..81ed3c10 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 4741445c118a840e2b5e972866f5d3df +folderAsset: yes +timeCreated: 1548504615 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider/GrantURIPermission.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider/GrantURIPermission.cs new file mode 100644 index 00000000..c1e7d601 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider/GrantURIPermission.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class GrantUriPermission : Element + { + protected override string GetName() + { + return "grant-uri-permission"; + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider/GrantURIPermission.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider/GrantURIPermission.cs.meta new file mode 100644 index 00000000..27dcc7f8 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider/GrantURIPermission.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7b07cd910e6be4553a135272f91d9f07 +timeCreated: 1548504627 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider/PathPermission.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider/PathPermission.cs new file mode 100644 index 00000000..be70b369 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider/PathPermission.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class PathPermission : Element + { + protected override string GetName() + { + return "path-permission"; + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider/PathPermission.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider/PathPermission.cs.meta new file mode 100644 index 00000000..991c560e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider/PathPermission.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b6bcf71e231bf480fadab94f9ab54eb0 +timeCreated: 1548504643 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider/Provider.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider/Provider.cs new file mode 100644 index 00000000..24d22313 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider/Provider.cs @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Provider : Element + { + public void Add(MetaData element) + { + base.Add(element); + } + + protected override string GetName() + { + return "provider"; + } + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider/Provider.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider/Provider.cs.meta new file mode 100644 index 00000000..1b8fc0cd --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Provider/Provider.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e78bc9d4fdf754e07a32907facc984aa +timeCreated: 1548483109 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Receiver.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Receiver.cs new file mode 100644 index 00000000..65ad789a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Receiver.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Receiver : AppComponent + { + protected override string GetName() + { + return "receiver"; + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Receiver.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Receiver.cs.meta new file mode 100644 index 00000000..11633006 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Receiver.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 504b08d54874f469a9d64a4e11a612ab +timeCreated: 1548483103 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Service.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Service.cs new file mode 100644 index 00000000..2a9c82be --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Service.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Service : AppComponent + { + protected override string GetName() + { + return "service"; + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Service.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Service.cs.meta new file mode 100644 index 00000000..34ac66b0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Application/Service.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7417a612ca54045af8a5cc32e2e90883 +timeCreated: 1548483098 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/CompatibleScreens.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/CompatibleScreens.cs new file mode 100644 index 00000000..f36407db --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/CompatibleScreens.cs @@ -0,0 +1,25 @@ +using System.Collections; +using System.Collections.Generic; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class CompatibleScreens : Element + { + public void Add(Screen element) + { + base.Add(element); + } + protected override string GetName() + { + return "compatible-screens"; + } + + public class Screen : Element + { + protected override string GetName() + { + return "screen"; + } + } + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/CompatibleScreens.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/CompatibleScreens.cs.meta new file mode 100644 index 00000000..69249aee --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/CompatibleScreens.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: aff57dee9ad4e4bd1abe823cedafe291 +timeCreated: 1548505477 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Configuration.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Configuration.cs new file mode 100644 index 00000000..a3f42264 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Configuration.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Configuration : Element + { + protected override string GetName() + { + return "configuration"; + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Configuration.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Configuration.cs.meta new file mode 100644 index 00000000..d8939106 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Configuration.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e5af08ca249f147e0b318aff8ba412c5 +timeCreated: 1548481286 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Feature.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Feature.cs new file mode 100644 index 00000000..9ae69fee --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Feature.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Feature : Element + { + protected override string GetName() + { + return "uses-feature"; + } + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Feature.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Feature.cs.meta new file mode 100644 index 00000000..31c6a070 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Feature.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2bdb9e995965349f48ccd6dd8bcf4409 +timeCreated: 1548481308 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Instrumentation.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Instrumentation.cs new file mode 100644 index 00000000..81b633c1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Instrumentation.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Instrumentation : Element + { + protected override string GetName() + { + return "instrumentation"; + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Instrumentation.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Instrumentation.cs.meta new file mode 100644 index 00000000..3296c086 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Instrumentation.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f2933ec077ea14403aa9fefa241e6f2d +timeCreated: 1548481247 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Manifest.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Manifest.cs new file mode 100644 index 00000000..1ac4551e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Manifest.cs @@ -0,0 +1,79 @@ +using System.Collections; +using System.Collections.Generic; +using System.Xml; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Manifest : Element + { + public void Add(Application element) + { + base.Add(element); + } + + public void Add(Permission element) + { + base.Add(element); + } + + public void Add(Feature element) + { + base.Add(element); + } + + public void Add(Configuration element) + { + base.Add(element); + } + + public void Add(SupportedGLTexture element) + { + base.Add(element); + } + + public void Add(PermissionGroup element) + { + base.Add(element); + } + + public void Add(PermissionTree element) + { + base.Add(element); + } + + public void Add(Instrumentation element) + { + base.Add(element); + } + + public void Add(CompatibleScreens element) + { + base.Add(element); + } + + public void Add(SupportedScreens element) + { + base.Add(element); + } + + public void Add(SDK element) + { + base.Add(element); + } + + public void Add(Queries queries) + { + base.Add(queries); + } + + public XmlElement GenerateXml(XmlDocument xmlDocument) + { + return base.ToXml(xmlDocument); + } + + protected override string GetName() + { + return "manifest"; + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Manifest.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Manifest.cs.meta new file mode 100644 index 00000000..6368625a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Manifest.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8c08fc6d6e87349f99270844bbb2b4a2 +timeCreated: 1548481173 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Permission.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Permission.cs new file mode 100644 index 00000000..6866387d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Permission.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Permission : Element + { + protected override string GetName() + { + return "uses-permission"; + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Permission.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Permission.cs.meta new file mode 100644 index 00000000..c6335b89 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Permission.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ba24f4210505a493182a49b82df92984 +timeCreated: 1548481300 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/PermissionGroup.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/PermissionGroup.cs new file mode 100644 index 00000000..abed2047 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/PermissionGroup.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class PermissionGroup : Element + { + protected override string GetName() + { + return "permission-group"; + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/PermissionGroup.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/PermissionGroup.cs.meta new file mode 100644 index 00000000..d1be1140 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/PermissionGroup.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 48014ab84c2404f3e8fae4ea391bbc4d +timeCreated: 1548481261 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/PermissionTree.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/PermissionTree.cs new file mode 100644 index 00000000..e978e419 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/PermissionTree.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class PermissionTree : Element + { + protected override string GetName() + { + return "permission-tree"; + } + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/PermissionTree.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/PermissionTree.cs.meta new file mode 100644 index 00000000..f12029f4 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/PermissionTree.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 140fa82570b9346b1878c520bec9117f +timeCreated: 1548481254 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries.meta new file mode 100644 index 00000000..09117885 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1635fc395ba504464bca2fd9a1ae1c0e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries/Intent.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries/Intent.cs new file mode 100644 index 00000000..5968e28a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries/Intent.cs @@ -0,0 +1,29 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Intent : Element + { + public void Add(Action action) + { + base.Add(action); + } + + public void Add(Category category) + { + base.Add(category); + } + + public void Add(Data data) + { + base.Add(data); + } + + protected override string GetName() + { + return "intent"; + } + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries/Intent.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries/Intent.cs.meta new file mode 100644 index 00000000..b921f115 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries/Intent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eecfdba1970a94aac831832949224a96 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries/Package.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries/Package.cs new file mode 100644 index 00000000..ab0a6750 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries/Package.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Package : Element + { + protected override string GetName() + { + return "package"; + } + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries/Package.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries/Package.cs.meta new file mode 100644 index 00000000..7a199e68 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries/Package.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ccb7e399fc57c4fdc8f372485ccb2c60 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries/Queries.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries/Queries.cs new file mode 100644 index 00000000..0bbacedf --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries/Queries.cs @@ -0,0 +1,24 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class Queries : Element + { + public void Add(Intent element) + { + base.Add(element); + } + + public void Add(Package element) + { + base.Add(element); + } + + protected override string GetName() + { + return "queries"; + } + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries/Queries.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries/Queries.cs.meta new file mode 100644 index 00000000..6699de01 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/Queries/Queries.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7ce5a75f8155149eb94f53f59ba0cfed +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/SDK.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/SDK.cs new file mode 100644 index 00000000..5b6a0b65 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/SDK.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class SDK : Element + { + protected override string GetName() + { + return "uses-sdk"; + } + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/SDK.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/SDK.cs.meta new file mode 100644 index 00000000..5667fc3a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/SDK.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 66cd7a768a80b4bb0b35b9d9d0b761cd +timeCreated: 1548481292 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/SupportedGLTexture.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/SupportedGLTexture.cs new file mode 100644 index 00000000..33a7a2a6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/SupportedGLTexture.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class SupportedGLTexture : Element + { + protected override string GetName() + { + return "supports-gl-texture"; + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/SupportedGLTexture.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/SupportedGLTexture.cs.meta new file mode 100644 index 00000000..e99e119e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/SupportedGLTexture.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a95f31e815d6946d58d3729c2051ddc5 +timeCreated: 1548481272 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/SupportedScreens.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/SupportedScreens.cs new file mode 100644 index 00000000..56f6e3df --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/SupportedScreens.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Android +{ + public class SupportedScreens : Element + { + protected override string GetName() + { + return "compatible-screens"; + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/SupportedScreens.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/SupportedScreens.cs.meta new file mode 100644 index 00000000..67aa5122 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Android/Manifest/SupportedScreens.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 22f762cc3a0ee484a93f94d396546604 +timeCreated: 1548481239 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/INativeBindingsWriter.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/INativeBindingsWriter.cs new file mode 100644 index 00000000..8f8ba9c6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/INativeBindingsWriter.cs @@ -0,0 +1,24 @@ +using System.Collections; +using System.Collections.Generic; +using System.Reflection; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + public interface INativeBindingsWriter + { + #region Methods + + void WriteStart(string product = null, + string author = null, + string copyrights = null); + + void WriteCustomTypeDeclarations(System.Type[] customTypes); + + void WriteMethod(MethodInfo method); + + void WriteEnd(out string[] files); + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/INativeBindingsWriter.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/INativeBindingsWriter.cs.meta new file mode 100644 index 00000000..70246a82 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/INativeBindingsWriter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 74ea67f343f5841afa6d04d2e9cc190b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/LinkXmlWriter.AssemblyDefinition.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/LinkXmlWriter.AssemblyDefinition.cs new file mode 100644 index 00000000..387d729e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/LinkXmlWriter.AssemblyDefinition.cs @@ -0,0 +1,88 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + public partial class LinkXmlWriter + { + private class AssemblyDefinition + { + #region Fields + + private List m_requiredNamespaces; + + private List m_ignoreNamespaces; + + private List m_requiredTypes; + + private List m_ignoreTypes; + + #endregion + + #region Properties + + public string AssemblyName { get; private set; } + + public string[] RequiredNamespaces { get { return m_requiredNamespaces.ToArray(); } } + + public string[] IgnoreNamespaces { get { return m_ignoreNamespaces.ToArray(); } } + + public string[] RequiredTypes { get { return m_requiredTypes.ToArray(); } } + + public string[] IgnoredTypes { get { return m_ignoreTypes.ToArray(); } } + + #endregion + + #region Constructors + + public AssemblyDefinition(string assembly) + { + // set default properties + AssemblyName = assembly; + m_requiredNamespaces = new List(); + m_ignoreNamespaces = new List(); + m_requiredTypes = new List(); + m_ignoreTypes = new List(); + } + + #endregion + + #region Public methods + + public void AddRequiredNamespace(string name) + { + AddValueIfNotFound(m_requiredNamespaces, name); + } + + public void AddIgnoreNamespace(string name) + { + AddValueIfNotFound(m_ignoreNamespaces, name); + } + + public void AddRequiredType(string name) + { + AddValueIfNotFound(m_requiredTypes, name); + } + + public void AddIgnoreType(string name) + { + AddValueIfNotFound(m_ignoreTypes, name); + } + + #endregion + + #region Private methods + + private void AddValueIfNotFound(List list, string value) + { + if (!list.Contains(value)) + { + list.Add(value); + } + } + + #endregion + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/LinkXmlWriter.AssemblyDefinition.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/LinkXmlWriter.AssemblyDefinition.cs.meta new file mode 100644 index 00000000..53b46a59 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/LinkXmlWriter.AssemblyDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e5c70580980a9457aa8221741f447079 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/LinkXmlWriter.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/LinkXmlWriter.cs new file mode 100644 index 00000000..ed707bb9 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/LinkXmlWriter.cs @@ -0,0 +1,183 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Xml; +using UnityEngine; +using VoxelBusters.CoreLibrary; +using VoxelBusters.CoreLibrary.NativePlugins; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + public partial class LinkXmlWriter + { + #region Fields + + private List m_assemblies; + + private string m_savePath; + + #endregion + + #region Constructors + + public LinkXmlWriter(string path) + { + // set properties + m_savePath = path; + m_assemblies = new List(); + } + + #endregion + + #region Private static methods + + private static void WriteNamespace(XmlWriter writer, string name, bool preserve) + { + writer.WriteStartElement("namespace"); + writer.WriteAttributeString("fullname", name); + writer.WriteAttributeString("preserve", preserve ? "all" : "nothing"); + writer.WriteEndElement(); + } + + private static void WriteType(XmlWriter writer, string name, bool preserve) + { + writer.WriteStartElement("type"); + writer.WriteAttributeString("fullname", name); + writer.WriteAttributeString("preserve", preserve ? "all" : "nothing"); + writer.WriteEndElement(); + } + + #endregion + + #region Public methods + + private AssemblyDefinition GetOrCreateAssemblyDefinition(string assembly) + { + var targetDefinition = m_assemblies.Find((item) => string.Equals(assembly, item.AssemblyName)); + if (targetDefinition == null) + { + var newDefinition = new AssemblyDefinition(assembly); + m_assemblies.Add(newDefinition); + + return newDefinition; + } + return targetDefinition; + } + + public void AddConfiguration(string name, NativeFeatureRuntimeConfiguration runtimeConfiguration, RuntimePlatform platform, bool useFallbackPackage) + { + var packageConfiguration = runtimeConfiguration.GetPackageForPlatform(platform); + var fallbackConfiguration = runtimeConfiguration.FallbackPackage; + + if (useFallbackPackage && fallbackConfiguration != null) + { + DebugLogger.LogWarning(CoreLibraryDomain.Default, $"Using fallback configuration for : {name}."); + + AddRequiredType(fallbackConfiguration.Assembly, fallbackConfiguration.NativeInterfaceType); + if(packageConfiguration != null) + { + AddIgnoreType(packageConfiguration.Assembly, packageConfiguration.NativeInterfaceType); + } + + return; + } + + if(packageConfiguration != null) + { + AddRequiredNamespace(packageConfiguration.Assembly, packageConfiguration.Namespace); + } + } + + public void AddConfiguration(NativeFeatureRuntimeConfiguration runtimeConfiguration) + { + + var packages = runtimeConfiguration.Packages; + + foreach(var eachPackage in packages) + { + AddRequiredType(eachPackage.Assembly, eachPackage.NativeInterfaceType); + } + + var fallbackPackage = runtimeConfiguration.FallbackPackage; + + if(fallbackPackage != null) + { + AddRequiredType(fallbackPackage.Assembly, fallbackPackage.NativeInterfaceType); + } + } + + public void AddRequiredNamespace(string assembly, string ns) + { + GetOrCreateAssemblyDefinition(assembly) + .AddRequiredNamespace(ns); + } + + public void AddIgnoreNamespace(string assembly, string ns) + { + GetOrCreateAssemblyDefinition(assembly) + .AddIgnoreNamespace(ns); + } + + public void AddRequiredType(string assembly, string type) + { + GetOrCreateAssemblyDefinition(assembly) + .AddRequiredType(type); + } + + public void AddIgnoreType(string assembly, string type) + { + GetOrCreateAssemblyDefinition(assembly) + .AddIgnoreType(type); + } + + public void WriteToFile() + { + // remove existing file + if (IOServices.FileExists(m_savePath)) + { + IOServices.DeleteFile(m_savePath); + } + + // create new + var settings = new XmlWriterSettings(); + settings.Encoding = new System.Text.UTF8Encoding(true); + settings.ConformanceLevel = ConformanceLevel.Document; + settings.OmitXmlDeclaration = true; + settings.Indent = true; + using (var writer = XmlWriter.Create(m_savePath, settings)) + { + writer.WriteStartDocument(); + + writer.WriteStartElement("linker"); + foreach (var item in m_assemblies) + { + // write ignored namespace + writer.WriteStartElement("assembly"); + writer.WriteAttributeString("fullname", item.AssemblyName); + foreach (string namespaceValue in item.RequiredNamespaces) + { + WriteNamespace(writer, namespaceValue, true); + } + foreach (string namespaceValue in item.IgnoreNamespaces) + { + WriteNamespace(writer, namespaceValue, false); + } + foreach (string type in item.RequiredTypes) + { + WriteType(writer, type, true); + } + foreach (string type in item.IgnoredTypes) + { + WriteType(writer, type, false); + } + writer.WriteEndElement(); + } + writer.WriteEndElement(); + + writer.WriteEndDocument(); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/LinkXmlWriter.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/LinkXmlWriter.cs.meta new file mode 100644 index 00000000..016896eb --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/LinkXmlWriter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c15509cba6a7c484a81ba9e9502ed2fb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativeBindingsGenerator.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativeBindingsGenerator.cs new file mode 100644 index 00000000..f18d7da0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativeBindingsGenerator.cs @@ -0,0 +1,128 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Reflection; +using UnityEditor; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + public enum NativeBindingsGeneratorOptions + { + Header = 1 << 0, + + Source = 1 << 1, + } + + public class NativeBindingsGenerator + { + #region Properties + + private string m_output; + + private NativeBindingsGeneratorOptions m_options; + + private string m_product; + + private string m_author; + + private string m_copyrights; + + #endregion + + #region Constructors + + public NativeBindingsGenerator(string outputPath, + NativeBindingsGeneratorOptions options) + { + // Set properties + m_output = IOServices.GetAbsolutePath(outputPath); + m_options = options; + } + + #endregion + + #region Static methods + + public static INativeBindingsWriter CreateBindingsWriter(string path, + string fileName, + NativeBindingsGeneratorOptions options, + BuildTarget buildTarget) + { + switch (buildTarget) + { + case BuildTarget.iOS: + return new ObjectiveCBindingsWriter(path, fileName, options); + + default: + throw new NotSupportedException(); + } + } + + #endregion + + #region Public methods + + public NativeBindingsGenerator SetProduct(string value) + { + // Set value + m_product = value; + + return this; + } + + public NativeBindingsGenerator SetAuthor(string value) + { + // Set value + m_author = value; + + return this; + } + + public NativeBindingsGenerator SetCopyrights(string value) + { + // Set value + m_copyrights = value; + + return this; + } + + public void Generate(Type cScriptType, + string fileName, + BuildTarget buildTarget, + Type[] customTypes, + out string[] files) + { + // Create output folder + IOServices.CreateDirectory(m_output, false); + + // Create native files + var bindingsWriter = CreateBindingsWriter(m_output, + fileName, + m_options, + buildTarget); + try + { + var externMethods = Array.FindAll(cScriptType.GetMethods(BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public), + (method) => (method.GetMethodBody() == null) && method.IsStatic); + bindingsWriter.WriteStart(m_product, + m_author, + m_copyrights); + if (!customTypes.IsNullOrEmpty()) + { + bindingsWriter.WriteCustomTypeDeclarations(customTypes); + } + foreach (var method in externMethods) + { + bindingsWriter.WriteMethod(method); + } + } + finally + { + bindingsWriter.WriteEnd(out files); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativeBindingsGenerator.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativeBindingsGenerator.cs.meta new file mode 100644 index 00000000..9c878ed8 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativeBindingsGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f46f80088620f499c821d1d293724797 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsExporterObject.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsExporterObject.cs new file mode 100644 index 00000000..d7634d01 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsExporterObject.cs @@ -0,0 +1,92 @@ +using System; +using UnityEngine; +using UnityEngine.Serialization; +using UnityEditor; +using System.Collections.Generic; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + [Serializable] + public partial class NativePluginsExporterObject : ScriptableObject + { + #region Constants + + private const string kBaseExporterName = "Base"; + + #endregion + + #region Fields + + [SerializeField] + private NativePluginsExporterObjectGroup m_group; + + [SerializeField] + private bool m_isEnabled = true; + + #endregion + + #region Properties + + public NativePluginsExporterObjectGroup Group + { + get { return m_group; } + set { m_group = value; } + } + + public bool IsEnabled + { + get { return m_isEnabled; } + set + { + m_isEnabled = value; + UpdateInternalState(value); + } + } + + #endregion + + #region Static methods + + public static T[] FindObjects(bool includeInactive = false) where T : NativePluginsExporterObject + { + var availableObjects = AssetDatabaseUtility.FindAssetObjects(); + + // Filter assets to required type objects + bool hasActiveObjects = false; + var baseExporterObject = default(T); + var finalObjectList = new List(availableObjects.Length); + foreach (var exporterObject in availableObjects) + { + bool isBaseObject = string.Equals(exporterObject.name, kBaseExporterName); + if (includeInactive || exporterObject.IsEnabled) + { + finalObjectList.Add(exporterObject); + } + // Track object status + if (isBaseObject) + { + baseExporterObject = exporterObject; + } + hasActiveObjects |= !isBaseObject && exporterObject.IsEnabled; + } + + // Ensure base type is included + if (!includeInactive) + { + baseExporterObject.IsEnabled = true; + finalObjectList.AddUnique(baseExporterObject); + } + + return finalObjectList.ToArray(); + } + + #endregion + + #region Private methods + + protected virtual void UpdateInternalState(bool active) + { } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsExporterObject.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsExporterObject.cs.meta new file mode 100644 index 00000000..96021869 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsExporterObject.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f4eeec00769cc43f2a21921915f8fa89 +timeCreated: 1549459341 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsExporterObjectEditor.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsExporterObjectEditor.cs new file mode 100644 index 00000000..154b7c61 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsExporterObjectEditor.cs @@ -0,0 +1,12 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using VoxelBusters.CoreLibrary.Editor; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + [CustomEditor(typeof(NativePluginsExporterObject))] + public class NativePluginsExporterObjectEditor : CustomInspector + { } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsExporterObjectEditor.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsExporterObjectEditor.cs.meta new file mode 100644 index 00000000..19cf364b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsExporterObjectEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: bad85a568bb154ae285eb827aa08ce10 +timeCreated: 1579541166 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsExporterObjectGroup.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsExporterObjectGroup.cs new file mode 100644 index 00000000..155deae2 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsExporterObjectGroup.cs @@ -0,0 +1,28 @@ +using System; +using UnityEngine; +using UnityEditor; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + [CreateAssetMenu(fileName = "NativePluginsExporterObjectGroup", menuName = "Native Plugins/Exporter Object Group", order = 0)] + public class NativePluginsExporterObjectGroup : ScriptableObject + { + #region Fields + + [SerializeField] + private string m_name; + + [SerializeField] + private bool m_usesNestedHeierarchy = true; + + #endregion + + #region Properties + + public string Name => m_name; + + public bool UsesNestedHeierarchy => m_usesNestedHeierarchy; + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsExporterObjectGroup.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsExporterObjectGroup.cs.meta new file mode 100644 index 00000000..7bb17467 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsExporterObjectGroup.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8494aa9edfa214a818449f2dea39a05a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsManager.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsManager.cs new file mode 100644 index 00000000..0cd9a0f2 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsManager.cs @@ -0,0 +1,112 @@ +using System; +using UnityEditor; +using UnityEditor.Build; +using UnityEditor.Build.Reporting; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + public abstract class NativePluginsManager : IPreprocessBuildWithReport, IPostprocessBuildWithReport + { + #region Proprerties + + public BuildReport Report { get; private set; } + + public BuildTarget BuildTarget => Report.summary.platform; + + public string OutputPath => Report.summary.outputPath; + + public bool IsPreprocessing { get; set; } + + public bool IsPostprocessing { get; set; } + + #endregion + + #region Static methods + + protected static T[] FindPluginsProcessors(NativePluginsManager manager) where T : NativePluginsProcessor + { + var baseClassType = typeof(T); + var targetTypes = ReflectionUtility.FindAllTypes((type) => !type.IsAbstract && type.IsSubclassOf(baseClassType)); + return Array.ConvertAll( + targetTypes, + (type) => + { + var processor = ReflectionUtility.CreateInstance(type) as T; + processor.SetPropertyValue("Manager", manager); + return processor; + }); + } + + protected static LinkXmlWriter CreateDefaultLinkXmlWriter() + { + var defaultPath = IOServices.GetAbsolutePath("Assets/Plugins/VoxelBusters/link.xml"); + return new LinkXmlWriter(defaultPath); + } + + #endregion + + #region Base class methods + + protected virtual bool IsSupported(BuildTarget target) => true; + + protected abstract void OnPreprocessNativePlugins(); + + protected abstract void OnPostprocessNativePlugins(); + + #endregion + + #region IPreprocessBuildWithReport implementation + + int IOrderedCallback.callbackOrder => int.MaxValue; + + void IPreprocessBuildWithReport.OnPreprocessBuild(BuildReport report) + { + if (!IsSupported(target: report.summary.platform)) return; + + try + { + // Set properties + Report = report; + IsPreprocessing = true; + + // Send appropriate message + OnPreprocessNativePlugins(); + } + catch(Exception e) + { + throw new BuildFailedException(e); + } + finally + { + // Reset properties + IsPreprocessing = false; + } + } + + #endregion + + #region IPostprocessBuildWithReport implementation + + void IPostprocessBuildWithReport.OnPostprocessBuild(BuildReport report) + { + if (!IsSupported(target: report.summary.platform)) return; + + try + { + // Set properties + Report = report; + IsPostprocessing = true; + + // Send appropriate messages + OnPostprocessNativePlugins(); + } + finally + { + // Reset properties + IsPostprocessing = false; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsManager.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsManager.cs.meta new file mode 100644 index 00000000..6610a837 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3b1f94ff40b114a6d9b20a8d49bb3cf4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsProcessor.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsProcessor.cs new file mode 100644 index 00000000..61790403 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsProcessor.cs @@ -0,0 +1,53 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEditor; +using UnityEditor.Build.Reporting; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + public class NativePluginsProcessor + { + #region Properties + + public NativePluginsManager Manager { get; private set; } + + public BuildReport BuildReport => Manager.Report; + + public BuildTarget BuildTarget => BuildReport.summary.platform; + + public string OutputPath => BuildReport.summary.outputPath; + + #endregion + + #region Preprocess message methods + + + public virtual void OnCheckConfiguration() + { } + + public virtual void OnUpdateExporterObjects() + { } + + public virtual void OnUpdateLinkXml(LinkXmlWriter writer) + { } + + #endregion + + #region Postprocess message methods + + public virtual void OnAddFiles() + { } + + public virtual void OnAddFolders() + { } + + public virtual void OnAddResources() + { } + + public virtual void OnUpdateConfiguration() + { } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsProcessor.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsProcessor.cs.meta new file mode 100644 index 00000000..46bd98ca --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/NativePluginsProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 17f208e59b9fa42469d21728809e5556 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/TargetBuilder.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/TargetBuilder.cs new file mode 100644 index 00000000..dd690f60 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/TargetBuilder.cs @@ -0,0 +1,182 @@ +using System; +using System.Collections.Generic; +using UnityEditor; +using UnityEditor.Build; +using UnityEditor.Build.Reporting; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + public class TargetBuilder + { +#if NATIVE_PLUGINS_DEBUG + [MenuItem("Tools/Make Build")] +#endif + public static void Build() + { +#if UNITY_IOS + BuildIos(); +#elif UNITY_ANDROID + BuildAndroid(); +#elif UNITY_STANDALONE_WIN + BuildWindows(); +#elif UNITY_STANDALONE_OSX + BuildOsx(); +#elif UNITY_STANDALONE_LINUX + BuildLinux(); +#elif UNITY_WEBGL + BuildLinux(); +#else + Debug.LogError("No platform target defined!"); +#endif + } + + private static void BuildIos() + { + Build(BuildTargetGroup.iOS, BuildTarget.iOS, null); + } + + private static void BuildAndroid() + { + EditorUserBuildSettings.exportAsGoogleAndroidProject = true; + PlayerSettings.SetScriptingBackend(NamedBuildTarget.Android, ScriptingImplementation.IL2CPP); + PlayerSettings.Android.targetArchitectures = AndroidArchitecture.ARMv7 | AndroidArchitecture.ARM64; + if (EditorUserBuildSettings.development) + { +#if !UNITY_2019_1_OR_NEWER + PlayerSettings.Android.targetArchitectures |= AndroidArchitecture.X86; +#endif + } + + Build(BuildTargetGroup.Android, BuildTarget.Android, null, /*BuildOptions.AcceptExternalModificationsToPlayer |*/ BuildOptions.AllowDebugging); + } + + private static void BuildWindows() + { + Build(BuildTargetGroup.Standalone, BuildTarget.StandaloneWindows64, "exe"); + } + + private static void BuildOsx() + { + Build(BuildTargetGroup.Standalone, BuildTarget.StandaloneOSX, "app"); + } + + private static void BuildLinux() + { + Build(BuildTargetGroup.Standalone, BuildTarget.StandaloneLinux64, null); + } + + private static void BuildWebGl() + { + Build(BuildTargetGroup.WebGL, BuildTarget.WebGL, null); + } + + private static void BuildAllPlatforms() + { + BuildMobilePlatforms(); + BuildNonMobilePlatforms(); + } + + private static void BuildMobilePlatforms() + { + BuildIos(); + BuildAndroid(); + } + + private static void BuildNonMobilePlatforms() + { + BuildOsx(); + BuildWindows(); + BuildLinux(); + BuildWebGl(); + } + + private static void Build(BuildTargetGroup targetGroup, BuildTarget target, string extension, BuildOptions options = BuildOptions.None) + { + string platform = GetPlatformName(target); + + //Set values from environment variables + LoadEnvironmentVariables(target); + + //Switch to active target + bool isSwitchSuccess = EditorUserBuildSettings.SwitchActiveBuildTarget(targetGroup, target); + + if (!isSwitchSuccess) + Debug.LogError(string.Format("Failed switching to platform : {0}", platform)); + + //Build +#if UNITY_2019_3_OR_NEWER + string targetPath = (extension != null) ? string.Format("../builds/{0}.{1}", platform, extension) : string.Format("../builds/{0}/{1}", platform, PlayerSettings.productName); +#else + string targetPath = (extension != null) ? string.Format("../builds/{0}.{1}", platform, extension) : string.Format("../builds/{0}", platform); +#endif + BuildReport report = UnityEditor.BuildPipeline.BuildPlayer(EditorBuildSettings.scenes, targetPath, target, options); + BuildSummary summary = report.summary; + + if (summary.result == BuildResult.Succeeded) + { + Debug.Log(string.Format("Finished building for {0} : {1}", platform, targetPath)); + } + else if (summary.result == BuildResult.Failed) + { + Debug.LogError(string.Format("Failed building for {0} : {1}", platform, targetPath)); + } + else if (summary.result == BuildResult.Cancelled) + { + Debug.LogError(string.Format("Cancelled building for {0} : {1}", platform, targetPath)); + } + else + { + Debug.LogError(string.Format("Failed building for {0} : {1}", platform, targetPath)); + } + } + + private static string GetPlatformName(BuildTarget target) + { + switch (target) + { + case BuildTarget.iOS: + return "ios"; + case BuildTarget.Android: + return "android"; + case BuildTarget.StandaloneLinux64: + return "linux"; + case BuildTarget.StandaloneWindows64: + return "windows"; + case BuildTarget.StandaloneOSX: + return "osx"; + case BuildTarget.WebGL: + return "webgl"; + default: + throw new System.Exception("Platform name not set!"); + } + } + + private static void LoadEnvironmentVariables(BuildTarget target) + { + PlayerSettings.productName = GetEnvironmentVariable("PRODUCT_NAME", PlayerSettings.productName); + PlayerSettings.bundleVersion = GetEnvironmentVariable("PRODUCT_VERSION", PlayerSettings.bundleVersion); + PlayerSettings.companyName = GetEnvironmentVariable("PRODUCT_COMPANY_NAME", PlayerSettings.companyName); + + switch (target) + { + case BuildTarget.Android: + PlayerSettings.applicationIdentifier = GetEnvironmentVariable("ANDROID_PACKAGE_NAME", PlayerSettings.applicationIdentifier); + break; + case BuildTarget.iOS: + PlayerSettings.applicationIdentifier = GetEnvironmentVariable("IOS_BUNDLE_IDENTIFIER", PlayerSettings.applicationIdentifier); + break; + } + + } + + private static T GetEnvironmentVariable(string key, T defaultValue) where T : IConvertible + { + object value = System.Environment.GetEnvironmentVariable(key); + if (value != null) + return (T)Convert.ChangeType(value, typeof(T)); + else + return defaultValue; + } + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/TargetBuilder.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/TargetBuilder.cs.meta new file mode 100644 index 00000000..8e45b98e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/TargetBuilder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 789382482b4a044b1a1415d340cd8a83 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/UnsupportedPlatformNativePluginsManager.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/UnsupportedPlatformNativePluginsManager.cs new file mode 100644 index 00000000..b6af1078 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/UnsupportedPlatformNativePluginsManager.cs @@ -0,0 +1,36 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + public class UnsupportedPlatformNativePluginsManager : NativePluginsManager + { + #region Base class methods + + protected override bool IsSupported(BuildTarget target) + { + return !((target == BuildTarget.iOS) || + (target == BuildTarget.tvOS) || + (target == BuildTarget.Android)); + } + + protected override void OnPreprocessNativePlugins() + { + var pluginsProcessors = FindPluginsProcessors(this); + var linkerFileWriter = CreateDefaultLinkXmlWriter(); + pluginsProcessors.ForEach( + (item) => + { + item.OnUpdateLinkXml(linkerFileWriter); + }); + linkerFileWriter.WriteToFile(); + } + + protected override void OnPostprocessNativePlugins() + { } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/UnsupportedPlatformNativePluginsManager.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/UnsupportedPlatformNativePluginsManager.cs.meta new file mode 100644 index 00000000..a50f8df6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/UnsupportedPlatformNativePluginsManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d319604252a9a46c2ba87927ae8aa64b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/UnsupportedPlatformNativePluginsProcessor.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/UnsupportedPlatformNativePluginsProcessor.cs new file mode 100644 index 00000000..dd6848d8 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/UnsupportedPlatformNativePluginsProcessor.cs @@ -0,0 +1,9 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + public class UnsupportedPlatformNativePluginsProcessor : NativePluginsProcessor + { } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/UnsupportedPlatformNativePluginsProcessor.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/UnsupportedPlatformNativePluginsProcessor.cs.meta new file mode 100644 index 00000000..b86e449e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/UnsupportedPlatformNativePluginsProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3a538b642cf6b46f08de15578c2be800 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode.meta new file mode 100644 index 00000000..6cf3a002 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b9bf66a06f5534f7282e87258614cd70 +folderAsset: yes +timeCreated: 1579785814 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/BuildConfigurationKey.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/BuildConfigurationKey.cs new file mode 100644 index 00000000..e57b94b7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/BuildConfigurationKey.cs @@ -0,0 +1,25 @@ +#if UNITY_IOS || UNITY_TVOS +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Xcode +{ + public static class BuildConfigurationKey + { + public const string kBuildSettings = "buildSettings"; + + public const string kHeaderSearchPaths = "HEADER_SEARCH_PATHS"; + + public const string kLibrarySearchPaths = "LIBRARY_SEARCH_PATHS"; + + public const string kFrameworkSearchPaths = "FRAMEWORK_SEARCH_PATHS"; + + public const string kOtherCFlags = "OTHER_CFLAGS"; + + public const string kOtherLDFlags = "OTHER_LDFLAGS"; + + public const string kCodeSignEntitlements = "CODE_SIGN_ENTITLEMENTS"; + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/BuildConfigurationKey.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/BuildConfigurationKey.cs.meta new file mode 100644 index 00000000..1d490eb7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/BuildConfigurationKey.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: acb0fb6205f0e487a8196435917cf8b6 +timeCreated: 1578831698 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/InfoPlistKey.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/InfoPlistKey.cs new file mode 100644 index 00000000..2379c6f8 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/InfoPlistKey.cs @@ -0,0 +1,43 @@ +#if UNITY_IOS || UNITY_TVOS +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Xcode +{ + public static class InfoPlistKey + { + #region Constants + + public const string kNSContactsUsage = "NSContactsUsageDescription"; + + public const string kNSCameraUsage = "NSCameraUsageDescription"; + + public const string kNSPhotoLibraryUsage = "NSPhotoLibraryUsageDescription"; + + public const string kNSPhotoLibraryAdd = "NSPhotoLibraryAddUsageDescription"; + + public const string kNSMicrophoneUsage = "NSMicrophoneUsageDescription"; + + public const string kNSLocationWhenInUse = "NSLocationWhenInUseUsageDescription"; + + public const string kNSAppTransportSecurity = "NSAppTransportSecurity"; + + public const string kNSAllowsArbitraryLoads = "NSAllowsArbitraryLoads"; + + public const string kNSQuerySchemes = "LSApplicationQueriesSchemes"; + + public const string kNSDeviceCapablities = "UIRequiredDeviceCapabilities"; + + public const string kCFBundleURLTypes = "CFBundleURLTypes"; + + public const string kCFBundleURLName = "CFBundleURLName"; + + public const string kCFBundleURLSchemes = "CFBundleURLSchemes"; + + public const string kNSGKFriendListUsage = "NSGKFriendListUsageDescription"; + + #endregion + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/InfoPlistKey.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/InfoPlistKey.cs.meta new file mode 100644 index 00000000..cea05470 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/InfoPlistKey.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4f2e3899f884c419a9bac4f482c312e2 +timeCreated: 1563179772 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/MacroDefinitionsManager.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/MacroDefinitionsManager.cs new file mode 100644 index 00000000..cb8e0375 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/MacroDefinitionsManager.cs @@ -0,0 +1,65 @@ +#if UNITY_IOS || UNITY_TVOS +using System; +using System.Collections; +using System.Collections.Generic; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Xcode +{ + public class MacroDefinitionsManager + { + #region Fields + + private string m_savePath; + + private string m_headerComments; + + private List m_requiredMacros; + + #endregion + + #region Constructors + + public MacroDefinitionsManager(string path, string headerComments) + { + // Set properties + m_savePath = path; + m_headerComments = headerComments; + m_requiredMacros = new List(); + } + + #endregion + + #region Public methods + + public void AddMacro(params string[] values) + { + foreach (var value in values) + { + m_requiredMacros.AddUnique(value); + } + } + + public void WriteToFile() + { + // Build content + var stringBuilder = new System.Text.StringBuilder(256); + if (m_headerComments != null) + { + stringBuilder.AppendLine(m_headerComments) + .AppendLine(); + } + stringBuilder.AppendLine("#pragma once") + .AppendLine(); + foreach (var definition in m_requiredMacros) + { + stringBuilder.AppendLine($"#define {definition}"); + } + + // Serialize changes + IOServices.CreateFile(m_savePath, stringBuilder.ToString()); + } + + #endregion + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/MacroDefinitionsManager.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/MacroDefinitionsManager.cs.meta new file mode 100644 index 00000000..5e9d9953 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/MacroDefinitionsManager.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 72d1def92e47d4fc08fff42c01b0b8f7 +timeCreated: 1596395226 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXAssociatedDomainsEntitlement.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXAssociatedDomainsEntitlement.cs new file mode 100644 index 00000000..6ed4003d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXAssociatedDomainsEntitlement.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + [Serializable] + public class PBXAssociatedDomainsEntitlement + { + #region Fields + + [SerializeField] + private string[] m_domains; + + #endregion + + #region Properties + + public string[] Domains => m_domains; + + #endregion + + #region Constructors + + public PBXAssociatedDomainsEntitlement(string[] domains) + { + // set properties + m_domains = domains; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXAssociatedDomainsEntitlement.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXAssociatedDomainsEntitlement.cs.meta new file mode 100644 index 00000000..f24d7e3c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXAssociatedDomainsEntitlement.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ef89706a136bb48fab2345a3dc3acf34 +timeCreated: 1586429981 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXCapability.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXCapability.cs new file mode 100644 index 00000000..f9d43081 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXCapability.cs @@ -0,0 +1,72 @@ +using System; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + [Serializable] + public class PBXCapability + { + #region Fields + + [SerializeField] + private PBXCapabilityType m_type; + + [SerializeField] + private PBXAssociatedDomainsEntitlement m_associatedDomainsEntitlement; + + #endregion + + #region Properties + + public PBXCapabilityType Type => m_type; + + public PBXAssociatedDomainsEntitlement AssociatedDomainsEntitlement => m_associatedDomainsEntitlement; + + #endregion + + #region Create methods + + public static PBXCapability iCloud() + { + return new PBXCapability() + { + m_type = PBXCapabilityType.iCloud, + }; + } + + public static PBXCapability InAppPurchase() + { + return new PBXCapability() + { + m_type = PBXCapabilityType.InAppPurchase, + }; + } + + public static PBXCapability GameCenter() + { + return new PBXCapability() + { + m_type = PBXCapabilityType.GameCenter, + }; + } + + public static PBXCapability PushNotifications() + { + return new PBXCapability() + { + m_type = PBXCapabilityType.PushNotifications, + }; + } + + public static PBXCapability AssociatedDomains(string[] domains) + { + return new PBXCapability() + { + m_type = PBXCapabilityType.AssociatedDomains, + m_associatedDomainsEntitlement = new PBXAssociatedDomainsEntitlement(domains), + }; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXCapability.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXCapability.cs.meta new file mode 100644 index 00000000..3ac61f8f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXCapability.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3a0c3b4ae180f4694bf5fec6c8e3c2d2 +timeCreated: 1578832973 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXCapabilityType.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXCapabilityType.cs new file mode 100644 index 00000000..6f61047a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXCapabilityType.cs @@ -0,0 +1,15 @@ +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + public enum PBXCapabilityType + { + GameCenter = 1, + + InAppPurchase, + + iCloud, + + PushNotifications, + + AssociatedDomains, + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXCapabilityType.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXCapabilityType.cs.meta new file mode 100644 index 00000000..50c15282 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXCapabilityType.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c9db54d699ec9461187c77cf6639c105 +timeCreated: 1578832973 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFIle.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFIle.cs new file mode 100644 index 00000000..8f7ef22d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFIle.cs @@ -0,0 +1,40 @@ +using System.IO; +using UnityEngine; +using UnityEditor; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + [System.Serializable] + public class PBXFile + { + #region Fields + + [SerializeField] + private Object m_reference; + + [SerializeField] + private string m_compileFlags; + + #endregion + + #region Properties + + public string RelativePath => AssetDatabase.GetAssetPath(m_reference); + + public string AbsoultePath => Path.GetFullPath(RelativePath); + + public string[] CompileFlags + { + get + { + return m_compileFlags.Split(','); + } + set + { + m_compileFlags = string.Join(",", value); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFIle.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFIle.cs.meta new file mode 100644 index 00000000..1b86506c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFIle.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 987a0da92031341349193308b63a379d +timeCreated: 1578832973 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFileDrawer.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFileDrawer.cs new file mode 100644 index 00000000..d74573db --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFileDrawer.cs @@ -0,0 +1,37 @@ +using UnityEngine; +using UnityEditor; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + [CustomPropertyDrawer(typeof(PBXFile))] + public class PBXFileDrawer : PropertyDrawer + { + #region Unity methods + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return EditorGUIUtility.singleLineHeight; + } + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + // show property name label + label = EditorGUI.BeginProperty(position, label, property); + position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), GUIContent.none); + + // show property attributes + Rect refRect = new Rect(position.x, position.y, position.width * 0.6f, position.height); + Rect flagsRect = new Rect(refRect.xMax + 5f, position.y, position.width - refRect.width - 5f, position.height); + int indentLevel = EditorGUI.indentLevel; + + EditorGUI.indentLevel = 0; + EditorGUI.PropertyField(refRect, property.FindPropertyRelative("m_reference"), GUIContent.none); + EditorGUI.PropertyField(flagsRect, property.FindPropertyRelative("m_compileFlags"), GUIContent.none); + EditorGUI.indentLevel = indentLevel; + + EditorGUI.EndProperty(); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFileDrawer.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFileDrawer.cs.meta new file mode 100644 index 00000000..da88a83c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFileDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 182fe8e658a3e4deaba3ffd7dc799ad8 +timeCreated: 1578832973 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFramework.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFramework.cs new file mode 100644 index 00000000..92b9cbce --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFramework.cs @@ -0,0 +1,77 @@ +using System; +using UnityEngine; +using UnityEngine.Serialization; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + [Serializable] + public class PBXFramework + { + #region Fields + + [SerializeField, PBXFrameworkName] + private string m_name; + + [SerializeField, EnumMaskField(typeof(PBXTargetMembership))] + private PBXTargetMembership m_target; + + [SerializeField, FormerlySerializedAs("m_isWeak")] + private bool m_isOptional; + + #endregion + + #region Properties + + public string Name + { + get => m_name; + private set => m_name = value; + } + + public PBXTargetMembership Target + { + get => m_target; + private set => m_target = value; + } + + public bool IsOptional + { + get => m_isOptional; + private set => m_isOptional = value; + } + + #endregion + + #region Constructors + + public PBXFramework(string name, PBXTargetMembership target = (PBXTargetMembership)0, + bool isOptional = false) + { + // Set properties + Name = name; + Target = target; + IsOptional = isOptional; + } + + #endregion + + #region Base class methods + + public override bool Equals(object obj) + { + if (obj is PBXFramework) + { + return string.Equals(m_name, ((PBXFramework)obj).m_name); + } + + return base.Equals(obj); + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFramework.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFramework.cs.meta new file mode 100644 index 00000000..22bfe8ef --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFramework.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5fb405b9534404452b2e471c3b9acccb +timeCreated: 1578832973 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFrameworkDrawer.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFrameworkDrawer.cs new file mode 100644 index 00000000..d96b30eb --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFrameworkDrawer.cs @@ -0,0 +1,41 @@ +using UnityEngine; +using UnityEditor; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + [CustomPropertyDrawer(typeof(PBXFramework))] + public class PBXFrameworkDrawer : PropertyDrawer + { + #region Unity methods + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return EditorGUIUtility.singleLineHeight; + } + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + // show property name label + label = EditorGUI.BeginProperty(position, label, property); + position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), GUIContent.none); + + // show property attributes + float maxWidth = position.width * .3f; + float offset = position.width * .01f; + Rect nameRect = new Rect(position.x, position.y, maxWidth, position.height); + Rect targetRect = new Rect(nameRect.xMax + offset, position.y, maxWidth, position.height); + Rect optionalRect = new Rect(targetRect.xMax + offset, position.y, maxWidth, position.height); + int indentLevel = EditorGUI.indentLevel; + + EditorGUI.indentLevel = 0; + EditorGUI.PropertyField(nameRect, property.FindPropertyRelative("m_name"), GUIContent.none); + EditorGUI.PropertyField(targetRect, property.FindPropertyRelative("m_target"), GUIContent.none); + EditorGUI.PropertyField(optionalRect, property.FindPropertyRelative("m_isOptional"), GUIContent.none); + EditorGUI.indentLevel = indentLevel; + + EditorGUI.EndProperty(); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFrameworkDrawer.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFrameworkDrawer.cs.meta new file mode 100644 index 00000000..dc09cd4c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFrameworkDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: cdab6c6b4610e43ec88fb480aed37db6 +timeCreated: 1578832973 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFrameworkNameAttribute.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFrameworkNameAttribute.cs new file mode 100644 index 00000000..80fef1af --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFrameworkNameAttribute.cs @@ -0,0 +1,40 @@ +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + public class PBXFrameworkNameAttribute : PropertyAttribute + { + #region Static fields + + private static readonly string[] s_frameworkNames = new string[] + { + "Accounts.framework", + "AVFoundation.framework", + "Contacts.framework", + "CloudKit.framework", + "GameKit.framework", + "MessageUI.framework", + "MobileCoreServices.framework", + "Photos.framework", + "Social.framework", + "StoreKit.framework", + "SystemConfiguration.framework", + "UserNotifications.framework", + "WebKit.framework", + "ReplayKit.framework", + "PhotosUI.framework", + "UniformTypeIdentifiers.framework" + }; + + #endregion + + #region Public Methods + + public string[] GetFrameworkNames() + { + return s_frameworkNames; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFrameworkNameAttribute.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFrameworkNameAttribute.cs.meta new file mode 100644 index 00000000..60ffae45 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFrameworkNameAttribute.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 23bdd93a72b5d49aa9d5ab80767468db +timeCreated: 1578832973 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFrameworkNameAttributeDrawer.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFrameworkNameAttributeDrawer.cs new file mode 100644 index 00000000..b47126ab --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFrameworkNameAttributeDrawer.cs @@ -0,0 +1,31 @@ +using System.Collections; +using System.Collections.Generic; +using System; +using UnityEngine; +using UnityEditor; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + [CustomPropertyDrawer(typeof(PBXFrameworkNameAttribute))] + public class PBXFrameworkNameAttributeDrawer : PropertyDrawer + { + #region Unity methods + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + label = EditorGUI.BeginProperty(position, label, property); + + // show popup + string[] options = ((PBXFrameworkNameAttribute)attribute).GetFrameworkNames(); + int selectedIndex = Array.FindIndex(options, (item) => string.Equals(item, property.stringValue)); + selectedIndex = EditorGUI.Popup(position, label.text, selectedIndex, options); + + // assign value + property.stringValue = (selectedIndex == -1) ? options[0] : options[selectedIndex]; + + EditorGUI.EndProperty(); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFrameworkNameAttributeDrawer.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFrameworkNameAttributeDrawer.cs.meta new file mode 100644 index 00000000..679d7249 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXFrameworkNameAttributeDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3d275d2e014054d1d9a26557b5cbd7b6 +timeCreated: 1578832973 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXNativePluginsExporterObject.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXNativePluginsExporterObject.cs new file mode 100644 index 00000000..38dd6cd1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXNativePluginsExporterObject.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + [Serializable, CreateAssetMenu(fileName = "PBXNativePluginsExporterObject", menuName = "Native Plugins/PBX Exporter Object", order = 0)] + public class PBXNativePluginsExporterObject : NativePluginsExporterObject + { + #region Fields + + [SerializeField] + private string[] m_compileFlags; + + [SerializeField] + private List m_headerPaths = new List(); + + [SerializeField] + private List m_frameworks = new List(); + + [SerializeField] + private List m_capabilities = new List(); + + [SerializeField] + private List m_macros = new List(); + + [SerializeField] + private List m_buildProperties = new List(); + + #endregion + + #region Properties + + public string[] CompileFlags => m_compileFlags; + + public PBXFile[] HeaderPaths => m_headerPaths.ToArray(); + + public PBXFramework[] Frameworks => m_frameworks.ToArray(); + + public PBXCapability[] Capabilities => m_capabilities.ToArray(); + + public StringKeyValuePair[] Macros => m_macros.ToArray(); + + public StringKeyValuePair[] BuildProperties => m_buildProperties.ToArray(); + + #endregion + + #region Public methods + + public void SetCompilerFlags(params string[] flags) + { + m_compileFlags = flags; + } + + public void AddCapability(PBXCapability value) + { + m_capabilities.Add(value); + } + + public void RemoveCapability(PBXCapability value) + { + m_capabilities.Remove(value); + } + + public void ClearCapabilities() + { + m_capabilities.Clear(); + } + + public void AddMacro(string name, string value) + { + var keyValuePair = new StringKeyValuePair(name, value); + m_macros.AddOrReplace( + keyValuePair, + (item) => string.Equals(item.Key, name)); + } + + public void RemoveMacro(string name) + { + m_macros.Remove((item) => string.Equals(item.Key, name)); + } + + public void ClearMacros() + { + m_macros.Clear(); + } + + public void AddFramework(PBXFramework value) + { + m_frameworks.Add(value); + } + + public void RemoveFramework(PBXFramework value) + { + m_frameworks.Remove(value); + } + + public void ClearFrameworks() + { + m_frameworks.Clear(); + } + + public void AddBuildProperty(string name, string value) + { + var keyValuePair = new StringKeyValuePair(name, value); + m_buildProperties.AddOrReplace( + keyValuePair, + (item) => string.Equals(item.Key, name)); + } + + public void RemoveBuildProperty(string name) + { + m_buildProperties.Remove((item) => string.Equals(item.Key, name)); + } + + public void ClearBuildProperties() + { + m_buildProperties.Clear(); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXNativePluginsExporterObject.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXNativePluginsExporterObject.cs.meta new file mode 100644 index 00000000..6435887d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXNativePluginsExporterObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d4ef977ceb472480b934e1aee1b94354 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXNativePluginsManager.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXNativePluginsManager.cs new file mode 100644 index 00000000..171820f2 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXNativePluginsManager.cs @@ -0,0 +1,585 @@ +#if UNITY_IOS || UNITY_TVOS +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using UnityEditor; +using UnityEditor.Build; +using UnityEditor.Build.Reporting; +using UnityEditor.iOS.Xcode; +using UnityEditor.iOS.Xcode.Extensions; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Xcode +{ + public class PBXNativePluginsManager : NativePluginsManager, IPostprocessBuildWithReport + { + +#region Constants + + private const string kPluginRelativePath = "VoxelBusters/"; + + private static readonly string kPreprocessorFilePath = NativePluginsPackageLayout.IosPluginPath + "/NPConfig.h"; + + private static readonly string[] kIgnoreFileExtensions = new string[] + { + ".meta", + ".pdf", + ".DS_Store", + ".mdown", + ".asset", + ".cs" + }; + +#endregion + +#region Fields + + private PBXProject m_project; + + private List m_librarySearchPaths; + + private List m_frameworkSearchPaths; + + private PBXNativePluginsProcessor[] m_pluginsProcessors; + +#endregion + +#region Properties + + public PBXProject Project => ObjectHelper.CreateInstanceIfNull( + ref m_project, + () => + { + PBXProject project = null; + if (IsPostprocessing) + { + project = new PBXProject(); + project.ReadFromFile(ProjectFilePath); + } + return project; + }); + + private PBXNativePluginsProcessor[] PluginsProcessors => ObjectHelper.CreateInstanceIfNull( + ref m_pluginsProcessors, + () => FindPluginsProcessors(this)); + + private PBXNativePluginsExporterObject[] ActiveExporterObjects { get; set; } + + private string ProjectFilePath => PBXProject.GetPBXProjectPath(OutputPath); + +#endregion + +#region Base class methods + + protected override bool IsSupported(BuildTarget target) + { + return (BuildTarget.iOS == target) || (BuildTarget.tvOS == target); + } + + protected override void OnPreprocessNativePlugins() + { + // Send message to complete preprocess actions to all the NativeProcessors + var linkerFileWriter = CreateDefaultLinkXmlWriter(); + PluginsProcessors.ForEach( + (item) => + { + item.OnCheckConfiguration(); + item.OnUpdateExporterObjects(); + item.OnUpdateLinkXml(linkerFileWriter); + }); + linkerFileWriter.WriteToFile(); + } + + protected override void OnPostprocessNativePlugins() + { + // Set properties + m_librarySearchPaths = new List(); + m_frameworkSearchPaths = new List(); + ActiveExporterObjects = NativePluginsExporterObject.FindObjects(); + + ClearPluginsData(); + UpdateProjectConfiguation(); + } + +#endregion + +#region Public methods + + public void AddFile(string sourceFilePath, string parentGroup, string[] compileFlags) + { + AddFileToProject( + Project, + sourceFilePath, + Project.GetFrameworkGuid(), + parentGroup, + compileFlags); + } + +#endregion + +#region Private methods + + private void UpdateProjectConfiguation() + { + LinkNativeAssets(); + UpdateInfoPlistDocument(); + UpdateProjectCapabilities(); + UpdateMacroDefinitions(); + UpdateEntitlementsPlistDocument(); + + // Apply changes + File.WriteAllText(ProjectFilePath, Project.WriteToString()); + } + + private void LinkNativeAssets() + { + DebugLogger.Log(CoreLibraryDomain.Default, "Linking native files."); + + // Open project file for editing + string projectFilePath = ProjectFilePath; + var project = Project; + string mainTargetGuid = project.GetMainTargetGuid(); + string frameworkTargetGuid = project.GetFrameworkGuid(); + DebugLogger.Log(CoreLibraryDomain.NativePlugins, $"Project File Path: {projectFilePath} targetGuid: {frameworkTargetGuid} ProjectPath: {OutputPath}"); + + //@@ fix for "does not refer to a file in a known build section" + project.AddSourcesBuildPhase(frameworkTargetGuid); + project.AddHeadersBuildPhase(frameworkTargetGuid); + + // Read exporter settings for adding native files + foreach (var exporterObject in ActiveExporterObjects) + { + DebugLogger.Log(CoreLibraryDomain.Default, $"Is feature: {exporterObject.name} enabled:{exporterObject.IsEnabled}."); + string exporterFilePath = Path.GetFullPath(AssetDatabase.GetAssetPath(exporterObject)); + string exporterFolder = Path.GetDirectoryName(exporterFilePath); + string exporterGroup = GetExportGroupPath(exporterObject: exporterObject, prefixPath: kPluginRelativePath); + string parentFolder = IOServices.GetDirectoryName(AssetDatabase.GetAssetPath(exporterObject)); + + // Add files + AddFolderToProject(project, parentFolder, frameworkTargetGuid, exporterGroup, exporterObject.CompileFlags); + + // Add headerpaths + foreach (var pathInfo in exporterObject.HeaderPaths) + { + string destinationPath = GetFilePathInProject(pathInfo.AbsoultePath, exporterFolder, exporterGroup); + string formattedPath = FormatFilePathInProject(destinationPath); + project.AddHeaderSearchPath(frameworkTargetGuid, formattedPath); + } + + // Add frameworks + foreach (var framework in exporterObject.Frameworks) + { + if (framework.Target.HasFlag(PBXTargetMembership.UnityIphone)) + { + project.AddFrameworkToProject(mainTargetGuid, framework.Name, framework.IsOptional); + } + if (framework.Target.HasFlag(PBXTargetMembership.UnityFramework)) + { + project.AddFrameworkToProject(frameworkTargetGuid, framework.Name, framework.IsOptional); + } + } + + // Add build properties + foreach (var property in exporterObject.BuildProperties) + { + project.AddBuildProperty(frameworkTargetGuid, property.Key, property.Value); + } + } + + // Add header search paths + foreach (string path in m_librarySearchPaths) + { + project.AddLibrarySearchPath(frameworkTargetGuid, FormatFilePathInProject(path)); + } + + // Add framework search paths + foreach (string path in m_frameworkSearchPaths) + { + project.AddFrameworkSearchPath(frameworkTargetGuid, FormatFilePathInProject(path)); + } + + // Add resources + CopyAssetsFromStreamingAssets(); + + // Send message to all the NativeProcessors + PluginsProcessors.ForEach( + (item) => + { + item.OnAddFiles(); + item.OnAddFolders(); + item.OnAddResources(); + item.OnUpdateConfiguration(); + }); + } + + private string GetExportGroupPath(NativePluginsExporterObject exporterObject, string prefixPath) + { + string groupPath = prefixPath; + bool usesNestedHierarchy = true; + if (exporterObject.Group != null) + { + groupPath += exporterObject.Group.Name + "/"; + usesNestedHierarchy = exporterObject.Group.UsesNestedHeierarchy; + } + if (usesNestedHierarchy) + { + groupPath += exporterObject.name + "/"; + } + return groupPath; + } + + private void AddFileToProject(PBXProject project, string sourceFilePath, string targetGuid, string parentGroup, string[] compileFlags) + { + // Convert relative path to absolute path + if (!Path.IsPathRooted(sourceFilePath)) + { + sourceFilePath = Path.GetFullPath(sourceFilePath); + } + + // Copy the file to the project directory + string fileName = Path.GetFileName(sourceFilePath); + string destinationFilePath = sourceFilePath; + if (!IOServices.IsSubDirectory(OutputPath, destinationFilePath)) + { + string destinationFolder = IOServices.CombinePath(OutputPath, parentGroup); + destinationFilePath = CopyFileToProject(sourceFilePath, destinationFolder); + DebugLogger.Log(CoreLibraryDomain.Default, $"Adding file {fileName} to project."); + } + + // Add copied file to the project + string fileGuid = project.AddFile(FormatFilePathInProject(destinationFilePath, rooted: false), parentGroup + fileName); + project.AddFileToBuildWithFlags( + targetGuid, + fileGuid, + compileFlags.IsNullOrEmpty() ? string.Empty : string.Join(" ", compileFlags)); + + // Add search path project + string fileExtension = Path.GetExtension(destinationFilePath); + if (string.Equals(fileExtension, ".a", StringComparison.InvariantCultureIgnoreCase)) + { + CacheLibrarySearchPath(destinationFilePath); + } + else if (string.Equals(fileExtension, ".framework", StringComparison.InvariantCultureIgnoreCase)) + { + CacheFrameworkSearchPath(destinationFilePath); + project.AddFileToEmbedFrameworks(Project.GetMainTargetGuid(), fileGuid); + //@@project.AddFileToBuildSection(targetGuid, project.GetFrameworksBuildPhaseByTarget(targetGuid), fileGuid); + } + } + + private void AddFolderToProject(PBXProject project, string sourceFolder, string targetGuid, string parentGroup, string[] compileFlags) + { + // Check whether given folder is valid + var sourceFolderInfo = new DirectoryInfo(sourceFolder); + if (!sourceFolderInfo.Exists) return; + + // Add files placed within this folder + foreach (var fileInfo in FindFiles(sourceFolderInfo)) + { + AddFileToProject( + project, + fileInfo.FullName, + targetGuid, + parentGroup, + compileFlags); + } + + // add folders placed within this folder + foreach (var subFolderInfo in sourceFolderInfo.GetDirectories()) + { + if(subFolderInfo.Name.EndsWith(".framework")) + { + AddFileToProject( + project, + subFolderInfo.FullName, + targetGuid, + parentGroup, + compileFlags); + } + else + { + string folderGroup = parentGroup + subFolderInfo.Name + "/"; + + AddFolderToProject( + project, + subFolderInfo.FullName, + targetGuid, + folderGroup, + compileFlags); + } + } + } + + private string CopyFileToProject(string filePath, string targetFolder) + { +#if NATIVE_PLUGINS_DEBUG + return filePath; +#else + // create target folder directory, incase if it doesn't exist + if (!IOServices.DirectoryExists(targetFolder)) + { + IOServices.CreateDirectory(targetFolder); + } + + // copy specified file + string fileName = Path.GetFileName(filePath); + string destPath = Path.Combine(targetFolder, fileName); + + DebugLogger.Log(CoreLibraryDomain.NativePlugins, $"Copying file {filePath} to {destPath}."); + FileUtil.CopyFileOrDirectory(filePath, destPath); + + return destPath; +#endif + } + + private string GetFilePathInProject(string sourcePath, string parentFolder, string parentGroup) + { +#if NATIVE_PLUGINS_DEBUG + return sourcePath; +#else + string relativePath = IOServices.GetRelativePath(parentFolder, sourcePath); + string destinationFolder = IOServices.CombinePath(OutputPath, parentGroup); + return IOServices.CombinePath(destinationFolder, relativePath); +#endif + } + + private string FormatFilePathInProject(string path, bool rooted = true) + { +#if NATIVE_PLUGINS_DEBUG + return path; +#else + if (path.Contains("$(inherited)")) + { + return path; + } + + string relativePathToProject = IOServices.GetRelativePath(OutputPath, path); + return rooted ? Path.Combine("$(SRCROOT)", relativePathToProject) : relativePathToProject; +#endif + } + + private void CacheLibrarySearchPath(string path) + { + string directoryPath = Path.GetDirectoryName(path); + m_librarySearchPaths.AddUnique(directoryPath); + } + + private void CacheFrameworkSearchPath(string path) + { + string directoryPath = Path.GetDirectoryName(path); + m_frameworkSearchPaths.AddUnique(directoryPath); + } + + private FileInfo[] FindFiles(DirectoryInfo folder) + { + return folder.GetFiles().Where((fileInfo) => + { + string fileExtension = fileInfo.Extension; + return !Array.Exists(kIgnoreFileExtensions, (ignoreExt) => string.Equals(fileExtension, ignoreExt, StringComparison.InvariantCultureIgnoreCase)); + }).ToArray(); + } + + // Added for supporting notification services custom sound files + private void CopyAssetsFromStreamingAssets() + { + string mainTargetGuid = Project.GetMainTargetGuid(); + + // Copy audio files from streaming assets if any to Raw folder + string path = UnityEngine.Application.streamingAssetsPath; + if (IOServices.DirectoryExists(path)) + { + var files = System.IO.Directory.GetFiles(path); + string destinationFolder = OutputPath; + + var formats = new string[] + { + ".mp3", + ".wav", + ".ogg", + ".aiff" + }; + for (int i=0; i< files.Length; i++) + { + string extension = IOServices.GetExtension(files[i]); + if (formats.Contains(extension.ToLower())) + { + string destinationRelativePath = files[i].Replace(path, "."); + IOServices.CopyFile(files[i], IOServices.CombinePath(destinationFolder, IOServices.GetFileName(files[i]))); + DebugLogger.Log(CoreLibraryDomain.NativePlugins, $"Coping asset with relativePath: {destinationRelativePath}."); + Project.AddFileToBuild(mainTargetGuid, Project.AddFile(destinationRelativePath, destinationRelativePath)); + } + } + } + } + +#endregion + +#region Misc methods + + private void UpdateInfoPlistDocument() + { + DebugLogger.Log(CoreLibraryDomain.Default, "Updating plist configuration."); + + // Open the file + string plistPath = $"{OutputPath}/Info.plist"; + var plistDoc = new PlistDocument(); + plistDoc.ReadFromString(File.ReadAllText(plistPath)); + + // Send message to all the NativeProcessors + PluginsProcessors.ForEach( + (item) => + { + item.OnUpdateInfoPlist(plistDoc); + }); + + // Save changes + plistDoc.WriteToFile(plistPath); + } + + private void UpdateEntitlementsPlistDocument() + { + DebugLogger.Log(CoreLibraryDomain.Default, "Updating entitlements plist configuration."); + + // Open the file + string plistPath = Path.Combine(OutputPath, GetEntitlementsPath()); + var plistDoc = new PlistDocument(); + plistDoc.ReadFromString(File.ReadAllText(plistPath)); + + // Send message to all the NativeProcessors + PluginsProcessors.ForEach( + (item) => + { + item.OnUpdateEntitlementsPlist(plistDoc); + }); + + // Save changes + plistDoc.WriteToFile(plistPath); + } + + + private void UpdateProjectCapabilities() + { + var capabilityManager = new ProjectCapabilityManager( + ProjectFilePath, + GetEntitlementsPath(), + Project.GetMainTargetName(), + Project.GetMainTargetGuid()); + + // Add the capabilities specified in the Exporters + foreach (var exporterObject in ActiveExporterObjects) + { + if (!exporterObject.IsEnabled) continue; + + foreach (var capability in exporterObject.Capabilities) + { + switch (capability.Type) + { + case PBXCapabilityType.GameCenter: + capabilityManager.AddGameCenter(); + break; + + case PBXCapabilityType.iCloud: + capabilityManager.AddiCloud(enableKeyValueStorage: true, enableiCloudDocument: false, enablecloudKit: false, addDefaultContainers: false, customContainers: null); + break; + + case PBXCapabilityType.InAppPurchase: + capabilityManager.AddInAppPurchase(); + break; + + case PBXCapabilityType.PushNotifications: + capabilityManager.AddPushNotifications(Debug.isDebugBuild); + capabilityManager.AddBackgroundModes(BackgroundModesOptions.RemoteNotifications); + break; + + case PBXCapabilityType.AssociatedDomains: + var associatedDomainsEntitlement = capability.AssociatedDomainsEntitlement; + capabilityManager.AddAssociatedDomains(domains: associatedDomainsEntitlement.Domains); + break; + + default: + throw VBException.SwitchCaseNotImplemented(capability.Type); + } + } + } + + // Send message to all the NativeProcessors + PluginsProcessors.ForEach( + (item) => + { + item.OnUpdateCapabilities(capabilityManager); + }); + + // Save changes + capabilityManager.WriteToFile(); + } + + private void UpdateMacroDefinitions() + { + var preprocessorDirectivesManager = new MacroDefinitionsManager( + path: kPreprocessorFilePath, + headerComments: "// NPConfig.h" + + "// Native Plugins" + + "//" + + "// Created by Ashwin kumar" + + "// Copyright (c) 2024 Voxel Busters Interactive LLP. All rights reserved." + + "//"); + + // Add macros from Settings file + foreach (var exporterObject in ActiveExporterObjects) + { + var macros = exporterObject.Macros; + foreach (var entry in macros) + { + preprocessorDirectivesManager.AddMacro($"{entry.Key} {entry.Value}"); + } + } + + // Send message to add macros to all the Processor instances + PluginsProcessors.ForEach((item) => item.OnUpdateMacroDefinitions(preprocessorDirectivesManager)); + + // Serialize + preprocessorDirectivesManager.WriteToFile(); + } + + private string GetEntitlementsPath() + { + var mainTargetGuid = Project.GetMainTargetGuid(); + var mainTargetName = Project.GetMainTargetName(); + + var relativePath = Project.GetBuildPropertyForAnyConfig(mainTargetGuid, BuildConfigurationKey.kCodeSignEntitlements); + if (relativePath != null) + { + var fullPath = Path.Combine(OutputPath, relativePath); + if (IOServices.FileExists(fullPath)) + { + return relativePath;//This should be relative path (if we pass full path it behaves differently on windows as internally PBXPath.Combine only checks for starting / but not windows style) + } + } + + // Make new file + var entitlementsPath = Path.Combine(OutputPath, mainTargetName, $"{mainTargetName}.entitlements"); + var entitlementsPlist = new PlistDocument(); + entitlementsPlist.WriteToFile(entitlementsPath); + + // Copy the entitlement file to the xcode project + var entitlementFileName = Path.GetFileName(entitlementsPath); + var relativeDestination = $"{mainTargetName}/{entitlementFileName}"; + + // Add the pbx configs to include the entitlements files on the project + Project.AddFile(relativeDestination, entitlementFileName); + Project.SetBuildProperty(mainTargetGuid, BuildConfigurationKey.kCodeSignEntitlements, relativeDestination); + + return relativeDestination; + } + + private void ClearPluginsData() + { + string pluginExportPath = Path.Combine(OutputPath, kPluginRelativePath); + IOServices.DeleteDirectory(pluginExportPath); + } + +#endregion + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXNativePluginsManager.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXNativePluginsManager.cs.meta new file mode 100644 index 00000000..8aa3fc48 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXNativePluginsManager.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a56154e6bd4cf4a30b3d500cab5bf553 +timeCreated: 1596392066 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXNativePluginsProcessor.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXNativePluginsProcessor.cs new file mode 100644 index 00000000..ce784717 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXNativePluginsProcessor.cs @@ -0,0 +1,31 @@ +#if UNITY_IOS || UNITY_TVOS +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using UnityEditor.Build; +using UnityEditor.Build.Reporting; +using UnityEditor.iOS.Xcode; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Xcode +{ + public abstract class PBXNativePluginsProcessor : NativePluginsProcessor + { +#region Postprocess message methods + + public virtual void OnUpdateInfoPlist(PlistDocument doc) + { } + + public virtual void OnUpdateEntitlementsPlist(PlistDocument doc) + { } + + public virtual void OnUpdateCapabilities(ProjectCapabilityManager capabilityManager) + { } + + public virtual void OnUpdateMacroDefinitions(MacroDefinitionsManager manager) + { } + +#endregion + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXNativePluginsProcessor.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXNativePluginsProcessor.cs.meta new file mode 100644 index 00000000..76b1069f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXNativePluginsProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cdde9fcb9dc7547eeb61c6fafbee3906 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXProjectExtensions.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXProjectExtensions.cs new file mode 100644 index 00000000..7d785a69 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXProjectExtensions.cs @@ -0,0 +1,87 @@ +#if UNITY_IOS || UNITY_TVOS +using System.IO; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor.iOS.Xcode; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Xcode +{ + public static class PBXProjectExtensions + { + #region Search paths + + public static void AddHeaderSearchPath(this PBXProject project, string targetGuid, string headerSearchPath) + { + AddBuildProperty(project, targetGuid, BuildConfigurationKey.kHeaderSearchPaths, GetPlatformCompatiblePath(headerSearchPath)); + } + + public static void AddLibrarySearchPath(this PBXProject project, string targetGuid, string librarySearchPath) + { + AddBuildProperty(project, targetGuid, BuildConfigurationKey.kLibrarySearchPaths, GetPlatformCompatiblePath(librarySearchPath), false, false); + } + + public static void AddFrameworkSearchPath(this PBXProject project, string targetGuid, string frameworkSearchPath) + { + AddBuildProperty(project, targetGuid, BuildConfigurationKey.kFrameworkSearchPaths, GetPlatformCompatiblePath(frameworkSearchPath), false, false); + } + + private static void AddBuildProperty(PBXProject project, string targetGuid, string key, string value, bool recursive = true, bool quoted = true) + { + // add recursive symbol for folder paths + if (recursive) + { + value = value.TrimEnd('/') + "/**"; + } + + // xcode uses space as the delimiter here, so if there's a space in the filename, we must add quote + if (quoted) + { + if (value.EndsWith("/**")) + { + value = "\"" + value.Replace("/**", "/\"/**"); + } + else + { + value = "\"" + value + "\""; + } + } + + project.AddBuildProperty(targetGuid, key, value); + } + + private static string GetPlatformCompatiblePath(string path) + { + path = path.Replace("\\", "/"); + return path; + } + + #endregion + + #region Target methods + + public static string GetMainTargetName(this PBXProject project) +#if UNITY_2019_3_OR_NEWER + => "Unity-iPhone"; +#else + => PBXProject.GetUnityTargetName(); +#endif + + + public static string GetMainTargetGuid(this PBXProject project) +#if UNITY_2019_3_OR_NEWER + => project.GetUnityMainTargetGuid(); +#else + => project.TargetGuidByName(PBXProject.GetUnityTargetName()); +#endif + + public static string GetFrameworkGuid(this PBXProject project) +#if UNITY_2019_3_OR_NEWER + => project.GetUnityFrameworkTargetGuid(); +#else + => project.TargetGuidByName(PBXProject.GetUnityTargetName()); +#endif + + #endregion + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXProjectExtensions.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXProjectExtensions.cs.meta new file mode 100644 index 00000000..39a3a33a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXProjectExtensions.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8b30711eaf30a4280a3aa9769c8dc2bf +timeCreated: 1578831715 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXTargetMembership.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXTargetMembership.cs new file mode 100644 index 00000000..46913de3 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXTargetMembership.cs @@ -0,0 +1,16 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + [System.Flags] + public enum PBXTargetMembership + { + UnityIphone = 1 << 0, + + UnityIphoneTests = 1 << 1, + + UnityFramework = 1 << 2, + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXTargetMembership.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXTargetMembership.cs.meta new file mode 100644 index 00000000..80832766 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PBXTargetMembership.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7dcbdc94d28c5497cb93ba60167f4c8a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PlistUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PlistUtility.cs new file mode 100644 index 00000000..a2562cca --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PlistUtility.cs @@ -0,0 +1,76 @@ +#if UNITY_IOS || UNITY_TVOS +using System.Collections.Generic; +using UnityEngine; +using UnityEditor.iOS.Xcode; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Xcode +{ + public static class PlistUtility + { + #region Plist extensions + + public static bool TryGetElement(this PlistElementDict dict, string key, out T element) where T : PlistElement + { + IDictionary dictionary = dict.values; + PlistElement value; + if (dictionary.TryGetValue(key, out value)) + { + element = (T)value; + return true; + } + + element = default(T); + return false; + } + + public static bool Contains(this PlistElementArray array, string value) + { + List valueList = array.values; + for (int iter = 0; iter < valueList.Count; iter++) + { + if (valueList[iter].AsString() == value) + { + return true; + } + } + + return false; + } + + public static void AddUniqueString(this PlistElementArray array, string value) + { + foreach (PlistElement each in array.values) + { + if (each is PlistElementString) + { + string existingValue = each.AsString(); + if (!string.IsNullOrEmpty(existingValue) && existingValue.Equals(value)) + { + return; + } + } + } + + // We reached here as value doesn't exist + array.AddString(value); + } + + // This add new array if the key doesn't exist. If exists, returns it. + public static PlistElementArray GetArray(this PlistElementDict source, string key) + { + PlistElementArray array = null; + if (source.values.ContainsKey(key)) + { + array = source.values[key] as PlistElementArray; + } + if (array == null) + { + array = source.CreateArray(key); + } + return array; + } + + #endregion + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PlistUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PlistUtility.cs.meta new file mode 100644 index 00000000..dc11eace --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/PlistUtility.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2db1aba3287b94a7cad66d73f74f5c29 +timeCreated: 1576070995 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/ProjectCapabilityManagerExtensions.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/ProjectCapabilityManagerExtensions.cs new file mode 100644 index 00000000..1aee4712 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/ProjectCapabilityManagerExtensions.cs @@ -0,0 +1,48 @@ +#if UNITY_IOS || UNITY_TVOS +using System.Collections; +using System.Collections.Generic; +using System.Reflection; +using UnityEditor.iOS.Xcode; +using UnityEngine; + +using CapabilityType = UnityEditor.iOS.Xcode.PBXCapabilityType; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build.Xcode +{ + public static class ProjectCapabilityManagerExtensions + { + private const BindingFlags NonPublicInstanceBinding = BindingFlags.NonPublic | BindingFlags.Instance; + + public static void ForceAddInAppPurchase(this ProjectCapabilityManager manager) + { + AddCapability(manager, "com.apple.InAppPurchase", true, "StoreKit.framework", false); + } + + public static void ForceAddGameCenter(this ProjectCapabilityManager manager) + { + AddCapability(manager, "com.apple.GameCenter.iOS", true, "GameKit.framework", false); + } + + private static void AddCapability(this ProjectCapabilityManager manager, string id, bool requiresEntitlements, string framework = "", bool optionalFramework = false) + { + var managerType = typeof(ProjectCapabilityManager); + var projectField = managerType.GetField("project", NonPublicInstanceBinding); + var targetGuidField = managerType.GetField("m_TargetGuid", NonPublicInstanceBinding); + + if (projectField == null || targetGuidField == null) return; + + var project = projectField.GetValue(manager) as PBXProject; + if (project != null) + { + var mainTargetGuid = targetGuidField.GetValue(manager) as string; + var type = typeof(CapabilityType); + var types = new [] { typeof(string), typeof(bool), typeof(string), typeof (bool) }; + var parameters = new object[] { id, requiresEntitlements, framework, optionalFramework }; + var pbxCapabilityType = (CapabilityType)type.GetConstructor(NonPublicInstanceBinding, null, types, null).Invoke(parameters); + project.AddCapability(mainTargetGuid, pbxCapabilityType); + } + + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/ProjectCapabilityManagerExtensions.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/ProjectCapabilityManagerExtensions.cs.meta new file mode 100644 index 00000000..182b5f32 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/BuildPipeline/Xcode/ProjectCapabilityManagerExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb1eb60d5919f46368453bcd159b6680 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/DemoKit.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/DemoKit.meta new file mode 100644 index 00000000..c37dbc91 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/DemoKit.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: e8e8e5516925c4111b4eb085e5f79844 +folderAsset: yes +timeCreated: 1577520307 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/DemoKit/EditorDemoManager.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/DemoKit/EditorDemoManager.cs new file mode 100644 index 00000000..0cb81a04 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/DemoKit/EditorDemoManager.cs @@ -0,0 +1,24 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using VoxelBusters.CoreLibrary.NativePlugins.DemoKit; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.DemoKit +{ + public class EditorDemoManager : MonoBehaviour + { + [UnityEditor.Callbacks.DidReloadScripts] + private static void OnScriptsReloaded() + { + if (EditorApplication.isPlaying) + { + DemoPanel panel = FindFirstObjectByType(); + if (panel != null) + { + panel.Invoke(nameof(DemoPanel.Rebuild), 5f); + } + } + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/DemoKit/EditorDemoManager.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/DemoKit/EditorDemoManager.cs.meta new file mode 100644 index 00000000..af852dce --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/DemoKit/EditorDemoManager.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 595bcac18d85a4e45b8ea5ddf0c887ba +timeCreated: 1577520359 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/NativePluginsPackageLayout.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/NativePluginsPackageLayout.cs new file mode 100644 index 00000000..57513cf8 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/NativePluginsPackageLayout.cs @@ -0,0 +1,13 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins +{ + public static class NativePluginsPackageLayout + { + public static string ExtrasPath { get { return "Assets/Plugins/VoxelBusters/CoreLibrary"; } } + + public static string IosPluginPath { get { return ExtrasPath + "/Plugins/iOS"; } } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/NativePluginsPackageLayout.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/NativePluginsPackageLayout.cs.meta new file mode 100644 index 00000000..0f5458e0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/NativePluginsPackageLayout.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd2cbbb02770345a08fd2cb055bf6717 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/ObjectiveCBindingsGenerator.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/ObjectiveCBindingsGenerator.cs new file mode 100644 index 00000000..7762316c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/ObjectiveCBindingsGenerator.cs @@ -0,0 +1,340 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using UnityEngine; +using VoxelBusters.CoreLibrary.NativePlugins; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.Build +{ + public class ObjectiveCBindingsWriter : INativeBindingsWriter + { + #region Static fields + + private static Dictionary s_dataTypeMap = new Dictionary() + { + { typeof(void), "void" }, + { typeof(bool), "bool" }, + { typeof(int), "int" }, + { typeof(long), "long" }, + { typeof(float), "float" }, + { typeof(double), "double" }, + { typeof(string), "const char*" }, + { typeof(IntPtr), "NPIntPtr" }, + { typeof(Delegate), "void*" }, + }; + + private static Dictionary s_defaultMethodImplMap = new Dictionary() + { + { typeof(void), "" }, + { typeof(bool), "return false;" }, + { typeof(int), "return 0;" }, + { typeof(long), "return 0;" }, + { typeof(float), "return 0;" }, + { typeof(double), "return 0;" }, + { typeof(string), "return nil;" }, + { typeof(IntPtr), "return nil;" }, + { typeof(Delegate), "return nil;" }, + }; + + #endregion + + #region Fields + + private string m_headerFilePath; + + private StreamWriter m_headerFileWriter; + + private string m_implementationFilePath; + + private StreamWriter m_implementationFileWriter; + + private NativeBindingsGeneratorOptions m_options; + + #endregion + + #region Constructors + + public ObjectiveCBindingsWriter(string path, + string fileName, + NativeBindingsGeneratorOptions options) + { + // Set properties + m_options = options; + if (NeedsHeaderFile()) + { + m_headerFilePath = IOServices.CombinePath(path, $"{fileName}.h"); + m_headerFileWriter = new StreamWriter(m_headerFilePath, append: false); + } + if (NeedsSourceFile()) + { + m_implementationFilePath = IOServices.CombinePath(path, $"{fileName}.mm"); + m_implementationFileWriter = new StreamWriter(m_implementationFilePath, append: false); + } + } + + #endregion + + #region Static methods + + private static bool IsStructType(Type type) => type.IsValueType && !type.IsPrimitive && !type.IsEnum; + + #endregion + + #region Private methods + + private bool NeedsHeaderFile() => m_options.HasFlag(NativeBindingsGeneratorOptions.Header); + + private bool NeedsSourceFile() => m_options.HasFlag(NativeBindingsGeneratorOptions.Source); + + #endregion + + #region INativeBindingsGenerator implementation + + public void WriteStart(string product = null, + string author = null, + string copyrights = null) + { + // Header file + string headerName = null; + if (NeedsHeaderFile()) + { + headerName = IOServices.GetFileName(m_headerFilePath); + WriteHeaderComments(m_headerFileWriter, + headerName, + product, + author, + copyrights); + m_headerFileWriter.WriteLine(); + + WriteHeaderImports(m_headerFileWriter, + "#import ", + "#import \"NPDefines.h\"", + "#import \"NPUnityDataTypes.h\""); + m_headerFileWriter.WriteLine(); + } + + // Implementation file + if (NeedsSourceFile()) + { + var implementationName = IOServices.GetFileName(m_implementationFilePath); + WriteHeaderComments(m_implementationFileWriter, + implementationName, + product, + author, + copyrights); + m_implementationFileWriter.WriteLine(); + + if (headerName != null) + { + WriteHeaderImports(m_implementationFileWriter, + $"#import \"{headerName}\""); + } + WriteHeaderImports(m_implementationFileWriter, + "#import \"NPDefines.h\"", + "#import \"NPUnityDataTypes.h\""); + m_implementationFileWriter.WriteLine(); + } + } + + public void WriteCustomTypeDeclarations(Type[] customTypes) + { + var writer = m_headerFileWriter ?? m_implementationFileWriter; + if (writer == null) return; + + for (int iter = 0; iter < customTypes.Length; iter++) + { + var item = customTypes[iter]; + if (iter != 0) + { + writer.WriteLine(); + } + + if (IsStructType(item)) + { + WriteStructTypeDeclaration(writer, item); + } + } + writer.WriteLine(); + } + + public void WriteMethod(MethodInfo method) + { + var returnTypeName = GetTypeDefinition(method.ReturnType); + string methodName = method.Name; + var parameters = Array.ConvertAll(method.GetParameters(), + (pItem) => GetParameterDefinition(pItem)); + var methodBody = GetDefaultMethodBodyDefinition(method.ReturnType); + var methodSignature = $"{returnTypeName} {methodName}({string.Join(", ", parameters)})"; + + // Header section + if (NeedsHeaderFile()) + { + m_headerFileWriter.WriteLine($"{methodSignature};"); + } + + // Implementation section + if (NeedsSourceFile()) + { + m_implementationFileWriter.WriteLine($"NPBINDING DONTSTRIP {methodSignature}\n{methodBody}"); + m_implementationFileWriter.WriteLine(); + } + } + + public void WriteEnd(out string[] files) + { + var fileList = new List(); + if (NeedsHeaderFile()) + { + fileList.Add(m_headerFilePath); + m_headerFileWriter.Close(); + } + if (NeedsSourceFile()) + { + fileList.Add(m_implementationFilePath); + m_implementationFileWriter.Close(); + } + + // Set reference values + files = fileList.ToArray(); + } + + #endregion + + #region Write methods + + private void WriteHeaderComments(StreamWriter writer, + string fileName, + string product, + string author, + string copyrights) + { + writer.WriteLine("//"); + writer.WriteLine($"// {fileName}"); + writer.WriteLine($"// {product}"); + writer.WriteLine("//"); + if (author != null) + { + writer.WriteLine($"// Created by {author} on {DateTime.Now.ToString("d")}."); + } + if (copyrights != null) + { + writer.WriteLine($"// {copyrights}"); + } + writer.WriteLine("//"); + } + + private void WriteHeaderImports(StreamWriter writer, + params string[] files) + { + foreach (var item in files) + { + writer.WriteLine($"{item}"); + } + } + + private void WriteStructTypeDeclaration(StreamWriter writer, + Type structType) + { + if(!TryGetBuiltinTypeName(structType, out string nativeTypeName)) + { + nativeTypeName = structType.Name; + } + + writer.WriteLine($"struct {nativeTypeName}"); + writer.WriteLine("{"); + writer.WriteLine("};"); + writer.WriteLine($"typedef struct {nativeTypeName} {nativeTypeName};"); + } + + #endregion + + #region Private methods + + private string GetTypeDefinition(Type type) + { + // Resolve the type to the suitable representation + if (typeof(Delegate).IsAssignableFrom(type)) + { + type = typeof(Delegate); + } + + // Match type to its representation in objective c + if (type.IsArray || type.IsByRef) + { + return GetTypeDefinition(type.GetElementType()) + "*"; + } + if (type.IsEnum) + { + return "int"; + } + + if (s_dataTypeMap.TryGetValue(type, out string typeName)) + { + return typeName; + } + if (TryGetBuiltinTypeName(type, out string nativeTypeName)) + { + return nativeTypeName; + } + return type.Name; + } + + private string GetParameterDefinition(ParameterInfo param) + { + var paramType = GetTypeDefinition(param.ParameterType); + var paramName = param.Name; + return $"{paramType} {paramName}"; + } + + public string GetDefaultMethodBodyDefinition(Type returnType) + { + string methodBody = null; + if (returnType.IsEnum) + { + returnType = typeof(int); + } + + if (!s_defaultMethodImplMap.TryGetValue(returnType, out methodBody)) + { + if (TryGetBuiltinTypeName(returnType, out string nativeType)) + { + if (returnType.IsValueType) + { + methodBody = $"return {nativeType}();"; + } + } + } + return string.IsNullOrEmpty(methodBody) + ? "{ }" + : $"{{\n\t{methodBody}\n}}"; + } + + private bool TryGetBuiltinTypeName(Type type, out string nativeType) + { + nativeType = null; + + if (type.FullName.StartsWith("VoxelBusters")) + { + if (IsStructType(type)) + { + string typeName = type.Name; + if (typeName.StartsWith("Unity")) + { + nativeType = $"NP{typeName}"; + return true; + } + if (typeName.StartsWith("Native")) + { + nativeType = typeName.Replace("Native", "NP"); + return true; + } + } + } + return false; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/ObjectiveCBindingsGenerator.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/ObjectiveCBindingsGenerator.cs.meta new file mode 100644 index 00000000..1b96d70b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/ObjectiveCBindingsGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 49cf1f2da22e64129b00da78026ab7a2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/PluginFeatureObject.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/PluginFeatureObject.cs new file mode 100644 index 00000000..455995e6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/PluginFeatureObject.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEditor; +using UnityEditor.Compilation; +using UnityEngine; +using VoxelBusters.CoreLibrary.Editor.NativePlugins.Build; + +namespace VoxelBusters.CoreLibrary.Editor +{ + public abstract class PluginFeatureObject : ScriptableObject + { + #region + + [SerializeField] + protected bool m_isEnabled = true; + + #endregion + + #region Public methods + + public void EnableFeature(BuildTarget[] allowedImplementationTargets = null) + { + /* allowedImplementationTargets + * We will look into the Implementations/iOS or Android or Windows and enable those libraries alone and disable rest. + * + */ + m_isEnabled = true; + UpdateAsmdef((AssemblyDefinitionProxy proxy) => proxy.IncludeAllPlatforms()); + GenerateLinkXml(); + } + + public void DisableFeature() + { + m_isEnabled = false; + UpdateAsmdef((AssemblyDefinitionProxy proxy) => proxy.ExcludeAllPlatforms()); + } + + #endregion + + + #region Protected methods + + protected virtual void UpdateLinkXmlWriter(LinkXmlWriter xml) { } + + #endregion + + #region Private methods + + private AssemblyDefinitionProxy GetAsmdefProxy() + { + string directory = GetFeatureDirectory(); + var proxy = new AssemblyDefinitionProxy(directory); + return proxy; + } + + private string GetFeatureDirectory() + { + var path = AssetDatabase.GetAssetPath(this); + return IOServices.GetDirectoryName(path); + } + + private void UpdateAsmdef(Action action) + { + var proxy = GetAsmdefProxy(); + action.Invoke(proxy); + proxy.Save(); + } + + private void GenerateLinkXml() + { + string directory = GetFeatureDirectory(); + var linkXml = new LinkXmlWriter(IOServices.CombinePath(directory, "link.xml")); + UpdateLinkXmlWriter(linkXml); + linkXml.WriteToFile(); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/PluginFeatureObject.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/PluginFeatureObject.cs.meta new file mode 100644 index 00000000..b40e28d7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/PluginFeatureObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f8c6efc950e3e4442b19e7bc63fe685a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/SimulatorServices.Database.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/SimulatorServices.Database.cs new file mode 100644 index 00000000..5b67c20c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/SimulatorServices.Database.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins +{ + public partial class SimulatorServices + { + [Serializable] + public class Database + { + #region Fields + + [SerializeField] + private List m_dataItems = new List(); + + #endregion + + #region Data methods + + public void SetObject(string key, object obj) + { + // convert object to serialized form + string serializedData = JsonUtility.ToJson(obj); + var newItem = new StringKeyValuePair() { Key = key, Value = serializedData }; + + // check whether key exists + int keyIndex = FindItemIndex(key); + if (keyIndex == -1) + { + m_dataItems.Add(newItem); + } + else + { + m_dataItems[keyIndex] = newItem; + } + } + + public T GetObject(string key) + { + int keyIndex = FindItemIndex(key); + if (keyIndex != -1) + { + string serializedData = m_dataItems[keyIndex].Value; + return JsonUtility.FromJson(serializedData); + } + + return default(T); + } + + public void RemoveObject(string key) + { + int keyIndex = FindItemIndex(key); + if (keyIndex != -1) + { + m_dataItems.RemoveAt(keyIndex); + } + } + + public void RemoveAllObjects() + { + // remove existing data + m_dataItems.Clear(); + } + + #endregion + + #region Private methods + + private int FindItemIndex(string key) + { + return m_dataItems.FindIndex((item) => string.Equals(item.Key, key)); + } + + #endregion + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/SimulatorServices.Database.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/SimulatorServices.Database.cs.meta new file mode 100644 index 00000000..419e9886 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/SimulatorServices.Database.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4f2bd32a288dd4c8b8fb30e1d32f0eed +timeCreated: 1576668119 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/SimulatorServices.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/SimulatorServices.cs new file mode 100644 index 00000000..08d0b2f8 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/SimulatorServices.cs @@ -0,0 +1,102 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; +using VoxelBusters.CoreLibrary; +using VoxelBusters.CoreLibrary.Editor; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins +{ + public partial class SimulatorServices + { + #region Constants + + private const string kSimulatorDataFilePath = "Library/VoxelBusters/NativePlugins/SimulatorData.json"; + + #endregion + + #region Static + + private static Database s_database; + + #endregion + + #region Public methods + + public static Texture2D GetRandomImage() + { + // select a random image file + var textureGuids = AssetDatabase.FindAssets("t:texture"); + int randomIndex = Random.Range(0, textureGuids.Length); + var imagePath = AssetDatabase.GUIDToAssetPath(textureGuids[randomIndex]); + + // create file from texture data + var fileData = IOServices.ReadFileData(imagePath); + var texture = new Texture2D(2, 2); + texture.LoadImage(fileData, false); + + return texture; + } + + #endregion + + #region Data management methods + + public static void SetObject(string key, object obj) + { + InitIfRequired(); + + s_database.SetObject(key, obj); + SetDirty(); + } + + public static T GetObject(string key) + { + InitIfRequired(); + + return s_database.GetObject(key); + } + + public static void RemoveObject(string key) + { + InitIfRequired(); + + s_database.RemoveObject(key); + SetDirty(); + } + + public static void RemoveAllObjects() + { + InitIfRequired(); + + s_database.RemoveAllObjects(); + SetDirty(); + } + + #endregion + + #region Private methods + + private static void InitIfRequired() + { + if (s_database != null) return; + + // check whether serialized data exists + s_database = IOServices.FileExists(kSimulatorDataFilePath) + ? JsonUtility.FromJson(IOServices.ReadFile(kSimulatorDataFilePath)) + : new Database(); + } + + private static void SetDirty() + { + var parentFolder = IOServices.GetDirectoryName(kSimulatorDataFilePath); + IOServices.CreateDirectory(parentFolder, overwrite: false); + + // serializes the data + var fileData = JsonUtility.ToJson(s_database); + IOServices.CreateFile(kSimulatorDataFilePath, fileData); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/SimulatorServices.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/SimulatorServices.cs.meta new file mode 100644 index 00000000..14946fd1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/SimulatorServices.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 35ce05fae80b848a68c14b6ccc305276 +timeCreated: 1576668119 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/UnityUI.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/UnityUI.meta new file mode 100644 index 00000000..c4cd6837 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/UnityUI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eb314720b73d244a59985796625485ea +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/UnityUI/UnityUIEditorUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/UnityUI/UnityUIEditorUtility.cs new file mode 100644 index 00000000..a303c5b9 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/UnityUI/UnityUIEditorUtility.cs @@ -0,0 +1,33 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using VoxelBusters.CoreLibrary.Editor; +using VoxelBusters.CoreLibrary.NativePlugins; +using VoxelBusters.CoreLibrary.NativePlugins.UnityUI; + +namespace VoxelBusters.CoreLibrary.Editor.NativePlugins.UnityUI +{ + public static class UnityUIEditorUtility + { + #region Static methods + + public static UnityUIRenderer LoadRendererPrefab() + { + return LoadPrefab("UnityUIRenderer.prefab"); + } + + public static UnityUIAlertDialog LoadAlertDialogPrefab() + { + return LoadPrefab("UnityUIAlertDialog.prefab"); + } + + private static T LoadPrefab(string name) where T : Object + { + string prefabPath = CoreLibrarySettings.Package.GetFullPath($"Prefabs/{name}"); + return AssetDatabase.LoadAssetAtPath(prefabPath); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/UnityUI/UnityUIEditorUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/UnityUI/UnityUIEditorUtility.cs.meta new file mode 100644 index 00000000..a4f0db23 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/UnityUI/UnityUIEditorUtility.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a0e4454dec3164cec87995fda698d0be +timeCreated: 1578296765 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/VoxelBusters.CoreLibrary.Editor.NativePlugins.asmdef b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/VoxelBusters.CoreLibrary.Editor.NativePlugins.asmdef new file mode 100644 index 00000000..59e6bd24 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/VoxelBusters.CoreLibrary.Editor.NativePlugins.asmdef @@ -0,0 +1,18 @@ +{ + "name": "VoxelBusters.CoreLibrary.Editor.NativePlugins", + "references": [ + "VoxelBusters.CoreLibrary", + "VoxelBusters.CoreLibrary.Editor", + "VoxelBusters.CoreLibrary.NativePlugins" + ], + "optionalUnityReferences": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [] +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/VoxelBusters.CoreLibrary.Editor.NativePlugins.asmdef.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/VoxelBusters.CoreLibrary.Editor.NativePlugins.asmdef.meta new file mode 100644 index 00000000..d846a775 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Editor/NativePlugins/VoxelBusters.CoreLibrary.Editor.NativePlugins.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b26b55e8c8c3048eebf8103d71fd130c +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/EditorResources.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/EditorResources.meta new file mode 100644 index 00000000..f1b8f128 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/EditorResources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d113a24f748704384af00b11520c8d62 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/EditorResources/Textures.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/EditorResources/Textures.meta new file mode 100644 index 00000000..d63bc906 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/EditorResources/Textures.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 86bb6eec12d0f4d908b44114e42e7848 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/EditorResources/Textures/toggle-off.png b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/EditorResources/Textures/toggle-off.png new file mode 100644 index 00000000..2ef3f78c Binary files /dev/null and b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/EditorResources/Textures/toggle-off.png differ diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/EditorResources/Textures/toggle-off.png.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/EditorResources/Textures/toggle-off.png.meta new file mode 100644 index 00000000..cd308837 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/EditorResources/Textures/toggle-off.png.meta @@ -0,0 +1,159 @@ +fileFormatVersion: 2 +guid: 83c76dd713f944d49b6658d19511efca +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: tvOS + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/EditorResources/Textures/toggle-on.png b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/EditorResources/Textures/toggle-on.png new file mode 100644 index 00000000..9177bfd4 Binary files /dev/null and b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/EditorResources/Textures/toggle-on.png differ diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/EditorResources/Textures/toggle-on.png.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/EditorResources/Textures/toggle-on.png.meta new file mode 100644 index 00000000..a8df2d86 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/EditorResources/Textures/toggle-on.png.meta @@ -0,0 +1,159 @@ +fileFormatVersion: 2 +guid: ba3d6a006944a449789813ea5f087c3b +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: tvOS + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras.meta new file mode 100644 index 00000000..ce818d8e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a3654df5d282e405ab04e2a50e0e2e23 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers.meta new file mode 100644 index 00000000..6d3ce7a4 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a32f58ee149ab423abc73d74d4ae7e5e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers/DefaultJsonServiceProvider.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers/DefaultJsonServiceProvider.cs new file mode 100644 index 00000000..b565949f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers/DefaultJsonServiceProvider.cs @@ -0,0 +1,44 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +using JsonUtility = VoxelBusters.CoreLibrary.Parser.JsonUtility; + +namespace VoxelBusters.CoreLibrary.Helpers +{ + public class DefaultJsonServiceProvider : IJsonServiceProvider + { + #region Static methods + +#if UNITY_EDITOR + [UnityEditor.InitializeOnLoadMethod] +#endif + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] + private static void OnLoad() + { + if (ExternalServiceProvider.JsonServiceProvider != null) + { + return; + } + + // set default service provider + ExternalServiceProvider.JsonServiceProvider = new DefaultJsonServiceProvider(); + } + + #endregion + + #region IJsonServiceProvider implementation + + public string ToJson(object obj) + { + return JsonUtility.ToJson(obj); + } + + public object FromJson(string jsonString) + { + return JsonUtility.FromJson(jsonString); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers/DefaultJsonServiceProvider.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers/DefaultJsonServiceProvider.cs.meta new file mode 100644 index 00000000..ea1a9b16 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers/DefaultJsonServiceProvider.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1f5c1b36bdb714b7dafa07c41c9932c2 +timeCreated: 1579703881 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers/DefaultLocalisationServiceProvider.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers/DefaultLocalisationServiceProvider.cs new file mode 100644 index 00000000..a29e1e35 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers/DefaultLocalisationServiceProvider.cs @@ -0,0 +1,34 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Helpers +{ + public class DefaultLocalisationServiceProvider : ILocalisationServiceProvider + { + #region Static methods + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] + private static void OnLoad() + { + if (ExternalServiceProvider.LocalisationServiceProvider != null) + { + return; + } + + // set default service provider + ExternalServiceProvider.LocalisationServiceProvider = new DefaultLocalisationServiceProvider(); + } + + #endregion + + #region ILocalisationServiceProvider implementation + + public string GetLocalisedString(string key, string defaultValue) + { + return defaultValue; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers/DefaultLocalisationServiceProvider.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers/DefaultLocalisationServiceProvider.cs.meta new file mode 100644 index 00000000..f9deca9c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers/DefaultLocalisationServiceProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 844b91e0406484dfeab3f65932a1aac4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers/DefaultSaveServiceProvider.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers/DefaultSaveServiceProvider.cs new file mode 100644 index 00000000..8d929789 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers/DefaultSaveServiceProvider.cs @@ -0,0 +1,94 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.Helpers +{ + public class DefaultSaveServiceProvider : ISaveServiceProvider + { + #region Static methods + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] + private static void OnLoad() + { + if (ExternalServiceProvider.SaveServiceProvider != null) + { + return; + } + + // set default service provider + ExternalServiceProvider.SaveServiceProvider = new DefaultSaveServiceProvider(); + } + + #endregion + + #region ISaveServiceProvider implementation + + public int GetInt(string key, int defaultValue = 0) + { + return PlayerPrefs.GetInt(key, defaultValue); + } + + public float GetFloat(string key, float defaultValue = 0f) + { + return PlayerPrefs.GetFloat(key, defaultValue); + } + + public string GetString(string key, string defaultValue = null) + { + return PlayerPrefs.GetString(key, defaultValue); + } + + public string[] GetStringArray(string key, string[] defaultValue = null) + { + string arrayStr = PlayerPrefs.GetString(key, null); + if (!string.IsNullOrEmpty(arrayStr)) + { + IList jsonList = (IList)ExternalServiceProvider.JsonServiceProvider.FromJson(arrayStr); + + // convert to string array + string[] array = new string[jsonList.Count]; + for (int iter = 0; iter < jsonList.Count; iter++) + { + array[iter] = (string)jsonList[iter]; + } + return array; + } + + return null; + } + + public void SetInt(string key, int value) + { + PlayerPrefs.SetInt(key, value); + } + + public void SetFloat(string key, float value) + { + PlayerPrefs.SetFloat(key, value); + } + + public void SetString(string key, string value) + { + PlayerPrefs.SetString(key, value); + } + + public void SetStringArray(string key, string[] value) + { + string arrayStr = (null == value) ? null : ExternalServiceProvider.JsonServiceProvider.ToJson(value); + PlayerPrefs.SetString(key, arrayStr); + } + + public void RemoveKey(string key) + { + PlayerPrefs.DeleteKey(key); + } + + public void Save() + { + PlayerPrefs.Save(); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers/DefaultSaveServiceProvider.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers/DefaultSaveServiceProvider.cs.meta new file mode 100644 index 00000000..84500dc4 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Extras/Helpers/DefaultSaveServiceProvider.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b4f01a076e9304e249847cfa914a928e +timeCreated: 1579703881 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Fonts.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Fonts.meta new file mode 100644 index 00000000..55fa7a62 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Fonts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5e19966c47dd847799984055c12681e1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Fonts/Lato-Regular.ttf b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Fonts/Lato-Regular.ttf new file mode 100644 index 00000000..33eba8b1 Binary files /dev/null and b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Fonts/Lato-Regular.ttf differ diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Fonts/Lato-Regular.ttf.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Fonts/Lato-Regular.ttf.meta new file mode 100644 index 00000000..f7d61817 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Fonts/Lato-Regular.ttf.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: e418537621d284969acce413dd1c8c27 +TrueTypeFontImporter: + externalObjects: {} + serializedVersion: 4 + fontSize: 16 + forceTextureCase: -2 + characterSpacing: 0 + characterPadding: 1 + includeFontData: 1 + fontName: Lato + fontNames: + - Lato + fallbackFontReferences: + - {fileID: 12800000, guid: a5b008dd8a21646b79c906018e024b87, type: 3} + customCharacters: + fontRenderingMode: 0 + ascentCalculationMode: 1 + useLegacyBoundsCalculation: 0 + shouldRoundAdvanceValue: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins.meta new file mode 100644 index 00000000..ebe30c43 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a4b93811607564754a3451225934186f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS.meta new file mode 100644 index 00000000..2fa9fdbe --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 87d965fce72ea4c0586f9790ec4ebea2 +folderAsset: yes +timeCreated: 1578293808 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Base.asset b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Base.asset new file mode 100644 index 00000000..375bea91 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Base.asset @@ -0,0 +1,28 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d4ef977ceb472480b934e1aee1b94354, type: 3} + m_Name: Base + m_EditorClassIdentifier: + m_group: {fileID: 11400000, guid: 4702987cd52d14b4c8c5530706e3c833, type: 2} + m_isEnabled: 1 + m_compileFlags: [] + m_headerPaths: [] + m_frameworks: + - m_name: MobileCoreServices.framework + m_target: 4 + m_isOptional: 0 + - m_name: StoreKit.framework + m_target: 4 + m_isOptional: 0 + m_capabilities: [] + m_macros: [] + m_buildProperties: [] diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Base.asset.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Base.asset.meta new file mode 100644 index 00000000..7d0b58f3 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Base.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: c2f2c3a01863542eaaf464deb7b3d549 +timeCreated: 1549459458 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks.meta new file mode 100644 index 00000000..84d19ce8 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 56cef3f31ab5646dcae2232b05fe9f05 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework.meta new file mode 100644 index 00000000..27af3f23 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework.meta @@ -0,0 +1,80 @@ +fileFormatVersion: 2 +guid: 651851110e1c64a8d92165210194d9dc +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Headers/VBCoreLibrary-Swift.h b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Headers/VBCoreLibrary-Swift.h new file mode 100644 index 00000000..8320b986 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Headers/VBCoreLibrary-Swift.h @@ -0,0 +1,315 @@ +#if 0 +#elif defined(__arm64__) && __arm64__ +// Generated by Apple Swift version 6.0.2 effective-5.10 (swiftlang-6.0.2.1.2 clang-1600.0.26.4) +#ifndef VBCORELIBRARY_SWIFT_H +#define VBCORELIBRARY_SWIFT_H +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" + +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wauto-import" +#if defined(__OBJC__) +#include +#endif +#if defined(__cplusplus) +#include +#include +#include +#include +#include +#include +#include +#else +#include +#include +#include +#include +#endif +#if defined(__cplusplus) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-modular-include-in-framework-module" +#if defined(__arm64e__) && __has_include() +# include +#else +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-macro-identifier" +# ifndef __ptrauth_swift_value_witness_function_pointer +# define __ptrauth_swift_value_witness_function_pointer(x) +# endif +# ifndef __ptrauth_swift_class_method_pointer +# define __ptrauth_swift_class_method_pointer(x) +# endif +#pragma clang diagnostic pop +#endif +#pragma clang diagnostic pop +#endif + +#if !defined(SWIFT_TYPEDEFS) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif +#if !defined(SWIFT_CLASS_PROPERTY) +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif +#endif +#if !defined(SWIFT_RUNTIME_NAME) +# if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +# else +# define SWIFT_RUNTIME_NAME(X) +# endif +#endif +#if !defined(SWIFT_COMPILE_NAME) +# if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +# else +# define SWIFT_COMPILE_NAME(X) +# endif +#endif +#if !defined(SWIFT_METHOD_FAMILY) +# if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +# else +# define SWIFT_METHOD_FAMILY(X) +# endif +#endif +#if !defined(SWIFT_NOESCAPE) +# if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +# else +# define SWIFT_NOESCAPE +# endif +#endif +#if !defined(SWIFT_RELEASES_ARGUMENT) +# if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +# else +# define SWIFT_RELEASES_ARGUMENT +# endif +#endif +#if !defined(SWIFT_WARN_UNUSED_RESULT) +# if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# else +# define SWIFT_WARN_UNUSED_RESULT +# endif +#endif +#if !defined(SWIFT_NORETURN) +# if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) +# else +# define SWIFT_NORETURN +# endif +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif +#if !defined(SWIFT_RESILIENT_CLASS) +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif +#endif +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif +#endif +#if !defined(SWIFT_UNAVAILABLE) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#endif +#if !defined(SWIFT_UNAVAILABLE_MSG) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#endif +#if !defined(SWIFT_AVAILABILITY) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#endif +#if !defined(SWIFT_WEAK_IMPORT) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#endif +#if !defined(SWIFT_DEPRECATED) +# define SWIFT_DEPRECATED __attribute__((deprecated)) +#endif +#if !defined(SWIFT_DEPRECATED_MSG) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#endif +#if !defined(SWIFT_DEPRECATED_OBJC) +# if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +# else +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +# endif +#endif +#if defined(__OBJC__) +#if !defined(IBSegueAction) +# define IBSegueAction +#endif +#endif +#if !defined(SWIFT_EXTERN) +# if defined(__cplusplus) +# define SWIFT_EXTERN extern "C" +# else +# define SWIFT_EXTERN extern +# endif +#endif +#if !defined(SWIFT_CALL) +# define SWIFT_CALL __attribute__((swiftcall)) +#endif +#if !defined(SWIFT_INDIRECT_RESULT) +# define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result)) +#endif +#if !defined(SWIFT_CONTEXT) +# define SWIFT_CONTEXT __attribute__((swift_context)) +#endif +#if !defined(SWIFT_ERROR_RESULT) +# define SWIFT_ERROR_RESULT __attribute__((swift_error_result)) +#endif +#if defined(__cplusplus) +# define SWIFT_NOEXCEPT noexcept +#else +# define SWIFT_NOEXCEPT +#endif +#if !defined(SWIFT_C_INLINE_THUNK) +# if __has_attribute(always_inline) +# if __has_attribute(nodebug) +# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) __attribute__((nodebug)) +# else +# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) +# endif +# else +# define SWIFT_C_INLINE_THUNK inline +# endif +#endif +#if defined(_WIN32) +#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) +# define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport) +#endif +#else +#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) +# define SWIFT_IMPORT_STDLIB_SYMBOL +#endif +#endif +#if defined(__OBJC__) +#if __has_feature(objc_modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +#endif + +#endif +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" +#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" +#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" + +#if __has_attribute(external_source_symbol) +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="VBCoreLibrary",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") +#endif + +#if defined(__OBJC__) +#endif +#if __has_attribute(external_source_symbol) +# pragma clang attribute pop +#endif +#if defined(__cplusplus) +#endif +#pragma clang diagnostic pop +#endif + +#else +#error unsupported Swift architecture +#endif diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Headers/VBCoreLibrary.h b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Headers/VBCoreLibrary.h new file mode 100644 index 00000000..dca8ca76 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Headers/VBCoreLibrary.h @@ -0,0 +1,11 @@ +// +// VBCoreLibrary.h +// VBCoreLibrary +// +// Created by Ayyappa on 28/03/24. +// + +#pragma once + +#define NPBINDING extern "C" __attribute__((visibility ("default"))) +#define DONTSTRIP __attribute__((used)) diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Info.plist b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Info.plist new file mode 100644 index 00000000..827e2b7d Binary files /dev/null and b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Info.plist differ diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Modules/VBCoreLibrary.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Modules/VBCoreLibrary.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo new file mode 100644 index 00000000..dfbcea20 Binary files /dev/null and b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Modules/VBCoreLibrary.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo differ diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Modules/VBCoreLibrary.swiftmodule/arm64-apple-ios.abi.json b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Modules/VBCoreLibrary.swiftmodule/arm64-apple-ios.abi.json new file mode 100644 index 00000000..d2f988e4 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Modules/VBCoreLibrary.swiftmodule/arm64-apple-ios.abi.json @@ -0,0 +1,9 @@ +{ + "ABIRoot": { + "kind": "Root", + "name": "NO_MODULE", + "printedName": "NO_MODULE", + "json_format_version": 8 + }, + "ConstValues": [] +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Modules/VBCoreLibrary.swiftmodule/arm64-apple-ios.swiftdoc b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Modules/VBCoreLibrary.swiftmodule/arm64-apple-ios.swiftdoc new file mode 100644 index 00000000..60867279 Binary files /dev/null and b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Modules/VBCoreLibrary.swiftmodule/arm64-apple-ios.swiftdoc differ diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Modules/VBCoreLibrary.swiftmodule/arm64-apple-ios.swiftmodule b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Modules/VBCoreLibrary.swiftmodule/arm64-apple-ios.swiftmodule new file mode 100644 index 00000000..6e587515 Binary files /dev/null and b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Modules/VBCoreLibrary.swiftmodule/arm64-apple-ios.swiftmodule differ diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Modules/module.modulemap b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Modules/module.modulemap new file mode 100644 index 00000000..cc175f22 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/Modules/module.modulemap @@ -0,0 +1,11 @@ +framework module VBCoreLibrary { + umbrella header "VBCoreLibrary.h" + export * + + module * { export * } +} + +module VBCoreLibrary.Swift { + header "VBCoreLibrary-Swift.h" + requires objc +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/VBCoreLibrary b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/VBCoreLibrary new file mode 100644 index 00000000..2c6619a6 Binary files /dev/null and b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/VBCoreLibrary differ diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/_CodeSignature/CodeResources b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/_CodeSignature/CodeResources new file mode 100644 index 00000000..ab75d634 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/Frameworks/VBCoreLibrary.framework/_CodeSignature/CodeResources @@ -0,0 +1,179 @@ + + + + + files + + Headers/VBCoreLibrary-Swift.h + + Hjdqx8WxHOvG9hzlOg7nZRtw+Vo= + + Headers/VBCoreLibrary.h + + xQM6IhfaOY9SnPpTxFUD1eAKXiw= + + Info.plist + + pxo5gtPQWRFPCoOE8Gl4uo9iwvg= + + Modules/VBCoreLibrary.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo + + esth/aIvb7qQZYwjTaReVCL3fPs= + + Modules/VBCoreLibrary.swiftmodule/arm64-apple-ios.abi.json + + gcwBsH4BgyFY4sVtNt+/xOKS3vY= + + Modules/VBCoreLibrary.swiftmodule/arm64-apple-ios.swiftdoc + + JOvwORQkDM+/MNGPMdJUBUkPgqs= + + Modules/VBCoreLibrary.swiftmodule/arm64-apple-ios.swiftmodule + + h+4O81uw4s9EyQeIipgYg5onn40= + + Modules/module.modulemap + + Nq5Mevxbr/FCDD/KqYaLsJL4AXo= + + + files2 + + Headers/VBCoreLibrary-Swift.h + + hash2 + + tVGO+jGwI7HIKW4WEQ4l605l4nUpQcp9iVLqnJmUjeg= + + + Headers/VBCoreLibrary.h + + hash2 + + GP1JBTjVGnbdNnPsojUytDxFPn/gEPPwVFMtUMZdXc0= + + + Modules/VBCoreLibrary.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo + + hash2 + + /GDWOviRaSlDIr+e85UjwA9i0wr4UwKQLvY7oWCg37c= + + + Modules/VBCoreLibrary.swiftmodule/arm64-apple-ios.abi.json + + hash2 + + Qnesa0n4URGWAopawg9bGx36dUwkYV00BoCJ8LFzlyg= + + + Modules/VBCoreLibrary.swiftmodule/arm64-apple-ios.swiftdoc + + hash2 + + EZV99gTgcNlcE/M3FBcb9E/8eoctajeSCkFoFONBZHg= + + + Modules/VBCoreLibrary.swiftmodule/arm64-apple-ios.swiftmodule + + hash2 + + zzOdzP8tXFR13Twnwa0CSsvJ7G5ZXrZiXRtVzmBUQZY= + + + Modules/module.modulemap + + hash2 + + 1rYakAp5I9b0pp9Kp7XBAbf6FZQ0H9spG1LQDnCFerk= + + + + rules + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPBindingHelper.h b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPBindingHelper.h new file mode 100644 index 00000000..c7be586b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPBindingHelper.h @@ -0,0 +1,70 @@ +// +// NPBindingHelper.h +// Native Plugins +// +// Created by Ashwin kumar on 22/01/19. +// Copyright (c) 2019 Voxel Busters Interactive LLP. All rights reserved. +// + +#import +#import +#import +#import "NPDefines.h" +#import "NPUnityDataTypes.h" + +// common functions +char* NPCreateCStringFromNSString(NSString* nsString); +char* NPCreateCStringCopyFromNSString(NSString* nsString); +char* NPCreateCStringFromNSError(NSError* error); +char* NPCreateCStringCopyFromNSError(NSError* error); +NSArray* NPCreateArrayOfNSString(const char** array, int length); +NSString* NPCreateNSStringFromCString(const char* cString); +NSURL* NPCreateNSURLFromCString(const char* cString); +NPArray* NPCreateArrayOfCString(NSArray* array); +NSString* NPExtractTokenFromNSData(id token); +NPError NPCreateError(int code, NSString* description); +NPError NPCreateError(NSError* error); +NPError NPNullError(); + +// array opearations +NPArray* NPCreateNativeArrayFromNSArray(NSArray* array); + +// image operations +NSData* NPEncodeImageAsData(UIImage* image, UIImageEncodeType encodeType); +UIImage* NPCaptureScreenshotAsImage(); +NSData* NPCaptureScreenshotAsData(UIImageEncodeType encodeType); +UIImage* NPCreateImage(void* dataArrayPtr, int dataLength); +UIImage* LoadImageFromResources(NSString* name, NSString* extension); + +// convertor operations +NSString* NPConvertMimeTypeToUTType(NSString* mimeType); + +// JSON methods +NSString* NPToJson(id object, NSError** error); +id NPFromJson(NSString* jsonString, NSError** error); + +// formatter +NSNumberFormatter* NPGetBillingPriceFormatter(NSLocale* locale); +NSString* NPCreateNSStringFromNSDate(NSDate* date); +NSDate* NPCreateNSDateFromNSString(NSString* dateStr); + +// rect +CGPoint GetLastTouchPosition(); +void SetLastTouchPosition(CGPoint position); +CGRect NPConvertScreenSpaceRectToNormalisedRect(CGRect frame); +CGRect NPConvertNormalisedRectToScreenSpaceRect(CGRect normalisedRect); +NPUnityRect NPRectMake(CGRect rect); +CGPoint NPConverToNativePosition(float posX, float posY); + +// color methods +NPUnityColor NPColorMake(float r, float g, float b, float a); +NPUnityColor NPColorCreateFromUIColor(UIColor* color); + +// converter +NSString* NPGetTextEncodingName(NPUnityTextEncodingFormat format); +NPSize NPCreateSizeFromCGSize(CGSize size); + +// briding methods +void* NPRetainWithOwnershipTransfer(id object); +void* NPRetain(void* objectPtr); +void NPRelease(void* objectPtr); diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPBindingHelper.h.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPBindingHelper.h.meta new file mode 100644 index 00000000..8b89b8b7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPBindingHelper.h.meta @@ -0,0 +1,42 @@ +fileFormatVersion: 2 +guid: 92d95ca87268841a3b4846d01cd619bc +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPBindingHelper.mm b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPBindingHelper.mm new file mode 100644 index 00000000..af3b74eb --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPBindingHelper.mm @@ -0,0 +1,606 @@ +// +// NPBindingHelper.mm +// Native Plugins +// +// Created by Ashwin kumar on 22/01/19. +// Copyright (c) 2019 Voxel Busters Interactive LLP. All rights reserved. +// + +#import "NPBindingHelper.h" +#import "NPDefines.h" +#import "UnityView.h" + +#if !defined(MAKE_UNITY_VERSION) +#define MAKE_UNITY_VERSION(ver, maj, min) ((ver)*10000 + (maj)*100 + (min)) +#endif + +static NSMutableDictionary* _referenceHistory = nil; +static CGPoint _lastTouchPosition = CGPointMake(0, 0); + +UIImage* NPFixOrientation(UIImage* image, BOOL isOpaque); + +#pragma mark - String operations + +char* NPCreateCStringFromNSString(NSString* nsString) +{ + if (nsString) + { + return (char*)[nsString UTF8String]; + } + + return nil; +} + +char* NPCreateCStringCopyFromNSString(NSString* nsString) +{ + if (nsString) + { + // create copy + const char* cString = [nsString UTF8String]; + char* copy = (char*)malloc(strlen(cString) + 1); + strcpy(copy, cString); + return copy; + } + + return nil; +} + +char* NPCreateCStringFromNSError(NSError* error) +{ + if (error) + { + return (char*)[[error localizedDescription] UTF8String]; + } + + return nil; +} + +NPError NPCreateError(int code, NSString* description) +{ + NPError error; + error.code = code; + error.description = (void*)[description UTF8String]; + return error; +} + +NPError NPCreateError(NSError* error) +{ + if (error) + { + return NPCreateError((int) error.code, error.localizedDescription); + } + else + { + return NPNullError(); + } +} + +NPError NPNullError() +{ + NPError error = {-1, NULL}; + return error; +} + + +char* NPCreateCStringCopyFromNSError(NSError* error) +{ + if (error) + { + return NPCreateCStringCopyFromNSString([error localizedDescription]); + } + + return nil; +} + +NSArray* NPCreateArrayOfNSString(const char** array, int length) +{ + if (array) + { + NSMutableArray* nativeArray = [NSMutableArray arrayWithCapacity:length]; + for (int iter = 0; iter < length; iter++) + { + const char* cValue = array[iter]; + [nativeArray addObject:[NSString stringWithUTF8String:cValue]]; + } + + return nativeArray; + } + + return nil; +} + +NSString* NPCreateNSStringFromCString(const char* cString) +{ + if (cString) + { + return [NSString stringWithUTF8String:cString]; + } + + return nil; +} + +NSURL* NPCreateNSURLFromCString(const char* cString) +{ + if (cString) + { + NSString* urlString = [NSString stringWithUTF8String:cString]; + return [NSURL URLWithString:urlString]; + } + + return nil; +} + +NPArray* NPCreateArrayOfCString(NSArray* array) +{ + if (array) + { + int length = (int)[array count]; + NPArray* nativeArray = new NPArray(length); + for (int iter = 0; iter < length; iter++) + { + const char* item = [[array objectAtIndex:iter] UTF8String]; + nativeArray->setObjectAtIndex(iter, (void*)item); + } + + return nativeArray; + } + else + { + return new NPArray(-1); + } +} + +NSString* NPConvertDataToHexString(NSData* data) +{ + NSUInteger len = data.length; + if (len == 0) + { + return nil; + } + + const unsigned char* buffer = (const unsigned char*)[data bytes]; + NSMutableString* hexString = [NSMutableString stringWithCapacity:(len * 2)]; + for (int i = 0; i < len; ++i) + { + [hexString appendFormat:@"%02x", buffer[i]]; + } + return [hexString copy]; +} + +NSString* NPExtractTokenFromNSData(id token) +{ + if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"13")) + { + return NPConvertDataToHexString(token); + } + else + { + NSString* tokenStr = [token description]; + tokenStr = [tokenStr stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]]; + tokenStr = [tokenStr stringByReplacingOccurrencesOfString:@" " withString:@""]; + return tokenStr; + } +} + +#pragma mark - Array operations + +NPArray* NPCreateNativeArrayFromNSArray(NSArray* array) +{ + //It's not possible to create an empty array (with no elements) with calloc/malloc and in that place need to use null. But it beats the purpose as there can be empty arrays. So better to use NPArrayWrapper which is not a dynamic struct in those cases. + //Note on managed side, Length with zero is different from Length with -1. Length with zero means empty collection, where as length with -1 means no array exists. + if (array)// && [array count] > 0 + { + int length = (int)[array count]; + NPArray* nativeArray = new NPArray(length); + + for (int iter = 0; iter < length; iter++) + { + if([array[iter] isKindOfClass:[NSValue class]]) + { + NSValue *value = (NSValue*)array[iter]; + nativeArray->setObjectAtIndex(iter, value.pointerValue); + } + else + { + nativeArray->setObjectAtIndex(iter, (__bridge void*)array[iter]); + } + } + + return nativeArray; + } + else + { + return new NPArray(-1); + } +} + +#pragma mark - Image operations + +NSData* NPEncodeImageAsData(UIImage* image, UIImageEncodeType encodeType) +{ + switch (encodeType) + { + case UIImageEncodeTypePNG: + return UIImagePNGRepresentation(NPFixOrientation(image, false)); + + case UIImageEncodeTypeJPEG: + return UIImageJPEGRepresentation(NPFixOrientation(image, true), 1); + + default: + return nil; + } +} + +UIImage* NPFixOrientation(UIImage* image, bool isOpaque) //This is used as unity fails to consider exif flags for jpegs and also UIImageRepresentation fails to save orientation info when saved in png format. One shot - Two birds :D +{ + if (image.imageOrientation == UIImageOrientationUp) return image; + CGSize size = image.size; + float scale = image.scale; + + UIGraphicsBeginImageContextWithOptions(size, isOpaque, scale); + [image drawInRect:(CGRect){0, 0, size}]; + UIImage *orientedImage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return orientedImage; +} + +UIImage* NPCaptureScreenshotAsImage() +{ + UIView* glView = UnityGetGLView(); + CGRect bounds = glView.bounds; + + // write contents of view to context and create image using it + UIGraphicsBeginImageContextWithOptions(bounds.size, YES, 0.0); + [glView drawViewHierarchyInRect:bounds afterScreenUpdates:YES]; + UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + return image; +} + +NSData* NPCaptureScreenshotAsData(UIImageEncodeType encodeType) +{ + switch (encodeType) + { + case UIImageEncodeTypePNG: + return UIImagePNGRepresentation(NPCaptureScreenshotAsImage()); + + case UIImageEncodeTypeJPEG: + return UIImageJPEGRepresentation(NPCaptureScreenshotAsImage(), 1); + + default: + return nil; + } +} + +UIImage* NPCreateImage(void* dataArrayPtr, int dataLength) +{ + NSData* data = [NSData dataWithBytes:dataArrayPtr length:dataLength]; + return [UIImage imageWithData:data]; +} + +UIImage* LoadImageFromResources(NSString* name, NSString* extension) +{ +#if UNITY_VERSION < MAKE_UNITY_VERSION(2019,3,0) + return [UIImage imageNamed:[NSString stringWithFormat:@"%@.%@", name, extension]]; +#else + NSBundle* bundle = [NSBundle bundleForClass:[UnityView class]]; + NSString* resourcePath = [bundle pathForResource:name ofType:extension]; + return [UIImage imageWithContentsOfFile:resourcePath]; +#endif +} + +#pragma mark - Converter operations + +NSString* NPConvertMimeTypeToUTType(NSString* mimeType) +{ + if ([mimeType isEqualToString:kMimeTypePNG]) + { + return (NSString*)kUTTypePNG; + } + if ([mimeType isEqualToString:kMimeTypeJPG]) + { + return (NSString*)kUTTypeJPEG; + } + + return NULL; +} + +#pragma mark - JSON utility methods + +NSString* NPToJson(id object, NSError** error) +{ + if (object) + { + NSData* jsonData = [NSJSONSerialization dataWithJSONObject:object + options:0 + error:error]; + + if (*error == nil) + { + return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; + } + } + + return nil; +} + +id NPFromJson(NSString* jsonString, NSError** error) +{ + if (jsonString) + { + NSData* jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; + if (jsonData) + { + id object = [NSJSONSerialization JSONObjectWithData:jsonData + options:0 + error:error]; + if (*error == nil) + { + return object; + } + } + } + + return nil; +} + +#pragma mark - Formatters + +static NSNumberFormatter* _billingPriceFormatter = nil; +NSNumberFormatter* NPGetBillingPriceFormatter(NSLocale* locale) +{ + static dispatch_once_t sharedBlock; + dispatch_once(&sharedBlock, ^{ + NSNumberFormatter* priceFormatter = [[NSNumberFormatter alloc] init]; + [priceFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4]; + [priceFormatter setNumberStyle:NSNumberFormatterCurrencyStyle]; + [priceFormatter setLocale:locale]; + + // store reference + _billingPriceFormatter = priceFormatter; + }); + + return _billingPriceFormatter; +} + +static NSDateFormatter* _dateFormatter = nil; +NSDateFormatter* GetDateFormatter() +{ + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; + [dateFormatter setLocale:[NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"]]; + [dateFormatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]]; + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss Z"]; + + // save reference + _dateFormatter = dateFormatter; + }); + + return _dateFormatter; +} + +NSString* NPCreateNSStringFromNSDate(NSDate* date) +{ + if (date) + { + __weak NSDateFormatter* dateFormatter = GetDateFormatter(); + return [dateFormatter stringFromDate:date]; + } + + return nil; +} + +NSDate* NPCreateNSDateFromNSString(NSString* dateStr) +{ + if (dateStr) + { + __weak NSDateFormatter* dateFormatter = GetDateFormatter(); + return [dateFormatter dateFromString:dateStr]; + } + + return nil; +} + +#pragma mark - Rect functions + +CGFloat GetStatusBarHeight() +{ + UIApplication* sharedApplication = [UIApplication sharedApplication]; + if (![sharedApplication isStatusBarHidden]) + { + CGRect statusBarFrame = [sharedApplication statusBarFrame]; + return statusBarFrame.size.height; + } + + return 0; +} + +CGPoint GetLastTouchPosition() +{ + return _lastTouchPosition; +} + +void SetLastTouchPosition(CGPoint position) +{ + _lastTouchPosition = position; +} + +CGRect NPConvertScreenSpaceRectToNormalisedRect(CGRect frame) +{ + CGRect screenBounds = [[UIScreen mainScreen] bounds]; + // convert frame to normalised rect + CGRect normalisedRect; + normalisedRect.origin.x = (CGRectGetMinX(frame) - CGRectGetMinX(screenBounds)) / CGRectGetWidth(screenBounds); + normalisedRect.origin.y = (CGRectGetMinY(frame) - CGRectGetMinY(screenBounds)) / CGRectGetHeight(screenBounds); + normalisedRect.size.width = CGRectGetWidth(frame) / CGRectGetWidth(screenBounds); + normalisedRect.size.height = CGRectGetHeight(frame) / CGRectGetHeight(screenBounds); + + return normalisedRect; +} + +CGRect NPConvertNormalisedRectToScreenSpaceRect(CGRect normalisedRect) +{ + CGRect screenBounds = [[UIScreen mainScreen] bounds]; + // calculate frame + CGRect newFrame; + newFrame.origin.x = (CGRectGetMinX(normalisedRect) * CGRectGetWidth(screenBounds)) + CGRectGetMinX(screenBounds); + newFrame.origin.y = (CGRectGetMinY(normalisedRect) * CGRectGetHeight(screenBounds)) + CGRectGetMinY(screenBounds); + newFrame.size.width = CGRectGetWidth(normalisedRect) * CGRectGetWidth(screenBounds); + newFrame.size.height = CGRectGetHeight(normalisedRect) * CGRectGetHeight(screenBounds); + + return newFrame; +} + +NPUnityRect NPRectMake(CGRect rect) +{ + NPUnityRect npRect; + npRect.x = rect.origin.x; + npRect.y = rect.origin.y; + npRect.width = rect.size.width; + npRect.height = rect.size.height; + + return npRect; +} + +CGPoint NPConverToNativePosition(float posX, float posY) +{ + float contentScale = [[UIScreen mainScreen] scale]; + return CGPointMake(posX / contentScale, posY / contentScale); +} + +#pragma mark - Color methods + +NPUnityColor NPColorMake(float r, float g, float b, float a) +{ + NPUnityColor npColor; + npColor.r = r; + npColor.g = g; + npColor.b = b; + npColor.a = a; + return npColor; +} + +NPUnityColor NPColorCreateFromUIColor(UIColor* color) +{ + CGFloat r, g, b, a; + [color getRed:&r green:&g blue:&b alpha:&a]; + return NPColorMake((float)r, (float)g , (float)b, (float)a); +} + +#pragma mark - Converter methods + +NSString* NPGetTextEncodingName(NPUnityTextEncodingFormat format) +{ + if ([format isEqualToString:NPUnityTextEncodingFormatUTF8]) + { + return @"utf-8"; + } + if ([format isEqualToString:NPUnityTextEncodingFormatUTF16]) + { + return @"utf-16"; + } + if ([format isEqualToString:NPUnityTextEncodingFormatUTF32]) + { + return @"utf-32"; + } + + return nil; +} + +NPSize NPCreateSizeFromCGSize(CGSize size) +{ + NPSize npSize; + npSize.width = size.width; + npSize.height = size.height; + + return npSize; +} + +#pragma mark - Reference management methods + +void AddObjectReference(void* object, bool* isNew) +{ + // ensure that collection object is valid + if (_referenceHistory == nil) + { + _referenceHistory = [NSMutableDictionary dictionary]; + } + + // add object to collection + id key = [NSValue valueWithPointer:(const void*)object]; + NSNumber* value = [_referenceHistory objectForKey:key]; + if (value == nil) + { + [_referenceHistory setObject:[NSNumber numberWithInt:1] forKey:key]; + *isNew = true; + } + else + { + [_referenceHistory setObject:[NSNumber numberWithInt:[value intValue] + 1] forKey:key]; + *isNew = false; + } +} + +void* NPRetainWithOwnershipTransfer(id object) +{ + void* objectPtr; + bool isNew; + AddObjectReference((__bridge void*)object, &isNew); + if (isNew) + { + objectPtr = (void*)CFBridgingRetain(object); + } + else + { + objectPtr = (void*)CFRetain((__bridge CFTypeRef)object); + } + +#if NATIVE_PLUGINS_DEBUG_ENABLED + NSLog(@"[NativePlugins] Retaining ownership for pointer %@.", objectPtr); +#endif + + return objectPtr; +} + +void* NPRetain(void* objectPtr) +{ + return NPRetainWithOwnershipTransfer((__bridge id)objectPtr); +} + +void NPRelease(void* objectPtr) +{ + if (_referenceHistory == nil) + { +#if NATIVE_PLUGINS_DEBUG_ENABLED + NSLog(@"[NativePlugins] Fatal error! Collection object is not initialised. It seems like Release is called, before retain."); +#endif + return; + } + + id key = [NSValue valueWithPointer:(const void*)objectPtr]; + NSNumber* value = [_referenceHistory objectForKey:key]; + if (value == nil) + { +#if NATIVE_PLUGINS_DEBUG_ENABLED + NSLog(@"[NativePlugins] Fatal error! Object not found. It seems like Release is called, before retain."); +#endif + return; + } + + // check value + if ([value intValue] == 1) + { +#if NATIVE_PLUGINS_DEBUG_ENABLED + NSLog(@"[NativePlugins] Release object ownership for pointer %@.", objectPtr); +#endif + CFBridgingRelease(objectPtr); + [_referenceHistory removeObjectForKey:key]; + return; + } + + // update reference table + CFRelease(objectPtr); + [_referenceHistory setObject:[NSNumber numberWithInt:[value intValue] - 1] forKey:key]; +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPBindingHelper.mm.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPBindingHelper.mm.meta new file mode 100644 index 00000000..c38ca32a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPBindingHelper.mm.meta @@ -0,0 +1,50 @@ +fileFormatVersion: 2 +guid: a7e81a6e20d054aeb8d3da56a68291ec +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPConfig.h b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPConfig.h new file mode 100644 index 00000000..172fd677 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPConfig.h @@ -0,0 +1,7 @@ +// NPConfig.h// Native Plugins//// Created by Ashwin kumar// Copyright (c) 2024 Voxel Busters Interactive LLP. All rights reserved.// + +#pragma once + +#define NATIVE_PLUGINS_USES_DEEP_LINK 1 +#define NATIVE_PLUGINS_USES_NOTIFICATION 1 +#define NATIVE_PLUGINS_USES_PUSH_NOTIFICATION 1 diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPConfig.h.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPConfig.h.meta new file mode 100644 index 00000000..952ce297 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPConfig.h.meta @@ -0,0 +1,50 @@ +fileFormatVersion: 2 +guid: 111af326d79b34f52a5199aa000f56e5 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPDefines.h b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPDefines.h new file mode 100644 index 00000000..807b0b1f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPDefines.h @@ -0,0 +1,31 @@ +// +// NPDefines.h +// Native Plugins +// +// Created by Ashwin kumar on 22/01/19. +// Copyright (c) 2019 Voxel Busters Interactive LLP. All rights reserved. +// + +#pragma once + +#define NPBINDING extern "C" __attribute__((visibility ("default"))) +#define DONTSTRIP __attribute__((used)) +#define NPIntPtr void* +#define NPString char* + +#ifdef DEBUG + #define NPLog(fmt, ...) NSLog((fmt), ##__VA_ARGS__) +#else + #define NPLog(fmt, ...) +#endif + +#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) +#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) +#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) +#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) +#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) + +#define IsIpadInterface (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) + +static NSString* const kMimeTypeJPG = @"image/jpeg"; +static NSString* const kMimeTypePNG = @"image/png"; diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPDefines.h.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPDefines.h.meta new file mode 100644 index 00000000..70087607 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPDefines.h.meta @@ -0,0 +1,50 @@ +fileFormatVersion: 2 +guid: b55094604645d46369df45927a004790 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPKit.h b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPKit.h new file mode 100644 index 00000000..71652aa1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPKit.h @@ -0,0 +1,14 @@ +// +// NPKit.h +// Native Plugins +// +// Created by Ashwin kumar on 22/01/19. +// Copyright (c) 2019 Voxel Busters Interactive LLP. All rights reserved. +// + +#pragma once + +#import "NPDefines.h" +#import "NPUnityDataTypes.h" +#import "NPBindingHelper.h" +#import "NPConfig.h" diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPKit.h.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPKit.h.meta new file mode 100644 index 00000000..ef0e2d72 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPKit.h.meta @@ -0,0 +1,50 @@ +fileFormatVersion: 2 +guid: 8409ff84ada1e44f1b6788a198a41df9 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPListenerWrapperBase.h b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPListenerWrapperBase.h new file mode 100644 index 00000000..68753c6f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPListenerWrapperBase.h @@ -0,0 +1,17 @@ +// +// ListenerWrapperBase.h +// Unity-iPhone +// +// Created by Ayyappa J on 06/10/22. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NPListenerWrapperBase : NSObject +@property (nonatomic, assign) void* tag; +-(id) initWithTag:(void*) tag; +@end + +NS_ASSUME_NONNULL_END diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPListenerWrapperBase.h.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPListenerWrapperBase.h.meta new file mode 100644 index 00000000..186c6048 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPListenerWrapperBase.h.meta @@ -0,0 +1,42 @@ +fileFormatVersion: 2 +guid: c7966ae9023d34fcb9980b8ea50cc136 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPListenerWrapperBase.mm b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPListenerWrapperBase.mm new file mode 100644 index 00000000..c8ec1bf8 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPListenerWrapperBase.mm @@ -0,0 +1,20 @@ +// +// ListenerWrapperBase.m +// Unity-iPhone +// +// Created by Ayyappa J on 06/10/22. +// + +#import "NPListenerWrapperBase.h" + +@implementation NPListenerWrapperBase +@synthesize tag; + +-(id) initWithTag:(void*) tag +{ + self = [super init]; + self.tag = tag; + + return self; +} +@end diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPListenerWrapperBase.mm.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPListenerWrapperBase.mm.meta new file mode 100644 index 00000000..4354886a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPListenerWrapperBase.mm.meta @@ -0,0 +1,52 @@ +fileFormatVersion: 2 +guid: 84af00a4bcd9e4023a5c0a7befd8f55a +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 0 + settings: {} + - first: + tvOS: tvOS + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPManagedPointerCache.h b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPManagedPointerCache.h new file mode 100644 index 00000000..97c2c03a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPManagedPointerCache.h @@ -0,0 +1,19 @@ +// +// NPManagedPointerCache.h +// Native Plugins +// +// Created by Ashwin kumar on 22/01/19. +// Copyright (c) 2019 Voxel Busters Interactive LLP. All rights reserved. +// + +#import + +@interface NPManagedPointerCache : NSObject + ++ (NPManagedPointerCache*)sharedInstance; + +- (void)addPointer:(void*)pointer forKey:(id)object; +- (void*)pointerForKey:(id)object; +- (void)removePointerForKey:(id)object; + +@end diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPManagedPointerCache.h.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPManagedPointerCache.h.meta new file mode 100644 index 00000000..c0eb986c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPManagedPointerCache.h.meta @@ -0,0 +1,45 @@ +fileFormatVersion: 2 +guid: c6bd0f922b07841d0aa8c938322f23a1 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPManagedPointerCache.mm b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPManagedPointerCache.mm new file mode 100644 index 00000000..cb073814 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPManagedPointerCache.mm @@ -0,0 +1,62 @@ +// +// NPManagedPointerCache.mm +// Native Plugins +// +// Created by Ashwin kumar on 22/01/19. +// Copyright (c) 2019 Voxel Busters Interactive LLP. All rights reserved. +// + +#import "NPManagedPointerCache.h" + +// static fields +static NPManagedPointerCache* _sharedInstance = nil; + +@interface NPManagedPointerCache () + +@property(nonatomic, strong) NSMutableDictionary* tagCollection; + +@end + +@implementation NPManagedPointerCache + +@synthesize tagCollection = _tagCollection; + ++ (NPManagedPointerCache*)sharedInstance +{ + if (nil == _sharedInstance) + { + _sharedInstance = [[NPManagedPointerCache alloc] init]; + } + + return _sharedInstance; +} + +- (id)init +{ + self = [super init]; + if (self) + { + // initialise + self.tagCollection = [[NSMutableDictionary alloc] init]; + } + + return self; +} + +- (void)addPointer:(void*)pointer forKey:(id)object +{ + [self.tagCollection setObject:[NSValue valueWithPointer:pointer] forKey:[NSValue valueWithNonretainedObject:object]]; +} + +- (void*)pointerForKey:(id)object +{ + NSValue* value = [self.tagCollection objectForKey:[NSValue valueWithNonretainedObject:object]]; + return [value pointerValue]; +} + +- (void)removePointerForKey:(id)object +{ + [self.tagCollection removeObjectForKey:[NSValue valueWithNonretainedObject:object]]; +} + +@end diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPManagedPointerCache.mm.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPManagedPointerCache.mm.meta new file mode 100644 index 00000000..b0493451 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPManagedPointerCache.mm.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 4bb0042cbd61f4e139d3c15785897351 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 0 + settings: {} + - first: + tvOS: tvOS + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityAppController.h b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityAppController.h new file mode 100644 index 00000000..63e292de --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityAppController.h @@ -0,0 +1,29 @@ +// +// NPUnityAppController.h +// Unity-iPhone +// +// Created by Ashwin Kumar on 09/04/20. +// + +#import +#import "AppDelegateListener.h" +#import "UnityAppController.h" +#include "NPConfig.h" + +#if NATIVE_PLUGINS_USES_DEEP_LINK +// callback signatures +typedef bool (*HandleUrlSchemeCallback)(const char* url); +typedef bool (*HandleUniversalLinkCallback)(const char* url); +#endif + +@interface NPUnityAppController : UnityAppController + +#if NATIVE_PLUGINS_USES_DEEP_LINK +// set handlers methods ++ (void)registerUrlSchemeHandler:(HandleUrlSchemeCallback)callback; ++ (void)registerUniversalLinkHandler:(HandleUniversalLinkCallback)callback; + +- (void)initDeepLinkServices; +#endif + +@end diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityAppController.h.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityAppController.h.meta new file mode 100644 index 00000000..be6a1964 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityAppController.h.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: dbaa49345a0bb4952aa88a1ff50f3929 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXIntel + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: OSXIntel64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + - first: + tvOS: tvOS + second: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityAppController.mm b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityAppController.mm new file mode 100644 index 00000000..386483b0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityAppController.mm @@ -0,0 +1,145 @@ +// +// NPUnityAppController.mm +// Unity-iPhone +// +// Created by Ashwin Kumar on 09/04/20. +// + +#import "NPUnityAppController.h" +#import "NPKit.h" + +#if NATIVE_PLUGINS_USES_DEEP_LINK +static HandleUrlSchemeCallback _handleUrlSchemeCallback = nil; +static HandleUniversalLinkCallback _handleUniversalLinkCallback = nil; +#endif + +@interface NPUnityAppController () + +#if NATIVE_PLUGINS_USES_DEEP_LINK +@property(nonatomic) bool isDeepLinkServiceInitialised; +@property(nonatomic, copy) NSURL* cachedUrlScheme; +@property(nonatomic, copy) NSURL* cachedUniversalLink; +#endif + +@end + +@implementation NPUnityAppController + +#if NATIVE_PLUGINS_USES_DEEP_LINK +@synthesize isDeepLinkServiceInitialised = _isDeepLinkServiceInitialised; +@synthesize cachedUrlScheme = _cachedUrlScheme; +@synthesize cachedUniversalLink = _cachedUniversalLink; +#endif + +#pragma mark - Static methods + +#if NATIVE_PLUGINS_USES_DEEP_LINK ++ (void)registerUrlSchemeHandler:(HandleUrlSchemeCallback)callback; +{ + _handleUrlSchemeCallback = callback; +} + ++ (void)registerUniversalLinkHandler:(HandleUniversalLinkCallback)callback +{ + _handleUniversalLinkCallback = callback; +} + +- (void)initDeepLinkServices +{ + // update status + self.isDeepLinkServiceInitialised = true; + + // dispatch events + if (self.cachedUrlScheme) + { + [self handleUrlScheme:self.cachedUrlScheme]; + self.cachedUrlScheme = nil; + } + if (self.cachedUniversalLink) + { + [self handleUniversalLink:self.cachedUniversalLink]; + self.cachedUniversalLink = nil; + } +} + +- (bool)handleUrlScheme:(NSURL*)url +{ + if (_handleUrlSchemeCallback != nil) + { + return _handleUrlSchemeCallback(NPCreateCStringFromNSString([url absoluteString])); + } + + return false; +} + +- (bool)handleUniversalLink:(NSURL*)url +{ + if (_handleUniversalLinkCallback != nil) + { + return _handleUniversalLinkCallback(NPCreateCStringFromNSString([url absoluteString])); + } + + return false; +} + +- (BOOL)application:(UIApplication*)application openURL:(NSURL*)url options:(NSDictionary *)options +{ + // forward callback to parent class + bool originalResult = false; + if ([super respondsToSelector:@selector(application:openURL:options:)]) + { + originalResult = [super application:application openURL:url options:options]; + } + else if ([super respondsToSelector:@selector(application:openURL:sourceApplication:annotation:)]) + { + NSString* sourceApplication = options[UIApplicationOpenURLOptionsSourceApplicationKey]; + originalResult = [super application:application openURL:url sourceApplication:sourceApplication annotation:[NSDictionary dictionary]]; + } + + // check the availability of the service and process the incoming request + // store the event information for later usage incase if the service is not active + if (self.isDeepLinkServiceInitialised) + { + return [self handleUrlScheme:url]; + } + self.cachedUrlScheme = url; + + return originalResult; +} + +- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray> * __nullable restorableObjects))restorationHandler +{ + // forward callback to parent class + bool originalResult = false; + if ([super respondsToSelector:@selector(application:continueUserActivity:restorationHandler:)]) + { + originalResult = [super application:application continueUserActivity:userActivity restorationHandler:restorationHandler]; + } + + // check whether this event is concerned with web activity + if ([userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb]) + { + NSURL* url = userActivity.webpageURL; + if (url) + { + // check whether the embedded link can be handled by our application + // store the event information for later usage incase if the service is not active + if (self.isDeepLinkServiceInitialised) + { + return [self handleUniversalLink:url]; + } + + self.cachedUniversalLink = url; + } + } + + return originalResult; +} +#endif + +@end + +#if NATIVE_PLUGINS_USES_DEEP_LINK +// inform Unity to use UnityDeeplinksAppController as the main app controller: +IMPL_APP_CONTROLLER_SUBCLASS(NPUnityAppController) +#endif diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityAppController.mm.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityAppController.mm.meta new file mode 100644 index 00000000..d7c4374a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityAppController.mm.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 8b43456b3fd58411da7aef01d9b2c028 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 0 + settings: {} + - first: + tvOS: tvOS + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDataTypes.h b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDataTypes.h new file mode 100644 index 00000000..525ca99b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDataTypes.h @@ -0,0 +1,108 @@ +// +// NPUnityDataTypes.h +// Native Plugins +// +// Created by Ashwin kumar on 22/01/19. +// Copyright (c) 2019 Voxel Busters Interactive LLP. All rights reserved. +// + +#include "NPDefines.h" +#include "NPUnityDateComponents.h" + +typedef enum : NSInteger +{ + UIImageEncodeTypePNG, + UIImageEncodeTypeJPEG, +} UIImageEncodeType; + +struct NPUnityCircularRegion +{ + double latitude; + double longitude; + float radius; + NPIntPtr regionIdPtr; +}; +typedef struct NPUnityCircularRegion NPUnityCircularRegion; + +struct NPUnityAttachment +{ + int dataArrayLength; + NPIntPtr dataArrayPtr; + NPIntPtr mimeTypePtr; + NPIntPtr fileNamePtr; +}; +typedef struct NPUnityAttachment NPUnityAttachment; + +struct NPUnityRect +{ + float x; + float y; + float width; + float height; +}; +typedef struct NPUnityRect NPUnityRect; + +struct NPUnityColor +{ + float r; + float g; + float b; + float a; +}; +typedef struct NPUnityColor NPUnityColor; + +struct NPArray +{ + NPIntPtr* ptr; + int length; + + // constructors + NPArray(int length); + ~NPArray(); + + // methods + void setObjectAtIndex(int index, void* obj); +}; +typedef struct NPArray NPArray; + +// For multi dimentional array +struct NPArrayProxy +{ + NPIntPtr* ptr; + int length; +}; +typedef struct NPArrayProxy NPArrayProxy; + +// If allocation is continous use this. +struct NPArrayWrapper +{ + NPIntPtr ptr; + int length; +}; +typedef struct NPArrayWrapper NPArrayWrapper; + + +struct NPError +{ + int code; + NPIntPtr description; +}; +typedef struct NPError NPError; + +struct NPSize +{ + float width; + float height; +}; +typedef struct NPSize NPSize; + +typedef NSString* NPUnityTextEncodingFormat NS_EXTENSIBLE_STRING_ENUM; + +/// Encodes characters using the UTF-8 encoding. (Readonly) +FOUNDATION_EXPORT NPUnityTextEncodingFormat const NPUnityTextEncodingFormatUTF8; + +/// Encodes characters using the UTF-16 encoding. (Readonly) +FOUNDATION_EXPORT NPUnityTextEncodingFormat const NPUnityTextEncodingFormatUTF16; + +/// Encodes characters using the UTF-32 encoding. (Readonly) +FOUNDATION_EXPORT NPUnityTextEncodingFormat const NPUnityTextEncodingFormatUTF32; diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDataTypes.h.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDataTypes.h.meta new file mode 100644 index 00000000..b2f7f3ee --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDataTypes.h.meta @@ -0,0 +1,50 @@ +fileFormatVersion: 2 +guid: c31d4b2bdd80c401ebe8fc9523ea61a1 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDataTypes.mm b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDataTypes.mm new file mode 100644 index 00000000..3091f08c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDataTypes.mm @@ -0,0 +1,34 @@ +// +// NPUnityDataTypes.mm +// Native Plugins +// +// Created by Ashwin kumar on 22/01/19. +// Copyright (c) 2019 Voxel Busters Interactive LLP. All rights reserved. +// + +#import "NPUnityDataTypes.h" + +NPUnityTextEncodingFormat const NPUnityTextEncodingFormatUTF8 = @"utf8"; + +/// Encodes characters using the UTF-16 encoding. (Readonly) +NPUnityTextEncodingFormat const NPUnityTextEncodingFormatUTF16 = @"utf16"; + +/// Encodes characters using the UTF-32 encoding. (Readonly) +NPUnityTextEncodingFormat const NPUnityTextEncodingFormatUTF32 = @"utf32"; + + +NPArray::NPArray(int length) +{ + this->length = length; + this->ptr = length > 0 ? (void**)calloc(length, sizeof(void*)) : nil; +} + +NPArray::~NPArray() +{ + free(ptr); +} + +void NPArray::setObjectAtIndex(int index, void* obj) +{ + this->ptr[index] = obj; +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDataTypes.mm.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDataTypes.mm.meta new file mode 100644 index 00000000..a7d156d0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDataTypes.mm.meta @@ -0,0 +1,50 @@ +fileFormatVersion: 2 +guid: 4acef6bf79cc04dc7a3bba82caeb1850 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDateComponents.h b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDateComponents.h new file mode 100644 index 00000000..e62343da --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDateComponents.h @@ -0,0 +1,53 @@ +// +// NPUnityDateComponents.h +// Native Plugins +// +// Created by Ashwin kumar on 22/01/19. +// Copyright (c) 2019 Voxel Busters Interactive LLP. All rights reserved. +// + +// custom types +typedef enum : int +{ + CalendarGregorian, + CalendarBuddhist = 1, + CalendarChinese, + CalendarCoptic, + CalendarEthiopicAmeteMihret, + CalendarEthiopicAmeteAlem, + CalendarIso8601, + CalendarHebrew, + CalendarIndian, + CalendarIslamic, + CalendarIslamicCivil, + CalendarJapanese, + CalendarPersian, + CalendarRepublicOfChina, + CalendarIslamicTabular, + CalendarIslamicUmmAlQura, +} Calendar; + +// methods +NSCalendarIdentifier NPGetCalendarIdentifier(Calendar calendar); +Calendar NPGetCalendarEnum(NSCalendarIdentifier identifier); + +struct NPUnityDateComponents +{ + // fields + Calendar calendar; + long year; + long month; + long day; + long hour; + long minute; + long second; + long nanosecond; + long weekday; + long weekOfMonth; + long weekOfYear; + + // methods + void CopyProperties(NSDateComponents* dateComponents); + NSDateComponents* ToNSDateComponents(); +}; +typedef struct NPUnityDateComponents NPUnityDateComponents; diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDateComponents.h.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDateComponents.h.meta new file mode 100644 index 00000000..1d16ec29 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDateComponents.h.meta @@ -0,0 +1,50 @@ +fileFormatVersion: 2 +guid: 219d6b45352964a8ea2056d454a085cd +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDateComponents.mm b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDateComponents.mm new file mode 100644 index 00000000..5bda7732 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDateComponents.mm @@ -0,0 +1,202 @@ +// +// NPUnityDateComponents.mm +// Native Plugins +// +// Created by Ashwin kumar on 22/01/19. +// Copyright (c) 2019 Voxel Busters Interactive LLP. All rights reserved. +// + +#import "NPUnityDateComponents.h" + +NSCalendarIdentifier NPGetCalendarIdentifier(Calendar calendar) +{ + switch (calendar) { + case CalendarBuddhist: + return NSCalendarIdentifierBuddhist; + + case CalendarChinese: + return NSCalendarIdentifierChinese; + + case CalendarCoptic: + return NSCalendarIdentifierCoptic; + + case CalendarEthiopicAmeteAlem: + return NSCalendarIdentifierEthiopicAmeteAlem; + + case CalendarEthiopicAmeteMihret: + return NSCalendarIdentifierEthiopicAmeteMihret; + + case CalendarGregorian: + return NSCalendarIdentifierGregorian; + + case CalendarHebrew: + return NSCalendarIdentifierHebrew; + + case CalendarIndian: + return NSCalendarIdentifierIndian; + + case CalendarIslamic: + return NSCalendarIdentifierIslamic; + + case CalendarIslamicCivil: + return NSCalendarIdentifierIslamicCivil; + + case CalendarIslamicTabular: + return NSCalendarIdentifierIslamicTabular; + + case CalendarIslamicUmmAlQura: + return NSCalendarIdentifierIslamicUmmAlQura; + + case CalendarIso8601: + return NSCalendarIdentifierISO8601; + + case CalendarJapanese: + return NSCalendarIdentifierJapanese; + + case CalendarPersian: + return NSCalendarIdentifierPersian; + + case CalendarRepublicOfChina: + return NSCalendarIdentifierRepublicOfChina; + + default: + break; + } +} + +Calendar NPGetCalendarEnum(NSCalendarIdentifier identifier) +{ + if ([identifier isEqualToString:NSCalendarIdentifierBuddhist]) + { + return CalendarBuddhist; + } + if ([identifier isEqualToString:NSCalendarIdentifierChinese]) + { + return CalendarChinese; + } + if ([identifier isEqualToString:NSCalendarIdentifierCoptic]) + { + return CalendarCoptic; + } + if ([identifier isEqualToString:NSCalendarIdentifierEthiopicAmeteAlem]) + { + return CalendarEthiopicAmeteAlem; + } + if ([identifier isEqualToString:NSCalendarIdentifierEthiopicAmeteMihret]) + { + return CalendarEthiopicAmeteMihret; + } + if ([identifier isEqualToString:NSCalendarIdentifierGregorian]) + { + return CalendarGregorian; + } + if ([identifier isEqualToString:NSCalendarIdentifierHebrew]) + { + return CalendarHebrew; + } + if ([identifier isEqualToString:NSCalendarIdentifierIndian]) + { + return CalendarIndian; + } + if ([identifier isEqualToString:NSCalendarIdentifierIslamic]) + { + return CalendarIslamic; + } + if ([identifier isEqualToString:NSCalendarIdentifierIslamicCivil]) + { + return CalendarIslamicCivil; + } + if ([identifier isEqualToString:NSCalendarIdentifierIslamicTabular]) + { + return CalendarIslamicTabular; + } + if ([identifier isEqualToString:NSCalendarIdentifierIslamicUmmAlQura]) + { + return CalendarIslamicUmmAlQura; + } + if ([identifier isEqualToString:NSCalendarIdentifierISO8601]) + { + return CalendarIso8601; + } + if ([identifier isEqualToString:NSCalendarIdentifierJapanese]) + { + return CalendarJapanese; + } + if ([identifier isEqualToString:NSCalendarIdentifierPersian]) + { + return CalendarPersian; + } + if ([identifier isEqualToString:NSCalendarIdentifierRepublicOfChina]) + { + return CalendarRepublicOfChina; + } + + return (Calendar)0; +} + +void NPUnityDateComponents::CopyProperties(NSDateComponents* dateComponents) +{ + this->calendar = NPGetCalendarEnum([[dateComponents calendar] calendarIdentifier]); + this->year = [dateComponents year]; + this->month = [dateComponents month]; + this->day = [dateComponents day]; + this->hour = [dateComponents hour]; + this->minute = [dateComponents minute]; + this->second = [dateComponents second]; + this->nanosecond = [dateComponents nanosecond]; + this->weekday = [dateComponents weekday] == 1 ? 7 : [dateComponents weekday] - 1; //Converting from 1(SUNDAY) to 7(SATURDAY) => 1(MONDAY) to 7(SUNDAY) + this->weekOfMonth = [dateComponents weekOfMonth]; + this->weekOfYear = [dateComponents weekOfYear]; +} + +NSDateComponents* NPUnityDateComponents::ToNSDateComponents() +{ + NSDateComponents* dateComponents = [[NSDateComponents alloc] init]; + if ((int)calendar != 0) + { + NSCalendar* nsCalendar = [NSCalendar calendarWithIdentifier:NPGetCalendarIdentifier(this->calendar)]; + [dateComponents setCalendar:nsCalendar]; + } + if (this->year != -1) + { + [dateComponents setYear:this->year]; + } + if (this->month != -1) + { + [dateComponents setMonth:this->month]; + } + if (this->day != -1) + { + [dateComponents setDay:this->day]; + } + if (this->hour != -1) + { + [dateComponents setHour:this->hour]; + } + if (this->minute != -1) + { + [dateComponents setMinute:this->minute]; + } + if (this->second != -1) + { + [dateComponents setSecond:this->second]; + } + if (this->nanosecond != -1) + { + [dateComponents setNanosecond:this->nanosecond]; + } + if (this->weekday != -1) + { + [dateComponents setWeekday: (this->weekday == 7) ? 1 : this->weekday + 1]; //Input will be from 1(MONDAY) to 7(SUNDAY) => 1(SUNDAY) to 7(SATURDAY) + } + if (this->weekOfMonth != -1) + { + [dateComponents setWeekOfMonth:this->weekOfMonth]; + } + if (this->weekOfYear != -1) + { + [dateComponents setWeekOfYear:this->weekOfYear]; + } + + return dateComponents; +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDateComponents.mm.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDateComponents.mm.meta new file mode 100644 index 00000000..64633353 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUnityDateComponents.mm.meta @@ -0,0 +1,50 @@ +fileFormatVersion: 2 +guid: f5c5940323677482483e2cb8491a103c +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUtilityBinding.h b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUtilityBinding.h new file mode 100644 index 00000000..df0bdfd7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUtilityBinding.h @@ -0,0 +1,13 @@ +// +// NPUtilityBinding.h +// Native Plugins +// +// Created by Ashwin kumar on 22/01/19. +// Copyright (c) 2019 Voxel Busters Interactive LLP. All rights reserved. +// + +#import +#import + +// callback signatures +typedef void (*LoadImageNativeCallback)(void* dataArrayPtr, int dataLength, void* tagPtr); diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUtilityBinding.h.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUtilityBinding.h.meta new file mode 100644 index 00000000..e91a9e2a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUtilityBinding.h.meta @@ -0,0 +1,42 @@ +fileFormatVersion: 2 +guid: 3db404738ff284021b9dbdad3253c02c +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUtilityBinding.mm b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUtilityBinding.mm new file mode 100644 index 00000000..f0722974 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUtilityBinding.mm @@ -0,0 +1,78 @@ +// +// NPUtilityBinding.mm +// Native Plugins +// +// Created by Ashwin kumar on 22/01/19. +// Copyright (c) 2019 Voxel Busters Interactive LLP. All rights reserved. +// + +#import "NPUtilityBinding.h" +#import "NPKit.h" + +// static fields +static LoadImageNativeCallback _loadImageCallback = nil; + +#pragma mark - Utility methods + +void LoadTextureData(NSData* imageData, void* tagPtr) +{ + if (imageData) + { + _loadImageCallback((void *)[imageData bytes], (int)[imageData length], tagPtr); + } + else + { + _loadImageCallback(nil, 0, tagPtr); + } +} + +#pragma mark - Native binding methods + +NPBINDING DONTSTRIP void NPUtilityRegisterCallbacks(LoadImageNativeCallback loadImageCallback) +{ + // cache + _loadImageCallback = loadImageCallback; +} + +NPBINDING DONTSTRIP void NPUtilityLoadImage(void* nativeDataPtr, void* tagPtr) +{ + NSData* imageData = (__bridge NSData*)nativeDataPtr; + LoadTextureData(imageData, tagPtr); +} + +NPBINDING DONTSTRIP void NPUtilityTakeScreenshot(void* tagPtr) +{ + NSData* imageData = NPCaptureScreenshotAsData(UIImageEncodeTypePNG); + LoadTextureData(imageData, tagPtr); +} + +NPBINDING DONTSTRIP void NPUtilityRetainObject(void* nativePtr) +{ + NPRetain(nativePtr); +} + +NPBINDING DONTSTRIP void NPUtilityReleaseObject(void* nativePtr) +{ + NPRelease(nativePtr); +} + +NPBINDING DONTSTRIP void NPUtilityOpenSettings() +{ + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] + options:@{} + completionHandler:^(BOOL success) { + // done + }]; +} + +NPBINDING DONTSTRIP void NPUtilityFreeCPointerObject(NPIntPtr nativePtr) +{ + free(nativePtr); +} + +NPBINDING DONTSTRIP void NPUtilitySetLastTouchPosition(float posX, float posY) +{ + SetLastTouchPosition(NPConverToNativePosition(posX, posY)); +} + + diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUtilityBinding.mm.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUtilityBinding.mm.meta new file mode 100644 index 00000000..e3989c9e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NPUtilityBinding.mm.meta @@ -0,0 +1,52 @@ +fileFormatVersion: 2 +guid: a93f083e6713d4ee598fe76e08d113ef +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 0 + settings: {} + - first: + tvOS: tvOS + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NSError+Utility.h b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NSError+Utility.h new file mode 100644 index 00000000..9d0bd9a0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NSError+Utility.h @@ -0,0 +1,25 @@ +// +// UIViewController+Presentation.h +// Native Plugins +// +// Created by Ashwin kumar on 22/01/19. +// Copyright (c) 2019 Voxel Busters Interactive LLP. All rights reserved. +// + +#import + + +#define ErrorWithDomain(domain, code, description) [NSError createWithDomain: domain withCode: code withDescription: description] +#define CreateFromError(error, domain, code) [NSError createFromError: error withDomain: domain withCode: code] + +@interface NSError (Utility) + ++ (NSError*)createWithDomain:(NSString*) domain + withCode:(int) code + withDescription:(NSString*) description; + ++ (NSError*)createFromError:(NSError*) error + withDomain:(NSString*) domain + withCode:(int) code; + +@end diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NSError+Utility.h.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NSError+Utility.h.meta new file mode 100644 index 00000000..f15798c0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NSError+Utility.h.meta @@ -0,0 +1,80 @@ +fileFormatVersion: 2 +guid: 233102e263301407dade7bf90c4afd9f +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NSError+Utility.mm b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NSError+Utility.mm new file mode 100644 index 00000000..d9d27001 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NSError+Utility.mm @@ -0,0 +1,36 @@ +// +// UIViewController+Presentation.mm +// Native Plugins +// +// Created by Ashwin kumar on 22/01/19. +// Copyright (c) 2019 Voxel Busters Interactive LLP. All rights reserved. +// + +#import "NSError+Utility.h" + +@implementation NSError (Utility) + ++ (NSError*)createWithDomain:(NSString*) domain + withCode:(int) code + withDescription:(NSString*) description +{ + NSError* error = [NSError errorWithDomain:domain + code:code + userInfo: @{NSLocalizedDescriptionKey: description}]; + return error; +} + + ++ (id)createFromError:(NSError*) error + withDomain:(NSString*) domain + withCode:(int) code +{ + if(error == nil) + return nil; + + return [self errorWithDomain:domain + code:code + userInfo: @{NSLocalizedDescriptionKey: error.description}]; +} + +@end diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NSError+Utility.mm.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NSError+Utility.mm.meta new file mode 100644 index 00000000..e4dc6487 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NSError+Utility.mm.meta @@ -0,0 +1,85 @@ +fileFormatVersion: 2 +guid: 0ce7faeacf6f44568914f19f8e007dcc +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + - first: + tvOS: tvOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NativePluginsBaseGroup.asset b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NativePluginsBaseGroup.asset new file mode 100644 index 00000000..0428c24b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NativePluginsBaseGroup.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8494aa9edfa214a818449f2dea39a05a, type: 3} + m_Name: NativePluginsBaseGroup + m_EditorClassIdentifier: + m_name: NativePluginsBase + m_usesNestedHeierarchy: 0 diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NativePluginsBaseGroup.asset.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NativePluginsBaseGroup.asset.meta new file mode 100644 index 00000000..93923ed7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/NativePluginsBaseGroup.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4702987cd52d14b4c8c5530706e3c833 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIView+LayoutConstraints.h b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIView+LayoutConstraints.h new file mode 100644 index 00000000..7af37ee7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIView+LayoutConstraints.h @@ -0,0 +1,16 @@ +// +// UIView+LayoutConstraints.h +// Native Plugins +// +// Created by Ashwin kumar on 22/01/19. +// Copyright (c) 2019 Voxel Busters Interactive LLP. All rights reserved. +// + +#import + +@interface UIView (LayoutConstraints) + +- (void)removeExistingConstraints; + +@end + diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIView+LayoutConstraints.h.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIView+LayoutConstraints.h.meta new file mode 100644 index 00000000..e2ab5d29 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIView+LayoutConstraints.h.meta @@ -0,0 +1,42 @@ +fileFormatVersion: 2 +guid: 397567c4cc95840b3a5eb33acd7a49be +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIView+LayoutConstraints.mm b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIView+LayoutConstraints.mm new file mode 100644 index 00000000..30f17762 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIView+LayoutConstraints.mm @@ -0,0 +1,27 @@ +// +// UIView+LayoutConstraints.mm +// Native Plugins +// +// Created by Ashwin kumar on 22/01/19. +// Copyright (c) 2019 Voxel Busters Interactive LLP. All rights reserved. +// + +#import "UIView+LayoutConstraints.h" + +@implementation UIView (LayoutConstraints) + +- (void)removeExistingConstraints +{ + __weak UIView* parentView = self.superview; + __weak UIView* view = self; + for (NSLayoutConstraint* constraint in parentView.constraints) + { + if (constraint.firstItem == view) + { + constraint.active = false; + [parentView removeConstraint:constraint]; + } + } +} + +@end diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIView+LayoutConstraints.mm.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIView+LayoutConstraints.mm.meta new file mode 100644 index 00000000..3a343bf7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIView+LayoutConstraints.mm.meta @@ -0,0 +1,115 @@ +fileFormatVersion: 2 +guid: 0760a008559634d1b98d2c80c2351f2b +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: OSXIntel + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: OSXIntel64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + - first: + tvOS: tvOS + second: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIViewController+Presentation.h b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIViewController+Presentation.h new file mode 100644 index 00000000..6169486a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIViewController+Presentation.h @@ -0,0 +1,29 @@ +// +// UIViewController+Presentation.h +// Native Plugins +// +// Created by Ashwin kumar on 22/01/19. +// Copyright (c) 2019 Voxel Busters Interactive LLP. All rights reserved. +// + +#import + +@interface UIViewController (Presentation) + +- (void)presentViewControllerInPopoverStyleIfRequired:(UIViewController*)viewControllerToPresent + withDelegate:(id)delegate + fromPosition:(CGPoint)position + animated:(BOOL)flag + completion:(void (^)())completion; + +- (void)presentViewControllerInPopoverStyleIfRequired:(UIViewController*)viewControllerToPresent + withDelegate:(id)delegate + fromPosition:(CGPoint)position + permittedArrowDirections:(UIPopoverArrowDirection)direction + animated:(BOOL)flag + completion:(void (^)())completion; + +- (void)presentViewControllerInFullScreen: (UIViewController*)viewControllerToPresent + animated: (BOOL)flag + completion: (void (^)())completion; +@end diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIViewController+Presentation.h.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIViewController+Presentation.h.meta new file mode 100644 index 00000000..f4f10a7b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIViewController+Presentation.h.meta @@ -0,0 +1,50 @@ +fileFormatVersion: 2 +guid: 4d321181095c844b48ca4573ce35aad1 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIViewController+Presentation.mm b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIViewController+Presentation.mm new file mode 100644 index 00000000..e4473733 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIViewController+Presentation.mm @@ -0,0 +1,78 @@ +// +// UIViewController+Presentation.mm +// Native Plugins +// +// Created by Ashwin kumar on 22/01/19. +// Copyright (c) 2019 Voxel Busters Interactive LLP. All rights reserved. +// + +#import "UIViewController+Presentation.h" + +@implementation UIViewController (Presentation) + +- (void)presentViewControllerInPopoverStyleIfRequired:(UIViewController*)viewControllerToPresent + withDelegate:(id)delegate + fromPosition:(CGPoint)position + animated:(BOOL)flag + completion:(void (^)())completion +{ + [self presentViewControllerInPopoverStyleIfRequired:viewControllerToPresent + withDelegate:delegate + fromPosition:position + permittedArrowDirections:0 + animated:flag + completion:completion]; +} + +- (void)presentViewControllerInPopoverStyleIfRequired:(UIViewController*)viewControllerToPresent + withDelegate:(id)delegate + fromPosition:(CGPoint)position + permittedArrowDirections:(UIPopoverArrowDirection)direction + animated:(BOOL)flag + completion:(void (^)())completion +{ + // change presentation style to popover for iPad device + if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) + { + viewControllerToPresent.modalPresentationStyle = UIModalPresentationPopover; + + UIPopoverPresentationController* popoverPresentationController = viewControllerToPresent.popoverPresentationController; + popoverPresentationController.delegate = delegate; + popoverPresentationController.sourceView = self.view; + popoverPresentationController.sourceRect = CGRectMake(position.x, position.y, 1, 1); + popoverPresentationController.permittedArrowDirections = direction; + } + else + { + [viewControllerToPresent setPresentationSettings]; + } + + if(![viewControllerToPresent isKindOfClass:[UIAlertController class]]) + { + viewControllerToPresent.presentationController.delegate = delegate; + } + + // present specified object + [self presentViewController:viewControllerToPresent animated:flag completion:completion]; +} + +- (void)setPresentationSettings +{ + if (@available(iOS 13.0, *)) { + self.modalPresentationStyle = UIModalPresentationAutomatic; + } else { + // Fallback on earlier versions + self.modalPresentationStyle = UIModalPresentationFullScreen; + } +} + +- (void)presentViewControllerInFullScreen: (UIViewController*)viewControllerToPresent + animated: (BOOL)flag + completion: (void (^)())completion +{ + self.modalPresentationStyle = UIModalPresentationFullScreen; + + // present specified object + [self presentViewController:viewControllerToPresent animated:flag completion:completion]; +} +@end diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIViewController+Presentation.mm.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIViewController+Presentation.mm.meta new file mode 100644 index 00000000..5d0fd535 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Plugins/iOS/UIViewController+Presentation.mm.meta @@ -0,0 +1,50 @@ +fileFormatVersion: 2 +guid: e90d4d6f4fc974ebd86ce76cb9eeb047 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs.meta new file mode 100644 index 00000000..a7926619 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 88728744e6e5543ea80e4b69bd594444 +folderAsset: yes +timeCreated: 1578145851 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples.meta new file mode 100644 index 00000000..3e6c2748 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 10b7809ee425c4fb68a29d7b7d54c662 +folderAsset: yes +timeCreated: 1547647481 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/ActionPanel.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/ActionPanel.prefab new file mode 100644 index 00000000..d831c145 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/ActionPanel.prefab @@ -0,0 +1,294 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1383244600673324 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224754109732942086} + - component: {fileID: 114458823125844134} + - component: {fileID: 222301520386526820} + - component: {fileID: 114044915492134002} + - component: {fileID: 114483481525253056} + m_Layer: 5 + m_Name: ActionPanel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224754109732942086 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1383244600673324} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224291371103355398} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -200, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &114458823125844134 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1383244600673324} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1367256648, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Content: {fileID: 224464102030571442} + m_Horizontal: 0 + m_Vertical: 1 + m_MovementType: 1 + m_Elasticity: 0.1 + m_Inertia: 1 + m_DecelerationRate: 0.135 + m_ScrollSensitivity: 1 + m_Viewport: {fileID: 224291371103355398} + m_HorizontalScrollbar: {fileID: 0} + m_VerticalScrollbar: {fileID: 0} + m_HorizontalScrollbarVisibility: 2 + m_VerticalScrollbarVisibility: 2 + m_HorizontalScrollbarSpacing: -3 + m_VerticalScrollbarSpacing: -3 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.ScrollRect+ScrollRectEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!222 &222301520386526820 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1383244600673324} + m_CullTransparentMesh: 0 +--- !u!114 &114044915492134002 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1383244600673324} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.9245283, g: 0.9201673, b: 0.9201673, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!114 &114483481525253056 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1383244600673324} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: 0.8 + m_FlexibleHeight: 1 + m_LayoutPriority: 1 +--- !u!1 &1654873636067368 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224291371103355398} + - component: {fileID: 114671148024326956} + - component: {fileID: 222696952570705116} + - component: {fileID: 114270695033652748} + m_Layer: 5 + m_Name: Viewport + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224291371103355398 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1654873636067368} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224464102030571442} + m_Father: {fileID: 224754109732942086} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 1} +--- !u!114 &114671148024326956 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1654873636067368} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1200242548, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 0 +--- !u!222 &222696952570705116 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1654873636067368} + m_CullTransparentMesh: 0 +--- !u!114 &114270695033652748 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1654873636067368} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!1 &1843181782701574 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224464102030571442} + - component: {fileID: 114983446567434222} + - component: {fileID: 114060847495336644} + m_Layer: 5 + m_Name: Content + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224464102030571442 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1843181782701574} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224291371103355398} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 1} +--- !u!114 &114983446567434222 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1843181782701574} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 50 + m_Right: 50 + m_Top: 30 + m_Bottom: 30 + m_ChildAlignment: 1 + m_Spacing: 15 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 +--- !u!114 &114060847495336644 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1843181782701574} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1741964061, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalFit: 0 + m_VerticalFit: 2 diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/ActionPanel.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/ActionPanel.prefab.meta new file mode 100644 index 00000000..3113357e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/ActionPanel.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2e0ca81b3691d4221b2204056b220040 +timeCreated: 1562303402 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/BackButton.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/BackButton.prefab new file mode 100644 index 00000000..52ccb2ef --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/BackButton.prefab @@ -0,0 +1,233 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1225259909145202 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224035219049407068} + - component: {fileID: 222450307957982428} + - component: {fileID: 114385090189785120} + - component: {fileID: 114872307879632310} + - component: {fileID: 114772039989283150} + - component: {fileID: 114284364595003524} + m_Layer: 5 + m_Name: BackButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224035219049407068 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1225259909145202} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224573545078175188} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222450307957982428 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1225259909145202} + m_CullTransparentMesh: 0 +--- !u!114 &114385090189785120 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1225259909145202} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.990566, g: 0.990566, b: 0.990566, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!114 &114872307879632310 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1225259909145202} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114385090189785120} + m_OnClick: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114772039989283150 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1225259909145202} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: 40 + m_FlexibleWidth: 1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 +--- !u!114 &114284364595003524 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1225259909145202} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: acfc8ba4fff24474a9995469ae741b3c, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1410395622577962 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224573545078175188} + - component: {fileID: 222941698648888652} + - component: {fileID: 114766746790446206} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224573545078175188 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1410395622577962} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224035219049407068} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222941698648888652 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1410395622577962} + m_CullTransparentMesh: 0 +--- !u!114 &114766746790446206 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1410395622577962} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.11320752, g: 0.11320752, b: 0.11320752, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e418537621d284969acce413dd1c8c27, type: 3} + m_FontSize: 24 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 25 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Back diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/BackButton.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/BackButton.prefab.meta new file mode 100644 index 00000000..f49786fd --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/BackButton.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 976e185699ff140fdb61f269f556fe93 +timeCreated: 1562303594 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Button.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Button.prefab new file mode 100644 index 00000000..930987bd --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Button.prefab @@ -0,0 +1,220 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1430593560333864 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224952746328586062} + - component: {fileID: 222390527291107986} + - component: {fileID: 114860196457914472} + - component: {fileID: 114567474638298420} + - component: {fileID: 114464621491982878} + m_Layer: 5 + m_Name: Button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224952746328586062 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1430593560333864} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224801287003026676} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -200, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222390527291107986 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1430593560333864} + m_CullTransparentMesh: 0 +--- !u!114 &114860196457914472 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1430593560333864} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!114 &114567474638298420 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1430593560333864} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114860196457914472} + m_OnClick: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114464621491982878 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1430593560333864} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: 40 + m_FlexibleWidth: 1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 +--- !u!1 &1831795015738404 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224801287003026676} + - component: {fileID: 222102832875962158} + - component: {fileID: 114822244254790652} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224801287003026676 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1831795015738404} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224952746328586062} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222102832875962158 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1831795015738404} + m_CullTransparentMesh: 0 +--- !u!114 &114822244254790652 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1831795015738404} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.11320752, g: 0.11320752, b: 0.11320752, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e418537621d284969acce413dd1c8c27, type: 3} + m_FontSize: 24 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 16 + m_MaxSize: 24 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Button diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Button.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Button.prefab.meta new file mode 100644 index 00000000..cdb4eae8 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Button.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0ae52c31935f040969ff0c680344702b +timeCreated: 1547647503 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/ConsolePanel.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/ConsolePanel.prefab new file mode 100644 index 00000000..b3f025f9 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/ConsolePanel.prefab @@ -0,0 +1,464 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1043365091775690 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224230393480343426} + - component: {fileID: 222635698714245778} + - component: {fileID: 114087859162682762} + - component: {fileID: 114761511105016240} + - component: {fileID: 114395380185171680} + m_Layer: 5 + m_Name: ConsolePanel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224230393480343426 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1043365091775690} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224217292865860958} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0} +--- !u!222 &222635698714245778 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1043365091775690} + m_CullTransparentMesh: 0 +--- !u!114 &114087859162682762 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1043365091775690} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.990566, g: 0.990566, b: 0.990566, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!114 &114761511105016240 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1043365091775690} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 030d6e213de734b1ab4bfb8f6a416dc9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_text: {fileID: 114082688468709384} + m_textScroller: {fileID: 114305235823970096} +--- !u!114 &114395380185171680 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1043365091775690} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: 160 + m_FlexibleWidth: 1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 +--- !u!1 &1266210483889168 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224217292865860958} + - component: {fileID: 114305235823970096} + - component: {fileID: 222213325961543016} + - component: {fileID: 114092120971635258} + m_Layer: 5 + m_Name: ScrollRect + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224217292865860958 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1266210483889168} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224369000439747256} + m_Father: {fileID: 224230393480343426} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &114305235823970096 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1266210483889168} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1367256648, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Content: {fileID: 224164935523170058} + m_Horizontal: 0 + m_Vertical: 1 + m_MovementType: 1 + m_Elasticity: 0.1 + m_Inertia: 1 + m_DecelerationRate: 0.135 + m_ScrollSensitivity: 1 + m_Viewport: {fileID: 224369000439747256} + m_HorizontalScrollbar: {fileID: 0} + m_VerticalScrollbar: {fileID: 0} + m_HorizontalScrollbarVisibility: 2 + m_VerticalScrollbarVisibility: 2 + m_HorizontalScrollbarSpacing: -3 + m_VerticalScrollbarSpacing: -3 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.ScrollRect+ScrollRectEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!222 &222213325961543016 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1266210483889168} + m_CullTransparentMesh: 0 +--- !u!114 &114092120971635258 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1266210483889168} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.392} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!1 &1308015201791370 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224369000439747256} + - component: {fileID: 114346359527998570} + - component: {fileID: 222997546077947360} + - component: {fileID: 114981987312976902} + m_Layer: 5 + m_Name: Viewport + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224369000439747256 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1308015201791370} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224164935523170058} + m_Father: {fileID: 224217292865860958} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 12.399902, y: -10} + m_SizeDelta: {x: -24.8, y: -17.2} + m_Pivot: {x: 0, y: 1} +--- !u!114 &114346359527998570 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1308015201791370} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1200242548, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 0 +--- !u!222 &222997546077947360 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1308015201791370} + m_CullTransparentMesh: 0 +--- !u!114 &114981987312976902 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1308015201791370} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!1 &1620636455641208 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224818425575037616} + - component: {fileID: 222113324207946846} + - component: {fileID: 114082688468709384} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224818425575037616 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1620636455641208} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224164935523170058} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222113324207946846 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1620636455641208} + m_CullTransparentMesh: 0 +--- !u!114 &114082688468709384 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1620636455641208} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.11320752, g: 0.11320752, b: 0.11320752, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e418537621d284969acce413dd1c8c27, type: 3} + m_FontSize: 20 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: Console +--- !u!1 &1739254653831132 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224164935523170058} + - component: {fileID: 114107015515134430} + - component: {fileID: 114351036584141900} + m_Layer: 5 + m_Name: Content + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224164935523170058 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1739254653831132} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224818425575037616} + m_Father: {fileID: 224369000439747256} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0.09967924} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 1} +--- !u!114 &114107015515134430 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1739254653831132} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1741964061, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalFit: 0 + m_VerticalFit: 2 +--- !u!114 &114351036584141900 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1739254653831132} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 5 + m_Right: 5 + m_Top: 5 + m_Bottom: 5 + m_ChildAlignment: 4 + m_Spacing: 0 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/ConsolePanel.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/ConsolePanel.prefab.meta new file mode 100644 index 00000000..3acd28eb --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/ConsolePanel.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 36fd405962f494477b184f84fbd9a337 +timeCreated: 1562303414 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/DemoPanel.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/DemoPanel.prefab new file mode 100644 index 00000000..a2fc637e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/DemoPanel.prefab @@ -0,0 +1,157 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1090748803265720 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224871454335544214} + - component: {fileID: 114694957018523678} + m_Layer: 5 + m_Name: DemoPanel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224871454335544214 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1090748803265720} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224353115767227546} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &114694957018523678 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1090748803265720} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 1 + m_Spacing: 10 + m_ChildForceExpandWidth: 0 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 +--- !u!1 &1866383764505280 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224353115767227546} + - component: {fileID: 222364469615282034} + - component: {fileID: 114827569583914414} + - component: {fileID: 114137109017026640} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224353115767227546 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1866383764505280} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224871454335544214} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222364469615282034 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1866383764505280} + m_CullTransparentMesh: 0 +--- !u!114 &114827569583914414 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1866383764505280} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!114 &114137109017026640 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1866383764505280} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 1 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/DemoPanel.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/DemoPanel.prefab.meta new file mode 100644 index 00000000..e52b59bd --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/DemoPanel.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9cb60866b172b415da39c73dad3999e8 +timeCreated: 1562303428 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/DemoResources.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/DemoResources.prefab new file mode 100644 index 00000000..35906a59 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/DemoResources.prefab @@ -0,0 +1,60 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1976543427182744} + m_IsPrefabParent: 1 +--- !u!1 &1976543427182744 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4074120279433260} + - component: {fileID: 114540387559500602} + m_Layer: 0 + m_Name: DemoResources + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4074120279433260 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1976543427182744} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &114540387559500602 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1976543427182744} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 940266f63b2ee41128e43647609f80f8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_images: + - {fileID: 2800000, guid: 5adf67eb430f548418876cfedad78a9a, type: 3} + m_urls: + - https://www.google.com + m_texts: + - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor + incididunt ut labore et dolore magna aliqua. diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/DemoResources.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/DemoResources.prefab.meta new file mode 100644 index 00000000..5a5db232 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/DemoResources.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 353a001434f7343b4bd6ea715e28562f +timeCreated: 1563447691 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Dropdown.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Dropdown.prefab new file mode 100644 index 00000000..0f590fe0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Dropdown.prefab @@ -0,0 +1,797 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1023892561578514 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224016064779405710} + - component: {fileID: 222005949596316690} + - component: {fileID: 114046355294249188} + - component: {fileID: 114656726428466140} + m_Layer: 5 + m_Name: Template + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &224016064779405710 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1023892561578514} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 224743043863863404} + m_Father: {fileID: 224158029084090604} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: 2} + m_SizeDelta: {x: 0, y: 120} + m_Pivot: {x: 0.5, y: 1} +--- !u!222 &222005949596316690 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1023892561578514} + m_CullTransparentMesh: 0 +--- !u!114 &114046355294249188 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1023892561578514} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &114656726428466140 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1023892561578514} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1aa08ab6e0800fa44ae55d278d1423e3, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Content: {fileID: 224318144167479604} + m_Horizontal: 0 + m_Vertical: 1 + m_MovementType: 1 + m_Elasticity: 0.1 + m_Inertia: 1 + m_DecelerationRate: 0.135 + m_ScrollSensitivity: 1 + m_Viewport: {fileID: 224743043863863404} + m_HorizontalScrollbar: {fileID: 0} + m_VerticalScrollbar: {fileID: 0} + m_HorizontalScrollbarVisibility: 0 + m_VerticalScrollbarVisibility: 2 + m_HorizontalScrollbarSpacing: 0 + m_VerticalScrollbarSpacing: -3 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] +--- !u!1 &1045175234636876 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224514434835063082} + - component: {fileID: 222463721787903378} + - component: {fileID: 114776005954242994} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224514434835063082 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1045175234636876} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 224158029084090604} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -7.5, y: -0.5} + m_SizeDelta: {x: -35, y: -13} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222463721787903378 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1045175234636876} + m_CullTransparentMesh: 0 +--- !u!114 &114776005954242994 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1045175234636876} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: e418537621d284969acce413dd1c8c27, type: 3} + m_FontSize: 20 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Option A +--- !u!1 &1065878302462128 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224743043863863404} + - component: {fileID: 114333908284456814} + - component: {fileID: 222640113378206898} + - component: {fileID: 114089421562210144} + m_Layer: 5 + m_Name: Viewport + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224743043863863404 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1065878302462128} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 224318144167479604} + m_Father: {fileID: 224016064779405710} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 1} +--- !u!114 &114333908284456814 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1065878302462128} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 0 +--- !u!222 &222640113378206898 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1065878302462128} + m_CullTransparentMesh: 0 +--- !u!114 &114089421562210144 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1065878302462128} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &1094942323768938 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224685884398706474} + - component: {fileID: 114779507134661336} + m_Layer: 5 + m_Name: Item + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224685884398706474 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1094942323768938} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 224767923176248100} + - {fileID: 224132635888509720} + m_Father: {fileID: 224318144167479604} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 40} + m_Pivot: {x: 0.5, y: 1} +--- !u!114 &114779507134661336 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1094942323768938} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 0.9245283, g: 0.9201673, b: 0.9201673, a: 1} + m_HighlightedColor: {r: 0.990566, g: 0.990566, b: 0.990566, a: 1} + m_PressedColor: {r: 0.990566, g: 0.990566, b: 0.990566, a: 1} + m_SelectedColor: {r: 0.990566, g: 0.990566, b: 0.990566, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Highlighted + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114327894200692156} + toggleTransition: 1 + graphic: {fileID: 0} + m_Group: {fileID: 0} + onValueChanged: + m_PersistentCalls: + m_Calls: [] + m_IsOn: 1 +--- !u!1 &1193824002270256 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224158029084090604} + - component: {fileID: 222997439124120942} + - component: {fileID: 114945614848403610} + - component: {fileID: 114339634453116536} + - component: {fileID: 114435843442480086} + m_Layer: 5 + m_Name: Dropdown + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224158029084090604 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1193824002270256} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 224514434835063082} + - {fileID: 224808553636828290} + - {fileID: 224016064779405710} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 160, y: 40} + m_Pivot: {x: 1, y: 0.5} +--- !u!222 &222997439124120942 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1193824002270256} + m_CullTransparentMesh: 0 +--- !u!114 &114945614848403610 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1193824002270256} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.11320752, g: 0.11320752, b: 0.11320752, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &114339634453116536 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1193824002270256} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d0b652f32a2cc243917e4028fa0f046, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Highlighted + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114945614848403610} + m_Template: {fileID: 224016064779405710} + m_CaptionText: {fileID: 114776005954242994} + m_CaptionImage: {fileID: 0} + m_ItemText: {fileID: 114449367318763852} + m_ItemImage: {fileID: 0} + m_Value: 0 + m_Options: + m_Options: + - m_Text: Option A + m_Image: {fileID: 0} + - m_Text: Option B + m_Image: {fileID: 0} + - m_Text: Option C + m_Image: {fileID: 0} + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_AlphaFadeSpeed: 0.15 +--- !u!114 &114435843442480086 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1193824002270256} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: 160 + m_PreferredHeight: 40 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 +--- !u!1 &1209149006041006 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224767923176248100} + - component: {fileID: 222355603195166402} + - component: {fileID: 114327894200692156} + m_Layer: 5 + m_Name: Item Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224767923176248100 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1209149006041006} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 224685884398706474} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222355603195166402 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1209149006041006} + m_CullTransparentMesh: 0 +--- !u!114 &114327894200692156 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1209149006041006} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.9245283, g: 0.9201673, b: 0.9201673, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &1227429266343698 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224132635888509720} + - component: {fileID: 222684907768796092} + - component: {fileID: 114449367318763852} + m_Layer: 5 + m_Name: Item Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224132635888509720 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1227429266343698} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 224685884398706474} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 5, y: -0.5} + m_SizeDelta: {x: -30, y: -3} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222684907768796092 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1227429266343698} + m_CullTransparentMesh: 0 +--- !u!114 &114449367318763852 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1227429266343698} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.11320752, g: 0.11320752, b: 0.11320752, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: e418537621d284969acce413dd1c8c27, type: 3} + m_FontSize: 24 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Option A +--- !u!1 &1321823248984956 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224808553636828290} + - component: {fileID: 222673429768263828} + - component: {fileID: 114784797724014900} + m_Layer: 5 + m_Name: Arrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224808553636828290 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1321823248984956} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 224158029084090604} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: -15, y: 0} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222673429768263828 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1321823248984956} + m_CullTransparentMesh: 0 +--- !u!114 &114784797724014900 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1321823248984956} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 8452141070dc84588a81dcd4997c35d1, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &1577877957623102 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224318144167479604} + m_Layer: 5 + m_Name: Content + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224318144167479604 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1577877957623102} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 224685884398706474} + m_Father: {fileID: 224743043863863404} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 40} + m_Pivot: {x: 0.5, y: 1} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Dropdown.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Dropdown.prefab.meta new file mode 100644 index 00000000..39ac7efe --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Dropdown.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f6d2bd773e6664015bcea0a44da91f8d +timeCreated: 1549355756 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Grid.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Grid.prefab new file mode 100644 index 00000000..dd2ffb52 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Grid.prefab @@ -0,0 +1,70 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1729283381912644} + m_IsPrefabParent: 1 +--- !u!1 &1729283381912644 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224913561361295354} + - component: {fileID: 114442734718446736} + m_Layer: 5 + m_Name: Grid + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &114442734718446736 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1729283381912644} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -2095666955, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 1 + m_StartCorner: 0 + m_StartAxis: 0 + m_CellSize: {x: 320, y: 60} + m_Spacing: {x: 0, y: 0} + m_Constraint: 0 + m_ConstraintCount: 1 +--- !u!224 &224913561361295354 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1729283381912644} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Grid.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Grid.prefab.meta new file mode 100644 index 00000000..442bc287 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Grid.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 49cd706acfe6d466296dddcacc8c1b80 +timeCreated: 1549313181 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Header.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Header.prefab new file mode 100644 index 00000000..42df2dcc --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Header.prefab @@ -0,0 +1,177 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1166363502238262 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224101732043339844} + - component: {fileID: 222703062519739966} + - component: {fileID: 114546785299107946} + - component: {fileID: 114731851738737184} + m_Layer: 5 + m_Name: Header + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224101732043339844 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1166363502238262} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224083689230385278} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 1} +--- !u!222 &222703062519739966 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1166363502238262} + m_CullTransparentMesh: 0 +--- !u!114 &114546785299107946 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1166363502238262} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.990566, g: 0.990566, b: 0.990566, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!114 &114731851738737184 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1166363502238262} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: 80 + m_FlexibleWidth: 1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 +--- !u!1 &1386125318761082 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224083689230385278} + - component: {fileID: 222221176673892098} + - component: {fileID: 114267771407102612} + m_Layer: 5 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224083689230385278 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1386125318761082} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224101732043339844} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -240, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222221176673892098 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1386125318761082} + m_CullTransparentMesh: 0 +--- !u!114 &114267771407102612 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1386125318761082} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.11320752, g: 0.11320752, b: 0.11320752, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e418537621d284969acce413dd1c8c27, type: 3} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 1 + m_MinSize: 0 + m_MaxSize: 32 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Title diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Header.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Header.prefab.meta new file mode 100644 index 00000000..8c3584b2 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Header.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 642edd1adfa1d478ebaa2d75fa490d52 +timeCreated: 1562303385 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/InputField.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/InputField.prefab new file mode 100644 index 00000000..bdebfd94 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/InputField.prefab @@ -0,0 +1,322 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1338051371335932 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224955589825798102} + - component: {fileID: 222973406624162998} + - component: {fileID: 114155734850734234} + m_Layer: 5 + m_Name: Placeholder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224955589825798102 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1338051371335932} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224540353099770882} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -0.5} + m_SizeDelta: {x: -20, y: -13} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222973406624162998 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1338051371335932} + m_CullTransparentMesh: 0 +--- !u!114 &114155734850734234 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1338051371335932} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 0.5} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e418537621d284969acce413dd1c8c27, type: 3} + m_FontSize: 20 + m_FontStyle: 2 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Enter text... +--- !u!1 &1526539212069634 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224440253791260236} + - component: {fileID: 222865832714574392} + - component: {fileID: 114270666603452436} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224440253791260236 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1526539212069634} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224540353099770882} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -0.5} + m_SizeDelta: {x: -20, y: -13} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222865832714574392 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1526539212069634} + m_CullTransparentMesh: 0 +--- !u!114 &114270666603452436 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1526539212069634} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e418537621d284969acce413dd1c8c27, type: 3} + m_FontSize: 20 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: +--- !u!1 &1537348704010034 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224540353099770882} + - component: {fileID: 222996081364213050} + - component: {fileID: 114205020239875918} + - component: {fileID: 114469949788325500} + - component: {fileID: 114163320315824386} + m_Layer: 5 + m_Name: InputField + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224540353099770882 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1537348704010034} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224955589825798102} + - {fileID: 224440253791260236} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -85, y: 0} + m_SizeDelta: {x: -170, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222996081364213050 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1537348704010034} + m_CullTransparentMesh: 0 +--- !u!114 &114205020239875918 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1537348704010034} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!114 &114469949788325500 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1537348704010034} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 575553740, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114205020239875918} + m_TextComponent: {fileID: 114270666603452436} + m_Placeholder: {fileID: 114155734850734234} + m_ContentType: 0 + m_InputType: 0 + m_AsteriskChar: 42 + m_KeyboardType: 0 + m_LineType: 0 + m_HideMobileInput: 0 + m_CharacterValidation: 0 + m_CharacterLimit: 0 + m_OnEndEdit: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.InputField+SubmitEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.InputField+OnChangeEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null + m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_CustomCaretColor: 0 + m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412} + m_Text: + m_CaretBlinkRate: 0.85 + m_CaretWidth: 1 + m_ReadOnly: 0 +--- !u!114 &114163320315824386 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1537348704010034} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: 600 + m_PreferredHeight: 40 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/InputField.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/InputField.prefab.meta new file mode 100644 index 00000000..e28f0c59 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/InputField.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0faea64126a0946a2a229dc5c67a892b +timeCreated: 1562303997 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Label.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Label.prefab new file mode 100644 index 00000000..9206e2ac --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Label.prefab @@ -0,0 +1,138 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1743733418358568 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224181412554927584} + - component: {fileID: 222817667157265376} + - component: {fileID: 114304789178456594} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224181412554927584 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1743733418358568} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224880110391763244} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 20, y: 0} + m_SizeDelta: {x: -40, y: -10} + m_Pivot: {x: 0, y: 0.5} +--- !u!222 &222817667157265376 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1743733418358568} + m_CullTransparentMesh: 0 +--- !u!114 &114304789178456594 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1743733418358568} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.5647059, g: 0.5647059, b: 0.5647059, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e418537621d284969acce413dd1c8c27, type: 3} + m_FontSize: 24 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Label +--- !u!1 &1745382843081832 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224880110391763244} + - component: {fileID: 114640770555796246} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224880110391763244 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1745382843081832} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224181412554927584} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0.5} +--- !u!114 &114640770555796246 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1745382843081832} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: 40 + m_FlexibleWidth: 1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Label.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Label.prefab.meta new file mode 100644 index 00000000..1d1ac77e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Label.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0a5f545e2922b4f979c3a40c7ea220ce +timeCreated: 1562229135 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Row (Horizontal).prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Row (Horizontal).prefab new file mode 100644 index 00000000..f038bce4 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Row (Horizontal).prefab @@ -0,0 +1,105 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1729283381912644 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224913561361295354} + - component: {fileID: 114484300395288958} + - component: {fileID: -9146562865070377635} + - component: {fileID: -9061008655249065994} + m_Layer: 5 + m_Name: Row (Horizontal) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224913561361295354 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1729283381912644} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &114484300395288958 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1729283381912644} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 1 + m_Spacing: 0 + m_ChildForceExpandWidth: 0 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 +--- !u!222 &-9146562865070377635 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1729283381912644} + m_CullTransparentMesh: 1 +--- !u!114 &-9061008655249065994 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1729283381912644} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0.09411765} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Row (Horizontal).prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Row (Horizontal).prefab.meta new file mode 100644 index 00000000..673f7b7c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Row (Horizontal).prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: c3f90658978844a229ed44d672b70a93 +timeCreated: 1549313181 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Row.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Row.prefab new file mode 100644 index 00000000..4999fd44 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Row.prefab @@ -0,0 +1,46 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1729283381912644} + m_IsPrefabParent: 1 +--- !u!1 &1729283381912644 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224913561361295354} + m_Layer: 5 + m_Name: Row + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224913561361295354 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1729283381912644} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Row.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Row.prefab.meta new file mode 100644 index 00000000..31a4217e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Row.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 53106115b89de4cc6a667adc369f97b8 +timeCreated: 1549313181 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Section.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Section.prefab new file mode 100644 index 00000000..0e8cdbee --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Section.prefab @@ -0,0 +1,198 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1105364963865442 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224563612419213160} + - component: {fileID: 222647657039145556} + - component: {fileID: 114553031757334108} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224563612419213160 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1105364963865442} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224150235456743208} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 20, y: 0} + m_SizeDelta: {x: -40, y: -10} + m_Pivot: {x: 0, y: 0.5} +--- !u!222 &222647657039145556 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1105364963865442} + m_CullTransparentMesh: 0 +--- !u!114 &114553031757334108 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1105364963865442} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.5647059, g: 0.5647059, b: 0.5647059, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e418537621d284969acce413dd1c8c27, type: 3} + m_FontSize: 24 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Section +--- !u!1 &1370956973664342 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224804570984248434} + - component: {fileID: 114946616376835068} + m_Layer: 5 + m_Name: Section + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224804570984248434 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1370956973664342} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224150235456743208} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &114946616376835068 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1370956973664342} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 1 + m_Spacing: 4 + m_ChildForceExpandWidth: 0 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 +--- !u!1 &1786111478595968 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224150235456743208} + - component: {fileID: 114483417859780178} + m_Layer: 5 + m_Name: SubTitle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224150235456743208 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1786111478595968} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224563612419213160} + m_Father: {fileID: 224804570984248434} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0.5} +--- !u!114 &114483417859780178 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1786111478595968} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: 40 + m_FlexibleWidth: 1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Section.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Section.prefab.meta new file mode 100644 index 00000000..618f3bd3 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Section.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d7ff5e20ef7484e159eb8894a8465de0 +timeCreated: 1562305585 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/SelectableButton.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/SelectableButton.prefab new file mode 100644 index 00000000..6f6fdcb3 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/SelectableButton.prefab @@ -0,0 +1,299 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1457602808629010 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224468145109842630} + - component: {fileID: 222278369463802492} + - component: {fileID: 114843381117437088} + m_Layer: 5 + m_Name: Checked + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224468145109842630 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1457602808629010} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224246396564361528} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222278369463802492 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1457602808629010} + m_CullTransparentMesh: 0 +--- !u!114 &114843381117437088 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1457602808629010} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.990566, g: 0.990566, b: 0.990566, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!1 &1590734985891500 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224734417071291362} + - component: {fileID: 222698511777421920} + - component: {fileID: 114019987726141092} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224734417071291362 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1590734985891500} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224246396564361528} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222698511777421920 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1590734985891500} + m_CullTransparentMesh: 0 +--- !u!114 &114019987726141092 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1590734985891500} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.11320752, g: 0.11320752, b: 0.11320752, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e418537621d284969acce413dd1c8c27, type: 3} + m_FontSize: 24 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 16 + m_MaxSize: 24 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Button +--- !u!1 &1791280990977722 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224246396564361528} + - component: {fileID: 222731597850991564} + - component: {fileID: 114688525463478710} + - component: {fileID: 114017956030511436} + - component: {fileID: 114280077302381444} + m_Layer: 5 + m_Name: SelectableButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224246396564361528 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1791280990977722} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224468145109842630} + - {fileID: 224734417071291362} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222731597850991564 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1791280990977722} + m_CullTransparentMesh: 0 +--- !u!114 &114688525463478710 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1791280990977722} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.9245283, g: 0.9201673, b: 0.9201673, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!114 &114017956030511436 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1791280990977722} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 2109663825, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114688525463478710} + toggleTransition: 1 + graphic: {fileID: 114843381117437088} + m_Group: {fileID: 0} + onValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null + m_IsOn: 0 +--- !u!114 &114280077302381444 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1791280990977722} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: 40 + m_FlexibleWidth: 1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/SelectableButton.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/SelectableButton.prefab.meta new file mode 100644 index 00000000..22196ee7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/SelectableButton.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b705253d9d4224c17a4157333f3226b6 +timeCreated: 1562305190 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/SubHeader.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/SubHeader.prefab new file mode 100644 index 00000000..f4a48bb2 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/SubHeader.prefab @@ -0,0 +1,156 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1616264777658218 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224112343938402096} + - component: {fileID: 222848848218035406} + - component: {fileID: 114236370472595554} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224112343938402096 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1616264777658218} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224104657789406318} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222848848218035406 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1616264777658218} + m_CullTransparentMesh: 0 +--- !u!114 &114236370472595554 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1616264777658218} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 0 + m_MaxSize: 20 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Mail Composer +--- !u!1 &1762802492619682 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224104657789406318} + - component: {fileID: 222994696516698790} + - component: {fileID: 114476633020109748} + m_Layer: 5 + m_Name: SubHeader + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224104657789406318 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1762802492619682} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224112343938402096} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222994696516698790 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1762802492619682} + m_CullTransparentMesh: 0 +--- !u!114 &114476633020109748 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1762802492619682} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.672} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/SubHeader.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/SubHeader.prefab.meta new file mode 100644 index 00000000..e05334f3 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/SubHeader.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d436a6bd3c43c4064bb5b0487f71ecda +timeCreated: 1547647566 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/SubTitle.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/SubTitle.prefab new file mode 100644 index 00000000..40ab1c61 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/SubTitle.prefab @@ -0,0 +1,138 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1743733418358568 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224181412554927584} + - component: {fileID: 222817667157265376} + - component: {fileID: 114304789178456594} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224181412554927584 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1743733418358568} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224880110391763244} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 20, y: 0} + m_SizeDelta: {x: -40, y: -10} + m_Pivot: {x: 0, y: 0.5} +--- !u!222 &222817667157265376 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1743733418358568} + m_CullTransparentMesh: 0 +--- !u!114 &114304789178456594 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1743733418358568} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.5647059, g: 0.5647059, b: 0.5647059, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: e418537621d284969acce413dd1c8c27, type: 3} + m_FontSize: 24 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Label +--- !u!1 &1745382843081832 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224880110391763244} + - component: {fileID: 114640770555796246} + m_Layer: 5 + m_Name: SubTitle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224880110391763244 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1745382843081832} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224181412554927584} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0.5} +--- !u!114 &114640770555796246 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1745382843081832} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: 60 + m_FlexibleWidth: 1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/SubTitle.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/SubTitle.prefab.meta new file mode 100644 index 00000000..df69bf81 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/SubTitle.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8c0a1d0702e8d4c60b5f7cfd69c54073 +timeCreated: 1562229135 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Toggle.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Toggle.prefab new file mode 100644 index 00000000..f2a8bd2a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Toggle.prefab @@ -0,0 +1,383 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1115347289783676 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224026794194396316} + - component: {fileID: 222428208889105814} + - component: {fileID: 114606141039276814} + m_Layer: 5 + m_Name: Checkmark + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224026794194396316 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1115347289783676} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 224863752380380678} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222428208889105814 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1115347289783676} + m_CullTransparentMesh: 0 +--- !u!114 &114606141039276814 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1115347289783676} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.990566, g: 0.990566, b: 0.990566, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10901, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &1436292188102720 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224863752380380678} + - component: {fileID: 222784111643753116} + - component: {fileID: 114012976300579226} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224863752380380678 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1436292188102720} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 224026794194396316} + m_Father: {fileID: 224973839754196500} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: -10} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222784111643753116 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1436292188102720} + m_CullTransparentMesh: 0 +--- !u!114 &114012976300579226 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1436292188102720} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &1847481865867428 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224973839754196500} + - component: {fileID: 114691862735848880} + - component: {fileID: 114597546877301324} + - component: {fileID: 1056081746664844487} + - component: {fileID: 6641174690089426959} + m_Layer: 5 + m_Name: Toggle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224973839754196500 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1847481865867428} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 224863752380380678} + - {fileID: 224207624468828976} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &114691862735848880 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1847481865867428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Highlighted + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114012976300579226} + toggleTransition: 1 + graphic: {fileID: 114606141039276814} + m_Group: {fileID: 0} + onValueChanged: + m_PersistentCalls: + m_Calls: [] + m_IsOn: 1 +--- !u!114 &114597546877301324 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1847481865867428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: 120 + m_PreferredHeight: 40 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 +--- !u!222 &1056081746664844487 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1847481865867428} + m_CullTransparentMesh: 1 +--- !u!114 &6641174690089426959 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1847481865867428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0.09411765} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &1967550993301098 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224207624468828976} + - component: {fileID: 222843106342474602} + - component: {fileID: 114818449290004172} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224207624468828976 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1967550993301098} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 224973839754196500} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 24} + m_Pivot: {x: 0.5, y: 1} +--- !u!222 &222843106342474602 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1967550993301098} + m_CullTransparentMesh: 0 +--- !u!114 &114818449290004172 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1967550993301098} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.11320752, g: 0.11320752, b: 0.11320752, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: e418537621d284969acce413dd1c8c27, type: 3} + m_FontSize: 20 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Label diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Toggle.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Toggle.prefab.meta new file mode 100644 index 00000000..b35547c4 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/Examples/Toggle.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a71d99f82f5cb4d7e8703e58527ed9bd +timeCreated: 1549313487 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/UnityUIAlertDialog.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/UnityUIAlertDialog.prefab new file mode 100644 index 00000000..6435e6f4 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/UnityUIAlertDialog.prefab @@ -0,0 +1,787 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1212668156388774} + m_IsPrefabParent: 1 +--- !u!1 &1134199821205146 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224026503092109950} + - component: {fileID: 222798798132884822} + - component: {fileID: 114264837080710380} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1212668156388774 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224961064885394582} + - component: {fileID: 222855421965438568} + - component: {fileID: 114719650402599042} + m_Layer: 5 + m_Name: UnityUIAlertDialog + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1444912029132066 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224890410505311336} + - component: {fileID: 222871979494986796} + - component: {fileID: 114437939104182950} + m_Layer: 5 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1491521136401092 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224993442107416342} + - component: {fileID: 222660402211604342} + - component: {fileID: 114426906830461430} + - component: {fileID: 114633366171141876} + m_Layer: 5 + m_Name: Ok + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1578316838075366 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224427291746790018} + - component: {fileID: 222290285530892906} + - component: {fileID: 114340610768889040} + m_Layer: 5 + m_Name: Content + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1795177363468906 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224614295017793080} + - component: {fileID: 222313725694417170} + - component: {fileID: 114283677234356648} + - component: {fileID: 114847601616134896} + m_Layer: 5 + m_Name: Cancel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1858732617179576 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224624371019735436} + - component: {fileID: 114583720595074066} + m_Layer: 5 + m_Name: ButtonGroup + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1888375275847344 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224498473314747022} + - component: {fileID: 222655936121240924} + - component: {fileID: 114508959082617160} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1893706790752728 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224731969598681650} + - component: {fileID: 222079337800444530} + - component: {fileID: 114661597482121632} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1910709274486492 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224478732637988690} + - component: {fileID: 222591068814091094} + - component: {fileID: 114047670138849628} + m_Layer: 5 + m_Name: Message + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &114047670138849628 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1910709274486492} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 30 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 3 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Message +--- !u!114 &114264837080710380 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1134199821205146} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 24 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Button +--- !u!114 &114283677234356648 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1795177363468906} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0.5647059} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114340610768889040 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1578316838075366} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0.566} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114426906830461430 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1491521136401092} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0.5647059} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114437939104182950 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1444912029132066} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 30 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 3 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Title +--- !u!114 &114508959082617160 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1888375275847344} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 24 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Button +--- !u!114 &114583720595074066 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1858732617179576} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -405508275, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 4 + m_Spacing: 20 + m_ChildForceExpandWidth: 0 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 +--- !u!114 &114633366171141876 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1491521136401092} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 1, g: 1, b: 1, a: 1} + m_PressedColor: {r: 1, g: 1, b: 1, a: 1} + m_DisabledColor: {r: 1, g: 1, b: 1, a: 1} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114426906830461430} + m_OnClick: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114661597482121632 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1893706790752728} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.17647058, g: 0.17647058, b: 0.17647058, a: 0.478} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114719650402599042 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1212668156388774} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4392aa7fb54714d2786e9582d0601cae, type: 3} + m_Name: + m_EditorClassIdentifier: + m_title: {fileID: 114437939104182950} + m_message: {fileID: 114047670138849628} + m_buttons: + - {fileID: 114633366171141876} + - {fileID: 114847601616134896} +--- !u!114 &114847601616134896 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1795177363468906} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 1, g: 1, b: 1, a: 1} + m_PressedColor: {r: 1, g: 1, b: 1, a: 1} + m_DisabledColor: {r: 1, g: 1, b: 1, a: 1} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114283677234356648} + m_OnClick: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!222 &222079337800444530 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1893706790752728} +--- !u!222 &222290285530892906 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1578316838075366} +--- !u!222 &222313725694417170 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1795177363468906} +--- !u!222 &222591068814091094 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1910709274486492} +--- !u!222 &222655936121240924 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1888375275847344} +--- !u!222 &222660402211604342 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1491521136401092} +--- !u!222 &222798798132884822 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1134199821205146} +--- !u!222 &222855421965438568 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1212668156388774} +--- !u!222 &222871979494986796 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1444912029132066} +--- !u!224 &224026503092109950 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1134199821205146} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224614295017793080} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224427291746790018 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1578316838075366} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224890410505311336} + - {fileID: 224478732637988690} + - {fileID: 224624371019735436} + m_Father: {fileID: 224961064885394582} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 640, y: 400} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224478732637988690 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1910709274486492} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224427291746790018} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: 10} + m_SizeDelta: {x: -80, y: 120} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224498473314747022 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1888375275847344} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224993442107416342} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224614295017793080 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1795177363468906} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224026503092109950} + m_Father: {fileID: 224624371019735436} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 197, y: 58} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224624371019735436 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1858732617179576} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224614295017793080} + - {fileID: 224993442107416342} + m_Father: {fileID: 224427291746790018} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: -110} + m_SizeDelta: {x: 0, y: 58} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224731969598681650 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1893706790752728} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224961064885394582} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224890410505311336 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1444912029132066} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224427291746790018} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: 112} + m_SizeDelta: {x: -80, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224961064885394582 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1212668156388774} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224731969598681650} + - {fileID: 224427291746790018} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224993442107416342 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1491521136401092} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224498473314747022} + m_Father: {fileID: 224624371019735436} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 197, y: 58} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/UnityUIAlertDialog.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/UnityUIAlertDialog.prefab.meta new file mode 100644 index 00000000..6476f0a0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/UnityUIAlertDialog.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0bea496bdcd2d41ebb1104db0fd905dc +timeCreated: 1547476928 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/UnityUIRenderer.prefab b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/UnityUIRenderer.prefab new file mode 100644 index 00000000..e07d751b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/UnityUIRenderer.prefab @@ -0,0 +1,114 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1338797265575942 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224957196374820768} + - component: {fileID: 223815083016734448} + - component: {fileID: 114202664212081364} + - component: {fileID: 114813343446744758} + - component: {fileID: 114882653979984282} + m_Layer: 5 + m_Name: UnityUIRenderer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224957196374820768 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1338797265575942} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &223815083016734448 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1338797265575942} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 1000 + m_TargetDisplay: 0 +--- !u!114 &114202664212081364 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1338797265575942} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 640, y: 960} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &114813343446744758 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1338797265575942} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &114882653979984282 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1338797265575942} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: aac1689022e104e26a05af7729a092ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_displayOrder: 0 diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/UnityUIRenderer.prefab.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/UnityUIRenderer.prefab.meta new file mode 100644 index 00000000..cbf6d974 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Prefabs/UnityUIRenderer.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b8b2730da8ec14db686316d122a0939e +timeCreated: 1547474282 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/README.md b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/README.md new file mode 100644 index 00000000..39af52c0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/README.md @@ -0,0 +1,29 @@ +# README # + +This README would normally document whatever steps are necessary to get your application up and running. + +### What is this repository for? ### + +* Quick summary +* Version +* [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo) + +### How do I get set up? ### + +* Summary of set up +* Configuration +* Dependencies +* Database configuration +* How to run tests +* Deployment instructions + +### Contribution guidelines ### + +* Writing tests +* Code review +* Other guidelines + +### Who do I talk to? ### + +* Repo owner or admin +* Other community or team contact \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/README.md.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/README.md.meta new file mode 100644 index 00000000..9524bbe6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6821e77581cba42709aed902773c2d92 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime.meta new file mode 100644 index 00000000..2ce32d83 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2c5f40ac65e5b44a8bb645fccb961a15 +folderAsset: yes +timeCreated: 1576064798 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary.meta new file mode 100644 index 00000000..50b62dca --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ea5576c413096416d93b2ec8c0c7fa2b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AssemblyInfo.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AssemblyInfo.cs new file mode 100644 index 00000000..c3e080cc --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AssemblyInfo.cs @@ -0,0 +1,25 @@ +using System.Runtime.CompilerServices; + +// make it visible for internal modules +[assembly: InternalsVisibleTo("VoxelBusters.CoreLibrary.NativePlugins")] +[assembly: InternalsVisibleTo("VoxelBusters.CoreLibrary.Editor")] +[assembly: InternalsVisibleTo("VoxelBusters.CoreLibrary.Editor.NativePlugins")] + +[assembly: InternalsVisibleTo("VoxelBusters.EssentialKit")] +[assembly: InternalsVisibleTo("VoxelBusters.EssentialKit.Editor")] + +[assembly: InternalsVisibleTo("VoxelBusters.ScreenRecorderKit")] +[assembly: InternalsVisibleTo("VoxelBusters.ScreenRecorderKit.Editor")] + +[assembly: InternalsVisibleTo("VoxelBusters.ReportingKit")] +[assembly: InternalsVisibleTo("VoxelBusters.ReportingKit.Editor")] + +[assembly: InternalsVisibleTo("VoxelBusters.EasyMLKit")] +[assembly: InternalsVisibleTo("VoxelBusters.EasyMLKit.Editor")] + +[assembly: InternalsVisibleTo("VoxelBusters.SocialKit")] +[assembly: InternalsVisibleTo("VoxelBusters.SocialKit.Editor")] + +// AdsKit +[assembly: InternalsVisibleTo("VoxelBusters.AdsKit")] +[assembly: InternalsVisibleTo("VoxelBusters.AdsKit.Editor")] diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AssemblyInfo.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AssemblyInfo.cs.meta new file mode 100644 index 00000000..91700f6b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AssemblyInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7f5661c7f11324611b509f9f0aada138 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations.meta new file mode 100644 index 00000000..44f98690 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4f239ec3dc7484d988ea6c2d5e639796 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperation.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperation.cs new file mode 100644 index 00000000..5d3d8dd1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperation.cs @@ -0,0 +1,217 @@ +using System.Collections; + +namespace VoxelBusters.CoreLibrary +{ + [IncludeInDocs] + public abstract class AsyncOperation : IAsyncOperation, IAsyncOperation, IAsyncOperationUpdateHandler + { + #region Events + + private event Callback OnProgressTypeless; + + private event Callback OnCompleteTypeless; + + #endregion + + #region Constructors + + protected AsyncOperation() + { + // Set initial values + Status = AsyncOperationStatus.NotStarted; + IsDone = false; + Error = null; + OnComplete = null; + } + + #endregion + + #region Public methods + + public void Start() + { + // Check whether operation is already started + if (!IsCurrentStatus(AsyncOperationStatus.NotStarted)) + { + DebugLogger.LogWarning(CoreLibraryDomain.Default, "The requested operation could not be started."); + return; + } + + SetStarted(); + } + + public void Abort() + { + // Check whether operation is already completed + if (!IsCurrentStatus(AsyncOperationStatus.InProgress)) + { + DebugLogger.LogWarning(CoreLibraryDomain.Default, "The requested operation could not be cancelled."); + return; + } + + OnAbort(); + SetIsCompleted(error: new Error("Async operation was cancelled!")); + } + + #endregion + + #region Private methods + + private bool IsCurrentStatus(AsyncOperationStatus status) + { + return (Status == status); + } + + private void SetStarted() + { + // Update instance state + Status = AsyncOperationStatus.InProgress; + + // Register instance to the scheduler + AsyncOperationManager.ScheduleUpdate(this); + + // Send state specific message + OnStart(); + } + + protected virtual void SetIsCompleted(T result = default(T)) + { + SetIsCompletedInternal( + result: result, + error: null, + status: AsyncOperationStatus.Succeeded); + } + + protected virtual void SetIsCompleted(Error error) + { + Assert.IsArgNotNull(error, nameof(error)); + + SetIsCompletedInternal( + result: default(T), + error: error, + status: AsyncOperationStatus.Failed); + } + + private void SetIsCompletedInternal(T result, Error error, AsyncOperationStatus status) + { + // Check whether status can be updated + if (!IsCurrentStatus(AsyncOperationStatus.InProgress)) + { + DebugLogger.LogWarning(CoreLibraryDomain.Default, "The requested operation could not be marked as completed."); + return; + } + + // Unregister object from scheduler + AsyncOperationManager.UnscheduleUpdate(this); + + // Update instance state + IsDone = true; + Result = result; + Error = error; + Status = status; + + // Send state specific message + OnEnd(); + + SendCompleteEvent(); + } + + private void SendProgressEvent() + { + OnProgressTypeless?.Invoke(this); + OnProgress?.Invoke(this); + } + + private void SendCompleteEvent() + { + OnCompleteTypeless?.Invoke(this); + OnComplete?.Invoke(this); + } + + #endregion + + #region State messages + + protected virtual void OnStart() + { } + + protected virtual void OnUpdate() + { } + + protected virtual void OnEnd() + { } + + protected virtual void OnAbort() + { } + + #endregion + + #region IAsyncOperation implementation + + public AsyncOperationStatus Status { get; private set; } + + public bool IsDone { get; private set; } + + object IAsyncOperation.Result => Result; + + public Error Error { get; private set; } + + public float Progress { get; protected set; } + + event Callback IAsyncOperation.OnProgress + { + add { OnProgressTypeless += value; } + remove { OnProgressTypeless -= value; } + } + + event Callback IAsyncOperation.OnComplete + { + add { OnCompleteTypeless += value; } + remove { OnCompleteTypeless -= value; } + } + + public T Result { get; private set; } + + public event Callback> OnProgress; + + public event Callback> OnComplete; + + object IEnumerator.Current => null; + + bool IEnumerator.MoveNext() + { + if (IsCurrentStatus(AsyncOperationStatus.NotStarted)) + { + SetStarted(); + } + + return !IsDone; + } + + public virtual void Reset() + { + // Reset properties + Status = AsyncOperationStatus.NotStarted; + IsDone = false; + Error = null; + Progress = 0f; + } + + #endregion + + #region IAsyncOperationUpdateHandler implemetation + + void IAsyncOperationUpdateHandler.Update() + { + // Execute start method instructions when operation begins + if (IsCurrentStatus(AsyncOperationStatus.InProgress)) + { + OnUpdate(); + SendProgressEvent(); + return; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperation.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperation.cs.meta new file mode 100644 index 00000000..8b652341 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2c54782cb90eb43a2a52fb6c1f232928 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationHandle.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationHandle.cs new file mode 100644 index 00000000..c3a8f951 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationHandle.cs @@ -0,0 +1,140 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class AsyncOperationHandle : IAsyncOperationHandle, IEquatable> + { + #region Events + + private event Callback OnProgressTypeless; + + private event Callback OnCompleteTypeless; + + #endregion + + #region IAsyncOperationHandle implementation + + public IAsyncOperation InternalOp { get; private set; } + + public AsyncOperationStatus Status => InternalOp.Status; + + public bool IsDone => InternalOp.IsDone; + + public float Progress => InternalOp.Progress; + + object IAsyncOperationHandle.Result => Result; + + public Error Error => InternalOp.Error; + + public T Result => InternalOp.Result; + + event Callback IAsyncOperationHandle.OnProgress + { + add { OnProgressTypeless += value; } + remove { OnProgressTypeless -= value; } + } + + event Callback IAsyncOperationHandle.OnComplete + { + add { OnCompleteTypeless += value; } + remove { OnCompleteTypeless -= value; } + } + + public event Callback> OnProgress; + + public event Callback> OnComplete; + + #endregion + + #region Constructors + + public AsyncOperationHandle(IAsyncOperation op) + { + Assert.IsArgNotNull(op, nameof(op)); + + // Set properties + InternalOp = op; + OnProgress = null; + OnComplete = null; + RegisterForCallbacks(); + + // Manually invoke the events incase if the operation is already completed + if (op.IsDone) + { + SurrogateCoroutine.WaitForEndOfFrameAndInvoke(action: () => + { + HandleOnProgress(op); + HandleOnComplete(op); + }); + } + } + + #endregion + + #region Private methods + + private void RegisterForCallbacks() + { + if (InternalOp == null) return; + + InternalOp.OnProgress += HandleOnProgress; + InternalOp.OnComplete += HandleOnComplete; + } + + private void UnregisterCallbacks() + { + if (InternalOp == null) return; + + InternalOp.OnProgress -= HandleOnProgress; + InternalOp.OnComplete -= HandleOnComplete; + } + + #endregion + + #region Event handler methods + + private void HandleOnProgress(IAsyncOperation asyncOperation) + { + // Forward event callback + OnProgressTypeless?.Invoke(this); + OnProgress?.Invoke(this); + } + + private void HandleOnComplete(IAsyncOperation asyncOperation) + { + // Forward event callback + OnCompleteTypeless?.Invoke(this); + OnComplete?.Invoke(this); + + UnregisterCallbacks(); + } + + #endregion + + #region IEnumerator implementation + + public object Current => null; + + public bool MoveNext() => !InternalOp.IsDone; + + public void Reset() => InternalOp?.Reset(); + + #endregion + + #region IEquatable implemetation + + public bool Equals(AsyncOperationHandle other) + { + if ((other == null) || (other.InternalOp == null)) return false; + + if (InternalOp == null) return false; + + return (InternalOp == other.InternalOp); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationHandle.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationHandle.cs.meta new file mode 100644 index 00000000..2cdb123b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationHandle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e04d669bab9834f0480f59e447829367 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationManager.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationManager.cs new file mode 100644 index 00000000..b322b5b3 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationManager.cs @@ -0,0 +1,74 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + internal static class AsyncOperationManager + { + #region Properties + + [ClearOnReload] + private static List s_targets; + + #endregion + + #region Static methods + + public static void ScheduleUpdate(IAsyncOperationUpdateHandler target) + { + Assert.IsArgNotNull(target, nameof(target)); + + EnsureInitialised(); + + s_targets.Add(target); + } + + public static void UnscheduleUpdate(IAsyncOperationUpdateHandler target) + { + Assert.IsArgNotNull(target, nameof(target)); + + EnsureInitialised(); + + s_targets.Remove(target); + } + + #endregion + + #region Unity methods + + private static void Update() + { + UpdateTargets(); + } + + #endregion + + #region Private methods + + private static void EnsureInitialised() + { + if (s_targets != null) return; + + // Set properties + s_targets = new List(8); + + // Register for callbacks + Scheduler.Update += Update; + } + + private static void UpdateTargets() + { + for (int iter = 0; iter < s_targets.Count; iter++) + { + var target = s_targets[iter]; + if (target != null) + { + target.Update(); + } + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationManager.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationManager.cs.meta new file mode 100644 index 00000000..59b92005 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 56f544199d23646cfb42341c091f51f6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationResultContainer.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationResultContainer.cs new file mode 100644 index 00000000..e5d13078 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationResultContainer.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class AsyncOperationResultContainer : IAsyncOperationResultContainer, IAsyncOperationResultContainer where TError : Error + { + #region Fields + + private TData m_data; + + private TError m_error; + + #endregion + + #region Constructors + + public AsyncOperationResultContainer() + { + // set properties + m_data = default(TData); + m_error = default(TError); + } + + #endregion + + #region Setter methods + + protected void SetDataInternal(TData data) + { + // set value + m_data = data; + } + + protected void SetErrorInternal(TError error) + { + // set value + m_error = error; + } + + #endregion + + #region IAsyncOperationResultContainer implementation + + public bool IsError() + { + return (m_error != null); + } + + public string GetErrorDescription() + { + return IsError() ? m_error.Description : null; + } + + Error IAsyncOperationResultContainer.GetError() + { + return GetError(); + } + + object IAsyncOperationResultContainer.GetData() + { + return GetData(); + } + + public string GetDataAsText() + { + throw new NotSupportedException(); + } + + #endregion + + #region Generic IAsyncOperationResultContainer implementation + + public TError GetError() + { + return m_error; + } + + public TData GetData() + { + return m_data; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationResultContainer.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationResultContainer.cs.meta new file mode 100644 index 00000000..7a5c6679 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationResultContainer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2b5efd7c0165f481794514c551a99183 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationStatus.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationStatus.cs new file mode 100644 index 00000000..881b2b9c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationStatus.cs @@ -0,0 +1,17 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public enum AsyncOperationStatus + { + NotStarted = 0, + + InProgress, + + Succeeded, + + Failed, + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationStatus.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationStatus.cs.meta new file mode 100644 index 00000000..f0782fe9 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/AsyncOperationStatus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 787d2e2a95b20456dace21f5c4a6a125 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/ChainedOperation.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/ChainedOperation.cs new file mode 100644 index 00000000..988ef31d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/ChainedOperation.cs @@ -0,0 +1,148 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class ChainedOperation : AsyncOperation + { + #region Fields + + private int m_operationCount; + + private bool m_abortOnError; + + private IAsyncOperation m_activeOperation; + + private int m_activeOperationIndex; + + #endregion + + #region Properties + + public IAsyncOperation[] Operations { get; private set; } + + #endregion + + #region Constructors + + public ChainedOperation(bool abortOnError = false, params IAsyncOperation[] operations) + { + Assert.IsArgNotNull(operations, nameof(operations)); + + int count = operations.Length; + Assert.IsNotZero(count, "Array is empty."); + + // set properties + Operations = operations; + m_operationCount = count; + m_abortOnError = abortOnError; + m_activeOperationIndex = -1; + } + + #endregion + + #region Base class methods + + public override void Reset() + { + base.Reset(); + + // reset properties + for (int iter = 0; iter < m_operationCount; iter++) + { + Operations[iter].Reset(); + } + m_activeOperation = null; + m_activeOperationIndex = -1; + } + + protected override void OnStart() + { + base.OnStart(); + + // start first operation + StartOperation(index: 0); + } + + protected override void OnUpdate() + { + base.OnUpdate(); + + // check whether current operation is completed + if (m_activeOperation == null) + { + SetIsCompleted(error: new Error("Unknown error!")); + return; + } + + if (m_activeOperation.IsDone) + { + if (m_abortOnError && (m_activeOperation.Status == AsyncOperationStatus.Failed)) + { + SetIsCompleted(error: m_activeOperation.Error); + return; + } + // proceed to the next operation + if (!StartOperation(index: (m_activeOperationIndex + 1))) + { + SetIsCompleted(result: null); + return; + } + } + else + { + UpdateProgress(); + } + } + + protected override void SetIsCompleted(object result) + { + // set final progress value + Progress = 1f; + + base.SetIsCompleted(result); + } + + protected override void SetIsCompleted(Error error) + { + // set final progress value + Progress = 0f; + + base.SetIsCompleted(error); + } + + #endregion + + #region Private methods + + private bool StartOperation(int index) + { + if (index < m_operationCount) + { + m_activeOperation = Operations[index]; + m_activeOperationIndex = index; + m_activeOperation.Start(); + + return true; + } + + return false; + } + + private void UpdateProgress() + { + // find cumulative progress + float progress = 0f; + for (int iter = 0; iter < m_operationCount; iter++) + { + progress += Operations[iter].Progress; + } + + // set normalized value + Progress = (progress / m_operationCount); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/ChainedOperation.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/ChainedOperation.cs.meta new file mode 100644 index 00000000..c19295be --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/ChainedOperation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d368eed805b7a4000a07da8f5dc6f061 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/GroupOperation.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/GroupOperation.cs new file mode 100644 index 00000000..65c2b313 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/GroupOperation.cs @@ -0,0 +1,161 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class GroupOperation : AsyncOperation + { + #region Fields + + private int m_operationCount; + + private bool m_abortOnError; + + #endregion + + #region Properties + + public IAsyncOperation[] Operations { get; private set; } + + #endregion + + #region Constructors + + public GroupOperation(bool abortOnError = false, params IAsyncOperation[] operations) + { + Assert.IsArgNotNull(operations, nameof(operations)); + + int count = operations.Length; + Assert.IsNotZero(count, "Array is empty."); + + // set properties + Operations = operations; + m_operationCount = count; + m_abortOnError = abortOnError; + } + + #endregion + + #region Base class methods + + public override void Reset() + { + base.Reset(); + + // reset properties + for (int iter = 0; iter < m_operationCount; iter++) + { + Operations[iter].Reset(); + } + } + + protected override void OnStart() + { + base.OnStart(); + + // start all operations + for (int iter = 0; iter < m_operationCount; iter++) + { + var current = Operations[iter]; + current.Start(); + } + } + + protected override void OnUpdate() + { + base.OnUpdate(); + + // iterate through the list and check current status of participating operations + bool isDone = true; + Error error = null; + for (int iter = 0; iter < m_operationCount; iter++) + { + // check whether operation has completed + var current = Operations[iter]; + if (!current.IsDone) + { + isDone = false; + break; + } + + if (AsyncOperationStatus.Failed == current.Status) + { + if (m_abortOnError) + { + error = current.Error; + break; + } + } + } + + // update state based on operation results + if (isDone) + { + if (error != null) + { + if (m_abortOnError) + { + AbortActiveOperations(); + } + SetIsCompleted(error: error); + } + else + { + SetIsCompleted(result: null); + } + } + else + { + UpdateProgress(); + } + } + + protected override void SetIsCompleted(object result) + { + // set final progress value + Progress = 1f; + + base.SetIsCompleted(result); + } + + protected override void SetIsCompleted(Error error) + { + // set final progress value + Progress = 0f; + + base.SetIsCompleted(error); + } + + #endregion + + #region Private methods + + private void UpdateProgress() + { + // find cumulative progress + float progress = 0f; + for (int iter = 0; iter < m_operationCount; iter++) + { + progress += Operations[iter].Progress; + } + + // set normalized value + Progress = (progress / m_operationCount); + } + + private void AbortActiveOperations() + { + for (int iter = 0; iter < m_operationCount; iter++) + { + var current = Operations[iter]; + if (!current.IsDone) + { + current.Abort(); + } + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/GroupOperation.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/GroupOperation.cs.meta new file mode 100644 index 00000000..5b2fc5a6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/GroupOperation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4281fd4f764e94111b3fc11840f471d1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/IAsyncOperation.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/IAsyncOperation.cs new file mode 100644 index 00000000..26f592e7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/IAsyncOperation.cs @@ -0,0 +1,61 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public interface IAsyncOperation : IEnumerator + { + #region Properties + + AsyncOperationStatus Status { get; } + + bool IsDone { get; } + + object Result { get; } + + Error Error { get; } + + float Progress { get; } + + #endregion + + #region Methods + + void Start(); + + void Abort(); + + #endregion + + #region Events + + event Callback OnProgress; + + event Callback OnComplete; + + #endregion + } + + public interface IAsyncOperation : IAsyncOperation + { + #region Properties + + new T Result { get; } + + #endregion + + #region Events + + new event Callback> OnProgress; + + new event Callback> OnComplete; + + #endregion + } + + public interface IAsyncOperationUpdateHandler + { + void Update(); + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/IAsyncOperation.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/IAsyncOperation.cs.meta new file mode 100644 index 00000000..4ac86f67 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/IAsyncOperation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c8f74c276e800437b8310588926a5b51 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/IAsyncOperationHandle.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/IAsyncOperationHandle.cs new file mode 100644 index 00000000..41dbdd1c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/IAsyncOperationHandle.cs @@ -0,0 +1,48 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public interface IAsyncOperationHandle : IEnumerator + { + #region Properties + + AsyncOperationStatus Status { get; } + + bool IsDone { get; } + + object Result { get; } + + Error Error { get; } + + float Progress { get; } + + #endregion + + #region Events + + event Callback OnProgress; + + event Callback OnComplete; + + #endregion + } + + public interface IAsyncOperationHandle : IAsyncOperationHandle + { + #region Properties + + new T Result { get; } + + #endregion + + #region Events + + new event Callback> OnProgress; + + new event Callback> OnComplete; + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/IAsyncOperationHandle.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/IAsyncOperationHandle.cs.meta new file mode 100644 index 00000000..99b97b87 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/IAsyncOperationHandle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f7869d21d008749068884a317745d5bd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/IAsyncOperationResultContainer.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/IAsyncOperationResultContainer.cs new file mode 100644 index 00000000..5eb3a9b8 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/IAsyncOperationResultContainer.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public interface IAsyncOperationResultContainer + { + #region Methods + + bool IsError(); + + string GetErrorDescription(); + + Error GetError(); + + object GetData(); + + string GetDataAsText(); + + #endregion + } + + public interface IAsyncOperationResultContainer : IAsyncOperationResultContainer where TError : Error + { + #region Methods + + new TError GetError(); + + new TData GetData(); + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/IAsyncOperationResultContainer.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/IAsyncOperationResultContainer.cs.meta new file mode 100644 index 00000000..4e91ebf5 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/AsyncOperations/IAsyncOperationResultContainer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 11dc72c5107f445179f18a5a78b83d05 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes.meta new file mode 100644 index 00000000..cd79e40e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1030d3800bbfd491ea826259732186c8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/ClearOnReloadAttribute.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/ClearOnReloadAttribute.cs new file mode 100644 index 00000000..638f09dd --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/ClearOnReloadAttribute.cs @@ -0,0 +1,56 @@ +using System; +// Credits: https://github.com/joshcamas/unity-domain-reload-helper + +namespace VoxelBusters.CoreLibrary +{ + public enum ClearOnReloadOption + { + None, + + Default, + + Custom, + } + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Event)] + public class ClearOnReloadAttribute : Attribute + { + #region Properties + + public ClearOnReloadOption Option { get; private set; } + + public object CustomValue { get; private set; } + + #endregion + + #region Properties + + /// + /// Marks field of property to be cleared and assigned given value on reload. + /// + public ClearOnReloadAttribute() + : this(ClearOnReloadOption.None, null) + { } + + /// + /// Marks field of property to be cleared and assigned given value on reload. + /// + /// Explicit value which will be assigned to field/property on reload. + public ClearOnReloadAttribute(object customValue) + : this(ClearOnReloadOption.Custom, customValue) + { } + + /// + /// Marks field of property to be cleared and assigned given value on reload. + /// + /// Option to be used. + /// Explicit value which will be assigned to field/property on reload. + public ClearOnReloadAttribute(ClearOnReloadOption option, object customValue = null) + { + Option = option; + CustomValue = customValue; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/ClearOnReloadAttribute.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/ClearOnReloadAttribute.cs.meta new file mode 100644 index 00000000..107fdc35 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/ClearOnReloadAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c99f4ee533eb349b09cc34a8fcc1528e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/DefaultAttribute.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/DefaultAttribute.cs new file mode 100644 index 00000000..4dccba6d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/DefaultAttribute.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class DefaultValueAttribute : Attribute + { + #region Fields + + private bool? m_boolValue; + + private int? m_int32Value; + + private float? m_singleValue; + + private string m_stringValue; + + #endregion + + #region Properties + + public bool BoolValue => m_boolValue.GetValueOrDefault(); + + public int Int32Value => m_int32Value.GetValueOrDefault(); + + public float SingleValue => m_singleValue.GetValueOrDefault(); + + public string StringValue => m_stringValue; + + #endregion + + #region Constructors + + public DefaultValueAttribute(bool value) + { + // set properties + m_boolValue = value; + } + + public DefaultValueAttribute(int value) + { + // set properties + m_int32Value = value; + } + + public DefaultValueAttribute(float value) + { + // set properties + m_singleValue = value; + } + + public DefaultValueAttribute(string value) + { + // set properties + m_stringValue = value; + } + + #endregion + + #region Public methods + + public T GetValue() + { + return (T)GetValue(typeof(T)); + } + + public object GetValue(Type type) + { + switch (Type.GetTypeCode(type)) + { + case TypeCode.Boolean: + return BoolValue; + + case TypeCode.Int32: + return Int32Value; + + case TypeCode.Single: + return SingleValue; + + case TypeCode.String: + return StringValue; + + default: + return null; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/DefaultAttribute.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/DefaultAttribute.cs.meta new file mode 100644 index 00000000..84b35853 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/DefaultAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 666901cb9fe5441f198888ba97da19b1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/EnumMaskFieldAttribute.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/EnumMaskFieldAttribute.cs new file mode 100644 index 00000000..d0eb1f0a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/EnumMaskFieldAttribute.cs @@ -0,0 +1,30 @@ +using System; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class EnumMaskFieldAttribute : PropertyAttribute + { + #region Properties + + public Type EnumType + { + get; + private set; + } + + #endregion + + #region Constructors + + private EnumMaskFieldAttribute() + {} + + public EnumMaskFieldAttribute(Type type) + { + EnumType = type; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/EnumMaskFieldAttribute.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/EnumMaskFieldAttribute.cs.meta new file mode 100644 index 00000000..2ee20346 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/EnumMaskFieldAttribute.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3a6eb93874bc5406ea64339972b667ad +timeCreated: 1579074419 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/ExecuteOnReloadAttribute.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/ExecuteOnReloadAttribute.cs new file mode 100644 index 00000000..42684174 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/ExecuteOnReloadAttribute.cs @@ -0,0 +1,15 @@ +using System; +// Credits: https://github.com/joshcamas/unity-domain-reload-helper + +namespace VoxelBusters.CoreLibrary +{ + [AttributeUsage(AttributeTargets.Method)] + public class ExecuteOnReloadAttribute : Attribute + { + /// + /// Marks method to be executed on reload. + /// + public ExecuteOnReloadAttribute() + { } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/ExecuteOnReloadAttribute.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/ExecuteOnReloadAttribute.cs.meta new file mode 100644 index 00000000..a6bc1aca --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/ExecuteOnReloadAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 558d91a3fc718409abcafe24bed90c1b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/FileBrowserAttribute.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/FileBrowserAttribute.cs new file mode 100644 index 00000000..e4de7307 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/FileBrowserAttribute.cs @@ -0,0 +1,28 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class FileBrowserAttribute : PropertyAttribute + { + #region Properties + + public bool UsesRelativePath { get; private set; } + + public string Extension { get; private set; } + + #endregion + + #region Constructors + + public FileBrowserAttribute(bool usesRelativePath, string extension = null) + { + // set properties + UsesRelativePath = usesRelativePath; + Extension = extension; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/FileBrowserAttribute.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/FileBrowserAttribute.cs.meta new file mode 100644 index 00000000..a871f9ed --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/FileBrowserAttribute.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: eb3faba3081ee40a7a091fb6423f3492 +timeCreated: 1576323712 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/FolderBrowserAttribute.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/FolderBrowserAttribute.cs new file mode 100644 index 00000000..40c0eed9 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/FolderBrowserAttribute.cs @@ -0,0 +1,25 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class FolderBrowserAttribute : PropertyAttribute + { + #region Properties + + public bool UsesRelativePath { get; private set; } + + #endregion + + #region Constructors + + public FolderBrowserAttribute(bool usesRelativePath) + { + // set properties + UsesRelativePath = usesRelativePath; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/FolderBrowserAttribute.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/FolderBrowserAttribute.cs.meta new file mode 100644 index 00000000..df91ce26 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/FolderBrowserAttribute.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: fd0b85bdf9d0042159e0caacf2196490 +timeCreated: 1576323713 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/IncludeInDocsAttribute.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/IncludeInDocsAttribute.cs new file mode 100644 index 00000000..8e9615d7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/IncludeInDocsAttribute.cs @@ -0,0 +1,9 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class IncludeInDocsAttribute : System.Attribute + { } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/IncludeInDocsAttribute.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/IncludeInDocsAttribute.cs.meta new file mode 100644 index 00000000..310a611d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/IncludeInDocsAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f2c7e1aa6af34f20884dc715ac25bd9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/InterfaceFieldAttribute.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/InterfaceFieldAttribute.cs new file mode 100644 index 00000000..d62a5a17 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/InterfaceFieldAttribute.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class InterfaceFieldAttribute : PropertyAttribute + { + #region Properties + + public Type InterfaceType + { + get; + private set; + } + + #endregion + + #region Constructors + + public InterfaceFieldAttribute(Type interfaceType) + { + // set properties + InterfaceType = interfaceType; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/InterfaceFieldAttribute.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/InterfaceFieldAttribute.cs.meta new file mode 100644 index 00000000..1491ed1b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/InterfaceFieldAttribute.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 31f63c1f822124d4bb5ea7f9c49cbfd0 +timeCreated: 1577514104 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/ReadOnlyAttribute.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/ReadOnlyAttribute.cs new file mode 100644 index 00000000..1a28ddd4 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/ReadOnlyAttribute.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class ReadOnlyAttribute : PropertyAttribute + { + public string Message + { + get; + private set; + } + + + /// + /// Marks field to be read-only in the inspector. + /// + public ReadOnlyAttribute(string message = null) + { + Message = message; + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/ReadOnlyAttribute.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/ReadOnlyAttribute.cs.meta new file mode 100644 index 00000000..723dea85 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/ReadOnlyAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6c19cb0d4b4f745b18fbe9734b0fd057 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/StringPopupAttribute.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/StringPopupAttribute.cs new file mode 100644 index 00000000..2ce4a0ec --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/StringPopupAttribute.cs @@ -0,0 +1,58 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + /// + /// Base class to create custom string popup field in the inspector. + /// + [IncludeInDocs] + public class StringPopupAttribute : PropertyAttribute + { + #region Static fields + + private static readonly string[] s_emptyOptions = new string[0]; + + #endregion + + #region Fields + + private readonly string[] m_fixedOptions; + + private readonly bool m_usesFixedOptions; + + #endregion + + #region Properties + + public string PreferencePropertyName { get; private set; } + + public bool PreferencePropertyValue { get; private set; } + + public string[] Options => m_usesFixedOptions ? m_fixedOptions : GetDynamicOptions(); + + #endregion + + #region Constructors + + public StringPopupAttribute(string preferencePropertyName = null, + bool preferencePropertyValue = true, + params string[] fixedOptions) + { + // set properties + PreferencePropertyName = preferencePropertyName; + PreferencePropertyValue = preferencePropertyValue; + m_fixedOptions = fixedOptions; + m_usesFixedOptions = !fixedOptions.IsNullOrEmpty(); + } + + #endregion + + #region Private methods + + protected virtual string[] GetDynamicOptions() => s_emptyOptions; + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/StringPopupAttribute.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/StringPopupAttribute.cs.meta new file mode 100644 index 00000000..b06ef8b6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Attributes/StringPopupAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d8e2dda3cd19542bf98c1644cce52d81 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components.meta new file mode 100644 index 00000000..e6bd52be --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2e638ac5554f2457688cc94da0c82081 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/ActionTriggerComponent.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/ActionTriggerComponent.cs new file mode 100644 index 00000000..d514ebc8 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/ActionTriggerComponent.cs @@ -0,0 +1,158 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public abstract class ActionTriggerComponent : MonoBehaviour + { + #region Fields + + [SerializeField] + private ActionTriggerType m_triggerOn; + + #endregion + + #region Properties + + public bool IsDone { get; protected set; } + + #endregion + + #region Abstract members + + public abstract void ExecuteAction(); + + #endregion + + #region Unity methods + + private void Start() + { + TryExecuteAction(triggerType: ActionTriggerType.Start); + } + + private void OnEnable() + { + TryExecuteAction(triggerType: ActionTriggerType.OnEnable); + } + + private void OnDisable() + { + TryExecuteAction(triggerType: ActionTriggerType.OnDisable); + } + + private void OnDestroy() + { + TryExecuteAction(triggerType: ActionTriggerType.Destroy); + } + + private void Update() + { + if (!IsDone) + { + TryExecuteAction(triggerType: ActionTriggerType.Update); + } + } + + private void OnTriggerEnter(Collider other) + { + TryExecuteAction(triggerType: ActionTriggerType.TriggerEnter); + } + + private void OnTriggerExit(Collider other) + { + TryExecuteAction(triggerType: ActionTriggerType.TriggerExit); + } + + private void OnCollisionEnter(Collision collision) + { + TryExecuteAction(triggerType: ActionTriggerType.CollisionEnter); + } + + private void OnCollisionExit(Collision collision) + { + TryExecuteAction(triggerType: ActionTriggerType.CollisionExit); + } + + private void OnTriggerEnter2D(Collider2D collision) + { + TryExecuteAction(triggerType: ActionTriggerType.TriggerEnter2D); + } + + private void OnTriggerExit2D(Collider2D collision) + { + TryExecuteAction(triggerType: ActionTriggerType.TriggerExit2D); + } + + private void OnCollisionEnter2D(Collision2D collision) + { + TryExecuteAction(triggerType: ActionTriggerType.CollisionEnter2D); + } + + private void OnCollisionExit2D(Collision2D collision) + { + TryExecuteAction(triggerType: ActionTriggerType.CollisionExit2D); + } + + #endregion + + #region Public methods + + public virtual void Reset() + { + IsDone = false; + } + + #endregion + + #region Private methods + + private bool TryExecuteAction(ActionTriggerType triggerType) + { + if (!IsDone && (triggerType == m_triggerOn)) + { + ExecuteAction(); + return true; + } + return false; + } + + #endregion + + #region Nested types + + public enum ActionTriggerType + { + Start = 1, + + Destroy, + + OnEnable, + + OnDisable, + + Update, + + TriggerEnter, + + TriggerExit, + + CollisionEnter, + + CollisionExit, + + TriggerEnter2D, + + TriggerExit2D, + + CollisionEnter2D, + + CollisionExit2D, + + Custom, + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/ActionTriggerComponent.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/ActionTriggerComponent.cs.meta new file mode 100644 index 00000000..8f8ef73a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/ActionTriggerComponent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cafe526d8f7d4487a8c51c21c2d036be +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/CallbackDispatcher.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/CallbackDispatcher.cs new file mode 100644 index 00000000..96088808 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/CallbackDispatcher.cs @@ -0,0 +1,228 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + /// + /// Generic callback definition for operations. + /// + public delegate void Callback(); + + /// + /// Generic callback definition for events. + /// + public delegate void Callback(TArg arg); + + /// + /// Generic callback definition for events. + /// + public delegate void SuccessCallback(TResult result); + + /// + /// Generic callback definition for operations. + /// + public delegate void ErrorCallback(Error error); + + /// + /// Generic callback definition for operations. + /// + public delegate void CompletionCallback(bool success, Error error); + + /// + /// Generic callback definition for events. + /// + public delegate void CompletionCallback(TResult result, Error error); + + /// + /// Generic callback definition for operations. + /// + public delegate void EventCallback(TResult result, Error error); + + public class CallbackDispatcher : PrivateSingletonBehaviour + { + #region Fields + + private Queue m_queue; + private readonly object queueLock = new object(); + + #endregion + + #region Static methods + + public static CallbackDispatcher Initialize() + { + return GetSingleton(); + } + + public static void InvokeOnMainThread(Callback callback) + { + // validate arguments + if (callback == null) + { + //DebugLogger.LogWarning("Callback is null."); + return; + } + + // add request to queue + var manager = GetSingleton(); + if (manager) + { + manager.AddAction(action: () => callback.Invoke()); + } + } + + public static void InvokeOnMainThread(Callback callback, TArg arg) + { + // validate arguments + if (callback == null) + { + //DebugLogger.LogWarning("Callback is null."); + return; + } + + // add request to queue + var manager = GetSingleton(); + if (manager) + { + manager.AddAction(() => callback.Invoke(arg)); + } + } + + public static void InvokeOnMainThread(SuccessCallback callback, TResult result) + { + // validate arguments + if (callback == null) + { + //DebugLogger.LogWarning("Callback is null."); + return; + } + + // add request to queue + var manager = GetSingleton(); + if (manager) + { + manager.AddAction(() => callback.Invoke(result)); + } + } + + public static void InvokeOnMainThread(ErrorCallback callback, Error error) + { + // validate arguments + if (callback == null) + { + //DebugLogger.LogWarning("Callback is null."); + return; + } + + // add request to queue + var manager = GetSingleton(); + if (manager) + { + manager.AddAction(() => callback.Invoke(error)); + } + } + + public static void InvokeOnMainThread(CompletionCallback callback, bool success, Error error) + { + // validate arguments + if (callback == null) + { + //DebugLogger.LogWarning("Callback is null."); + return; + } + + // add request to queue + var manager = GetSingleton(); + if (manager) + { + manager.AddAction(action: () => callback.Invoke(success, error)); + } + } + + public static void InvokeOnMainThread(CompletionCallback callback, TResult result, Error error) + { + // validate arguments + if (callback == null) + { + //DebugLogger.LogWarning("Callback is null."); + return; + } + + // add request to queue + var manager = GetSingleton(); + if (manager) + { + manager.AddAction(() => callback.Invoke(result, error)); + } + } + + public static void InvokeOnMainThread(EventCallback callback, IOperationResultContainer resultContainer) + { + InvokeOnMainThread(callback, resultContainer.GetResult(), resultContainer.GetError()); + } + + public static void InvokeOnMainThread(EventCallback callback, TResult result, Error error) + { + // validate arguments + if (callback == null) + { + //DebugLogger.LogWarning("Callback is null."); + return; + } + + // add request to queue + var manager = GetSingleton(); + if (manager) + { + manager.AddAction(() => callback.Invoke(result, error)); + } + } + + #endregion + + #region Unity methods + + protected override void OnSingletonAwake() + { + base.OnSingletonAwake(); + + // Set properties + m_queue = new Queue(capacity: 16); + } + + private void LateUpdate() + { + try + { + lock(queueLock) + { + // execute pending actions + while (m_queue.Count > 0) + { + var action = m_queue.Dequeue(); + action(); + } + } + } + catch (Exception expection) + { + DebugLogger.LogException(CoreLibraryDomain.Default, expection); + } + } + + #endregion + + #region Private methods + + private void AddAction(Action action) + { + lock(queueLock) + { + m_queue.Enqueue(action); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/CallbackDispatcher.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/CallbackDispatcher.cs.meta new file mode 100644 index 00000000..a8a9519c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/CallbackDispatcher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9db01c621d5964115aa41c1003a45c6c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/EditorScheduler.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/EditorScheduler.cs new file mode 100644 index 00000000..9e8a8fb6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/EditorScheduler.cs @@ -0,0 +1,91 @@ +#if UNITY_EDITOR +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + internal class EditorScheduler : IScheduler + { + #region Fields + + private List m_activeCoroutines; + + #endregion + + #region Constructors + + public EditorScheduler() + { + // Set properties + m_activeCoroutines = new List(); + + // Register for callback + UnityEditor.EditorApplication.update += EditorUpdate; + } + + ~EditorScheduler() + { + // Unregister from callback + UnityEditor.EditorApplication.update -= EditorUpdate; + } + + #endregion + + #region Private methods + + private void EditorUpdate() + { + UpdateCoroutines(); + SendUpdateEvent(); + } + + private void UpdateCoroutines() + { + for (int iter = 0; iter < m_activeCoroutines.Count; iter++) + { + var routine = m_activeCoroutines[iter]; + if (routine == null) continue; + + if (!routine.MoveNext()) + { + m_activeCoroutines.RemoveAt(iter); + iter--; + } + } + } + + private void SendUpdateEvent() + { + Update?.Invoke(); + } + + #endregion + + #region IScheduler implementation + + public event Callback Update; + + public void StartCoroutine(IEnumerator routine) + { + if (routine == null) return; + + m_activeCoroutines.AddUnique(routine); + } + + public void StopCoroutine(IEnumerator routine) + { + if (routine == null) return; + + m_activeCoroutines.Remove(routine); + } + + public void StopAllCoroutines() + { + m_activeCoroutines.Clear(); + } + + #endregion + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/EditorScheduler.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/EditorScheduler.cs.meta new file mode 100644 index 00000000..dc5a2272 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/EditorScheduler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 01c2a792f31c94b71bdb94f2a2eb2c8c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/IOperationResultContainer.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/IOperationResultContainer.cs new file mode 100644 index 00000000..44c6fa74 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/IOperationResultContainer.cs @@ -0,0 +1,17 @@ +namespace VoxelBusters.CoreLibrary +{ + public interface IOperationResultContainer + { + #region Methods + + bool IsError(); + + Error GetError(); + + TData GetResult(); + + string GetResultAsText(); + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/IOperationResultContainer.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/IOperationResultContainer.cs.meta new file mode 100644 index 00000000..622ecc06 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/IOperationResultContainer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4b40772b73da541d68f2a099bb788cd9 +timeCreated: 1575981659 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/IScheduler.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/IScheduler.cs new file mode 100644 index 00000000..4cec3ab8 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/IScheduler.cs @@ -0,0 +1,25 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public interface IScheduler + { + #region Events + + event Callback Update; + + #endregion + + #region Methods + + void StartCoroutine(IEnumerator routine); + + void StopCoroutine(IEnumerator routine); + + void StopAllCoroutines(); + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/IScheduler.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/IScheduler.cs.meta new file mode 100644 index 00000000..01acdb37 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/IScheduler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 05eb539b685444e3185b32e65e8a3d2d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/ISchedulerUpdateHandler.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/ISchedulerUpdateHandler.cs new file mode 100644 index 00000000..4138c041 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/ISchedulerUpdateHandler.cs @@ -0,0 +1,15 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public interface ISchedulerUpdateHandler + { + #region Methods + + void Update(); + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/ISchedulerUpdateHandler.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/ISchedulerUpdateHandler.cs.meta new file mode 100644 index 00000000..65e87997 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/ISchedulerUpdateHandler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bae940cc7f1a54e49b4b9122a76974be +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/MonoBehaviourZ.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/MonoBehaviourZ.cs new file mode 100644 index 00000000..2074568f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/MonoBehaviourZ.cs @@ -0,0 +1,52 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class MonoBehaviourZ : MonoBehaviour + { + #region Fields + + private bool m_isInitialisedInternal = false; + + #endregion + + #region Unity methods + + private void Awake() + { + EnsureInitialised(); + } + + protected virtual void Start() + { } + + protected virtual void OnEnable() + { } + + protected virtual void OnDisable() + { } + + protected virtual void OnDestroy() + { } + + #endregion + + #region Private methods + + protected void EnsureInitialised() + { + if (m_isInitialisedInternal) return; + + m_isInitialisedInternal = true; + + Init(); + } + + protected virtual void Init() + { } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/MonoBehaviourZ.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/MonoBehaviourZ.cs.meta new file mode 100644 index 00000000..d4da1397 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/MonoBehaviourZ.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 808f0313735c64ec5989f9ad2564abf1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/PersistentObject.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/PersistentObject.cs new file mode 100644 index 00000000..ce62aaf9 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/PersistentObject.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class PersistentObject : MonoBehaviour + { + #region Unity methods + + private void Awake() + { + DontDestroyOnLoad(gameObject); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/PersistentObject.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/PersistentObject.cs.meta new file mode 100644 index 00000000..5df2583c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/PersistentObject.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c89bacc55c95b410bbe311261e447720 +timeCreated: 1576350560 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/RuntimeScheduler.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/RuntimeScheduler.cs new file mode 100644 index 00000000..1a9ccaa6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/RuntimeScheduler.cs @@ -0,0 +1,67 @@ +using UnityEngine; +using System.Collections; +using System.Collections.Generic; + +namespace VoxelBusters.CoreLibrary +{ + internal class RuntimeScheduler : PrivateSingletonBehaviour, IScheduler + { + #region Fields + + private event Callback UpdateEvent; + + #endregion + + #region Static methods + + public static RuntimeScheduler Initialize() + { + return GetSingleton(); + } + + #endregion + + #region Unity methods + + private void Update() + { + SendUpdateEvent(); + } + + #endregion + + #region Private methods + + private void SendUpdateEvent() + { + UpdateEvent?.Invoke(); + } + + #endregion + + #region IScheduler implementation + + event Callback IScheduler.Update + { + add { UpdateEvent += value; } + remove { UpdateEvent -= value; } + } + + void IScheduler.StartCoroutine(IEnumerator routine) + { + StartCoroutine(routine); + } + + void IScheduler.StopCoroutine(IEnumerator routine) + { + StopCoroutine(routine); + } + + void IScheduler.StopAllCoroutines() + { + StopAllCoroutines(); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/RuntimeScheduler.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/RuntimeScheduler.cs.meta new file mode 100644 index 00000000..5e0b801b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/RuntimeScheduler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c8805e4e754ad4c4cbe890a68d47b559 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/Scheduler.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/Scheduler.cs new file mode 100644 index 00000000..bb917394 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/Scheduler.cs @@ -0,0 +1,75 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class Scheduler + { + #region Static fields + + [ClearOnReload] + private static IScheduler s_scheduler; + + #endregion + + #region Static events + + public static event Callback Update + { + add + { + EnsureInitialised(); + s_scheduler.Update += value; + } + remove + { + EnsureInitialised(); + s_scheduler.Update -= value; + } + } + + #endregion + + #region Static methods + + public static void StartCoroutine(IEnumerator routine) + { + EnsureInitialised(); + + s_scheduler.StartCoroutine(routine); + } + + public static void StopCoroutine(IEnumerator routine) + { + EnsureInitialised(); + + s_scheduler.StopCoroutine(routine); + } + + public static void StopAllCoroutines() + { + EnsureInitialised(); + + s_scheduler.StopAllCoroutines(); + } + + private static void EnsureInitialised() + { + if (s_scheduler != null) return; + + #if UNITY_EDITOR + if (!UnityEditor.EditorApplication.isPlayingOrWillChangePlaymode) + { + s_scheduler = new EditorScheduler(); + } + else + #endif + { + s_scheduler = RuntimeScheduler.Initialize(); //Need to find out why RuntimeScheduler when using Singleton base class not working with domain reload, but PrivateSingleton do work. + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/Scheduler.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/Scheduler.cs.meta new file mode 100644 index 00000000..74a7598a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/Scheduler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6a8fbb53372594131b4ac644c3492130 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/SurrogateCoroutine.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/SurrogateCoroutine.cs new file mode 100644 index 00000000..3af2a795 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/SurrogateCoroutine.cs @@ -0,0 +1,80 @@ +using System.Collections; +using System; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class SurrogateCoroutine + { + #region Static methods + + public static void StartCoroutine(IEnumerator routine) + { + Scheduler.StartCoroutine(routine); + } + + public static void StopCoroutine(IEnumerator routine) + { + Scheduler.StopCoroutine(routine); + } + + public static void WaitUntilAndInvoke(Func predicate, Action action) + { + Scheduler.StartCoroutine(WaitUntilAndInvokeInternal(predicate, action)); + } + + public static void WaitUntilAndInvoke(IEnumerator coroutine, Action action) + { + Scheduler.StartCoroutine(WaitUntilAndInvokeInternal(coroutine, action)); + } + + public static void WaitUntilAndInvoke(YieldInstruction instruction, Action action) + { + Scheduler.StartCoroutine(WaitUntilAndInvokeInternal(instruction, action)); + } + + public static void WaitForEndOfFrameAndInvoke(Action action) + { + Scheduler.StartCoroutine(WaitUntilAndInvokeInternal(new WaitForEndOfFrame(), action)); + } + + public static void Invoke(Action action, float delay) + { + Scheduler.StartCoroutine(WaitUntilAndInvokeInternal(new WaitForSeconds(delay), action)); + } + + #endregion + + #region Private static methods + + private static IEnumerator WaitUntilAndInvokeInternal(Func predicate, Action action) + { + yield return new WaitUntil(predicate); + + action(); + } + + private static IEnumerator WaitUntilAndInvokeInternal(IEnumerator coroutine, Action action) + { + yield return coroutine; + + action(); + } + + private static IEnumerator WaitUntilAndInvokeInternal(YieldInstruction instruction, Action action) + { + yield return instruction; + + action(); + } + + private static IEnumerator InvokeInternal(Action action, float delay) + { + yield return new WaitForSeconds(delay); + + action(); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/SurrogateCoroutine.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/SurrogateCoroutine.cs.meta new file mode 100644 index 00000000..bfb4f7fa --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Components/SurrogateCoroutine.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1538ec2986b674b359f11e25b2defd03 +timeCreated: 1575981659 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants.meta new file mode 100644 index 00000000..62a097fb --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 443366c8b588841c4884161095ccb277 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/ConsentStatus.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/ConsentStatus.cs new file mode 100644 index 00000000..4a25ba1a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/ConsentStatus.cs @@ -0,0 +1,15 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public enum ConsentStatus + { + NotDetermined = 0, + + Denied, + + Authorized, + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/ConsentStatus.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/ConsentStatus.cs.meta new file mode 100644 index 00000000..08a7a0f9 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/ConsentStatus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 79a1e0121158d489eb9d02bbd798418d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/ContentRating.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/ContentRating.cs new file mode 100644 index 00000000..b22ae4b3 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/ContentRating.cs @@ -0,0 +1,28 @@ +using UnityEngine; +using System.Collections; + +namespace VoxelBusters.CoreLibrary +{ + /// + /// Enum specifying the level of content maturity for an app. + /// + /// + /// This enum is used to specify the level of content maturity for an app. + /// + public enum ContentRating + { + Unspecified = 0, + + /// Content suitable for general audiences, including families. + GeneralAudience, + + /// Content suitable only for mature audiences. + MatureAudience, + + /// Content suitable for most audiences with parental guidance. + ParentalGuidance, + + /// Content suitable for teen and older audiences. + TeensAndOlder, + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/ContentRating.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/ContentRating.cs.meta new file mode 100644 index 00000000..8653f388 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/ContentRating.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fc7d3d7d0b03e464abf742058c6ac9b4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/CoreLibraryDomain.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/CoreLibraryDomain.cs new file mode 100644 index 00000000..68face05 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/CoreLibraryDomain.cs @@ -0,0 +1,13 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class CoreLibraryDomain + { + public static string Default => "VoxelBusters.CoreLibrary"; + + public static string NativePlugins => "VoxelBusters.CoreLibrary.NativePlugins"; + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/CoreLibraryDomain.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/CoreLibraryDomain.cs.meta new file mode 100644 index 00000000..b3022fc7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/CoreLibraryDomain.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 38ad3155306284d48b2aa55aed6bdec5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/MimeType.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/MimeType.cs new file mode 100644 index 00000000..36cdf886 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/MimeType.cs @@ -0,0 +1,153 @@ +using System.Collections; +using System.Collections.Generic; +using System; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + /// + /// The MimeType class is a collection of most commonly used MIME types. + /// + /// + /// MIME types enable apps to recognize the filetype of a file. + /// + public static class MimeType + { + #region Constants + + /// The MIME value used to determine any file. (Readonly) + public const string kAny = "*/*"; + + /// The MIME value used to determine plain text file. (Readonly) + public const string kPlainText = "text/plain"; + + /// The MIME value used to determine normal web pages. (Readonly) + public const string kHtmlText = "text/html"; + + /// The MIME value used to determine javascript content. (Readonly) + public const string kJavaScriptText = "text/javascript"; + + /// The MIME value used to determine all image files. (Readonly) + public const string kAllImages = "image/*"; + + /// The MIME value used to determine jpg image file. (Readonly) + public const string kJPGImage = "image/jpeg"; + + /// The MIME value used to determine png image file. (Readonly) + public const string kPNGImage = "image/png"; + + /// The MIME value used to determine gif image file. (Readonly) + public const string kGIFImage = "image/gif"; + + /// The MIME value used to determine Adobe® PDF documents. (Readonly) + public const string kPDF = "application/pdf"; + + + /// The MIME value used to determine all video files. (Readonly) + public const string kAllVideos = "video/*"; + + /// The MIME value used to determine mp4 video. (Readonly) + public const string kMP4Video = "video/mp4"; + + /// The MIME value used to determine all audio files. (Readonly) + public const string kAllAudio = "audio/*"; + + #endregion + + #region Static methods + + public static string GetTypeForExtension(string extension) + { + extension = extension.TrimStart('.'); + if (string.Equals(extension, "txt", StringComparison.InvariantCultureIgnoreCase)) + { + return kPlainText; + } + else if (string.Equals(extension, "html", StringComparison.InvariantCultureIgnoreCase)) + { + return kHtmlText; + } + else if (string.Equals(extension, "js", StringComparison.InvariantCultureIgnoreCase)) + { + return kJavaScriptText; + } + else if (string.Equals(extension, "jpg", StringComparison.InvariantCultureIgnoreCase) || + string.Equals(extension, "jpeg", StringComparison.InvariantCultureIgnoreCase)) + { + return kJPGImage; + } + else if (string.Equals(extension, "png", StringComparison.InvariantCultureIgnoreCase)) + { + return kPNGImage; + } + else if (string.Equals(extension, "gif", StringComparison.InvariantCultureIgnoreCase)) + { + return kGIFImage; + } + else if (string.Equals(extension, "pdf", StringComparison.InvariantCultureIgnoreCase)) + { + return kPDF; + } + else if (string.Equals(extension, "mp4", StringComparison.InvariantCultureIgnoreCase)) + { + return kMP4Video; + } + + DebugLogger.LogWarning(CoreLibraryDomain.Default, $"Unknown MIME type for extension: {extension}"); + return kPlainText; + } + + public static string GetExtensionForType(string mimeType) + { + if (string.Equals(mimeType, kPlainText, StringComparison.InvariantCultureIgnoreCase)) + { + return "txt"; + } + else if (string.Equals(mimeType, kHtmlText, StringComparison.InvariantCultureIgnoreCase)) + { + return "html"; + } + else if (string.Equals(mimeType, kJavaScriptText, StringComparison.InvariantCultureIgnoreCase)) + { + return "js"; + } + else if (string.Equals(mimeType, kJPGImage, StringComparison.InvariantCultureIgnoreCase)) + { + return "jpg"; + } + else if (string.Equals(mimeType, kPNGImage, StringComparison.InvariantCultureIgnoreCase)) + { + return "png"; + } + else if (string.Equals(mimeType, kGIFImage, StringComparison.InvariantCultureIgnoreCase)) + { + return "gif"; + } + else if (string.Equals(mimeType, kPDF, StringComparison.InvariantCultureIgnoreCase)) + { + return "pdf"; + } + else if (string.Equals(mimeType, kMP4Video, StringComparison.InvariantCultureIgnoreCase)) + { + return "mp4"; + } + else if (string.Equals(mimeType, kAllImages, StringComparison.InvariantCultureIgnoreCase)) //Defaults to png + { + return "png"; + } + else if (string.Equals(mimeType, kAllVideos, StringComparison.InvariantCultureIgnoreCase)) //Defaults to mp4 + { + return "mp4"; + } + else if (string.Equals(mimeType, kAllAudio, StringComparison.InvariantCultureIgnoreCase)) //Defaults to wav + { + return "wav"; + } + + DebugLogger.LogWarning(CoreLibraryDomain.Default, $"Unknown extension for MIME type : {mimeType}"); + return kPlainText; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/MimeType.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/MimeType.cs.meta new file mode 100644 index 00000000..376002b6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/MimeType.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d68885bd49dd540488b1c06ecfb83cf6 +timeCreated: 1576146562 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/TextEncodingFormat.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/TextEncodingFormat.cs new file mode 100644 index 00000000..f8428932 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/TextEncodingFormat.cs @@ -0,0 +1,22 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class TextEncodingFormat + { + #region Constants + + /// Encodes characters using the UTF-8 encoding. (Readonly) + public const string kUTF8 = "utf8"; + + /// Encodes characters using the UTF-16 encoding. (Readonly) + public const string kUTF16 = "utf16"; + + /// Encodes characters using the UTF-32 encoding. (Readonly) + public const string kUTF32 = "utf32"; + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/TextEncodingFormat.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/TextEncodingFormat.cs.meta new file mode 100644 index 00000000..d7654f94 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/TextEncodingFormat.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c0728fce467ac4c4aa2450ac0ebb6bd9 +timeCreated: 1576146562 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/TextureEncodingFormat.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/TextureEncodingFormat.cs new file mode 100644 index 00000000..009cf467 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/TextureEncodingFormat.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + /// + /// This enum is used to define the texture encoding technique to be used by the plugin. + /// + public enum TextureEncodingFormat + { + /// Encodes the given texture into PNG format. + PNG, + + /// Encodes the given texture into JPEG format. + JPG, + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/TextureEncodingFormat.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/TextureEncodingFormat.cs.meta new file mode 100644 index 00000000..083df586 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Constants/TextureEncodingFormat.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f3a28b85765d945bdb9550927d1fdde9 +timeCreated: 1576146562 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels.meta new file mode 100644 index 00000000..7e23fbf6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 60ac130d5072a4f95908150f5ad4d242 +folderAsset: yes +timeCreated: 1576063243 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ApplicationPrivacyConfiguration.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ApplicationPrivacyConfiguration.cs new file mode 100644 index 00000000..eb131a58 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ApplicationPrivacyConfiguration.cs @@ -0,0 +1,48 @@ +using UnityEngine; +using System.Collections; + +namespace VoxelBusters.CoreLibrary +{ + public class ApplicationPrivacyConfiguration + { + #region Properties + + public ConsentStatus UsageConsent { get; private set; } + + public bool? IsAgeRestrictedUser { get; private set; } + + public ContentRating? PreferredContentRating { get; private set; } + + public string Version { get; private set; } + + #endregion + + #region Constructors + + public ApplicationPrivacyConfiguration(ConsentStatus usageConsent, + bool? isAgeRestrictedUser = null, + ContentRating? preferredContentRating = null, + string version = null) + { + // Set properties + UsageConsent = usageConsent; + IsAgeRestrictedUser = isAgeRestrictedUser; + PreferredContentRating = preferredContentRating; + Version = version; + } + + #endregion + + #region Public methods + + public bool? IsCoppaApplicable() + { + if (IsAgeRestrictedUser == null) return null; + + return (IsAgeRestrictedUser.Value == true) || (UsageConsent != ConsentStatus.Authorized); + } + + #endregion + + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ApplicationPrivacyConfiguration.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ApplicationPrivacyConfiguration.cs.meta new file mode 100644 index 00000000..a4aaccd7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ApplicationPrivacyConfiguration.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 71301b2b0cd8345c9a4613989e8bdba8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ApplicationUser.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ApplicationUser.cs new file mode 100644 index 00000000..0e62b558 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ApplicationUser.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class User + { + #region Properties + + public string UserId { get; private set; } + + public string Email { get; private set; } + + public string FirstName { get; private set; } + + public string LastName { get; private set; } + + public UserGender Gender { get; private set; } + + public DateTime? DateOfBirth { get; private set; } + + public int? Age + { + get + { + if (DateOfBirth.HasValue) + { + var today = DateTime.Today; + var bday = DateOfBirth.Value; + int age = today.Year - bday.Year; + if (bday > today.AddYears(-age)) + { + age--; + } + return age; + } + return null; + } + } + + public bool IsGuest { get; private set; } + + #endregion + + #region Constructors + + public User(string userId, string email = null, + string firstName = null, string lastName = null, + UserGender gender = UserGender.Undefined, DateTime? dob = null, + bool isGuest = false) + { + // set properties + UserId = userId; + Email = email; + FirstName = firstName; + LastName = lastName; + DateOfBirth = dob; + Gender = gender; + IsGuest = isGuest; + } + + #endregion + + #region Nested types + + public enum UserGender + { + Undefined = 0, + + Male, + + Female, + + Others, + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ApplicationUser.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ApplicationUser.cs.meta new file mode 100644 index 00000000..c3b8e4a4 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ApplicationUser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 67da540a5aeda4477a763979cda8e7a7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/Asset.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/Asset.cs new file mode 100644 index 00000000..69bb80f0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/Asset.cs @@ -0,0 +1,61 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + [System.Serializable] + public class Asset + { + #region Properties + + public byte[] Data { get; private set; } + + public string MimeType { get; private set; } + + public string Name { get; private set; } + + #endregion + + #region Constructors + + public Asset(byte[] data, string mimeType, string name) + { + // set properties + Data = data; + MimeType = mimeType; + Name = name; + } + + #endregion + + #region Create methods + + public static Asset CreatePNGAsset(byte[] data, string name) + { + return new Asset(data, CoreLibrary.MimeType.kPNGImage, name); + } + + public static Asset CreateJPGAsset(byte[] data, string name) + { + return new Asset(data, CoreLibrary.MimeType.kJPGImage, name); + } + + public static Asset CreateMP4Asset(byte[] data, string name) + { + return new Asset(data, CoreLibrary.MimeType.kMP4Video, name); + } + + public static Asset CreatePDFAsset(byte[] data, string name) + { + return new Asset(data, CoreLibrary.MimeType.kPDF, name); + } + + public static Asset CreateTextAsset(byte[] data, string name) + { + return new Asset(data, CoreLibrary.MimeType.kPlainText, name); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/Asset.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/Asset.cs.meta new file mode 100644 index 00000000..1108af39 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/Asset.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b981393de27a540ad9ddbc3361a51776 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/Error.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/Error.cs new file mode 100644 index 00000000..8f85dd97 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/Error.cs @@ -0,0 +1,68 @@ +using System; + +namespace VoxelBusters.CoreLibrary +{ + public class Error + { + #region Properties + + /// + /// A description of the error occured (read-only). + /// + /// The description of the error. + public string Domain { get; private set; } + + /// + /// A value indicating the type of error occured (read-only). + /// + /// The error code. + public int Code { get; private set; } + + /// + /// A description of the error occured (read-only). + /// + /// The description of the error. + public string Description { get; private set; } + + #endregion + + #region Constructors + + public Error(string description) + : this(domain: null, code: 0, description: description) + { } + + public Error(string domain, int code, string description) + { + // set properties + Domain = domain; + Code = code; + Description = description; + } + + #endregion + + #region Static methods + + public static Error CreateNullableError(string description) + { + if (description == null) + { + return null; + } + + return new Error(description); + } + + #endregion + + #region Base class methods + + public override string ToString() + { + return string.Format("Error Domain: {0} Code: {1} Description: {2}", Domain, Code, Description); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/Error.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/Error.cs.meta new file mode 100644 index 00000000..49c95d18 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/Error.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 88d065ed06b734f9485e7024314b6843 +timeCreated: 1596311572 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/KeyValueDataStore.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/KeyValueDataStore.cs new file mode 100644 index 00000000..3841da0a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/KeyValueDataStore.cs @@ -0,0 +1,226 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary +{ + /// + /// Object represents a container to store key-value pairs. + /// + public class KeyValueDataStore + { + #region Fields + + private Dictionary m_dataCollection; + + private string m_savePath; + + #endregion + + #region Constructors + + /// + /// Create a new instance. + /// + /// The file path to save contents. + public KeyValueDataStore(string savePath) + { + // set properties + m_dataCollection = LoadDataFromPath(savePath) ?? new Dictionary(); + m_savePath = savePath; + } + + #endregion + + #region Get value methods + + /// + /// Returns the boolean value associated with the specified key. + /// + /// A string used to identify the value stored in the data store. + /// Default value. + /// + public bool GetBool(string key, bool defaultValue = default) + { + if (m_dataCollection.TryGetValue(key, out object value)) + { + return bool.Parse(value.ToString()); + } + return defaultValue; + } + + /// + /// Returns the long value associated with the specified key. + /// + /// A string used to identify the value stored in the data store. + /// Default value. + /// + public long GetLong(string key, long defaultValue = default) + { + if (m_dataCollection.TryGetValue(key, out object value)) + { + return long.Parse(value.ToString()); + } + return defaultValue; + } + + /// + /// Returns the double value associated with the specified key. + /// + /// A string used to identify the value stored in the data store. + /// Default value. + /// + public double GetDouble(string key, double defaultValue = default) + { + if (m_dataCollection.TryGetValue(key, out object value)) + { + return double.Parse(value.ToString()); + } + return defaultValue; + } + + /// + /// Returns the string value associated with the specified key. + /// + /// A string used to identify the value stored in the data store. + /// Default value. + /// + public string GetString(string key, string defaultValue = default) + { + if (m_dataCollection.TryGetValue(key, out object value)) + { + return value.ToString(); + } + return defaultValue; + } + + /// + /// Returns the byte array object associated with the specified key. + /// + /// A string used to identify the value stored in the data store. + /// Default value. + /// + public byte[] GetByteArray(string key, byte[] defaultValue = default) + { + if (m_dataCollection.TryGetValue(key, out object value)) + { + return System.Convert.FromBase64String(value.ToString()); + } + return defaultValue; + } + + /// + /// Returns the complete snapshot of data. + /// + /// Returns IDictionary with snapshot data + public IDictionary GetSnapshot() + { + return m_dataCollection; + } + + #endregion + + #region Set value methods + + /// + /// Sets a boolean value for the specified key in the data store. + /// + /// The key under which to store the value. + /// The boolean value to store. + public void SetBool(string key, bool value) + { + // save value + m_dataCollection[key] = value.ToString(); + } + + /// + /// Sets a long value for the specified key in the data store. + /// + /// The key under which to store the value. + /// The long value to store. + public void SetLong(string key, long value) + { + // save value + m_dataCollection[key] = value.ToString(); + } + + /// + /// Sets a double value for the specified key in the data store. + /// + /// The key under which to store the value. + /// The double value to store. + public void SetDouble(string key, double value) + { + // save value + m_dataCollection[key] = value.ToString(); + } + + /// + /// Sets a string value for the specified key in the data store. + /// + /// The key under which to store the value. + /// The string value to store. + public void SetString(string key, string value) + { + // save value + m_dataCollection[key] = value; + } + + /// + /// Sets a byte array value for the specified key in the data store. + /// + /// The key under which to store the value. + /// The long value to store. + public void SetByteArray(string key, byte[] value) + { + // save value + m_dataCollection[key] = System.Convert.ToBase64String(value); + } + + #endregion + + #region Misc methods + + /// + /// Explicitly synchronizes in-memory data with those stored on disk. + /// + public void Synchronize() + { + string jsonContent = ExternalServiceProvider.JsonServiceProvider.ToJson(m_dataCollection); + IOServices.CreateFile(m_savePath, jsonContent); + } + + /// + /// Removes all the entries from the data store. + /// + public void Clear() + { + m_dataCollection.Clear(); + Synchronize(); + } + + /// + /// Removes the value associated with the specified key from the data store. + /// + /// The key corresponding to the value you want to remove. + public bool RemoveKey(string key) + { + return m_dataCollection.Remove(key); + } + + #endregion + + #region Private methods + + private Dictionary LoadDataFromPath(string path) + { + if (!IOServices.FileExists(path)) return null; + + var jsonContent = IOServices.ReadFile(path); + return ExternalServiceProvider.JsonServiceProvider.FromJson(jsonContent) as Dictionary; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/KeyValueDataStore.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/KeyValueDataStore.cs.meta new file mode 100644 index 00000000..c239b7bf --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/KeyValueDataStore.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dbc1c5c10cdf245869b8f63107d3b39f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ReadableId.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ReadableId.cs new file mode 100644 index 00000000..9a5e504f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ReadableId.cs @@ -0,0 +1,39 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + [System.Serializable] + public class ReadableId + { + #region Fields + + [SerializeField] + private string m_name; + + [SerializeField] + private string m_id; + + #endregion + + #region Properties + + public string Name => m_name; + + public string Id => m_id; + + #endregion + + #region Constructors + + public ReadableId(string name, string id) + { + // set properties + m_name = name; + m_id = id; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ReadableId.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ReadableId.cs.meta new file mode 100644 index 00000000..7e0aa319 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ReadableId.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 75dea0c9d6fd74981bc4bc02a408bde7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/RuntimePlatformConstant.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/RuntimePlatformConstant.cs new file mode 100644 index 00000000..9f8354a6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/RuntimePlatformConstant.cs @@ -0,0 +1,115 @@ +using System; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + /// + /// Object represents an immutable, read-only object that combines a string value with a platform. + /// + [Serializable] + public class RuntimePlatformConstant + { + #region Fields + + [SerializeField] + private RuntimePlatform m_platform; + + [SerializeField] + private string m_value = string.Empty; + + #endregion + + #region Properties + + /// + /// Gets the runtime platform associated with string value. + /// + /// The enum value indicates the platform to which string value belongs. + public RuntimePlatform Platform => m_platform; + + /// + /// Gets the string value. + /// + /// The string value. + public string Value => m_value; + + #endregion + + #region Constructors + + public RuntimePlatformConstant(RuntimePlatform platform, string value) + { + // set properties + m_platform = platform; + m_value = value; + } + + #endregion + + #region Static methods + + /// + /// Returns a new instance of , containing a string value functional only on iOS platform. + /// + /// The instance of . + /// The string value associated with iOS platform. + public static RuntimePlatformConstant iOS(string value) + { + return new RuntimePlatformConstant(RuntimePlatform.IPhonePlayer, value); + } + + /// + /// Returns a new instance of , containing a string value functional only on tvOS platform. + /// + /// The instance of . + /// The string value associated with tvOS platform. + public static RuntimePlatformConstant tvOS(string value) + { + return new RuntimePlatformConstant(RuntimePlatform.tvOS, value); + } + + /// + /// Returns a new instance of , containing a string value functional only on Android platform. + /// + /// The instance of . + /// The string value associated with Android platform. + public static RuntimePlatformConstant Android(string value) + { + return new RuntimePlatformConstant(RuntimePlatform.Android, value); + } + + /// + /// Returns a new instance of , containing a string value associated with active platform. + /// + /// The instance of . + /// The string value associated with active platform. + public static RuntimePlatformConstant Current(string value) + { + var currentPlatform = ApplicationServices.GetActiveOrSimulationPlatform(); + return new RuntimePlatformConstant(currentPlatform, value); + } + + #endregion + + #region Public methods + + public bool IsEqualToPlatform(RuntimePlatform other) + { + if (other == m_platform) return true; + + // Special case for Editor + return other.IsEditor() && m_platform.IsEditor(); + } + + #endregion + + #region Base class methods + + public override string ToString() + { + return m_value; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/RuntimePlatformConstant.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/RuntimePlatformConstant.cs.meta new file mode 100644 index 00000000..652dc668 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/RuntimePlatformConstant.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a656b13371a454661b01a2100b68c285 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/RuntimePlatformConstantSet.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/RuntimePlatformConstantSet.cs new file mode 100644 index 00000000..350baa86 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/RuntimePlatformConstantSet.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + [Serializable] + public class RuntimePlatformConstantSet + { + #region Fields + + [SerializeField] + private string m_ios; + + [SerializeField] + private string m_tvos; + + [SerializeField] + private string m_android; + + #endregion + + #region Constructors + + public RuntimePlatformConstantSet(string ios = null, string tvos = null, string android = null) + { + // set properties + m_ios = ios?.Trim(); + m_tvos = tvos?.Trim(); + m_android = android?.Trim(); + } + + #endregion + + #region Public methods + + public string GetConstantForActivePlatform(string defaultValue = null) + { + var platform = ApplicationServices.GetActivePlatform(); + return GetConstantForPlatform(platform, defaultValue); + } + + public string GetConstantForActiveOrSimulationPlatform(string defaultValue = null)//Why this is not used? + { + var platform = ApplicationServices.GetActiveOrSimulationPlatform(); + return GetConstantForPlatform(platform, defaultValue); + } + + public string GetConstantForPlatform(RuntimePlatform platform, string defaultValue = null) + { + string targetValue; + switch (platform) + { + case RuntimePlatform.IPhonePlayer: + targetValue = m_ios; + break; + + case RuntimePlatform.tvOS: + targetValue = m_tvos; + break; + + case RuntimePlatform.Android: + targetValue = m_android; + break; + + default: + targetValue = defaultValue; + break; + } + + return string.IsNullOrEmpty(targetValue) ? defaultValue : targetValue; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/RuntimePlatformConstantSet.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/RuntimePlatformConstantSet.cs.meta new file mode 100644 index 00000000..b6b4d48e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/RuntimePlatformConstantSet.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eef8c656560ba4996ba11c3f8a327d5a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/SerializableKeyValuePair.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/SerializableKeyValuePair.cs new file mode 100644 index 00000000..4cb1e029 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/SerializableKeyValuePair.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + [Serializable] + public class SerializableKeyValuePair : IEquatable> + { + #region Fields + + [SerializeField] + private TKey m_key; + + [SerializeField] + private TValue m_value; + + #endregion + + #region Properties + + public TKey Key + { + get => m_key; + set => m_key = value; + } + + public TValue Value + { + get => m_value; + set => m_value = value; + } + + #endregion + + #region Constructors + + protected SerializableKeyValuePair(TKey key = default(TKey), TValue value = default(TValue)) + { + // set properties + m_key = key; + m_value = value; + } + + #endregion + + #region IEquatable implementation + + bool IEquatable>.Equals(SerializableKeyValuePair other) + { + if (other == null) return false; + + return EqualityComparer.Default.Equals(Key, other.Key) && + EqualityComparer.Default.Equals(Value, other.Value); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/SerializableKeyValuePair.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/SerializableKeyValuePair.cs.meta new file mode 100644 index 00000000..4025c75d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/SerializableKeyValuePair.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 019f38b07624b4d45a787002d72c43cc +timeCreated: 1575981659 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/StringKeyValuePair.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/StringKeyValuePair.cs new file mode 100644 index 00000000..ff1b45fa --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/StringKeyValuePair.cs @@ -0,0 +1,16 @@ +using System; + +namespace VoxelBusters.CoreLibrary +{ + [Serializable] + public class StringKeyValuePair : SerializableKeyValuePair + { + #region Constructors + + public StringKeyValuePair(string key = null, string value = null) + : base(key, value) + { } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/StringKeyValuePair.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/StringKeyValuePair.cs.meta new file mode 100644 index 00000000..842751db --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/StringKeyValuePair.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: df95b47cf01434be8b102b93aa72ea33 +timeCreated: 1575981659 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/TextureData.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/TextureData.cs new file mode 100644 index 00000000..2b77038a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/TextureData.cs @@ -0,0 +1,83 @@ +using System; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class TextureData + { + #region Fields + + private byte[] m_rawData; + + private Texture2D m_texture; + + #endregion + + #region Constructors + + public TextureData(byte[] rawData) + { + // set properties + m_rawData = rawData; + m_texture = null; + } + + public TextureData(Texture2D texture) + { + // set properties + m_rawData = null; + m_texture = texture; + } + + #endregion + + #region Public methods + + public byte[] GetBytes(TextureEncodingFormat format) + { + if (m_rawData != null) + { + return m_rawData; + } + else if (m_texture != null) + { + switch (format) + { + case TextureEncodingFormat.JPG: + return m_texture.EncodeToJPG(); + + default: + return m_texture.EncodeToPNG(); + } + } + + throw new VBException("Unknown error"); + } + + public Texture2D GetTexture() + { + if (m_texture != null) + { + return m_texture; + } + else if (m_rawData != null) + { + m_texture = CreateTexture(m_rawData); + return m_texture; + } + + throw new VBException("Unknown error"); + } + + private Texture2D CreateTexture(byte[] data) + { + var newTexture = new Texture2D(4, 4); + newTexture.LoadImage(data); + newTexture.Apply(); + + return newTexture; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/TextureData.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/TextureData.cs.meta new file mode 100644 index 00000000..ccec60b2 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/TextureData.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9d502c99a53b34565aa536c6d09642cb +timeCreated: 1575981659 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/URLString.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/URLString.cs new file mode 100644 index 00000000..4defe078 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/URLString.cs @@ -0,0 +1,95 @@ +using System.Collections; +using System.Collections.Generic; +using System; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + /// + /// Struct value to represent the location of a resource, such as an item on a remote server or the path to a local file. + /// + public struct URLString + { + #region Fields + + private string m_value; + + #endregion + + #region Properties + + /// + /// Gets a value indicating whether this is valid. + /// + /// true if is valid; otherwise, false. + public bool IsValid { get; private set; } + + public bool IsFilePath { get; private set; } + + #endregion + + #region Static methods + + /// + /// Returns a newly created object as a http URL with specified path. + /// + /// The path should be a valid web URL path. + public static URLString URLWithPath(string path) + { + // validate arguments + Assert.IsNotNullOrEmpty(path, "path"); + Assert.IsFalse(path.StartsWith("file"), "Input value is not http path."); + + // format value if required + if (false == path.StartsWith("http")) + { + path = string.Concat("http://", path); + } + + return new URLString() { m_value = path, IsValid = true }; + } + + /// + /// Returns a newly created object as a file URL with a specified path. + /// + /// The path should be a valid system path. + public static URLString FileURLWithPath(string path) + { + // validate arguments + Assert.IsNotNullOrEmpty(path, "path"); + Assert.IsFalse(path.StartsWith("http"), "Input value is not local file path."); + + // format value if required + if (false == path.StartsWith("file") +#if UNITY_ANDROID + && false == path.StartsWith("jar:file") +#endif + ) + { + path = string.Concat("file://", path); + } + + return new URLString() { m_value = path, IsValid = true, IsFilePath = true, }; + } + + #endregion + + #region Public methods + + /// + /// Returns the URL representation in string format. This value is null, if given URL is invalid. + /// + /// The URL string. + public override string ToString() + { + if (IsValid) + { + return m_value; + } + + return null; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/URLString.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/URLString.cs.meta new file mode 100644 index 00000000..9cef0493 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/URLString.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3db1a4e89276140efb55332ad4b03434 +timeCreated: 1576157288 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/UnityPackageDefinition.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/UnityPackageDefinition.cs new file mode 100644 index 00000000..0d540c0f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/UnityPackageDefinition.cs @@ -0,0 +1,92 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + [System.Serializable] + public class UnityPackageDefinition + { + #region Fields + + private string m_persistentDataRelativePath; + + #endregion + + #region Properties + + public string Name { get; private set; } + + public string DisplayName { get; private set; } + + public string Version { get; private set; } + + public string DefaultInstallPath { get; private set; } + + public string UpmInstallPath { get; private set; } + + public string MutableResourcesPath { get; private set; } + + public string MutableResourcesRelativePath { get; private set; } + + public string PersistentDataRelativePath + { + get + { + EnsurePersistentDataPathExists(); + return m_persistentDataRelativePath; + } + } + + public string PersistentDataPath + { + get + { + EnsurePersistentDataPathExists(); + return GetPersistentDataPathInternal(); + } + } + + public UnityPackageDefinition[] Dependencies { get; private set; } + + #endregion + + #region Constructors + + public UnityPackageDefinition(string name, string displayName, + string version, string defaultInstallPath = null, + string mutableResourcesPath = "Assets/Resources", string persistentDataRelativePath = null, + params UnityPackageDefinition[] dependencies) + { + // Set properties + Name = name; + DisplayName = displayName; + Version = version; + DefaultInstallPath = defaultInstallPath ?? $"Assets/{Name}"; + UpmInstallPath = $"Packages/{Name}"; + MutableResourcesPath = mutableResourcesPath; + Dependencies = dependencies; + + // Derived properties + MutableResourcesRelativePath = mutableResourcesPath.Replace("Assets/Resources", "").TrimStart('/'); + m_persistentDataRelativePath = persistentDataRelativePath ?? $"VoxelBusters/{string.Join("", displayName.Split(' '))}"; + } + + #endregion + + #region Private methods + + private void EnsurePersistentDataPathExists() + { + var fullPath = GetPersistentDataPathInternal(); + IOServices.CreateDirectory(fullPath, overwrite: false); + } + + private string GetPersistentDataPathInternal() + { + return IOServices.CombinePath(Application.persistentDataPath, m_persistentDataRelativePath); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/UnityPackageDefinition.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/UnityPackageDefinition.cs.meta new file mode 100644 index 00000000..6e4a6200 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/UnityPackageDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 82b361b76bebe4d0a903cecf540fb732 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/VBException.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/VBException.cs new file mode 100644 index 00000000..30ca8a72 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/VBException.cs @@ -0,0 +1,59 @@ +using System; + +namespace VoxelBusters.CoreLibrary +{ + public class VBException : Exception + { + #region Properties + + public string Domain { get; private set; } + + public int ErrorCode { get; private set; } + + #endregion + + #region Constructors + + public VBException(string message, int errorCode = -1, Exception innerException = null) + : base(message, innerException) + { + // set properties + ErrorCode = errorCode; + } + + public VBException(string message, Exception innerException) + : this(message, -1, innerException) + { } + + #endregion + + #region Create methods + + public static VBException NotImplemented(string messsage = "Not implemented.") + { + return new VBException(messsage); + } + + public static VBException NotSupported(string messsage = "Not supported.") + { + return new VBException(messsage); + } + + public static VBException InvalidOperation(string messsage = "Invalid operation.") + { + return new VBException(messsage); + } + + public static VBException ArgumentNull(string property) + { + return new VBException(string.Format("{0} is null.", property)); + } + + public static VBException SwitchCaseNotImplemented(object value) + { + return new VBException(string.Format("Switch case for {0} is not implemented.", value)); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/VBException.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/VBException.cs.meta new file mode 100644 index 00000000..144b510f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/VBException.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 996d9b17d37854d94ae153f0efe8a652 +timeCreated: 1596314726 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ValidationResult.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ValidationResult.cs new file mode 100644 index 00000000..b2a3e3c1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ValidationResult.cs @@ -0,0 +1,67 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class ValidationResult + { + #region Static properties + + public static ValidationResult Success { get; private set;} + + #endregion + + #region Properties + + public bool IsValid { get; private set; } + + public Error Error { get; private set; } + + #endregion + + #region Constructors + + static ValidationResult() + { + // set static property values + Success = new ValidationResult(isValid: true, error: null); + } + + private ValidationResult(bool isValid, Error error = null) + { + // set properties + IsValid = isValid; + Error = error; + } + + #endregion + + #region Create methods + + public static ValidationResult CreateError(Error error) + { + return new ValidationResult( + isValid: false, + error: error); + } + + public static ValidationResult CreateError(string domain = null, int code = -1, string description = "") + { + return new ValidationResult( + isValid: false, + error: new Error(domain, code, description)); + } + + #endregion + + #region Base class methods + + public override string ToString() + { + return $"(IsValid: {IsValid} Error: {Error})"; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ValidationResult.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ValidationResult.cs.meta new file mode 100644 index 00000000..5affe975 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DataModels/ValidationResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 464bc3697d6e443e79eba11ae189f5af +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns.meta new file mode 100644 index 00000000..a882615e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8a3bcee99b5cf4b2288bfe0ffd59b4ec +folderAsset: yes +timeCreated: 1547778314 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns/PrivateSingletonBehaviour.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns/PrivateSingletonBehaviour.cs new file mode 100644 index 00000000..a6f2c444 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns/PrivateSingletonBehaviour.cs @@ -0,0 +1,197 @@ +using System; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public abstract class PrivateSingletonBehaviour : MonoBehaviour where T : MonoBehaviour + { + #region Static fields + + [ClearOnReload] + private static T s_sharedInstance = null; + + [ClearOnReload(ClearOnReloadOption.Default)] + private static readonly object s_objectLock = new object(); + + [ClearOnReload(customValue: false)] + private static bool s_isDestroyed = false; + + #endregion + + #region Fields + + [SerializeField] + private bool m_isPersistent = true; + + private bool m_isInitialised = false; + + private bool m_forcedDestroy = false; + + #endregion + + #region Static properties + + public static bool IsSingletonActive => (s_sharedInstance != null); + + #endregion + + #region Static methods + + protected static T GetSingleton() + { + var objectType = typeof(T); + if (s_isDestroyed) + { + DebugLogger.LogWarning(CoreLibraryDomain.Default, $"{objectType} instance is already destroyed."); + return null; + } + + lock (s_objectLock) + { + if (s_sharedInstance == null) + { + // find all the instances that exist in the screen + var sceneInstances = FindObjectsByType(objectType, FindObjectsSortMode.None) as T[]; + if (sceneInstances.Length > 0) + { + // save first element and remove others + s_sharedInstance = sceneInstances[0]; + for (int iter = 1; iter < sceneInstances.Length; iter++) + { + Destroy(sceneInstances[iter].gameObject); + } + } + // create new instance + else if (s_sharedInstance == null) + { + string singletonName = objectType.Name; + s_sharedInstance = new GameObject(singletonName).AddComponent(); + } + } + } + + // make sure object passed is initialised + var instance = (PrivateSingletonBehaviour)(object)s_sharedInstance; + if (!instance.m_isInitialised) + { + instance.Init(); + } + + return s_sharedInstance; + } + + protected static bool TryGetSingleton(out T singleton) + { + singleton = GetSingleton(); + + return (singleton != null); + } + + #endregion + + #region Unity methods + + private void Awake() + { + if (!m_isInitialised) + { + Init(); + } + } + + private void Start() + { + if (s_sharedInstance == this) + { + OnSingletonStart(); + } + } + + private void OnDestroy() + { + if (s_sharedInstance == this) + { + s_sharedInstance = null; + s_isDestroyed = !m_forcedDestroy; + OnSingletonDestroy(); + } + } + + #endregion + + #region Lifecycle methods + + protected virtual void OnSingletonAwake() + { } + + protected virtual void OnSingletonStart() + { } + + protected virtual void OnSingletonDestroy() + { } + + #endregion + + #region Private methods + + private void Init() + { + // update flag indicating that instance is initialised + m_isInitialised = true; + + // resolve singleton reference + if (s_sharedInstance == null) + { + s_sharedInstance = this as T; + } + else if (s_sharedInstance != this) + { + Destroy(gameObject); + return; + } + + // invoke internal awake method + OnSingletonAwake(); + + // mark object as persistent, if specified + if (m_isPersistent) + { + DontDestroyOnLoad(gameObject); + } + } + + #endregion + + #region ISingletonBehaviour implementation + + public bool IsPersistent + { + get + { + return m_isPersistent; + } + set + { + m_isPersistent = value; + } + } + + public void DestorySingleton(bool immediate = true) + { + if (s_sharedInstance == this) + { + m_forcedDestroy = true; + if (immediate) + { + DestroyImmediate(gameObject); + } + else + { + Destroy(gameObject); + } + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns/PrivateSingletonBehaviour.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns/PrivateSingletonBehaviour.cs.meta new file mode 100644 index 00000000..083b42a6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns/PrivateSingletonBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4b9151ffe47f14def86de74a01351995 +timeCreated: 1575981659 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns/SingletonBehaviour.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns/SingletonBehaviour.cs new file mode 100644 index 00000000..b4abb748 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns/SingletonBehaviour.cs @@ -0,0 +1,17 @@ +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public abstract class SingletonBehaviour : PrivateSingletonBehaviour where T : MonoBehaviour + { + #region Static properties + + /// + /// Returns the singleton instance. + /// + /// The instance. + public static T Instance => GetSingleton(); + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns/SingletonBehaviour.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns/SingletonBehaviour.cs.meta new file mode 100644 index 00000000..92dd2484 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns/SingletonBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 86bc6b7ce122a492fa170d576be4fef2 +timeCreated: 1575981659 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns/SingletonObject.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns/SingletonObject.cs new file mode 100644 index 00000000..d4004788 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns/SingletonObject.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Reflection; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class SingletonObject where T : class + { + #region Static fields + + [ClearOnReload] + private static T s_sharedInstance = null; + + #endregion + + #region Static properties + + public static T Instance => ObjectHelper.CreateInstanceIfNull( + ref s_sharedInstance, + CreateInstance); + + #endregion + + #region Private static methods + + private static T CreateInstance() + { + // get non-public constructors + var ctors = typeof(T).GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic); + if (!Array.Exists(ctors, (ci) => ci.GetParameters().Length == 0)) + { + throw new VBException("Non-public ctor() note found."); + } + + // get reference to default non-public constructor. + var ctor = Array.Find(ctors, (ci) => ci.GetParameters().Length == 0); + + // invoke constructor and return resulting object. + return ctor.Invoke(new object[] {}) as T; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns/SingletonObject.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns/SingletonObject.cs.meta new file mode 100644 index 00000000..7d4da54a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/DesignPatterns/SingletonObject.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6fd5341cccf6d4932ab66c7d464d434a +timeCreated: 1576677030 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Events.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Events.meta new file mode 100644 index 00000000..70327585 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Events.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c351d0072c38447938ecc73f29085f7c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Events/EventHandlerCollection.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Events/EventHandlerCollection.cs new file mode 100644 index 00000000..6806fa99 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Events/EventHandlerCollection.cs @@ -0,0 +1,147 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class EventHandlerCollection where T : IEventHandler + { + #region Fields + + private List m_handlers = new List(); + + #endregion + + #region Delegates + + public delegate void EventFunction(T item); + + #endregion + + #region Public methods + + public int IndexOf(T obj) + { + // precondition + Assert.IsArgNotNull(obj, nameof(obj)); + + for (int iter = 0; iter < m_handlers.Count; iter++) + { + if (EqualityComparer.Default.Equals(m_handlers[iter], obj)) + { + return iter; + } + } + return -1; + } + + public bool Contains(T obj) + { + return (-1 != IndexOf(obj)); + } + + public bool Add(T obj) + { + // precondition + Assert.IsArgNotNull(obj, nameof(obj)); + + // add object + if (!Contains(obj)) + { + int index = m_handlers.BinarySearch(obj); + if (index < 0) + { + m_handlers.Insert(~index, obj); + } + else + { + m_handlers.Insert(index, obj); + } + + return true; + } + + return false; + } + + public bool Remove(T handler) + { + // precondition + Assert.IsArgNotNull(handler, nameof(handler)); + + // remove object + int index = IndexOf(handler); + if (index != -1) + { + m_handlers.RemoveAt(index); + return true; + } + return false; + } + + public void SendEvent(EventFunction function) + { + // precondition + Assert.IsArgNotNull(function, nameof(function)); + + // invoke action on every compatible object + var array = m_handlers.ToArray(); + int count = m_handlers.Count; + for (int iter = 0; iter < count; iter++) + { + try + { + var current = array[iter]; + if (current != null) + { + function(current); + } + } + catch (Exception exception) + { + DebugLogger.LogException(CoreLibraryDomain.Default, exception); + } + } + } + + #endregion + + #region Nested types + + private class EventHandlerComparer : IComparer + { + #region IComparer implementation + + public int Compare(T x, T y) + { + if (x == null) + { + if (y == null) + { + return 0; + } + else + { + return -1; + } + } + else + { + if (y == null) + { + return 1; + } + else + { + return x.CallbackOrder.CompareTo(y.CallbackOrder); + } + } + } + + #endregion + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Events/EventHandlerCollection.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Events/EventHandlerCollection.cs.meta new file mode 100644 index 00000000..73840a2d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Events/EventHandlerCollection.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d9f68cb6c25ca4a26842648e93568575 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Events/IEventHandler.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Events/IEventHandler.cs new file mode 100644 index 00000000..73995703 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Events/IEventHandler.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + /// + /// Base interface that all event handlers inherit from. + /// + [IncludeInDocs] + public interface IEventHandler + { + int CallbackOrder { get; } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Events/IEventHandler.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Events/IEventHandler.cs.meta new file mode 100644 index 00000000..e2a9a380 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Events/IEventHandler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6326ebca5027d4ee7b2e168a41b01535 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces.meta new file mode 100644 index 00000000..9981d7b0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6d09b55026caf4dc586cc604917a643b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/ExternalServiceProvider.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/ExternalServiceProvider.cs new file mode 100644 index 00000000..742cd05e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/ExternalServiceProvider.cs @@ -0,0 +1,82 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + /// + /// Provides an interface to connect external services used by the plugin. + /// + public static class ExternalServiceProvider + { + #region Static properties + + private static IJsonServiceProvider s_jsonServiceProvider; + + private static ISaveServiceProvider s_saveServiceProvider; + + private static ILocalisationServiceProvider s_localisationServiceProvider; + + #endregion + + #region Static fields + + /// + /// Gets or sets the JSON service provider. + /// + /// The JSON service provider. + public static IJsonServiceProvider JsonServiceProvider + { + get + { + return s_jsonServiceProvider; + } + set + { + // validate property + Assert.IsPropertyNotNull(value, "value"); + + // set value + s_jsonServiceProvider = value; + } + } + + /// + /// Gets or sets the save service provider. + /// + /// The save service provider. + public static ISaveServiceProvider SaveServiceProvider + { + get + { + return s_saveServiceProvider; + } + set + { + // validate property + Assert.IsPropertyNotNull(value, "value"); + + // set value + s_saveServiceProvider = value; + } + } + + public static ILocalisationServiceProvider LocalisationServiceProvider + { + get + { + return s_localisationServiceProvider; + } + set + { + // validate property + Assert.IsPropertyNotNull(value, "value"); + + // set value + s_localisationServiceProvider = value; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/ExternalServiceProvider.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/ExternalServiceProvider.cs.meta new file mode 100644 index 00000000..a92309dd --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/ExternalServiceProvider.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: add81dcba5652491caa73048e9bee1b1 +timeCreated: 1550517833 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/IJsonServiceProvider.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/IJsonServiceProvider.cs new file mode 100644 index 00000000..83431196 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/IJsonServiceProvider.cs @@ -0,0 +1,30 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + /// + /// Adapter interface for supporting json conversion compatible with the plugin. + /// + public interface IJsonServiceProvider + { + #region Methods + + /// + /// Generate a JSON representation of the given object. + /// + /// The json. + /// Object. + string ToJson(object obj); + + /// + /// Create an object from specified JSON representation. + /// + /// The object. + /// Json string. + object FromJson(string jsonString); + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/IJsonServiceProvider.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/IJsonServiceProvider.cs.meta new file mode 100644 index 00000000..bc3f515f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/IJsonServiceProvider.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c3225614eed7647a3a416754ef6ea830 +timeCreated: 1550517846 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/ILocalisationServiceProvider.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/ILocalisationServiceProvider.cs new file mode 100644 index 00000000..a39f8a9d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/ILocalisationServiceProvider.cs @@ -0,0 +1,11 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public interface ILocalisationServiceProvider + { + string GetLocalisedString(string key, string defaultValue); + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/ILocalisationServiceProvider.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/ILocalisationServiceProvider.cs.meta new file mode 100644 index 00000000..fd708f0c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/ILocalisationServiceProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5f3d4b29cb44b49d7ade649008c9e4de +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/ISaveServiceProvider.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/ISaveServiceProvider.cs new file mode 100644 index 00000000..c1520f9a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/ISaveServiceProvider.cs @@ -0,0 +1,36 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + /// + /// Adapter interface for supporting save service compatible with the plugin. + /// + public interface ISaveServiceProvider + { + #region Methods + + int GetInt(string key, int defaultValue = 0); + + float GetFloat(string key, float defaultValue = 0f); + + string GetString(string key, string defaultValue = null); + + string[] GetStringArray(string key, string[] defaultValue = null); + + void SetInt(string key, int value); + + void SetFloat(string key, float value); + + void SetString(string key, string value); + + void SetStringArray(string key, string[] value); + + void RemoveKey(string key); + + void Save(); + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/ISaveServiceProvider.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/ISaveServiceProvider.cs.meta new file mode 100644 index 00000000..8f8d548b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/ISaveServiceProvider.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 292e03e286b8d4a2c80cece8fa14ff54 +timeCreated: 1552894294 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/IValidator.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/IValidator.cs new file mode 100644 index 00000000..f6a97583 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/IValidator.cs @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public interface IValidator + { + #region Methods + + /// + /// Validate this instance. + /// + /// The validation result. + ValidationResult Validate(); + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/IValidator.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/IValidator.cs.meta new file mode 100644 index 00000000..c2651fab --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Interfaces/IValidator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b04d72e3421d643078c6df509e6ce27b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Managers.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Managers.meta new file mode 100644 index 00000000..edadc7f7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Managers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 84927570c65be4c65807cabdb839d13e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Managers/CommandProcessor.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Managers/CommandProcessor.cs new file mode 100644 index 00000000..7952dcaf --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Managers/CommandProcessor.cs @@ -0,0 +1,159 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Events; + +namespace VoxelBusters.CoreLibrary +{ + public class CommandProcessor + { + #region Fields + + private List m_inprogressCommands; + + private List m_pendingCommands; + + #endregion + + #region Properties + + public CommandExecutionOrder ExecutionOrder { get; private set; } + + #endregion + + #region Events + + public event Callback OnCompletion; + + #endregion + + #region Constructors + + public CommandProcessor(CommandExecutionOrder order) + { + // set properties + m_inprogressCommands = new List(); + m_pendingCommands = new List(); + ExecutionOrder = order; + } + + #endregion + + #region Command methods + + public void AddCommand(ICommand command) + { + Assert.IsArgNotNull(command, nameof(command)); + + if (CommandExecutionOrder.None == ExecutionOrder) + { + ProcessCommandInternal(command); + } + else if (CommandExecutionOrder.Sequential == ExecutionOrder) + { + // add command to queue + m_pendingCommands.Add(command); + } + } + + public void InvalidateAll() + { + m_pendingCommands.Clear(); + } + + #endregion + + #region Public methods + + public void Update() + { + if (CommandExecutionOrder.None == ExecutionOrder) + { + ProcessInprogressCommands(); + } + else if (CommandExecutionOrder.Sequential == ExecutionOrder) + { + ProcessCommandsInSequentialOrder(); + } + } + + #endregion + + #region Private methods + + private void ProcessCommandInternal(ICommand command) + { + // add item to the tracker + m_inprogressCommands.Add(command); + + // execute action associated with the command + command.Execute(); + } + + private void ProcessInprogressCommands() + { + // parse through the inprogress commands and remove the completed ones + for (int iter = 0; iter < m_inprogressCommands.Count; iter++) + { + var command = m_inprogressCommands[iter]; + if (command.IsDone) + { + m_inprogressCommands.RemoveAt(iter); + iter--; + + // send completion event + PostCommandCompleteEvent(command); + } + } + } + + private void ProcessCommandsInSequentialOrder() + { + // check whether active command is processed + if (m_inprogressCommands.Count > 0) + { + var command = m_inprogressCommands[0]; + if (!command.IsDone) + { + return; + } + + // notify that command is completed + m_inprogressCommands.RemoveAt(0); + PostCommandCompleteEvent(command); + } + + // execute command available in the pool + if (m_pendingCommands.Count > 0) + { + var newCommand = m_pendingCommands[0]; + m_pendingCommands.RemoveAt(0); + + ProcessCommandInternal(newCommand); + } + } + + private void PostCommandCompleteEvent(ICommand command) + { + OnCompletion?.Invoke(command); + } + + #endregion + + #region Nested types + + [Serializable] + public class CommandEvent : UnityEvent + { } + + public enum CommandExecutionOrder + { + None, + + Sequential, + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Managers/CommandProcessor.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Managers/CommandProcessor.cs.meta new file mode 100644 index 00000000..91e839ac --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Managers/CommandProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 705d21dd94a3a4304998c44f34fab18a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Managers/ICommand.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Managers/ICommand.cs new file mode 100644 index 00000000..be3b8c6b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Managers/ICommand.cs @@ -0,0 +1,23 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public interface ICommand + { + #region Properties + + bool IsDone { get; } + + Error Error { get; } + + #endregion + + #region Methods + + void Execute(); + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Managers/ICommand.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Managers/ICommand.cs.meta new file mode 100644 index 00000000..ab3dd534 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Managers/ICommand.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ee1b33b1e7223438bad27e46264abad6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc.meta new file mode 100644 index 00000000..2b0ce3ce --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8e208fb9bf46b403cbbe6846c27b1438 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/Assert.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/Assert.cs new file mode 100644 index 00000000..b39cc219 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/Assert.cs @@ -0,0 +1,107 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class Assert + { + #region Static methods + + public static void IsNotNull(object obj, string message) + { + if (obj == null) + { + throw new VBException(message); + } + } + + public static void IsNull(object obj, string message) + { + if (obj != null) + { + throw new VBException(message); + } + } + + public static void IsPropertyNotNull(object obj, string property) + { + if (obj == null) + { + throw new VBException(string.Format("{0} is null.", property)); + } + } + + public static void IsArgNotNull(object obj, string argName) + { + if (obj == null) + { + throw new VBException(string.Format("Arg {0} is null.", argName)); + } + } + + public static void AreNotEqual(object obj1, object obj2, string message) + { + if (obj1 == obj2) + { + throw new VBException(message); + } + } + + public static void AreNotEqual(T value, T target, string message) + { + if (EqualityComparer.Default.Equals(value, target)) + { + throw new VBException(message); + } + } + + public static void AreEqual(T value, T target, string message) + { + if (!EqualityComparer.Default.Equals(value, target)) + { + throw new VBException(message); + } + } + + public static void IsTrue(bool status, string message) + { + if (!status) + { + throw new VBException(message); + } + } + + public static void IsFalse(bool status, string message) + { + if (status) + { + throw new VBException(message); + } + } + + public static void IsNotZero(int value, string message) + { + AreNotEqual(value, 0, message); + } + + public static void IsNotNullOrEmpty(string value, string message) + { + IsFalse(string.IsNullOrEmpty(value), message); + } + + public static void IsNotNullOrEmpty(T[] array, string name) + { + if (array == null) + { + throw new VBException(string.Format("{0} is null.", name)); + } + if (0 == array.Length) + { + throw new VBException(string.Format("{0} is empty.", name)); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/Assert.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/Assert.cs.meta new file mode 100644 index 00000000..07ca9d24 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/Assert.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e783dcfe5edcf4e0db2dd73c5f7c5f9e +timeCreated: 1596367778 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/DebugLogger.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/DebugLogger.cs new file mode 100644 index 00000000..ef698630 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/DebugLogger.cs @@ -0,0 +1,194 @@ +using System.Collections.Generic; +using UnityEngine; + +using Exception = System.Exception; + +namespace VoxelBusters.CoreLibrary +{ + public static class DebugLogger + { + #region Constants + + private const string kDefaultTag = "VoxelBusters"; + + #endregion + + #region Static properties + + private static Dictionary TagLevelMap { get; set; } + + private static LogLevel DefaultLogLevel { get; set; } + + #endregion + + #region Constructors + + static DebugLogger() + { + // Set properties + TagLevelMap = new Dictionary(); + DefaultLogLevel = LogLevel.Critical; + } + + #endregion + + #region Static methods + + public static void SetLogLevel(LogLevel value, params string[] tags) + { + // Set value + if (tags.IsNullOrEmpty()) + { + DefaultLogLevel = value; + return; + } + + // Update tag based settings + foreach (var tag in tags) + { + TagLevelMap[tag] = value; + } + } + + #endregion + + #region Log methods + + public static void Log(string message, Object context = null) + { + Log(kDefaultTag, message, context); + } + + public static void Log(string tag, string message, Object context = null) + { + // Check whether the specified request is allowed + if (IgnoreLog(LogLevel.Info, tag)) return; + + Debug.Log($"[{tag}] {message}", context); + } + + public static void LogWarning(string message, Object context = null) + { + LogWarning(kDefaultTag, message, context); + } + + public static void LogWarning(string tag, string message, Object context = null) + { + // Check whether the specified request is allowed + if (IgnoreLog(LogLevel.Warning, tag)) return; + + Debug.LogWarning($"[{tag}] {message}", context); + } + + public static void LogError(string message, Object context = null) + { + LogError(kDefaultTag, message, context); + } + + public static void LogError(string tag, string message, Object context = null) + { + // Check whether the specified request is allowed + if (IgnoreLog(LogLevel.Error, tag)) return; + + Debug.LogError($"[{tag}] {message}", context); + } + + public static void LogException(Exception exception, Object context = null) + { + LogException(kDefaultTag, exception, context); + } + + public static void LogException(string tag, Exception exception, Object context = null) + { + // Check whether the specified request is allowed + if (IgnoreLog(LogLevel.Critical, tag)) return; + + Debug.LogError($"[{tag}] {exception}", context); + } + + #endregion + + #region Obsolete methods + + [System.Obsolete("This method is deprecated. Use Log instead.", false)] + public static void LogFormat(string format, params object[] arguments) + { + LogFormat(null, format, kDefaultTag, arguments); + } + + [System.Obsolete("This method is deprecated. Use Log instead.", false)] + public static void LogFormat(Object context, string format, params object[] arguments) + { + // Check whether logging is required + if (IgnoreLog(LogLevel.Info)) return; + + var formattedMessage = $"[VoxelBusters] {string.Format(format, arguments)}"; + Debug.Log(formattedMessage, context); + } + + [System.Obsolete("This method is deprecated. Use LogWarning instead.", false)] + public static void LogWarningFormat(string format, params object[] arguments) + { + LogWarningFormat(null, format, arguments); + } + + [System.Obsolete("This method is deprecated. Use LogWarning instead.", false)] + public static void LogWarningFormat(Object context, string format, params object[] arguments) + { + // Check whether logging is required + if (IgnoreLog(LogLevel.Warning)) return; + + var formattedMessage = "[VoxelBusters] " + string.Format(format, arguments); + Debug.LogWarning(formattedMessage, context); + } + + [System.Obsolete("This method is deprecated. Use LogError instead.", false)] + public static void LogErrorFormat(string format, params object[] arguments) + { + LogErrorFormat(null, format, arguments); + } + + [System.Obsolete("This method is deprecated. Use LogError instead.", false)] + public static void LogErrorFormat(Object context, string format, params object[] arguments) + { + // Check whether logging is required + if (IgnoreLog(LogLevel.Error)) return; + + var formattedMessage = "[VoxelBusters] " + string.Format(format, arguments); + Debug.LogError(formattedMessage, context); + } + + #endregion + + #region Private static methods + + private static bool IgnoreLog(LogLevel level, string tag = null) + { + if ((tag == null) || !TagLevelMap.TryGetValue(tag, out LogLevel allowedLogLevel)) + { + allowedLogLevel = DefaultLogLevel; + } + + return (level < allowedLogLevel); + } + + #endregion + + #region Nested types + + public enum LogLevel + { + Info = 0, + + Warning, + + Error, + + Critical, + + None + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/DebugLogger.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/DebugLogger.cs.meta new file mode 100644 index 00000000..d4037219 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/DebugLogger.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b418785d5aa4a4bc7bc51eb1078e6799 +timeCreated: 1575981659 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/ListPool{T}.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/ListPool{T}.cs new file mode 100644 index 00000000..976667d1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/ListPool{T}.cs @@ -0,0 +1,57 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class ListPool + { + #region Static fields + + private static ObjectPool> s_listObjectPool; + + #endregion + + #region Static methods + + public static List Get() + { + EnsureInitialized(); + + return s_listObjectPool.Get(); + } + + public static void Release(List obj) + { + EnsureInitialized(); + + s_listObjectPool.Add(obj); + } + + #endregion + + #region Private static methods + + private static void EnsureInitialized() + { + if (s_listObjectPool != null) return; + + s_listObjectPool = new ObjectPool>( + createFunc: OnCreateItem, + actionOnGet: null, + actionOnAdd: OnReleaseItem); + } + + private static List OnCreateItem() + { + return new List(capacity: 8); + } + + private static void OnReleaseItem(List item) + { + item.Clear(); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/ListPool{T}.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/ListPool{T}.cs.meta new file mode 100644 index 00000000..af228166 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/ListPool{T}.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d202487821edb44b8b3c334e1f4d02a8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/ObjectPool{T}.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/ObjectPool{T}.cs new file mode 100644 index 00000000..babaf57b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/ObjectPool{T}.cs @@ -0,0 +1,96 @@ +// credits: https://bitbucket.org/Unity-Technologies/ui/src/31cbc456efd5ed74cba398ec1a101a31f66716db/UnityEngine.UI/UI/Core/Utility/ObjectPool.cs +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class ObjectPool where T : class + { + #region Fields + + private readonly Stack m_stack; + + private readonly System.Func m_createFunc; + + private readonly Callback m_actionOnGet; + + private readonly Callback m_actionOnAdd; + + private readonly Callback m_actionOnRelease; + + #endregion + + #region Properties + + public int CountAll { get; private set; } + + public int CountActive { get { return CountAll - CountInactive; } } + + public int CountInactive { get { return m_stack.Count; } } + + #endregion + + #region Constructors + + public ObjectPool(System.Func createFunc, Callback actionOnGet = null, + Callback actionOnAdd = null, Callback actionOnRelease = null) + { + m_stack = new Stack(capacity: 16); + m_createFunc = createFunc; + m_actionOnGet = actionOnGet; + m_actionOnAdd = actionOnAdd; + m_actionOnRelease = actionOnRelease; + } + + #endregion + + #region Public methods + + public T Get() + { + // remove item + T element; + if (m_stack.Count == 0) + { + element = m_createFunc(); + CountAll++; + } + else + { + element = m_stack.Pop(); + } + + // send event + m_actionOnGet?.Invoke(element); + + return element; + } + + public void Add(T element) + { + if (m_stack.Count > 0 && ReferenceEquals(m_stack.Peek(), element)) + { + Debug.LogError("Internal error. Trying to destroy object that is already released to pool."); + } + + // send event + m_actionOnAdd?.Invoke(element); + + // add item + m_stack.Push(element); + } + + public void Reset() + { + CountAll = 0; + while (m_stack.Count > 0) + { + var item = m_stack.Pop(); + m_actionOnRelease?.Invoke(item); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/ObjectPool{T}.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/ObjectPool{T}.cs.meta new file mode 100644 index 00000000..655d7045 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/ObjectPool{T}.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4a1033bddacd44cb48c1fc9292cc984a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Networking.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Networking.meta new file mode 100644 index 00000000..be3afee0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Networking.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4dc3bbb6c530d4fc687fc6dc1f1c7ba3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Networking/RestClient.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Networking/RestClient.cs new file mode 100644 index 00000000..0c48e485 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Networking/RestClient.cs @@ -0,0 +1,82 @@ +using System.Collections; +using System.Collections.Generic; +using Newtonsoft.Json; +using UnityEngine; +using UnityEngine.Networking; + +namespace VoxelBusters.CoreLibrary +{ + internal class RestClient + { + #region Static fields + + [ClearOnReload] + private static RestClient s_sharedInstance; + + #endregion + + #region Static properties + + public static RestClient SharedInstance => ObjectHelper.CreateInstanceIfNull( + ref s_sharedInstance, + () => new RestClient()); + + #endregion + + #region Constructors + + public RestClient() + { + var settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + Formatting = Formatting.None, + MissingMemberHandling = MissingMemberHandling.Ignore, + }; + JsonConvert.DefaultSettings = () => settings; + } + + #endregion + + #region Static methods + + public static string EscapeUrl(string url) + { + return System.Uri.EscapeUriString(url); + } + + #endregion + + #region Public methods + + public void StartWebRequest(UnityWebRequest request, System.Action onSuccess, + System.Action onError) + { + DebugLogger.Log(CoreLibraryDomain.Default, $"Starting web request: {request.url}."); + request.SendWebRequest().completed += (obj) => + { + // Parse response + if ((request.responseCode >= 200) && (request.responseCode <= 301)) + { + DebugLogger.Log(CoreLibraryDomain.Default, $"Status: {request.responseCode} Result: {request.downloadHandler.text}."); + var result = JsonConvert.DeserializeObject(request.downloadHandler.text); + onSuccess(result); + } + else + { + var error = request.downloadHandler.text; + DebugLogger.LogError(CoreLibraryDomain.Default, $"Status: {request.responseCode} Error: {error}."); + onError(error); + } + }; + } + + public byte[] ConvertObjectToBytes(TData data) + { + var jsonStr = JsonConvert.SerializeObject(data); + return System.Text.Encoding.UTF8.GetBytes(jsonStr); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Networking/RestClient.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Networking/RestClient.cs.meta new file mode 100644 index 00000000..85176e0a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Networking/RestClient.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a15ecf7c2e0a54e5b9b99ab8d4db67f9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup.meta new file mode 100644 index 00000000..75912317 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9991300776ae94a94a300daff99f90c7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup/CoreLibrarySettings.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup/CoreLibrarySettings.cs new file mode 100644 index 00000000..17b233f1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup/CoreLibrarySettings.cs @@ -0,0 +1,39 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +/// +/// A common library for all Voxel Busters's plugins. +/// +namespace VoxelBusters.CoreLibrary +{ + public class CoreLibrarySettings + { + #region Static fields + + private static UnityPackageDefinition s_package; + + #endregion + + #region Static properties + + internal static UnityPackageDefinition Package => ObjectHelper.CreateInstanceIfNull( + ref s_package, + () => + { + return new UnityPackageDefinition( + name: "com.voxelbusters.corelibrary", + displayName: "Core Library", + version: "1.0.0", + defaultInstallPath: $"Assets/Plugins/VoxelBusters/CoreLibrary"); + }); + + public static string Name => Package.Name; + + public static string DisplayName => Package.DisplayName; + + public static string Version => Package.Version; + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup/CoreLibrarySettings.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup/CoreLibrarySettings.cs.meta new file mode 100644 index 00000000..6251b561 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup/CoreLibrarySettings.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0f69cc138576446bdb236b719f3a744c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup/SettingsObject.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup/SettingsObject.cs new file mode 100644 index 00000000..edaf7686 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup/SettingsObject.cs @@ -0,0 +1,34 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class SettingsObject : ScriptableObject + { + #region Events + + public event Callback OnSettingsUpdated; + + #endregion + + #region Base methods + + protected virtual void OnValidate() + { + OnSettingsUpdated?.Invoke(); + } + + #endregion + + #region Private methods + + protected virtual void UpdateLoggerSettings() { } + + internal virtual void OnEditorReload() + { + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup/SettingsObject.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup/SettingsObject.cs.meta new file mode 100644 index 00000000..00f147be --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup/SettingsObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ab434722b943d44019b2e12eb1e64e18 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup/SettingsPropertyGroup.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup/SettingsPropertyGroup.cs new file mode 100644 index 00000000..228dd5a2 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup/SettingsPropertyGroup.cs @@ -0,0 +1,47 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + [SerializeField] + public abstract class SettingsPropertyGroup + { + #region Fields + + [SerializeField] + [HideInInspector] + private bool m_isEnabled = true; + + #endregion + + #region Properties + + public bool IsEnabled + { + get + { + return m_isEnabled; + } + set + { + m_isEnabled = value; + } + } + + public string Name { get; private set; } + + #endregion + + #region Constructors + + protected SettingsPropertyGroup(string name, bool isEnabled = true) + { + // set properties + m_isEnabled = isEnabled; + Name = name; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup/SettingsPropertyGroup.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup/SettingsPropertyGroup.cs.meta new file mode 100644 index 00000000..0c4a56ac --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Setup/SettingsPropertyGroup.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 88b33b3a6141c4b25a5b29bdc48f93a6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities.meta new file mode 100644 index 00000000..913eccc4 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6981b02092dc848a489e2800c0cd4e90 +folderAsset: yes +timeCreated: 1562583572 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ApplicationLifecycleObserver.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ApplicationLifecycleObserver.cs new file mode 100644 index 00000000..3c751ef1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ApplicationLifecycleObserver.cs @@ -0,0 +1,53 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class ApplicationLifecycleObserver : SingletonBehaviour + { + [ClearOnReload(ClearOnReloadOption.Default)] + List m_listeners = new List(); + + #region Public methods + + public static ApplicationLifecycleObserver Initialize() + { + return GetSingleton(); + } + + public void AddListener(IApplicationLifecycleListener listener) + { + m_listeners.Add(listener); + } + + public void RemoveListener(IApplicationLifecycleListener listener) + { + m_listeners.Remove(listener); + } + #endregion + + private void OnApplicationFocus(bool hasFocus) + { + foreach(var listener in m_listeners) + { + listener.OnApplicationFocus(hasFocus); + } + } + + private void OnApplicationPause(bool pauseStatus) + { + foreach(var listener in m_listeners) + { + listener.OnApplicationPause(pauseStatus); + } + } + + private void OnApplicationQuit() + { + foreach(var listener in m_listeners) + { + listener.OnApplicationQuit(); + } + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ApplicationLifecycleObserver.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ApplicationLifecycleObserver.cs.meta new file mode 100644 index 00000000..ddbd9a37 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ApplicationLifecycleObserver.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 267b9d3c66a104583ab37cbc4e6e3a8c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ApplicationServices.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ApplicationServices.cs new file mode 100644 index 00000000..3bab9af7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ApplicationServices.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class ApplicationServices + { + #region Static fields + + //public static float OriginalTimeScale { get; set; } + private static float s_originalTimeScale; + + #endregion + + #region Constructors + + static ApplicationServices() + { + Initialize(); + } + + #endregion + + #region Static methods + + [ExecuteOnReload] + private static void Initialize() + { + //OriginalTimeScale = Time.timeScale; + } + + public static void SetApplicationPaused(bool pause) + { + if (pause) + { + // cache original value + //OriginalTimeScale = Time.timeScale; + s_originalTimeScale = Time.timeScale; + + // set new value + Time.timeScale = 0f; + } + else + { + //Time.timeScale = OriginalTimeScale; + Time.timeScale = s_originalTimeScale; + } + } + + public static RuntimePlatform GetActivePlatform() + { + return Application.platform; + } + + public static RuntimePlatform GetActiveOrSimulationPlatform() + { +#if UNITY_EDITOR + return ConvertBuildTargetToRuntimePlatform(UnityEditor.EditorUserBuildSettings.activeBuildTarget); +#else + return Application.platform; +#endif + } + + public static bool IsPlayingOrSimulatingMobilePlatform() + { +#if UNITY_EDITOR + var platform = GetActiveOrSimulationPlatform(); + return (platform == RuntimePlatform.Android) || (platform == RuntimePlatform.IPhonePlayer); +#else + return Application.isMobilePlatform; +#endif + } + +#if UNITY_EDITOR + public static RuntimePlatform ConvertBuildTargetToRuntimePlatform(UnityEditor.BuildTarget buildTarget) + { + switch (buildTarget) + { + case UnityEditor.BuildTarget.iOS: + return RuntimePlatform.IPhonePlayer; + + case UnityEditor.BuildTarget.tvOS: + return RuntimePlatform.tvOS; + + case UnityEditor.BuildTarget.Android: + return RuntimePlatform.Android; + + case UnityEditor.BuildTarget.StandaloneOSX: + return RuntimePlatform.OSXPlayer; + + case UnityEditor.BuildTarget.StandaloneWindows: + case UnityEditor.BuildTarget.StandaloneWindows64: + return RuntimePlatform.WindowsPlayer; + + case UnityEditor.BuildTarget.WebGL: + return RuntimePlatform.WebGLPlayer; + + default: + return Application.platform; + } + } +#endif + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ApplicationServices.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ApplicationServices.cs.meta new file mode 100644 index 00000000..1321a447 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ApplicationServices.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6d504bedbd29942489d9921a68180697 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/CollectionUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/CollectionUtility.cs new file mode 100644 index 00000000..5fcccc5e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/CollectionUtility.cs @@ -0,0 +1,252 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class CollectionUtility + { + #region Extension methods + + public static bool IsNullOrEmpty(this IList list) + { + return (list == null) || (list.Count == 0); + } + + public static bool AddUnique(this IList list, T item) + { + if (null == list) return false; + + if (!list.Contains(item)) + { + list.Add(item); + return true; + } + return false; + } + + public static IList Add(this IList list, System.Func condition, System.Func getItem) + { + if ((list != null) && condition()) + { + list.Add(getItem()); + } + return list; + } + + public static void AddOrReplace(this List list, T item, System.Predicate match) + { + int replaceIndex = list.FindIndex(match); + if (-1 == replaceIndex) + { + list.Add(item); + } + else + { + list[replaceIndex] = item; + } + } + + public static bool Remove(this List list, System.Predicate match) + { + int targetIndex = list.FindIndex(match); + if (targetIndex != -1) + { + list.RemoveAt(targetIndex); + return true; + } + return false; + } + + public static T GetItemAt(this IList list, int index, bool throwError = true) + { + // Check whether item is within bounds + if (throwError || ((index >= 0) && (index < list.Count))) + { + return list[index]; + } + return default(T); + } + + public static void AddFirst(this IList list, T item) + { + list.Insert(0, item); + } + + public static void AddLast(this IList list, T item) + { + list.Add(item); + } + + public static T PopFirst(this IList list) + { + var item = list[0]; + list.RemoveAt(0); + + return item; + } + + public static T PopLast(this IList list) + { + int lastIndex = list.Count - 1; + var item = list[lastIndex]; + list.RemoveAt(lastIndex); + + return item; + } + + public static void ForEach(this IList list, System.Action action) + { + foreach (var item in list) + { + action(item); + } + } + + public static TOutput[] ConvertAll(this IList source, System.Converter converter, System.Predicate match = null) + { + var newList = new List(source.Count); + foreach (var item in source) + { + if ((match != null) && !match(item)) continue; + + var convertedItem = converter(item); + newList.Add(convertedItem); + } + return newList.ToArray(); + } + + #endregion + + #region IDictionary methods + + public static bool IsNullOrEmpty(this IDictionary dict) + { + return (dict == null) || (dict.Count == 0); + } + + public static bool ContainsKeyPath(this IDictionary dictionary, string keyPath) + { + if (string.IsNullOrEmpty(keyPath)) return false; + + try + { + var pathComponents = keyPath.Split('/'); + int count = pathComponents.Length; + var currentDict = dictionary; + + for (int pIter = 0; pIter < count; pIter++) + { + string key = pathComponents[pIter]; + if (currentDict == null || !currentDict.Contains(key)) + { + return false; + } + + // Update reference to object at current key path + currentDict = currentDict[key] as IDictionary; + } + return true; + } + catch (System.Exception exception) + { + Debug.LogWarning($"[CoreLibrary] {exception.Message}"); + return false; + } + } + + public static T GetIfAvailable(this IDictionary dictionary, string key, T defaultValue = default(T)) + { + if (key == null || !dictionary.Contains(key)) return defaultValue; + + object value = dictionary[key]; + var targetType = typeof(T); + + if (value == null) + { + return defaultValue; + } + if (targetType.IsInstanceOfType(value)) + { + return (T)value; + } + +#if !NETFX_CORE + if (targetType.IsEnum) +#else + if (targetType.GetTypeInfo().IsEnum) +#endif + { + return (T)System.Enum.ToObject(targetType, value); + } + else + { + return (T)System.Convert.ChangeType(value, targetType); + } + } + + public static T GetIfAvailable(this IDictionary dictionary, string key, string path) + { + // Trim path at start + if (path != null) + { + // Trim start and end slash if exists. + path = path.TrimStart('/').TrimEnd('/'); + } + + if (!string.IsNullOrEmpty(key)) + { + if (string.IsNullOrEmpty(path)) + { + return dictionary.GetIfAvailable(key); + } + else + { + var pathComponents = path.Split('/'); + var currentDict = dictionary; + + // Here traverse to the path + foreach (string each in pathComponents) + { + if (currentDict.Contains(each)) + { + currentDict = currentDict[each] as IDictionary; + } + else + { + Debug.LogError($"[CoreLibrary]Path not found. Path={path}"); + return default(T); + } + } + return currentDict.GetIfAvailable(key); + } + } + else + { + return default(T); + } + } + + public static string GetKey(this IDictionary dictionary, T value) + { + string key = null; + if (value != null) + { + var keys = dictionary.Keys; + foreach (string eachKey in keys) + { + var eachValue = dictionary[eachKey] as object; + if (eachValue != null && eachValue.Equals(value)) + { + key = eachKey; + break; + } + } + } + + return key; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/CollectionUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/CollectionUtility.cs.meta new file mode 100644 index 00000000..d41802ed --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/CollectionUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 087f3ca9621e347e29c8666e1db6f153 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ComponentUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ComponentUtility.cs new file mode 100644 index 00000000..aed8393b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ComponentUtility.cs @@ -0,0 +1,88 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class ComponentUtility + { + #region Static methods + + public static T AddComponentIfNotFound(this GameObject gameObject) where T : Component + { + var component = gameObject.GetComponent(); + if (null == component) + { + component = gameObject.AddComponent(); + } + return component; + } + + public static TBase AddUniqueComponent(this GameObject gameObject, System.Type type) where TBase : Component + { + // remove components except the specified type + var components = gameObject.GetComponents(); + var targetComponent = default(TBase); + foreach (var item in components) + { + if (item.GetType() == type) + { + targetComponent = item; + continue; + } + Object.DestroyImmediate(item); + } + + // create a new instance if component does not exist + if (type != null) + { + return (targetComponent != null) + ? targetComponent + : gameObject.AddComponent(type) as TBase; + } + else + { + return null; + } + } + + public static T GetComponentInPredecessor(this MonoBehaviour monoBehaviour) where T : Component + { + var parentTransform = monoBehaviour.transform.parent; + while (parentTransform) + { + var targetComponent = parentTransform.GetComponent(); + if (targetComponent) + { + return targetComponent; + } + parentTransform = parentTransform.parent; + } + + return null; + } + + public static T[] GetComponentsInChildren(this Component component, bool includeParent, bool includeInactive) where T : Component + { + var components = component.GetComponentsInChildren(includeInactive); + if (includeParent) + { + return components; + } + else + { + var childComponents = new List(); + foreach (var item in components) + { + if (item.transform != component.transform) + { + childComponents.Add(item); + } + } + + return childComponents.ToArray(); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ComponentUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ComponentUtility.cs.meta new file mode 100644 index 00000000..de73f58b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ComponentUtility.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ca1ad03ecec0340abaec203005bb94f4 +timeCreated: 1575981712 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/EnumUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/EnumUtility.cs new file mode 100644 index 00000000..207a5174 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/EnumUtility.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class EnumUtility + { + #region Static methods + + public static string[] GetEnumNames(Type enumType, bool ignoreDefault = false) + { + var list = new List(); + foreach (var item in Enum.GetValues(enumType)) + { + list.Add(item.ToString()); + } + if (ignoreDefault) + { + list.RemoveAt(0); + } + return list.ToArray(); + } + + public static T[] GetEnumValues(bool ignoreDefault = false) + { + var list = new List(); + foreach (var item in Enum.GetValues(typeof(T))) + { + list.Add((T)item); + } + if (ignoreDefault) + { + list.RemoveAt(0); + } + return list.ToArray(); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/EnumUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/EnumUtility.cs.meta new file mode 100644 index 00000000..df9778c5 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/EnumUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e1abfa1e0b07f48619b6beabe63b3c83 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/GameObjectUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/GameObjectUtility.cs new file mode 100644 index 00000000..a4d8ef90 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/GameObjectUtility.cs @@ -0,0 +1,109 @@ +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class GameObjectUtility + { + #region Static methods + + public static GameObject Instantiate(GameObject prefab, Transform parent = null) + { + var newGO = Object.Instantiate(prefab, parent: parent); + newGO.name = prefab.name; + + return newGO; + } + + public static GameObject Instantiate(GameObject prefab, System.Action onBeforeAwake) + { + var tempGO = new GameObject("Temp"); + tempGO.SetActive(false); + + var newInstance = Object.Instantiate(prefab, tempGO.transform); + newInstance.name = prefab.name; + + try + { + // call the onBeforeAwake method + onBeforeAwake(newInstance); + + return newInstance; + } + finally + { + // reset gameobject state + newInstance.transform.SetParent(null); + + // destroy temp object + Object.Destroy(tempGO); + } + } + + public static GameObject CreateChild(string childName, Transform parent) + { + return CreateChild(childName, Vector3.zero, Quaternion.identity, Vector3.one, parent); + } + + public static GameObject CreateChild(string childName, Vector3 localPosition, Quaternion localRotation, Vector3 localScale, Transform parent) + { + var containerGO = (parent is RectTransform) ? new GameObject(childName, typeof(RectTransform)) : new GameObject(childName); + + // set transform properties + var containerTrans = containerGO.transform; + containerTrans.SetParent(parent); + containerTrans.localPosition = localPosition; + containerTrans.localRotation = localRotation; + containerTrans.localScale = localScale; + + return containerGO; + } + + public static GameObject CreateGameObject(string name, System.Action onBeforeActive = null) + { + var gameObject = new GameObject(name); + try + { + if (onBeforeActive != null) + { + gameObject.SetActive(false); + onBeforeActive(gameObject); + } + } + finally + { + if (!gameObject.activeSelf) + { + gameObject.SetActive(true); + } + } + return gameObject; + } + + public static T CreateGameObjectWithComponent(string name, System.Action onBeforeAwake = null) where T : Component + { + var gameObject = new GameObject(name); + T component = default; + try + { + gameObject.SetActive(false); + component = gameObject.AddComponent(); + onBeforeAwake?.Invoke(component); + } + finally + { + gameObject.SetActive(true); + } + return component; + } + + public static void SetActive(this GameObject[] gameObjects, bool value) + { + for (int iter = 0; iter < gameObjects.Length; iter++) + { + gameObjects[iter].SetActive(value); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/GameObjectUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/GameObjectUtility.cs.meta new file mode 100644 index 00000000..c6c6294b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/GameObjectUtility.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d162b9a2bfab04c2781ef252b67ef848 +timeCreated: 1575981712 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/IApplicationLifecycleListener.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/IApplicationLifecycleListener.cs new file mode 100644 index 00000000..b438e614 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/IApplicationLifecycleListener.cs @@ -0,0 +1,9 @@ +namespace VoxelBusters.CoreLibrary +{ + public interface IApplicationLifecycleListener + { + void OnApplicationFocus(bool hasFocus); + void OnApplicationPause(bool pauseStatus); + void OnApplicationQuit(); + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/IApplicationLifecycleListener.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/IApplicationLifecycleListener.cs.meta new file mode 100644 index 00000000..4c0ff0a6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/IApplicationLifecycleListener.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0025684c1ed374fe59ae77c0f232db24 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/IOServices.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/IOServices.cs new file mode 100644 index 00000000..8b5ccaa5 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/IOServices.cs @@ -0,0 +1,279 @@ +using System; +using System.IO; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class IOServices + { + #region Static methods + + public static string CombinePath(params string[] paths) + { + return Path.Combine(paths); + } + + public static string GetAbsolutePath(string path) + { + if (string.IsNullOrEmpty(path)) + { + return Environment.CurrentDirectory; + } + + return Path.GetFullPath(path); + } + + public static string GetRelativePath(string referencePath, string path) + { + // folders must end in a slash + string directorySeparatorChar = Path.DirectorySeparatorChar.ToString(); + if (!referencePath.EndsWith(directorySeparatorChar)) + { + referencePath += Path.DirectorySeparatorChar; + // hack to stop getting unusual results + if (referencePath.StartsWith(directorySeparatorChar)) + { + referencePath += "a.tmp"; + } + } + + var referenceUri = new Uri(referencePath); + var pathUri = new Uri(path); + var relativeUri = referenceUri.MakeRelativeUri(pathUri); + return Uri.UnescapeDataString(relativeUri.ToString().Replace('/', Path.DirectorySeparatorChar)); + } + + #endregion + + #region Directory operations + + public static bool IsDirectory(string path) + { + var attr = File.GetAttributes(path); + return ((attr & FileAttributes.Directory) == FileAttributes.Directory); + } + + public static bool CreateDirectory(string path, bool overwrite = false) + { + if (DirectoryExists(path)) + { + if (!overwrite) + { + return false; + } + + DeleteDirectory(path, true); + } + + Directory.CreateDirectory(path); + return true; + } + + public static void DeleteDirectory(string path, bool recursive = true, bool throwError = false) + { + var directoryInfo = new DirectoryInfo(path); + if (!directoryInfo.Exists) + { + if (throwError) + { + throw new FileNotFoundException(); + } + return; + } + + directoryInfo.Delete(recursive); + } + + public static void ClearDirectory(string path) + { + var directoryInfo = new DirectoryInfo(path); + if (directoryInfo.Exists) + { + foreach (var file in directoryInfo.GetFiles()) + { + file.Delete(); + } + foreach (var dir in directoryInfo.GetDirectories()) + { + dir.Delete(true); + } + } + } + + public static string GetDirectoryName(string path) + { + return Path.GetDirectoryName(path); + } + + public static void CopyDirectory(string root, string dest, bool recursive, string filePattern = null) + { + // create sub folders + if (recursive) + { + foreach (var directory in Directory.GetDirectories(root)) + { + string dirName = Path.GetFileName(directory); + if (!Directory.Exists(Path.Combine(dest, dirName))) + { + Directory.CreateDirectory(Path.Combine(dest, dirName)); + } + CopyDirectory(directory, Path.Combine(dest, dirName), recursive, filePattern); + } + } + + // copy files + var files = (filePattern == null) ? Directory.GetFiles(root) : Directory.GetFiles(root, filePattern); + foreach (var file in files) + { + File.Copy(file, Path.Combine(dest, Path.GetFileName(file))); + } + } + + public static void MoveDirectory(string source, string destination) + { + try + { + var parent = Directory.GetParent(destination); + CreateDirectory(parent.FullName); + + Directory.Move(source, destination); + } + catch (Exception e) + { + Debug.LogException(e); + } + } + + public static bool DirectoryExists(string path) + { + return Directory.Exists(path); + } + + public static bool IsSubDirectory(string parent, string path) + { + var parentUri = new Uri(GetUriSafePath(parent)); + var childUri = new Uri(GetUriSafePath(Path.GetDirectoryName(path))); + return (parentUri != childUri) && parentUri.IsBaseOf(childUri); + } + + private static string GetUriSafePath(string path) + { + if(IsDirectory(path)) + { + return Path.Combine(path, $"{Path.PathSeparator}"); + } + + return path; + } + + public static string GetUniquePath(string path) + { + string uniquePath = path; + int tryCount = 0; + while (Directory.Exists(uniquePath)) + { + uniquePath = string.Format("{0}{1}", path, ++tryCount); + } + + return uniquePath; + } + + public static string GenerateFileName(string prefix, string extension) + { + return $"{prefix}_{DateTime.Now:yyyyMMddHHmmssfff}.{extension}"; + } + + #endregion + + #region File operations + + public static bool FileExists(string path) + { + return File.Exists(path); + } + + public static string GetFileName(string path) + { + return Path.GetFileName(path); + } + + public static void CreateFile(string path, string contents) + { + File.WriteAllText(path, contents); + } + + public static void CreateFile(string path, byte[] contents) + { + File.WriteAllBytes(path, contents); + } + + public static string ReadFile(string path) + { + return File.ReadAllText(path); + } + + public static byte[] ReadFileData(string path) + { + return File.ReadAllBytes(path); + } + + public static void CopyFile(string source, string destination, bool overwrite = true) + { + File.Copy(source, destination, overwrite); + } + + public static void MoveFile(string source, string destination) + { + if(File.Exists(source)) + { + File.Move(source, destination); + } + } + + public static void DeleteFile(string path, bool throwError = false) + { + if (!FileExists(path)) + { + if (throwError) + { + throw new FileNotFoundException(); + } + return; + } + + File.Delete(path); + } + + #endregion + + #region Hybrid methods + + public static void DeleteFileOrDirectory(string path, bool throwError = false) + { + var fileInfo = new FileInfo(path); + if (fileInfo.Exists) + { + if ((fileInfo.Attributes & FileAttributes.Directory) != 0) + { + DeleteDirectory(path, true, throwError); + } + else + { + DeleteFile(path, throwError); + } + } + } + + public static string GetFileNameWithoutExtension(string path) + { + return Path.GetFileNameWithoutExtension(path); + } + + public static string GetExtension(string path) + { + return Path.GetExtension(path); + } + + #endregion + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/IOServices.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/IOServices.cs.meta new file mode 100644 index 00000000..a5c69b1d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/IOServices.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f03251a97128b4f1c95bc72d0e6c0ca2 +timeCreated: 1595269876 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ObjectHelper.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ObjectHelper.cs new file mode 100644 index 00000000..4dec775e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ObjectHelper.cs @@ -0,0 +1,22 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class ObjectHelper + { + #region Static methods + + public static T CreateInstanceIfNull(ref T reference, System.Func createFunc) where T : class + { + if (reference == null) + { + reference = createFunc(); + } + return reference; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ObjectHelper.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ObjectHelper.cs.meta new file mode 100644 index 00000000..7017ce8a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ObjectHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 01a41eaf37cf94688b89e33c036289dc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/PropertyHelper.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/PropertyHelper.cs new file mode 100644 index 00000000..7d3620cd --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/PropertyHelper.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq.Expressions; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class PropertyHelper + { + #region Static methods + + public static string GetValueOrDefault(string value, string defaultValue = default) + { + if (string.IsNullOrEmpty(value)) return defaultValue; + + return value; + } + + public static string GetValueOrDefault(TInstance instance, Expression> fieldAccess, string value) + { + if (!string.IsNullOrEmpty(value)) return value; + + // Find default value using reflection + var fieldName = ReflectionUtility.GetFieldName(fieldAccess); + var fieldInfo = ReflectionUtility.GetField(typeof(TInstance), fieldName); + var attribute = ReflectionUtility.GetAttribute(fieldInfo); + return attribute.StringValue; + } + + public static TValue GetValueOrDefault(TInstance instance, Expression> fieldAccess, Nullable value) where TValue : struct + { + if (value != null) return value.GetValueOrDefault(); + + // Find default value using reflection + var fieldName = ReflectionUtility.GetFieldName(fieldAccess); + var fieldInfo = ReflectionUtility.GetField(typeof(TInstance), fieldName); + var attribute = ReflectionUtility.GetAttribute(fieldInfo); + return attribute.GetValue(); + } + + public static int GetConstrainedValue(TInstance instance, Expression> fieldAccess, int value) + { + var fieldName = ReflectionUtility.GetFieldName(fieldAccess); + var fieldInfo = ReflectionUtility.GetField(typeof(TInstance), fieldName); + var attribute = ReflectionUtility.GetAttribute(fieldInfo); + return Mathf.Clamp(value, (int)attribute.min, (int)attribute.max); + } + + public static float GetConstrainedValue(TInstance instance, Expression> fieldAccess, float value) + { + var fieldName = ReflectionUtility.GetFieldName(fieldAccess); + var fieldInfo = ReflectionUtility.GetField(typeof(TInstance), fieldName); + var attribute = ReflectionUtility.GetAttribute(fieldInfo); + return Mathf.Clamp(value, attribute.min, attribute.max); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/PropertyHelper.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/PropertyHelper.cs.meta new file mode 100644 index 00000000..a375eedc --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/PropertyHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 153ea3dabf0e645058dbce17fc67436e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ReflectionUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ReflectionUtility.cs new file mode 100644 index 00000000..2e6e4aff --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ReflectionUtility.cs @@ -0,0 +1,298 @@ +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Reflection; +using UnityEngine; +using System.Linq; + +namespace VoxelBusters.CoreLibrary +{ + public static class SystemAssemblyName + { + public const string kCSharpFirstPass = "Assembly-CSharp-firstpass"; + public const string kCSharp = "Assembly-CSharp"; + } + + public static class ReflectionUtility + { + #region Type methods + + [System.Obsolete("Use method GetTypeFromAssemblyCSharp instead.", false)] + public static Type GetTypeFromCSharpAssembly(string typeName) + { + return GetType(SystemAssemblyName.kCSharp, typeName); + } + + [System.Obsolete("Use method GetTypeFromAssemblyCSharp instead.", false)] + public static Type GetTypeFromCSharpFirstPassAssembly(string typeName) + { + return GetType(SystemAssemblyName.kCSharpFirstPass, typeName); + } + + public static Type GetTypeFromAssemblyCSharp(string typeName, bool includeFirstPass = false) + { + Type targetType = null; + if (includeFirstPass) + { + targetType = GetType(SystemAssemblyName.kCSharpFirstPass, typeName); + }; + if (targetType == null) + { + targetType = GetType(SystemAssemblyName.kCSharp, typeName); + } + return targetType; + } + + public static Type GetType(string assemblyName, string typeName) + { + var targetAssembly = FindAssemblyWithName(assemblyName); + if (targetAssembly != null) + { + return targetAssembly.GetType(typeName, false); + } + + return null; + } + + public static Assembly FindAssemblyWithName(string assemblyName) + { + return Array.Find(AppDomain.CurrentDomain.GetAssemblies(), (item) => + { + return string.Equals(item.GetName().Name, assemblyName); + }); + } + + public static Type[] FindAllTypes(Predicate predicate = null) + { + var typeList = new List(); + foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) + { + foreach (var type in GetLoadableTypes(assembly)) + { + if ((predicate == null) || predicate(type)) + { + typeList.Add(type); + } + } + } + return typeList.ToArray(); + } + + public static bool TryGetCustomAttriute(this MethodInfo methodInfo, + Type attributeType, + out Attribute attribute, + bool inherit = false) + { + // Set default value + attribute = null; + + // Find custom attributes + var attributes = methodInfo.GetCustomAttributes(attributeType, inherit); + if (attributes.Length > 0) + { + attribute = attributes[0] as Attribute; + return true; + } + return false; + } + + public static bool TryGetCustomAttriute(this MethodInfo methodInfo, + out TAttribute attribute, + bool inherit = false) where TAttribute : Attribute + { + bool value = TryGetCustomAttriute(methodInfo: methodInfo, + attributeType: typeof(TAttribute), + attribute: out Attribute genericAttr, + inherit: inherit); + attribute = genericAttr as TAttribute; + return value; + } + + #endregion + + #region Create instance methods + + public static object CreateInstance(Type type, bool nonPublic = true) + { + return Activator.CreateInstance(type, nonPublic); + } + + public static object CreateInstance(Type type, params object[] args) + { + return Activator.CreateInstance(type, args); + } + + #endregion + + #region Attribute methods + + public static Dictionary FindTypesWithAttribute(Type attributeType, bool inherit = false) + { + var collection = new Dictionary(); + foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) + { + foreach (var type in GetLoadableTypes(assembly)) + { + if (type.IsClass == false) continue; + + var customAttributes = type.GetCustomAttributes(attributeType, inherit); + if (customAttributes.Length == 0) continue; + + collection.Add(type, Array.ConvertAll(customAttributes, (item) => item as Attribute)); + } + } + return collection; + } + + /* + public static Type[] FindTypesWithAttributes(Type attributeType, System.Func typeFilter = null, + System.Func methodFilter = null) + { + var targetTypes = new List(); + foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) + { + foreach (var type in assembly.GetTypes()) + { + if ((typeFilter != null) && !typeFilter(type)) continue; + + foreach (var method in type.GetRuntimeMethods()) + { + + } + + } + } + + return targetTypes.ToArray(); + } + */ + + #endregion + + #region Invoke methods + + public static object InvokeStaticMethod(this Type type, string method, params object[] parameters) + { + return type.GetMethod(method, BindingFlags.Public | BindingFlags.Static).Invoke(null, parameters); + } + + public static T InvokeStaticMethod(this Type type, string method, params object[] parameters) + { + return (T)InvokeStaticMethod(type, method, parameters); + } + + #endregion + + #region Modifier methods + + public static void SetPropertyValue(this object obj, string name, object value) + { + var type = obj.GetType(); + var bindingAttr = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; + var property = type.GetProperty(name, bindingAttr); + if (property != null) + { + if (property.DeclaringType != type) + { + property.DeclaringType.GetProperty(name, bindingAttr).SetValue(obj, value); + } + else + { + property.SetValue(obj, value); + } + } + } + + #endregion + + #region Constraints methods + + // Credits: Thomas Hourdel + public static string GetFieldName(Expression> fieldAccess) + { + var memberExpression = fieldAccess.Body as MemberExpression; + if (memberExpression != null) + { + return memberExpression.Member.Name; + } + throw new InvalidOperationException("Member expression expected"); + } + + public static FieldInfo GetField(Type type, string fieldName) + { + return type.GetField(fieldName, BindingFlags.NonPublic | BindingFlags.Instance); + } + + public static TAttribute GetAttribute(FieldInfo field) where TAttribute : Attribute + { + return (TAttribute)Attribute.GetCustomAttribute(field, typeof(TAttribute)); + } + + // MinAttribute + public static void ConstrainMin(TInstance instance, Expression> fieldAccess, float value) + { + var fieldName = GetFieldName(fieldAccess); + var fieldInfo = GetField(typeof(TInstance), fieldName); + fieldInfo.SetValue(instance, Mathf.Max(value, GetAttribute(fieldInfo).min)); + } + + public static void ConstrainMin(TInstance instance, Expression> fieldAccess, int value) + { + var fieldName = GetFieldName(fieldAccess); + var fieldInfo = GetField(typeof(TInstance), fieldName); + fieldInfo.SetValue(instance, (int)Mathf.Max(value, GetAttribute(fieldInfo).min)); + } + + // RangeAttribute + public static void ConstrainRange(TInstance instance, Expression> fieldAccess, float value) + { + var fieldName = GetFieldName(fieldAccess); + var fieldInfo = GetField(typeof(TInstance), fieldName); + var attribute = GetAttribute(fieldInfo); + fieldInfo.SetValue(instance, Mathf.Clamp(value, attribute.min, attribute.max)); + } + + public static void ConstrainRange(TInstance instance, Expression> fieldAccess, int value) + { + var fieldName = GetFieldName(fieldAccess); + var fieldInfo = GetField(typeof(TInstance), fieldName); + var attribute = GetAttribute(fieldInfo); + fieldInfo.SetValue(instance, (int)Mathf.Clamp(value, attribute.min, attribute.max)); + } + + public static void ConstrainDefault(TInstance instance, Expression> fieldAccess, Func condition = null) + { + if ((condition != null) && !condition()) return; + + var fieldName = GetFieldName(fieldAccess); + var fieldInfo = GetField(typeof(TInstance), fieldName); + var attribute = GetAttribute(fieldInfo); + if (attribute != null) + { + fieldInfo.SetValue(instance, attribute.GetValue(fieldInfo.FieldType)); + } + } + + public static void ConstrainDefault(TInstance instance, Expression> fieldAccess, string value) + { + if (!string.IsNullOrEmpty(value)) return; + + ConstrainDefault(instance, fieldAccess); + } + + #endregion + + #region Private methods + + private static IEnumerable GetLoadableTypes(Assembly assembly) { + if (assembly == null) throw new ArgumentNullException("assembly"); + try { + return assembly.GetTypes(); + } catch (ReflectionTypeLoadException e) { + return e.Types.Where(t => t != null); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ReflectionUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ReflectionUtility.cs.meta new file mode 100644 index 00000000..cbdbb0c4 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ReflectionUtility.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3b8e3dad17bea4adba258ad4293b2ed6 +timeCreated: 1576213852 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ResourcesUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ResourcesUtility.cs new file mode 100644 index 00000000..bc18f5a4 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ResourcesUtility.cs @@ -0,0 +1,24 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class ResourcesUtility + { + #region Static methods + + public static T LoadBuiltinAsset(string name) where T : Object + { + return Resources.Load(name); + } + + public static T LoadAsset(this UnityPackageDefinition package, string name) where T : Object + { + string path = $"{package.GetMutableResourcesPath()}/{name}"; + return Resources.Load(path); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ResourcesUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ResourcesUtility.cs.meta new file mode 100644 index 00000000..72e37338 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ResourcesUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1a946811916dd488ba03ca679c9eaeff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/RuntimePlatformConstantUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/RuntimePlatformConstantUtility.cs new file mode 100644 index 00000000..b03ecb51 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/RuntimePlatformConstantUtility.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class RuntimePlatformConstantUtility + { + #region Static methods + + public static RuntimePlatformConstant FindConstantForActivePlatform(RuntimePlatformConstant[] array) + { + var activePlatform = ApplicationServices.GetActiveOrSimulationPlatform(); + return FindConstantForPlatform(array, activePlatform); + } + + public static RuntimePlatformConstant FindConstantForPlatform(RuntimePlatformConstant[] array, RuntimePlatform platform) + { + if (array != null) + { + return Array.Find(array, (item) => item.IsEqualToPlatform(platform)); + } + + return null; + } + + public static string GetConstantValueForActivePlatform(RuntimePlatformConstant[] array) + { + var targetConstant = FindConstantForActivePlatform(array); + return targetConstant?.Value; + } + + public static string GetConstantValueForPlatform(RuntimePlatformConstant[] array, RuntimePlatform platform) + { + var targetConstant = FindConstantForPlatform(array, platform); + return targetConstant?.Value; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/RuntimePlatformConstantUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/RuntimePlatformConstantUtility.cs.meta new file mode 100644 index 00000000..ec46103a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/RuntimePlatformConstantUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 62434b2c5f2a4444582f820fe7c72d12 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/RuntimePlatformUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/RuntimePlatformUtility.cs new file mode 100644 index 00000000..1c2d1558 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/RuntimePlatformUtility.cs @@ -0,0 +1,16 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class RuntimePlatformUtility + { + public static bool IsEditor(this RuntimePlatform other) + { + return (other == RuntimePlatform.OSXEditor) || + (other == RuntimePlatform.WindowsEditor) || + (other == RuntimePlatform.OSXEditor); + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/RuntimePlatformUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/RuntimePlatformUtility.cs.meta new file mode 100644 index 00000000..1497c8ec --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/RuntimePlatformUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4e40aaa960ac24750b85b0b753d4aa61 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ScreenUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ScreenUtility.cs new file mode 100644 index 00000000..9b3a4103 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ScreenUtility.cs @@ -0,0 +1,54 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public class ScreenUtility : PrivateSingletonBehaviour + { + #region Fields + + private bool m_captureFrame = false; + + private Callback m_callback = null; + + #endregion + + #region Static methods + + public static void CaptureFrame(Callback callback) + { + var instance = GetSingleton(); + instance.m_captureFrame = true; + instance.m_callback += callback; + } + + #endregion + + #region Unity methods + + private void LateUpdate() + { + if (m_captureFrame) + { + m_captureFrame = false; + StartCoroutine(CaptureFrameRoutine()); + } + } + + private IEnumerator CaptureFrameRoutine() + { + yield return new WaitForEndOfFrame(); + var texture = ScreenCapture.CaptureScreenshotAsTexture(); + + // send data + m_callback?.Invoke(texture); + + // cleanup + m_callback = null; + Object.Destroy(texture); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ScreenUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ScreenUtility.cs.meta new file mode 100644 index 00000000..919f6733 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/ScreenUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3bab61dc3fccd4c749247992476003d1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/SystemUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/SystemUtility.cs new file mode 100644 index 00000000..0a86c7c1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/SystemUtility.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using UnityEngine; +using UnityEngine.Networking; + +namespace VoxelBusters.CoreLibrary +{ + public static class SystemUtility + { + #region String methods + + public static string EscapeString(string value) + { + return UnityWebRequest.EscapeURL(value).Replace("+", "%20"); + } + + #endregion + + #region List methods + + public static object[] ConvertListToArray(IList list) + { + int count = list.Count; + var array = new object[count]; + for (int iter = 0; iter < count; iter++) + { + array[iter] = list[iter]; + } + + return array; + } + + public static TOutput[] ConvertEnumeratorItems(IEnumerator enumerator, Converter converter, bool includeNullObjects) + { + Assert.IsNotNull(enumerator, "Enumerator is null."); + + // create original data array from native data + var outputObjects = new List(capacity: 8); + while (enumerator.MoveNext()) + { + var inputObject = enumerator.Current; + var outputObject = converter(inputObject); + if (EqualityComparer.Default.Equals(outputObject, default(TOutput)) && !includeNullObjects) + { + DebugLogger.LogWarning(CoreLibraryDomain.Default, $"Failed to convert object with data {inputObject}."); + continue; + } + + // add object to list + outputObjects.Add(outputObject); + } + + return outputObjects.ToArray(); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/SystemUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/SystemUtility.cs.meta new file mode 100644 index 00000000..301cf889 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/SystemUtility.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e186d5a1769064da6b38b8014df4f562 +timeCreated: 1576146223 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/TextureUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/TextureUtility.cs new file mode 100644 index 00000000..0f25b185 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/TextureUtility.cs @@ -0,0 +1,126 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class TextureUtility + { + #region Encode methods + + public static string GetMimeType(TextureEncodingFormat encodeFormat) + { + switch (encodeFormat) + { + case TextureEncodingFormat.JPG: + return MimeType.kJPGImage; + + case TextureEncodingFormat.PNG: + return MimeType.kPNGImage; + + default: + throw VBException.SwitchCaseNotImplemented(encodeFormat); + } + } + + public static byte[] Encode(this Texture2D texture) + { + string mimeType; + return Encode(texture, out mimeType); + } + + public static byte[] Encode(this Texture2D texture, out string mimeType) + { + switch (texture.format) + { + case TextureFormat.Alpha8: + case TextureFormat.ARGB32: + case TextureFormat.ARGB4444: + case TextureFormat.RGBA32: + case TextureFormat.RGBA4444: + case TextureFormat.BGRA32: + case TextureFormat.RGBAHalf: + case TextureFormat.RGBAFloat: + case TextureFormat.PVRTC_RGBA2: + case TextureFormat.PVRTC_RGBA4: + mimeType = MimeType.kPNGImage; + return texture.EncodeToPNG(); + + default: + mimeType = MimeType.kJPGImage; + return texture.EncodeToJPG(); + } + } + + public static byte[] Encode(this Texture2D texture, TextureEncodingFormat encodeFormat) + { + switch (encodeFormat) + { + case TextureEncodingFormat.JPG: + return ImageConversion.EncodeToJPG(texture); + + case TextureEncodingFormat.PNG: + return ImageConversion.EncodeToPNG(texture); + + default: + throw VBException.SwitchCaseNotImplemented(encodeFormat); + } + } + + public static byte[] Encode(this Texture2D texture, TextureEncodingFormat encodeFormat, out string mimeType) + { + string textEncodingName; + return Encode(texture, encodeFormat, out mimeType, out textEncodingName); + } + + public static byte[] Encode(this Texture2D texture, TextureEncodingFormat encodeFormat, out string mimeType, out string textEncodingName) + { + // set default values + mimeType = null; + textEncodingName = TextEncodingFormat.kUTF8; + + // convert to specified format + byte[] data = null; + switch (encodeFormat) + { + case TextureEncodingFormat.PNG: + data = texture.EncodeToPNG(); + mimeType = MimeType.kPNGImage; + break; + + case TextureEncodingFormat.JPG: + data = texture.EncodeToJPG(); + mimeType = MimeType.kJPGImage; + break; + } + + return data; + } + + #endregion + + #region Static methods + + public static string TakeScreenshot(string fileName) + { + return TakeScreenshot(Application.persistentDataPath, fileName); + } + + public static string TakeScreenshot(string directory, string fileName) + { + string filePath = directory + "/" + fileName; + + IOServices.CreateDirectory(directory); + + // delete existing file + IOServices.DeleteFileOrDirectory(filePath); + + // start Capturing + ScreenCapture.CaptureScreenshot(fileName); + + return filePath; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/TextureUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/TextureUtility.cs.meta new file mode 100644 index 00000000..c3516fa7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/TextureUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e04b39855b3f04773a15f0de7df8ec9d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/TransformUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/TransformUtility.cs new file mode 100644 index 00000000..217c1d5e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/TransformUtility.cs @@ -0,0 +1,49 @@ +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class TransformUtility + { + #region Extension methods + + public static Transform[] GetImmediateChildren(Transform transform) + { + int childCount = transform.childCount; + var children = new Transform[childCount]; + for (int iter = 0; iter < childCount; iter++) + { + children[iter] = transform.GetChild(iter); + } + return children; + } + + public static T FindComponentInChildren(GameObject gameObject, string name) + { + return gameObject.transform.Find(name).GetComponent(); + } + + public static void RemoveAllChilds(this Transform parent) + { + RemoveChildren(parent); + } + + public static void RemoveChildren(this Transform parent) + { + var children = GetImmediateChildren(parent); + for (int iter = 0; iter < children.Length; iter++) + { + Object.Destroy(children[iter].gameObject); + } + } + + public static bool RemoveChild(this Transform parent, int index) + { + if ((index < 0) || (index >= parent.childCount)) return false; + + Object.Destroy(parent.GetChild(index).gameObject); + return true; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/TransformUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/TransformUtility.cs.meta new file mode 100644 index 00000000..8a7c2a5c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/TransformUtility.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 229d7d1e6da8f438c928f26c2380c443 +timeCreated: 1575981712 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/UnityEngineUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/UnityEngineUtility.cs new file mode 100644 index 00000000..b43d1d22 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/UnityEngineUtility.cs @@ -0,0 +1,27 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary +{ + public static class UnityEngineUtility + { + #region Screen methods + + public static Vector2 InvertScreenPosition(Vector2 position, bool invertX = true, bool invertY = true) + { + if (invertX) + { + position.x = Screen.width - position.x; + } + if (invertY) + { + position.y = Screen.height - position.y; + } + + return position; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/UnityEngineUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/UnityEngineUtility.cs.meta new file mode 100644 index 00000000..1021a442 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/UnityEngineUtility.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 10c0b5322ab5d4fa4911a13be90cf142 +timeCreated: 1576146571 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/UnityPackagePathResolver.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/UnityPackagePathResolver.cs new file mode 100644 index 00000000..04d0ccbd --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/UnityPackagePathResolver.cs @@ -0,0 +1,102 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace VoxelBusters.CoreLibrary +{ + public static class UnityPackagePathResolver + { + #region Static methods + + public static bool IsInstalledWithinAssets(this UnityPackageDefinition package) + { + return IOServices.DirectoryExists(package.DefaultInstallPath) && + IOServices.FileExists($"{package.DefaultInstallPath}/package.json"); + } + + public static string GetInstallPath(this UnityPackageDefinition package) + { + if (IsSupported()) + { + return IsInstalledWithinAssets(package) ? package.DefaultInstallPath : package.UpmInstallPath; + } + return null; + } + + public static string GetRuntimeScriptsPath(this UnityPackageDefinition package) + { + return CombinePath(pathA: GetInstallPath(package), pathB: "Runtime"); + } + + public static string GetEditorScriptsPath(this UnityPackageDefinition package) + { + return CombinePath(pathA: GetInstallPath(package), pathB: "Editor"); + } + + public static string GetEditorResourcesPath(this UnityPackageDefinition package) + { + return CombinePath(pathA: GetInstallPath(package), pathB: "EditorResources"); + } + + public static string GetMutableResourcesPath(this UnityPackageDefinition package) + { + return package.MutableResourcesPath; + } + + public static string GetImmutableResourcesPath(this UnityPackageDefinition package) + { + return CombinePath(pathA: GetInstallPath(package), pathB: "Resources"); + } + + public static string GetPackageResourcesPath(this UnityPackageDefinition package) + { + return CombinePath(pathA: GetInstallPath(package), pathB: "PackageResources"); + } + + public static string GetFullPath(this UnityPackageDefinition package, string relativePath) + { + return CombinePath(pathA: GetInstallPath(package), pathB: relativePath); + } + + public static string GetMutableResourceRelativePath(this UnityPackageDefinition package, string name) + { + return CombinePath(pathA: package.MutableResourcesRelativePath, pathB: name); + } + + public static string GetExtrasPath(this UnityPackageDefinition package) + { + return CombinePath(pathA: package.DefaultInstallPath, pathB: "Extras"); + } + + public static string GetEssentialsPath(this UnityPackageDefinition package) + { + return CombinePath(pathA: package.DefaultInstallPath, pathB: "Essentials"); + } + + public static string GetGeneratedPath(this UnityPackageDefinition package) + { + return CombinePath(pathA: package.DefaultInstallPath, pathB: "Generated"); + } + + private static bool IsSupported() => Application.isEditor; + + private static string CombinePath(string pathA, string pathB) + { + if (pathA == null) + { + return null; + } + else if (pathA == "") + { + return pathB; + } + else + { + return $"{pathA}/{pathB}"; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/UnityPackagePathResolver.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/UnityPackagePathResolver.cs.meta new file mode 100644 index 00000000..6cddbc5c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Utilities/UnityPackagePathResolver.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 94536336db51e46a1a20ed360ccd155f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/VoxelBusters.CoreLibrary.asmdef b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/VoxelBusters.CoreLibrary.asmdef new file mode 100644 index 00000000..788137c1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/VoxelBusters.CoreLibrary.asmdef @@ -0,0 +1,12 @@ +{ + "name": "VoxelBusters.CoreLibrary", + "references": [], + "optionalUnityReferences": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [] +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/VoxelBusters.CoreLibrary.asmdef.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/VoxelBusters.CoreLibrary.asmdef.meta new file mode 100644 index 00000000..075e2436 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/VoxelBusters.CoreLibrary.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 46ee17e5fcc7f436f9df354a1efda6a4 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins.meta new file mode 100644 index 00000000..70c07ee0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 88f0438e9840c4f628aff17d6eb40019 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android.meta new file mode 100644 index 00000000..b3ebcea6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c0c933458bcaa4dfb865d7680c1741c7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common.meta new file mode 100644 index 00000000..babaeae6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 43a4fb87f52614e0e86314e33e590c42 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/JNIUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/JNIUtility.cs new file mode 100644 index 00000000..1f52bf01 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/JNIUtility.cs @@ -0,0 +1,90 @@ +#if UNITY_ANDROID +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public static class JNIUtility + { + public delegate T NativeJavaObjectConverter(AndroidJavaObject nativeObject); + + public static List GetList(this AndroidJavaObject nativeObject, NativeJavaObjectConverter converter) + { + if (nativeObject == null) + return null; + + int size = nativeObject.Call("size"); + + List list = new List(); + for (int eachIndex = 0; eachIndex < size; eachIndex++) + { + AndroidJNI.PushLocalFrame(128); + using (AndroidJavaObject eachNativeObject = nativeObject.Call("get", eachIndex)) + { + T newObject = converter(eachNativeObject); + list.Add(newObject); + } + AndroidJNI.PopLocalFrame(IntPtr.Zero); + } + + return list; + } + + + public static List GetList(this AndroidJavaObject nativeObject) + { + if (nativeObject == null) + return null; + + T[] array = AndroidJNIHelper.ConvertFromJNIArray(nativeObject.GetRawObject()); + return new List(array); + } + + public static string GetString(this AndroidJavaObject javaObject) + { + if (javaObject == null) + return null; + + return javaObject.Call("toString"); + } + + public static T Get(this AndroidJavaObject nativeObject, string getterName) + { + if (nativeObject == null) + return default(T); + + T value = nativeObject.Call(getterName); + return value; + } + + public static T GetArray(this AndroidJavaObject nativeObject) + { + + if (nativeObject == null) + return default(T); + + T value = AndroidJNIHelper.ConvertFromJNIArray(nativeObject.GetRawObject()); + return value; + } + + public static T GetEnum(this AndroidJavaObject nativeObject) where T:struct + { + int value = nativeObject.Call("ordinal"); + return (T)(object)value; + } + + public static Color GetColor(this AndroidJavaObject nativeObject) + { + float red = nativeObject.Call("getRed") / 255; + float green = nativeObject.Call("getRed") / 255; + float blue = nativeObject.Call("getRed") / 255; + float alpha = nativeObject.Call("alpha") / 255.0f; + + return new Color(red, green, blue, alpha); + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/JNIUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/JNIUtility.cs.meta new file mode 100644 index 00000000..f3d94587 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/JNIUtility.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 16d56bee7bda84a7c87d48ad8d648586 +timeCreated: 1547729646 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeActivity.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeActivity.cs new file mode 100644 index 00000000..b301bb00 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeActivity.cs @@ -0,0 +1,27 @@ +#if UNITY_ANDROID +using System; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public class NativeActivity : NativeAndroidJavaObjectWrapper + { + public NativeActivity(AndroidJavaObject javaObject) : base("android.app.Activity", javaObject) + { + } + public NativeActivity(NativeAndroidJavaObjectWrapper wrapper) : base(wrapper) + { + } + + public void RunOnUiThread(Action action) + { + m_nativeObject.Call("runOnUiThread", new AndroidJavaRunnable(() => + { + action(); + })); + } + + + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeActivity.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeActivity.cs.meta new file mode 100644 index 00000000..034d4a6f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeActivity.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bf0150c256d0841d39afa0fe600952ab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeAndroidJavaObjectWrapper.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeAndroidJavaObjectWrapper.cs new file mode 100644 index 00000000..9664e30e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeAndroidJavaObjectWrapper.cs @@ -0,0 +1,116 @@ +#if UNITY_ANDROID +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public abstract class NativeAndroidJavaObjectWrapper + { + protected AndroidJavaObject m_nativeObject; + protected string m_className; + + public AndroidJavaObject NativeObject + { + get + { + return m_nativeObject; + } + } + + public NativeAndroidJavaObjectWrapper(string className, params object[] args) + { +#if NATIVE_PLUGINS_DEBUG_ENABLED + DebugLogger.Log(string.Format("Creating {0}", this.GetType())); +#endif + m_className = className; + m_nativeObject = new AndroidJavaObject(className, args); + } + + public NativeAndroidJavaObjectWrapper(string className, AndroidJavaObject androidJavaObject) + { +#if NATIVE_PLUGINS_DEBUG_ENABLED + DebugLogger.Log(string.Format("Creating from AndroidJavaObject : {0}", this.GetType())); +#endif + m_className = className; + m_nativeObject = androidJavaObject; + } + + public NativeAndroidJavaObjectWrapper(NativeAndroidJavaObjectWrapper wrapper) + { +#if NATIVE_PLUGINS_DEBUG_ENABLED + DebugLogger.Log(string.Format("Creating from wrapper : {0}", this.GetType())); +#endif + m_className = wrapper.GetClassName(); + m_nativeObject = wrapper.NativeObject; + } + +#if NATIVE_PLUGINS_DEBUG_ENABLED + ~NativeAndroidJavaObjectWrapper() + { + //DebugLogger.Log("Destructor for " + this.GetType()); + } +#endif + + public static AndroidJavaObject CreateFromStatic(string className, string methodName, params object[] args) + { + AndroidJavaClass cls = new AndroidJavaClass(className); + AndroidJavaObject androidJavaObject = cls.CallStatic(methodName, args); + return androidJavaObject; + } + + public bool IsNull() + { + return m_nativeObject == null; + } + + protected T Get(string fieldName) + { + return m_nativeObject.Get(fieldName); + } + + protected void Set(string fieldName, T val) + { + m_nativeObject.Set(fieldName, val); + } + + protected void Call(string methodName, params object[] args) + { + if(!IsNull()) + { +#if NATIVE_PLUGINS_DEBUG_ENABLED + Debug.Log(string.Format("[Class : {0}] [Method : {1}]", this.GetType(), methodName)); +#endif + m_nativeObject.Call(methodName, args); + } + else + { +#if NATIVE_PLUGINS_DEBUG_ENABLED + Debug.Log(string.Format("Null Call [Class : {0}] [Method : {1}]", this.GetType(), methodName)); +#endif + } + } + + protected T Call(string methodName, params object[] args) + { + if(!IsNull()) + { +#if NATIVE_PLUGINS_DEBUG_ENABLED + Debug.Log(string.Format("[Class : {0}] [Method : {1}]", this.GetType(), methodName)); +#endif + return m_nativeObject.Call(methodName, args); + } + else + { +#if NATIVE_PLUGINS_DEBUG_ENABLED + Debug.Log(string.Format("Null Call [Class : {0}] [Method : {1}]", this.GetType(), methodName)); +#endif + return default(T); + } + } + + protected string GetClassName() + { + return m_className; + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeAndroidJavaObjectWrapper.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeAndroidJavaObjectWrapper.cs.meta new file mode 100644 index 00000000..069147ee --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeAndroidJavaObjectWrapper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aee0d2c592981459e851b12ada679d40 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeArrayBuffer.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeArrayBuffer.cs new file mode 100644 index 00000000..1bef615d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeArrayBuffer.cs @@ -0,0 +1,73 @@ +#if UNITY_ANDROID +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public class NativeArrayBuffer : NativeAndroidJavaObjectWrapper + { + public NativeArrayBuffer(AndroidJavaObject androidJavaObject) : base("com.voxelbusters.android.essentialkit.common.ArrayBuffer", androidJavaObject) + { + } + + public int Size() + { + return m_nativeObject.Call("size"); + } + + public T Get(int index) + { + if (m_nativeObject == null) + return default(T); + + T instance; + if(IsStringOrPrimitive(typeof(T))) + { + instance = Call("get", index); + } + else + { + AndroidJavaObject androidJavaObject = Call("get", index); + instance = (T)Activator.CreateInstance(typeof(T), new object[] { androidJavaObject }); + } + + return instance; + } + + public T[] GetArray() + { + if (NativeObject == null) + return default(T[]); + + List list = new List(); + int size = Size(); + for (int i = 0; i < size; i++) + { + T each = Get(i); + list.Add(each); + } + + return list.ToArray(); + } + + private static bool IsStringOrPrimitive(Type type) + { + // Check if the type is string + if (type == typeof(string)) + { + return true; + } + + // Check if the type is a primitive type + if (type.IsPrimitive) + { + return true; + } + + return false; + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeArrayBuffer.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeArrayBuffer.cs.meta new file mode 100644 index 00000000..b71d38f8 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeArrayBuffer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a52488425b5bc4c80b4bb039aadb50c0 +timeCreated: 1581450433 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeByteBuffer.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeByteBuffer.cs new file mode 100644 index 00000000..62c2d716 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeByteBuffer.cs @@ -0,0 +1,68 @@ +#if UNITY_ANDROID +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public class NativeByteBuffer : NativeAndroidJavaObjectWrapper + { +#region Fields + + private const string kClassName = "java.nio.ByteBuffer"; + private byte[] m_cachedBytes; + +#endregion + + public NativeByteBuffer(AndroidJavaObject androidJavaObject) : base(kClassName, androidJavaObject) + { +#if NATIVE_PLUGINS_DEBUG_ENABLED + DebugLogger.Log("Creating from android native object : " + androidJavaObject.GetRawObject()); +#endif + } + + public static NativeByteBuffer Wrap(byte[] array) + { + if(array == null) + return null; + + return Wrap(array.ToSBytes()); + } + + public static NativeByteBuffer Wrap(sbyte[] data) + { + if(data == null) + return null; + + NativeByteBuffer nativeByteBuffer = new NativeByteBuffer(CreateFromStatic(kClassName, "wrap", data)); + return nativeByteBuffer; + } + + public byte[] GetBytes() + { + if (m_nativeObject == null) + return default(byte[]); + + if(m_cachedBytes == null) + { + sbyte[] sbyteArray = Call("array"); + m_cachedBytes = sbyteArray.ToBytes(); + } + + return m_cachedBytes; + } + + public int size() + { + byte[] bytes = GetBytes(); + + if(bytes == null) + return 0; + + return bytes.Length; + } + + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeByteBuffer.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeByteBuffer.cs.meta new file mode 100644 index 00000000..8cae680a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeByteBuffer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: af135a033c56e42e0a1b65e9c17e7f25 +timeCreated: 1581450433 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeContext.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeContext.cs new file mode 100644 index 00000000..3b5b2d38 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeContext.cs @@ -0,0 +1,13 @@ +#if UNITY_ANDROID +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public class NativeContext : NativeAndroidJavaObjectWrapper + { + public NativeContext(AndroidJavaObject javaObject) : base("android.content.Context", javaObject) + { + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeContext.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeContext.cs.meta new file mode 100644 index 00000000..8436f86e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeContext.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: fba83798072dc401eb1572b0d0202645 +timeCreated: 1581450433 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeDate.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeDate.cs new file mode 100644 index 00000000..e6e831d6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeDate.cs @@ -0,0 +1,43 @@ +#if UNITY_ANDROID +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public class NativeDate : NativeAndroidJavaObjectWrapper + { + private const string kClassName = "java.util.Date"; + public NativeDate() : base(kClassName) + { + m_nativeObject = new AndroidJavaObject(kClassName); + } + public NativeDate(AndroidJavaObject nativeObject) : base(kClassName, nativeObject) + { + } + + public void SetDateTime(DateTime dateTime) + { + DateTime epochReference = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + long epoch = Convert.ToInt64((dateTime - epochReference).TotalMilliseconds); + m_nativeObject.Call("setTime", epoch); + } + + public DateTime GetDateTime() + { + long epoch = m_nativeObject.Call("getTime")/1000; + DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + return dateTime.AddSeconds(epoch); + } + + public DateTime? GetDateTimeOptional(DateTime? defaultValue = null) + { + if(IsNull()) + return defaultValue; + + return GetDateTime(); + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeDate.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeDate.cs.meta new file mode 100644 index 00000000..79be8150 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeDate.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7ef75fbaca24c45aeb9babf47794f6c3 +timeCreated: 1581450433 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeErrorInfo.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeErrorInfo.cs new file mode 100644 index 00000000..683d7c40 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeErrorInfo.cs @@ -0,0 +1,78 @@ +#if UNITY_ANDROID +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public class NativeErrorInfo : NativeAndroidJavaObjectWrapper + { + #region Static properties + + private static AndroidJavaClass m_nativeClass; + + #endregion + #region Constructor + + // Default constructor + public NativeErrorInfo(AndroidJavaObject androidJavaObject) : base(Native.kClassName, androidJavaObject) + { + } + public NativeErrorInfo(NativeAndroidJavaObjectWrapper wrapper) : base(wrapper) + { + } + public NativeErrorInfo(int code, string description) : base(Native.kClassName ,code, description) + { + } + public NativeErrorInfo(string description) : base(Native.kClassName ,description) + { + } + +#if NATIVE_PLUGINS_DEBUG_ENABLED + ~NativeErrorInfo() + { + DebugLogger.Log("Disposing NativeErrorInfo"); + } +#endif + #endregion + #region Static methods + private static AndroidJavaClass GetClass() + { + if (m_nativeClass == null) + { + m_nativeClass = new AndroidJavaClass(Native.kClassName); + } + return m_nativeClass; + } + + #endregion + #region Public methods + + public int GetCode() + { + return Call(Native.Method.kGetCode); + } + public string GetDescription() + { + return Call(Native.Method.kGetDescription); + } + public override string ToString() + { + return Call(Native.Method.kToString); + } + + #endregion + + internal class Native + { + internal const string kClassName = "com.voxelbusters.essentialkit.utilities.common.ErrorInfo"; + + internal class Method + { + internal const string kToString = "toString"; + internal const string kGetCode = "getCode"; + internal const string kGetDescription = "getDescription"; + } + + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeErrorInfo.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeErrorInfo.cs.meta new file mode 100644 index 00000000..6fe9bafd --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeErrorInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1e539da62bb21417e9d35885ea7a66e8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeErrorInfoExtensions.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeErrorInfoExtensions.cs new file mode 100644 index 00000000..88092706 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeErrorInfoExtensions.cs @@ -0,0 +1,14 @@ +#if UNITY_ANDROID +using System; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public static class NativeErrorInfoExtensions + { + public static Error Convert(this NativeErrorInfo nativeError, string domain = null) + { + return new Error(domain, nativeError.GetCode(), nativeError.GetDescription()); + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeErrorInfoExtensions.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeErrorInfoExtensions.cs.meta new file mode 100644 index 00000000..79b4ca32 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeErrorInfoExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 91d2713f2f415490881b49d41d2374bd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeException.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeException.cs new file mode 100644 index 00000000..229ffb87 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeException.cs @@ -0,0 +1,26 @@ +#if UNITY_ANDROID +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public class NativeException : NativeAndroidJavaObjectWrapper + { + public NativeException(AndroidJavaObject androidJavaObject) : base("java.lang.Exception", androidJavaObject) + { + } + + public string GetMessage() + { + return m_nativeObject.Call("getMessage"); + } + + public void PrintStackTrace() + { + m_nativeObject.Call("printStackTrace"); + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeException.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeException.cs.meta new file mode 100644 index 00000000..3aaac7aa --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 49493f240600d4811af386b86122d57b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeFloat.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeFloat.cs new file mode 100644 index 00000000..e0c45de8 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeFloat.cs @@ -0,0 +1,19 @@ +#if UNITY_ANDROID +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public class NativeFloat : NativeAndroidJavaObjectWrapper + { + public NativeFloat(AndroidJavaObject javaObject) : base("android.lang.Float", javaObject) + { + } + + public float GetFloatValue() + { + float value = m_nativeObject.Call("floatValue"); + return value; + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeFloat.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeFloat.cs.meta new file mode 100644 index 00000000..7001fe7e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeFloat.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e2f8dead3fff848ab9c31b0fbe8e9505 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeInteger.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeInteger.cs new file mode 100644 index 00000000..43a7c234 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeInteger.cs @@ -0,0 +1,19 @@ +#if UNITY_ANDROID +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public class NativeInteger : NativeAndroidJavaObjectWrapper + { + public NativeInteger(AndroidJavaObject javaObject) : base("android.lang.Integer", javaObject) + { + } + + public int GetIntValue() + { + int value = m_nativeObject.Call("intValue"); + return value; + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeInteger.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeInteger.cs.meta new file mode 100644 index 00000000..cf5eb66f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeInteger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e3f53da493eaf45c79617b8967119d3b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeJSONObject.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeJSONObject.cs new file mode 100644 index 00000000..99c98922 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeJSONObject.cs @@ -0,0 +1,20 @@ +#if UNITY_ANDROID +using System; +using UnityEngine; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public class NativeJSONObject : NativeAndroidJavaObjectWrapper + { + public NativeJSONObject(AndroidJavaObject androidJavaObject) : base("org.json.JSONObject", androidJavaObject) + { + } + + public override string ToString() + { + return m_nativeObject.Call("toString"); + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeJSONObject.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeJSONObject.cs.meta new file mode 100644 index 00000000..8cc93277 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeJSONObject.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: fc00b0292cce342b290bdd6496e360ca +timeCreated: 1547810936 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeList.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeList.cs new file mode 100644 index 00000000..7c2fe13c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeList.cs @@ -0,0 +1,37 @@ +#if UNITY_ANDROID +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public class NativeList : NativeAndroidJavaObjectWrapper + { + public NativeList(AndroidJavaObject androidJavaObject) : base("java.util.List", androidJavaObject) + { + } + + public int Size() + { + return m_nativeObject.Call("size"); + } + + public List Get() + { + int size = Size(); + List list = new List(); + for (int eachIndex = 0; eachIndex < size; eachIndex++) + { + AndroidJNI.PushLocalFrame(128); + AndroidJavaObject eachNativeObject = m_nativeObject.Call("get", eachIndex); + var instance = (T)Activator.CreateInstance(typeof(T), new object[] { eachNativeObject }); + list.Add(instance); + AndroidJNI.PopLocalFrame(IntPtr.Zero); + } + + return list; + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeList.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeList.cs.meta new file mode 100644 index 00000000..34b0653d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeList.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 98ed585e287844fabbbf2de65a052029 +timeCreated: 1581450433 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeObject.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeObject.cs new file mode 100644 index 00000000..b946a8e3 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeObject.cs @@ -0,0 +1,13 @@ +#if UNITY_ANDROID +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public class NativeObject : NativeAndroidJavaObjectWrapper + { + public NativeObject(AndroidJavaObject javaObject) : base("android.lang.Object", javaObject) + { + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeObject.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeObject.cs.meta new file mode 100644 index 00000000..58eced72 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: afd3edefd056c4b6d8d745b6a97dee1e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeParcel.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeParcel.cs new file mode 100644 index 00000000..25e9d6c0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeParcel.cs @@ -0,0 +1,13 @@ +#if UNITY_ANDROID +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public class NativeParcel : NativeAndroidJavaObjectWrapper + { + public NativeParcel(AndroidJavaObject javaObject) : base("android.os.Parcel", javaObject) + { + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeParcel.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeParcel.cs.meta new file mode 100644 index 00000000..3f3178e0 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeParcel.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0785fa9caa0d44034a62ff5fb58ad1a3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativePoint.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativePoint.cs new file mode 100644 index 00000000..b7e53d08 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativePoint.cs @@ -0,0 +1,134 @@ +#if UNITY_ANDROID +using UnityEngine; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public class NativePoint : NativeAndroidJavaObjectWrapper + { + #region Static properties + + private static AndroidJavaClass m_nativeClass; + + #endregion + #region Public properties + + public int X + { + get + { + return Get("x"); + } + + set + { + Set("x", value); + } + } + + + public int Y + { + get + { + return Get("y"); + } + + set + { + Set("y", value); + } + } + + + public const int CONTENTS_FILE_DESCRIPTOR = 1; + + public const int PARCELABLE_WRITE_RETURN_VALUE = 1; + + #endregion + + #region Constructor + + // Wrapper constructors + public NativePoint(AndroidJavaObject androidJavaObject) : base(Native.kClassName, androidJavaObject) + { + } + + public NativePoint(NativeAndroidJavaObjectWrapper wrapper) : base(wrapper) + { + } + + public NativePoint() : base(Native.kClassName) + { + } + +#if NATIVE_PLUGINS_DEBUG_ENABLED + ~NativePoint() + { + DebugLogger.Log("Disposing NativePoint"); + } +#endif + #endregion + #region Static methods + private static AndroidJavaClass GetClass() + { + if (m_nativeClass == null) + { + m_nativeClass = new AndroidJavaClass(Native.kClassName); + } + return m_nativeClass; + } + + #endregion + #region Public methods + + public int DescribeContents() + { + return Call(Native.Method.kDescribeContents); + } + public bool Equals(NativeObject arg0) + { + return Call(Native.Method.kEquals, arg0.NativeObject); + } + public int HashCode() + { + return Call(Native.Method.kHashCode); + } + public void ReadFromParcel(NativeParcel arg0) + { + Call(Native.Method.kReadFromParcel, arg0.NativeObject); + } + public void Set(int arg0, int arg1) + { + Call(Native.Method.kSet, arg0, arg1); + } + public new string ToString() + { + return Call(Native.Method.kToString); + } + public void WriteToParcel(NativeParcel arg0, int arg1) + { + Call(Native.Method.kWriteToParcel, arg0.NativeObject, arg1); + } + + #endregion + + internal class Native + { + internal const string kClassName = "android.graphics.Point"; + + internal class Method + { + internal const string kToString = "toString"; + internal const string kHashCode = "hashCode"; + internal const string kWriteToParcel = "writeToParcel"; + internal const string kReadFromParcel = "readFromParcel"; + internal const string kEquals = "equals"; + internal const string kDescribeContents = "describeContents"; + internal const string kSet = "set"; + } + + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativePoint.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativePoint.cs.meta new file mode 100644 index 00000000..ac833463 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativePoint.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: db32d3ddeecf34f5ea9b94f4b917a45c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativePointF.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativePointF.cs new file mode 100644 index 00000000..d7bcfba5 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativePointF.cs @@ -0,0 +1,134 @@ +#if UNITY_ANDROID +using UnityEngine; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public class NativePointF : NativeAndroidJavaObjectWrapper + { + #region Static properties + + private static AndroidJavaClass m_nativeClass; + + #endregion + #region Public properties + + public float X + { + get + { + return Get("x"); + } + + set + { + Set("x", value); + } + } + + + public float Y + { + get + { + return Get("y"); + } + + set + { + Set("y", value); + } + } + + + public const int CONTENTS_FILE_DESCRIPTOR = 1; + + public const int PARCELABLE_WRITE_RETURN_VALUE = 1; + + #endregion + + #region Constructor + + // Wrapper constructors + public NativePointF(AndroidJavaObject androidJavaObject) : base(Native.kClassName, androidJavaObject) + { + } + + public NativePointF(NativeAndroidJavaObjectWrapper wrapper) : base(wrapper) + { + } + + public NativePointF() : base(Native.kClassName) + { + } + +#if NATIVE_PLUGINS_DEBUG_ENABLED + ~NativePointF() + { + DebugLogger.Log("Disposing NativePointF"); + } +#endif + #endregion + #region Static methods + private static AndroidJavaClass GetClass() + { + if (m_nativeClass == null) + { + m_nativeClass = new AndroidJavaClass(Native.kClassName); + } + return m_nativeClass; + } + public static float Length(float arg0, float arg1) + { + return GetClass().CallStatic(Native.Method.kLength, arg0, arg1); + } + + #endregion + #region Public methods + + public int DescribeContents() + { + return Call(Native.Method.kDescribeContents); + } + public bool Equals(NativeObject arg0) + { + return Call(Native.Method.kEquals, arg0.NativeObject); + } + public int HashCode() + { + return Call(Native.Method.kHashCode); + } + public void ReadFromParcel(NativeParcel arg0) + { + Call(Native.Method.kReadFromParcel, arg0.NativeObject); + } + public new string ToString() + { + return Call(Native.Method.kToString); + } + public void WriteToParcel(NativeParcel arg0, int arg1) + { + Call(Native.Method.kWriteToParcel, arg0.NativeObject, arg1); + } + + #endregion + + internal class Native + { + internal const string kClassName = "android.graphics.PointF"; + + internal class Method + { + internal const string kToString = "toString"; + internal const string kHashCode = "hashCode"; + internal const string kWriteToParcel = "writeToParcel"; + internal const string kReadFromParcel = "readFromParcel"; + internal const string kLength = "length"; + internal const string kEquals = "equals"; + internal const string kDescribeContents = "describeContents"; + } + + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativePointF.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativePointF.cs.meta new file mode 100644 index 00000000..fd4549af --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativePointF.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 13fbbbdbad7ee4ed1985df4da7241a58 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeProxy.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeProxy.cs new file mode 100644 index 00000000..86c5288e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeProxy.cs @@ -0,0 +1,31 @@ +#if UNITY_ANDROID +using System; +using UnityEngine; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public abstract class NativeProxyBase : AndroidJavaProxy + { + public NativeProxyBase(string interfaceName) : base(interfaceName) + { + } + + protected void DispatchOnMainThread(Callback action) + { + // Dispatch on Unity Thread + CallbackDispatcher.InvokeOnMainThread(action); + } + } + + public class NativeProxy : NativeProxyBase + { + protected T m_callback; + + public NativeProxy(T m_callback, string interfaceName) : base(interfaceName) + { + this.m_callback = m_callback; + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeProxy.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeProxy.cs.meta new file mode 100644 index 00000000..af1623e3 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeProxy.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d05d6febe7ca94928964d47f5efe9c13 +timeCreated: 1547810936 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeRect.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeRect.cs new file mode 100644 index 00000000..f24c9d25 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeRect.cs @@ -0,0 +1,299 @@ +#if UNITY_ANDROID +using UnityEngine; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public class NativeRect : NativeAndroidJavaObjectWrapper + { + #region Static properties + + private static AndroidJavaClass m_nativeClass; + + #endregion + #region Public properties + + public int Bottom + { + get + { + return Get("bottom"); + } + + set + { + Set("bottom", value); + } + } + + + public int Left + { + get + { + return Get("left"); + } + + set + { + Set("left", value); + } + } + + + public int Right + { + get + { + return Get("right"); + } + + set + { + Set("right", value); + } + } + + + public int Top + { + get + { + return Get("top"); + } + + set + { + Set("top", value); + } + } + + + public const int CONTENTS_FILE_DESCRIPTOR = 1; + + public const int PARCELABLE_WRITE_RETURN_VALUE = 1; + + #endregion + + #region Constructor + + // Wrapper constructors + public NativeRect(AndroidJavaObject androidJavaObject) : base(Native.kClassName, androidJavaObject) + { + } + + public NativeRect(NativeAndroidJavaObjectWrapper wrapper) : base(wrapper) + { + } + + public NativeRect() : base(Native.kClassName) + { + } + +#if NATIVE_PLUGINS_DEBUG_ENABLED + ~NativeRect() + { + DebugLogger.Log("Disposing NativeRect"); + } +#endif + #endregion + #region Static methods + private static AndroidJavaClass GetClass() + { + if (m_nativeClass == null) + { + m_nativeClass = new AndroidJavaClass(Native.kClassName); + } + return m_nativeClass; + } + public static bool Intersects(NativeRect arg0, NativeRect arg1) + { + return GetClass().CallStatic(Native.Method.kIntersects, arg0.NativeObject, arg1.NativeObject); + } + public static NativeRect UnflattenFromString(string arg0) + { + AndroidJavaObject nativeObj = GetClass().CallStatic(Native.Method.kUnflattenFromString, arg0); + if(nativeObj != null) + { + NativeRect data = new NativeRect(nativeObj); + return data; + } + else + { + return default(NativeRect); + } + } + + #endregion + #region Public methods + + public int CenterX() + { + return Call(Native.Method.kCenterX); + } + public int CenterY() + { + return Call(Native.Method.kCenterY); + } + public bool Contains(int arg0, int arg1) + { + return Call(Native.Method.kContains, arg0, arg1); + } + public bool Contains(int arg0, int arg1, int arg2, int arg3) + { + return Call(Native.Method.kContains, arg0, arg1, arg2, arg3); + } + public bool Contains(NativeRect arg0) + { + return Call(Native.Method.kContains, arg0.NativeObject); + } + public int DescribeContents() + { + return Call(Native.Method.kDescribeContents); + } + public bool Equals(NativeObject arg0) + { + return Call(Native.Method.kEquals, arg0.NativeObject); + } + public float ExactCenterX() + { + return Call(Native.Method.kExactCenterX); + } + public float ExactCenterY() + { + return Call(Native.Method.kExactCenterY); + } + public string FlattenToString() + { + return Call(Native.Method.kFlattenToString); + } + public int HashCode() + { + return Call(Native.Method.kHashCode); + } + public int Height() + { + return Call(Native.Method.kHeight); + } + public void Inset(int arg0, int arg1) + { + Call(Native.Method.kInset, arg0, arg1); + } + public bool Intersect(NativeRect arg0) + { + return Call(Native.Method.kIntersect, arg0.NativeObject); + } + public bool Intersect(int arg0, int arg1, int arg2, int arg3) + { + return Call(Native.Method.kIntersect, arg0, arg1, arg2, arg3); + } + public bool Intersects(int arg0, int arg1, int arg2, int arg3) + { + return Call(Native.Method.kIntersects, arg0, arg1, arg2, arg3); + } + public bool IsEmpty() + { + return Call(Native.Method.kIsEmpty); + } + public void Offset(int arg0, int arg1) + { + Call(Native.Method.kOffset, arg0, arg1); + } + public void OffsetTo(int arg0, int arg1) + { + Call(Native.Method.kOffsetTo, arg0, arg1); + } + public void ReadFromParcel(NativeParcel arg0) + { + Call(Native.Method.kReadFromParcel, arg0.NativeObject); + } + public void Set(int arg0, int arg1, int arg2, int arg3) + { + Call(Native.Method.kSet, arg0, arg1, arg2, arg3); + } + public void Set(NativeRect arg0) + { + Call(Native.Method.kSet, arg0.NativeObject); + } + public void SetEmpty() + { + Call(Native.Method.kSetEmpty); + } + public bool SetIntersect(NativeRect arg0, NativeRect arg1) + { + return Call(Native.Method.kSetIntersect, arg0.NativeObject, arg1.NativeObject); + } + public void Sort() + { + Call(Native.Method.kSort); + } + public string ToShortString() + { + return Call(Native.Method.kToShortString); + } + public new string ToString() + { + return Call(Native.Method.kToString); + } + public void Union(int arg0, int arg1, int arg2, int arg3) + { + Call(Native.Method.kUnion, arg0, arg1, arg2, arg3); + } + public void Union(NativeRect arg0) + { + Call(Native.Method.kUnion, arg0.NativeObject); + } + public void Union(int arg0, int arg1) + { + Call(Native.Method.kUnion, arg0, arg1); + } + public int Width() + { + return Call(Native.Method.kWidth); + } + public void WriteToParcel(NativeParcel arg0, int arg1) + { + Call(Native.Method.kWriteToParcel, arg0.NativeObject, arg1); + } + + #endregion + + internal class Native + { + internal const string kClassName = "android.graphics.Rect"; + + internal class Method + { + internal const string kToString = "toString"; + internal const string kContains = "contains"; + internal const string kHashCode = "hashCode"; + internal const string kSetEmpty = "setEmpty"; + internal const string kOffsetTo = "offsetTo"; + internal const string kExactCenterX = "exactCenterX"; + internal const string kExactCenterY = "exactCenterY"; + internal const string kSetIntersect = "setIntersect"; + internal const string kWriteToParcel = "writeToParcel"; + internal const string kToShortString = "toShortString"; + internal const string kUnflattenFromString = "unflattenFromString"; + internal const string kIsEmpty = "isEmpty"; + internal const string kCenterX = "centerX"; + internal const string kCenterY = "centerY"; + internal const string kIntersects = "intersects"; + internal const string kIntersect = "intersect"; + internal const string kReadFromParcel = "readFromParcel"; + internal const string kFlattenToString = "flattenToString"; + internal const string kHeight = "height"; + internal const string kOffset = "offset"; + internal const string kEquals = "equals"; + internal const string kDescribeContents = "describeContents"; + internal const string kWidth = "width"; + internal const string kUnion = "union"; + internal const string kInset = "inset"; + internal const string kSort = "sort"; + internal const string kSet = "set"; + } + + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeRect.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeRect.cs.meta new file mode 100644 index 00000000..390c3821 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeRect.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a6ff68bdc3ecd4704a99099727d6678a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeRectF.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeRectF.cs new file mode 100644 index 00000000..c6e02272 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeRectF.cs @@ -0,0 +1,260 @@ +#if UNITY_ANDROID +using UnityEngine; +using VoxelBusters.CoreLibrary; +using VoxelBusters.CoreLibrary.NativePlugins.Android; + +namespace VoxelBusters.EasyMLKit.NativePlugins.Android +{ + public class NativeRectF : NativeAndroidJavaObjectWrapper + { + #region Static properties + + private static AndroidJavaClass m_nativeClass; + + #endregion + #region Public properties + + public float Bottom + { + get + { + return Get("bottom"); + } + + set + { + Set("bottom", value); + } + } + + + public float Left + { + get + { + return Get("left"); + } + + set + { + Set("left", value); + } + } + + + public float Right + { + get + { + return Get("right"); + } + + set + { + Set("right", value); + } + } + + + public float Top + { + get + { + return Get("top"); + } + + set + { + Set("top", value); + } + } + + + public const int CONTENTS_FILE_DESCRIPTOR = 1; + + public const int PARCELABLE_WRITE_RETURN_VALUE = 1; + + #endregion + + #region Constructor + + // Wrapper constructors + public NativeRectF(AndroidJavaObject androidJavaObject) : base(Native.kClassName, androidJavaObject) + { + } + + public NativeRectF(NativeAndroidJavaObjectWrapper wrapper) : base(wrapper) + { + } + + public NativeRectF() : base(Native.kClassName) + { + } + +#if NATIVE_PLUGINS_DEBUG + ~NativeRectF() + { + DebugLogger.Log("Disposing NativeRectF"); + } +#endif + #endregion + #region Static methods + private static AndroidJavaClass GetClass() + { + if (m_nativeClass == null) + { + m_nativeClass = new AndroidJavaClass(Native.kClassName); + } + return m_nativeClass; + } + public static bool Intersects(NativeRectF arg0, NativeRectF arg1) + { + return GetClass().CallStatic(Native.Method.kIntersects, arg0.NativeObject, arg1.NativeObject); + } + + #endregion + #region Public methods + + public bool Contains(NativeRectF arg0) + { + return Call(Native.Method.kContains, arg0.NativeObject); + } + public bool Contains(float arg0, float arg1) + { + return Call(Native.Method.kContains, arg0, arg1); + } + public bool Contains(float arg0, float arg1, float arg2, float arg3) + { + return Call(Native.Method.kContains, arg0, arg1, arg2, arg3); + } + public int DescribeContents() + { + return Call(Native.Method.kDescribeContents); + } + public bool Equals(NativeObject arg0) + { + return Call(Native.Method.kEquals, arg0.NativeObject); + } + public int HashCode() + { + return Call(Native.Method.kHashCode); + } + public void Inset(float arg0, float arg1) + { + Call(Native.Method.kInset, arg0, arg1); + } + public bool Intersect(float arg0, float arg1, float arg2, float arg3) + { + return Call(Native.Method.kIntersect, arg0, arg1, arg2, arg3); + } + public bool Intersect(NativeRectF arg0) + { + return Call(Native.Method.kIntersect, arg0.NativeObject); + } + public bool Intersects(float arg0, float arg1, float arg2, float arg3) + { + return Call(Native.Method.kIntersects, arg0, arg1, arg2, arg3); + } + public void Offset(float arg0, float arg1) + { + Call(Native.Method.kOffset, arg0, arg1); + } + public void OffsetTo(float arg0, float arg1) + { + Call(Native.Method.kOffsetTo, arg0, arg1); + } + public void ReadFromParcel(NativeParcel arg0) + { + Call(Native.Method.kReadFromParcel, arg0.NativeObject); + } + public void Round(NativeRect arg0) + { + Call(Native.Method.kRound, arg0.NativeObject); + } + public void RoundOut(NativeRect arg0) + { + Call(Native.Method.kRoundOut, arg0.NativeObject); + } + public void Set(NativeRectF arg0) + { + Call(Native.Method.kSet, arg0.NativeObject); + } + public void Set(NativeRect arg0) + { + Call(Native.Method.kSet, arg0.NativeObject); + } + public void Set(float arg0, float arg1, float arg2, float arg3) + { + Call(Native.Method.kSet, arg0, arg1, arg2, arg3); + } + public void SetEmpty() + { + Call(Native.Method.kSetEmpty); + } + public bool SetIntersect(NativeRectF arg0, NativeRectF arg1) + { + return Call(Native.Method.kSetIntersect, arg0.NativeObject, arg1.NativeObject); + } + public void Sort() + { + Call(Native.Method.kSort); + } + public string ToShortString() + { + return Call(Native.Method.kToShortString); + } + public new string ToString() + { + return Call(Native.Method.kToString); + } + public void Union(float arg0, float arg1, float arg2, float arg3) + { + Call(Native.Method.kUnion, arg0, arg1, arg2, arg3); + } + public void Union(float arg0, float arg1) + { + Call(Native.Method.kUnion, arg0, arg1); + } + public void Union(NativeRectF arg0) + { + Call(Native.Method.kUnion, arg0.NativeObject); + } + public void WriteToParcel(NativeParcel arg0, int arg1) + { + Call(Native.Method.kWriteToParcel, arg0.NativeObject, arg1); + } + + #endregion + + internal class Native + { + internal const string kClassName = "android.graphics.RectF"; + + internal class Method + { + internal const string kToString = "toString"; + internal const string kContains = "contains"; + internal const string kHashCode = "hashCode"; + internal const string kRoundOut = "roundOut"; + internal const string kSetEmpty = "setEmpty"; + internal const string kOffsetTo = "offsetTo"; + internal const string kSetIntersect = "setIntersect"; + internal const string kWriteToParcel = "writeToParcel"; + internal const string kToShortString = "toShortString"; + internal const string kIntersects = "intersects"; + internal const string kIntersect = "intersect"; + internal const string kReadFromParcel = "readFromParcel"; + internal const string kOffset = "offset"; + internal const string kEquals = "equals"; + internal const string kDescribeContents = "describeContents"; + internal const string kRound = "round"; + internal const string kUnion = "union"; + internal const string kInset = "inset"; + internal const string kSort = "sort"; + internal const string kSet = "set"; + } + + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeRectF.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeRectF.cs.meta new file mode 100644 index 00000000..3804e726 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeRectF.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f34ff82721d3e4f89be31b14ff23c1d9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeUnityPluginUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeUnityPluginUtility.cs new file mode 100644 index 00000000..d3c6a74c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeUnityPluginUtility.cs @@ -0,0 +1,72 @@ +#if UNITY_ANDROID +using UnityEngine; +using System.Collections.Generic; +using System; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public class NativeUnityPluginUtility + { + private static AndroidJavaObject s_context = null; + private static NativeContext s_nativeContext = null; + private static NativeActivity s_nativeActivity = null; + private static NativeViewGroup s_decorRootView = null; + + public static NativeActivity GetActivity() + { + if(s_nativeActivity == null) + { + s_nativeActivity = new NativeActivity(GetUnityActivity()); + } + return s_nativeActivity; + } + + public static NativeContext GetContext() + { + if (s_nativeContext == null) + { + s_nativeContext = new NativeContext(GetUnityActivity()); + } + return s_nativeContext; + } + + public static To[] Map(List fromList) + { + List list = new List(); + foreach (From each in fromList) + { + list.Add((To)Activator.CreateInstance(typeof(To), new object[] { each })); + } + + return list.ToArray(); + } + + public static NativeViewGroup GetDecorRootView() + { + if(s_decorRootView == null) + { + AndroidJavaObject activity = GetUnityActivity(); + AndroidJavaObject window = activity.Call("getWindow"); + AndroidJavaObject decorView = window.Call("getDecorView"); + AndroidJavaObject rootView = decorView.Call("getRootView"); + s_decorRootView = new NativeViewGroup(rootView); + } + + return s_decorRootView; + } + + private static AndroidJavaObject GetUnityActivity() + { + if (s_context == null) + { + AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); + s_context = jc.GetStatic("currentActivity"); + } + return s_context; + } + + //Get root view group + } +} +#endif + \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeUnityPluginUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeUnityPluginUtility.cs.meta new file mode 100644 index 00000000..34894f7d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeUnityPluginUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 20cb40962cc9d49309f241198d4206a9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeViewGroup.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeViewGroup.cs new file mode 100644 index 00000000..52f3ca0c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeViewGroup.cs @@ -0,0 +1,13 @@ +#if UNITY_ANDROID +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public class NativeViewGroup : NativeAndroidJavaObjectWrapper + { + public NativeViewGroup(AndroidJavaObject javaObject) : base("android.view.ViewGroup", javaObject) + { + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeViewGroup.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeViewGroup.cs.meta new file mode 100644 index 00000000..505dc080 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/NativeViewGroup.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 25053421ab095450496f748113f49af3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/Utility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/Utility.cs new file mode 100644 index 00000000..1ffa27f4 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/Utility.cs @@ -0,0 +1,50 @@ +#if UNITY_ANDROID +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins.Android +{ + public static class Utility + { + public static sbyte[] ToSBytes(this byte[] from) + { + if (from == null) + return null; + + return (sbyte[])(Array)from; + } + + public static byte[] ToBytes(this sbyte[] from) + { + if (from == null) + return null; + + return (byte[])(Array)from; + } + + public static Color GetColor(this AndroidJavaObject nativeObject) + { + float red = nativeObject.Call("getRed") / 255; + float green = nativeObject.Call("getRed") / 255; + float blue = nativeObject.Call("getRed") / 255; + float alpha = nativeObject.Call("alpha") / 255.0f; + + return new Color(red, green, blue, alpha); + } + + public static void TakeScreenshot(Action callback) + { + SurrogateCoroutine.WaitForEndOfFrameAndInvoke(() => + { + Texture2D texture = ScreenCapture.CaptureScreenshotAsTexture(); + string mimeType; + byte[] data = texture.Encode(TextureEncodingFormat.JPG, out mimeType); + callback(data, mimeType); + }); + } + } +} +#endif \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/Utility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/Utility.cs.meta new file mode 100644 index 00000000..a9de1549 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/Common/Utility.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a199715aa7deb4eadb5522575b05e8ff +timeCreated: 1547729646 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/VoxelBusters.CoreLibrary.NativePlugins.AndroidModule.asmdef b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/VoxelBusters.CoreLibrary.NativePlugins.AndroidModule.asmdef new file mode 100644 index 00000000..7027d274 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/VoxelBusters.CoreLibrary.NativePlugins.AndroidModule.asmdef @@ -0,0 +1,18 @@ +{ + "name": "VoxelBusters.CoreLibrary.NativePlugins.AndroidModule", + "references": [ + "VoxelBusters.CoreLibrary", + "VoxelBusters.CoreLibrary.NativePlugins" + ], + "optionalUnityReferences": [], + "includePlatforms": [ + "Android", + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [] +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/VoxelBusters.CoreLibrary.NativePlugins.AndroidModule.asmdef.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/VoxelBusters.CoreLibrary.NativePlugins.AndroidModule.asmdef.meta new file mode 100644 index 00000000..71ad17bc --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Android/VoxelBusters.CoreLibrary.NativePlugins.AndroidModule.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 347661ae03c1d4bb2a47971c48c56a6c +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/AssemblyInfo.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/AssemblyInfo.cs new file mode 100644 index 00000000..32027a9c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Runtime.CompilerServices; + +// make it visible for internal modules +[assembly: InternalsVisibleTo("VoxelBusters.CoreLibrary.NativePlugins.iOSModule")] +[assembly: InternalsVisibleTo("VoxelBusters.CoreLibrary.Editor.NativePlugins")] + +[assembly: InternalsVisibleTo("VoxelBusters.EssentialKit")] +[assembly: InternalsVisibleTo("VoxelBusters.EssentialKit.Editor")] +[assembly: InternalsVisibleTo("VoxelBusters.EssentialKit.iOSModule")] +[assembly: InternalsVisibleTo("VoxelBusters.EssentialKit.AndroidModule")] +[assembly: InternalsVisibleTo("VoxelBusters.EssentialKit.SimulatorModule")] + +[assembly: InternalsVisibleTo("VoxelBusters.ScreenRecorderKit")] +[assembly: InternalsVisibleTo("VoxelBusters.ScreenRecorderKit.Editor")] +[assembly: InternalsVisibleTo("VoxelBusters.ScreenRecorderKit.iOSModule")] +[assembly: InternalsVisibleTo("VoxelBusters.ScreenRecorderKit.AndroidModule")] + + +[assembly: InternalsVisibleTo("VoxelBusters.EasyMLKit")] +[assembly: InternalsVisibleTo("VoxelBusters.EasyMLKit.Editor")] \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/AssemblyInfo.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/AssemblyInfo.cs.meta new file mode 100644 index 00000000..c3de40b2 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/AssemblyInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0cb462a3026a542da8abdc2eaa87b069 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core.meta new file mode 100644 index 00000000..fff3883d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0c7936da04c2c44be8c241463590eeec +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base.meta new file mode 100644 index 00000000..2201394c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2362ac1fb376448ec8ba7dd5f704b848 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureActivator.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureActivator.cs new file mode 100644 index 00000000..7e26b14a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureActivator.cs @@ -0,0 +1,110 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + public static class NativeFeatureActivator + { + #region Static properties + + public static INativeFeatureInterfaceProvider InterfaceProvider { get; set; } + + #endregion + + #region Static methods + + public static TFeatureInterface CreateInterface(NativeFeatureRuntimeConfiguration runtimeConfiguration, bool isAvailable, params object[] args) where TFeatureInterface : INativeFeatureInterface + { + Assert.IsArgNotNull(runtimeConfiguration, "packageConfiguration"); + + object interfaceObject = null; + if (isAvailable) + { + var currentPlatform = Application.platform; + + // try creating interface object using custom interface provider + if (InterfaceProvider != null) + { + interfaceObject = InterfaceProvider.CreateInterface(typeof(TFeatureInterface), currentPlatform); + } + + // incase if no implementation is found, system retracts to default activation methods + if (interfaceObject == null) + { + var packageType = runtimeConfiguration.GetPackageForPlatform(currentPlatform); + if (packageType != null) + { + interfaceObject = CreateInstance(packageType.Assembly, packageType.NativeInterfaceType, args); + } + } + } + + // fallback case, create default type object incase if specified type is not found + if (interfaceObject == null) + { + var packageType = runtimeConfiguration.FallbackPackage; + interfaceObject = CreateInstance(packageType.Assembly, packageType.NativeInterfaceType, args); + } + + DebugLogger.Log(CoreLibraryDomain.NativePlugins, $"Created native interface of type: {interfaceObject}"); + return (TFeatureInterface)interfaceObject; + } + + public static TFeatureInterface CreateNativeInterfaceComponent(this GameObject gameObject, NativeFeatureRuntimeConfiguration runtimeConfiguration, bool isEnabled) where TFeatureInterface : INativeFeatureInterface + { + object interfaceObject = null; + if (isEnabled) + { + var targetPackage = runtimeConfiguration.GetPackageForPlatform(Application.platform); + var targetType = ReflectionUtility.GetType(assemblyName: targetPackage.Assembly, typeName: targetPackage.NativeInterfaceType); + interfaceObject = gameObject.AddComponent(targetType); + } + + // fallback case, create default type object incase if specified type is not found + if (interfaceObject == null) + { + var fallbackPackage = runtimeConfiguration.FallbackPackage; + var fallbackType = ReflectionUtility.GetType(assemblyName: fallbackPackage.Assembly, typeName: fallbackPackage.NativeInterfaceType); + interfaceObject = gameObject.AddComponent(fallbackType); + } + + return (TFeatureInterface)interfaceObject; + } + + #endregion + + #region Private static methods + + private static object CreateInstance(string assemblyName, string typeName, object[] arguments) + { + Type targetType = null; + try + { + targetType = ReflectionUtility.GetType(assemblyName, typeName); + if (targetType == null) + { + targetType = ReflectionUtility.GetTypeFromAssemblyCSharp(typeName, includeFirstPass: true); + } + + if (arguments == null) + { + return ReflectionUtility.CreateInstance(targetType); + } + else + { + return ReflectionUtility.CreateInstance(targetType, arguments); + } + } + catch (Exception e) + { + DebugLogger.LogError(CoreLibraryDomain.NativePlugins, $"Failed when creating instance. Assembly: {assemblyName} Type: {typeName} TargetType: {targetType} Error: {e.InnerException?.Message ?? e.Message}"); + return null; + } + } + + #endregion + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureActivator.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureActivator.cs.meta new file mode 100644 index 00000000..dd6886b9 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureActivator.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b3904366438314c5fb0a7422a5622022 +timeCreated: 1582637352 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureBehaviour.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureBehaviour.cs new file mode 100644 index 00000000..c603047a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureBehaviour.cs @@ -0,0 +1,86 @@ +using System; +using System.Reflection; +using System.Collections.Generic; +using UnityEngine; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + public abstract class NativeFeatureBehaviour : MonoBehaviour + { + #region Fields + + private bool m_isInitialised = false; + + #endregion + + #region Abstract methods + + public abstract bool IsAvailable(); + + protected abstract string GetFeatureName(); + + #endregion + + #region Static methods + + public static T CreateInstance(string name = "GameObject") where T : NativeFeatureBehaviour + { + return CreateInstanceInternal(name, null); + } + + protected static T CreateInstanceInternal(string name, params object[] args) where T : NativeFeatureBehaviour + { + T instance = new GameObject(name).AddComponent(); + instance.AwakeInternal(args); + + return instance; + } + + #endregion + + #region Unity methods + + private void Awake() + { } + + private void Start() + { + // check feature availablity + if (!IsAvailable()) + { + Diagnostics.LogNotSupported(featureName: GetFeatureName()); + return; + } + + StartInternal(); + } + + protected void OnDestroy() + { + DebugLogger.Log(CoreLibraryDomain.NativePlugins, $"Destroying native feature behaviour: {name}."); + DestroyInternal(); + } + + #endregion + + #region Lifecycle methods + + protected virtual void AwakeInternal(object[] args) + { + // check component status + Assert.IsFalse(m_isInitialised, "Initialisation error"); + + // update state + m_isInitialised = true; + } + + protected virtual void StartInternal() + { } + + protected virtual void DestroyInternal() + { } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureBehaviour.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureBehaviour.cs.meta new file mode 100644 index 00000000..b68492e5 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 767f56cafb4a049cf86968c934f05dde +timeCreated: 1576506889 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureInterfaceBase.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureInterfaceBase.cs new file mode 100644 index 00000000..a99d3884 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureInterfaceBase.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + public abstract class NativeFeatureInterfaceBase : NativeObjectBase, INativeFeatureInterface + { + #region Constructors + + protected NativeFeatureInterfaceBase(bool isAvailable, NativeObjectRef nativeObjectRef = null) + : base(nativeObjectRef) + { + // set properties + IsAvailable = isAvailable; + } + + ~NativeFeatureInterfaceBase() + { + Dispose(false); + } + + #endregion + + #region INativeFeatureInterface implementation + + public bool IsAvailable + { + get; + private set; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureInterfaceBase.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureInterfaceBase.cs.meta new file mode 100644 index 00000000..374dad2f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureInterfaceBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4668d85eaef144adaa92aee7bc630781 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureRuntimeConfiguration.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureRuntimeConfiguration.cs new file mode 100644 index 00000000..d4332659 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureRuntimeConfiguration.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + public class NativeFeatureRuntimeConfiguration + { + #region Properties + + public NativeFeatureRuntimePackage[] Packages { get; private set; } + + public NativeFeatureRuntimePackage SimulatorPackage { get; private set; } + + public NativeFeatureRuntimePackage FallbackPackage { get; private set; } + + #endregion + + #region Constructors + + public NativeFeatureRuntimeConfiguration(NativeFeatureRuntimePackage[] packages, NativeFeatureRuntimePackage simulatorPackage = null, + NativeFeatureRuntimePackage fallbackPackage = null) + { + // Set properties + Packages = packages; + SimulatorPackage = simulatorPackage; + FallbackPackage = fallbackPackage; + } + + #endregion + + #region Public methods + + public NativeFeatureRuntimePackage GetPackageForPlatform(RuntimePlatform platform) + { + switch (platform) + { + case RuntimePlatform.OSXEditor: + case RuntimePlatform.WindowsEditor: + case RuntimePlatform.LinuxEditor: + return SimulatorPackage; + + default: + return Array.Find(Packages, (item) => item.SupportsPlatform(platform)); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureRuntimeConfiguration.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureRuntimeConfiguration.cs.meta new file mode 100644 index 00000000..1d762377 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureRuntimeConfiguration.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0f7b35262a6654f8793a5bc9ddee1a22 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureRuntimePackage.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureRuntimePackage.cs new file mode 100644 index 00000000..baafad29 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureRuntimePackage.cs @@ -0,0 +1,153 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + [System.Serializable] + public class NativeFeatureRuntimePackage + { + #region Fields + + private readonly RuntimePlatform[] m_platforms; + + private readonly string m_custom; + + #endregion + + #region Properties + + public string Assembly { get; private set; } + + public string Namespace { get; private set; } + + public string NativeInterfaceType { get; private set; } + + public string[] BindingTypes { get; private set; } + + #endregion + + #region Constructors + + private NativeFeatureRuntimePackage(string assembly, string ns, + string nativeInterfaceType, string[] bindingTypes = null, + string custom = null, params RuntimePlatform[] platforms) + { + // Set properties + m_platforms = platforms; + m_custom = custom; + Assembly = assembly; + Namespace = ns; + NativeInterfaceType = GetTypeFullName(ns, nativeInterfaceType); + BindingTypes = (bindingTypes != null) + ? System.Array.ConvertAll(bindingTypes, (type) => GetTypeFullName(ns, type)) + : new string[0]; + } + + #endregion + + #region Static methods + + public static NativeFeatureRuntimePackage Generic(string assembly, string ns, + string nativeInterfaceType, string[] bindingTypes = null) + { + return new NativeFeatureRuntimePackage( + assembly: assembly, + ns: ns, + nativeInterfaceType: nativeInterfaceType, + bindingTypes: bindingTypes); + } + + public static NativeFeatureRuntimePackage Android(string assembly, string ns, + string nativeInterfaceType, string[] bindingTypes = null) + { + return new NativeFeatureRuntimePackage( + assembly: assembly, + ns: ns, + nativeInterfaceType: nativeInterfaceType, + bindingTypes: bindingTypes, + platforms: RuntimePlatform.Android); + } + + public static NativeFeatureRuntimePackage IPhonePlayer(string assembly, string ns, + string nativeInterfaceType, string[] bindingTypes = null) + { + return new NativeFeatureRuntimePackage( + assembly: assembly, + ns: ns, + nativeInterfaceType: nativeInterfaceType, + bindingTypes: bindingTypes, + platforms: RuntimePlatform.IPhonePlayer); + } + + public static NativeFeatureRuntimePackage TvOS(string assembly, string ns, + string nativeInterfaceType, string[] bindingTypes = null) + { + return new NativeFeatureRuntimePackage( + assembly: assembly, + ns: ns, + nativeInterfaceType: nativeInterfaceType, + bindingTypes: bindingTypes, + platforms: RuntimePlatform.tvOS); + } + + public static NativeFeatureRuntimePackage iOS(string assembly, string ns, + string nativeInterfaceType, string[] bindingTypes = null) + { + return new NativeFeatureRuntimePackage( + assembly: assembly, + ns: ns, + nativeInterfaceType: nativeInterfaceType, + bindingTypes: bindingTypes, + platforms: new RuntimePlatform[] { RuntimePlatform.IPhonePlayer, RuntimePlatform.tvOS }); + } + + public static NativeFeatureRuntimePackage Custom(string custom, string assembly, + string ns, string nativeInterfaceType, + string[] bindingTypes = null) + { + return new NativeFeatureRuntimePackage( + assembly: assembly, + ns: ns, + nativeInterfaceType: nativeInterfaceType, + bindingTypes: bindingTypes, + custom: custom); + } + + private static string GetTypeFullName(string ns, string type) => $"{ns}.{type}"; + + #endregion + + #region Public methods + + public System.Type[] GetBindingTypeReferences() + { + var assembly = ReflectionUtility.FindAssemblyWithName(Assembly); + return System.Array.ConvertAll(BindingTypes, (item) => + { + System.Type type = assembly.GetType(item); + if(type == null) + { + DebugLogger.LogError($"Expected type missing for {item}. Contact developer."); + } + return type; + }); + } + + public bool IsMatch(RuntimePlatform platform, string custom) + { + if ((custom != null) && string.Equals(m_custom, custom)) + { + return true; + } + return SupportsPlatform(platform); + } + + public bool SupportsPlatform(RuntimePlatform platform) + { + return (m_platforms == null) || System.Array.Exists(m_platforms, (value) => (value == platform)); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureRuntimePackage.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureRuntimePackage.cs.meta new file mode 100644 index 00000000..5e7cb1af --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureRuntimePackage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5da41611b7e7b47fdbf18a8ec6cb3c0c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureUsagePermissionDefinition.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureUsagePermissionDefinition.cs new file mode 100644 index 00000000..743846de --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureUsagePermissionDefinition.cs @@ -0,0 +1,78 @@ +using System.Collections; +using System.Collections.Generic; +using System; +using UnityEngine; +using UnityEngine.Serialization; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + [Serializable] + public class NativeFeatureUsagePermissionDefinition + { + #region Fields + + [SerializeField] + private string m_description; + + [SerializeField] + private RuntimePlatformConstantSet m_descriptionOverrides; + + #endregion + + #region Constructors + + public NativeFeatureUsagePermissionDefinition(string description = null, RuntimePlatformConstantSet descriptionOverrides = null) + { + // set properties + m_description = description; + m_descriptionOverrides = descriptionOverrides ?? new RuntimePlatformConstantSet(); + } + + #endregion + + #region Public methods + + public string GetDescriptionForActivePlatform() + { + return GetDescription(ApplicationServices.GetActiveOrSimulationPlatform()); + } + + public string GetDescription(RuntimePlatform platform) + { + // check whether overrides are available + string targetValue = m_descriptionOverrides.GetConstantForPlatform(platform, m_description); + if (targetValue == null) + { + DebugLogger.LogError(CoreLibraryDomain.NativePlugins, "Permission is not defined."); + return null; + } + else + { + return FormatDescription(targetValue, platform); + } + } + + #endregion + + #region Private methods + + private string FormatDescription(string description, RuntimePlatform targetPlatform) + { + switch (targetPlatform) + { + case RuntimePlatform.IPhonePlayer: + case RuntimePlatform.tvOS: + return description.Replace("$productName", "$(PRODUCT_NAME)"); + + case RuntimePlatform.Android: + return description.Replace("$productName", "%app_name%"); + + default: + return description; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureUsagePermissionDefinition.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureUsagePermissionDefinition.cs.meta new file mode 100644 index 00000000..8cb65b96 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureUsagePermissionDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5fc6140c0d697442c811e30d35b4be13 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureUsagePermissionHandler.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureUsagePermissionHandler.cs new file mode 100644 index 00000000..0ff7e090 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureUsagePermissionHandler.cs @@ -0,0 +1,15 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + public static class NativeFeatureUsagePermissionHandler + { + #region Staic properties + + public static INativeFeatureUsagePermissionHandler Default { get; set; } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureUsagePermissionHandler.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureUsagePermissionHandler.cs.meta new file mode 100644 index 00000000..c3adbb07 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeFeatureUsagePermissionHandler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b98aa52511283458daebda671fe88c4e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeObjectBase.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeObjectBase.cs new file mode 100644 index 00000000..d179a532 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeObjectBase.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + public abstract class NativeObjectBase : INativeObject + { + #region Properties + + protected bool IsDisposed { get; private set; } + + #endregion + + #region Constructors + + protected NativeObjectBase(NativeObjectRef nativeObjectRef = null) + { + // set properties + NativeObjectRef = nativeObjectRef; + IsDisposed = false; + } + + ~NativeObjectBase() + { + Dispose(false); + } + + #endregion + + #region INativeInterface implementation + + public NativeObjectRef NativeObjectRef { get; protected set; } + + public IntPtr AddrOfNativeObject() + { + return (NativeObjectRef == null) ? IntPtr.Zero : NativeObjectRef.Pointer; + } + + #endregion + + #region IDisposable implementation + + public void Dispose() + { + Dispose(true); + } + + protected virtual void Dispose(bool disposing) + { + // check object state + if (IsDisposed) + { + return; + } + +#if NATIVE_PLUGINS_DEBUG && !UNITY_ANDROID + DebugLogger.Log(CoreLibraryDomain.NativePlugins, $"Disposing native object: {GetType()}."); +#endif + + if (disposing) + { + // dispose managed state (managed objects) + } + + // free unmanaged resources (unmanaged objects) + if (NativeObjectRef != null) + { + NativeObjectRef.Dispose(); + } + + // mark that object is released + IsDisposed = true; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeObjectBase.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeObjectBase.cs.meta new file mode 100644 index 00000000..9cda49da --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeObjectBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3c26198a4c0c74137b309cbbfc92d5c5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeObjectRef.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeObjectRef.cs new file mode 100644 index 00000000..0ea63c41 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeObjectRef.cs @@ -0,0 +1,89 @@ +using System; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + public class NativeObjectRef : IDisposable + { + #region Fields + + private bool m_disposed; + + #endregion + + #region Properties + + public IntPtr Pointer { get; private set; } + + #endregion + + #region Constructors + + public NativeObjectRef(IntPtr ptr, bool autoRetain) + { + // check argument valuie + Assert.IsFalse(ptr == IntPtr.Zero, "Ptr is null."); + + // set properties + Pointer = ptr; + m_disposed = false; + + if (autoRetain) + { + Retain(); + } + } + + ~NativeObjectRef() + { + Dispose(false); + } + + #endregion + + #region Memory management methods + + private void Retain() + { + RetainInternal(Pointer); + } + + private void Release() + { + ReleaseInternal(Pointer); + } + + protected virtual void RetainInternal(IntPtr ptr) + { } + + protected virtual void ReleaseInternal(IntPtr ptr) + { } + + #endregion + + #region IDisposable implementation + + public void Dispose() + { + Dispose(true); + } + + private void Dispose(bool disposing) + { + if (!m_disposed) + { + DebugLogger.Log(CoreLibraryDomain.NativePlugins, "Disposing native object."); + if (disposing) + { + // dispose managed state (managed objects). + } + + // free unmanaged resources (unmanaged objects) + Release(); + m_disposed = true; + } + } + + #endregion + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeObjectRef.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeObjectRef.cs.meta new file mode 100644 index 00000000..cc679d3a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Base/NativeObjectRef.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0e7f9350b37144545b727770b965bdb4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Constants.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Constants.meta new file mode 100644 index 00000000..e549fd3a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Constants.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 49b3df04feaa34d0489f9ae385445504 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Constants/Calendar.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Constants/Calendar.cs new file mode 100644 index 00000000..632077ea --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Constants/Calendar.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + /// + /// An enumeration for the available calendars. + /// + public enum Calendar + { + // Identifier for the Buddhist calendar. + Buddhist = 1, + + // Identifier for the Chinese calendar. + Chinese, + + // Identifier for the Coptic calendar. + Coptic, + + // Identifier for the Ethiopic (Amete Alem) calendar. + EthiopicAmeteAlem, + + // Identifier for the Ethiopic (Amete Mihret) calendar. + EthiopicAmeteMihret, + + // Identifier for the Gregorian calendar. + Gregorian, + + // Identifier for the Hebrew calendar. + Hebrew, + + // Identifier for the Indian calendar. + Indian, + + // Identifier for the Islamic calendar. + Islamic, + + // Identifier for the Islamic civil calendar. + IslamicCivil, + + // Identifier for the tabular Islamic calendar. + IslamicTabular, + + // Identifier for the Islamic Umm al-Qura calendar, as used in Saudi Arabia. + IslamicUmmAlQura, + + // Identifier for the ISO8601 calendar. + Iso8601, + + // Identifier for the Japanese calendar. + Japanese, + + // Identifier for the Persian calendar. + Persian, + + // Identifier for the Republic of China (Taiwan) calendar. + RepublicOfChina, + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Constants/Calendar.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Constants/Calendar.cs.meta new file mode 100644 index 00000000..ec13643b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Constants/Calendar.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4aca1aa19e3a84647bf445e172fe5b77 +timeCreated: 1576157724 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Constants/NativePlatform.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Constants/NativePlatform.cs new file mode 100644 index 00000000..21b286b1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Constants/NativePlatform.cs @@ -0,0 +1,25 @@ +using System; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + /// + /// The enum is used to indicate the platform application is running. + /// + [Flags] + public enum NativePlatform + { + /// The runtime platform could not be determined. + Unknown = 0, + + /// The runtime platform is iOS. + iOS = 1 << 0, + + /// The runtime platform is tvOS. + tvOS = 1 << 1, + + /// The runtime platform is Android. + Android = 1 << 2, + + All = iOS | tvOS | Android, + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Constants/NativePlatform.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Constants/NativePlatform.cs.meta new file mode 100644 index 00000000..dfe85d3a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Constants/NativePlatform.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1ff7dcb4297b74826a7416f29c3334e4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Controllers.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Controllers.meta new file mode 100644 index 00000000..6654a466 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Controllers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f0a18063511f747ac803092d817acb1e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Controllers/TouchScreenKeyboardController.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Controllers/TouchScreenKeyboardController.cs new file mode 100644 index 00000000..4b27d34e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Controllers/TouchScreenKeyboardController.cs @@ -0,0 +1,172 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +using UnityTouchScreenKeyboard = UnityEngine.TouchScreenKeyboard; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + public class TouchScreenKeyboardController : MonoBehaviour + { + #region Static fields + + [ClearOnReload] + private static TouchScreenKeyboardController s_sharedInstance = null; + + #endregion + + #region Fields + +#if UNITY_EDITOR + private bool m_simulateInEditor = false; + private float m_editorKeyboardHeightRatio = 0.4f; +#endif + + #endregion + + #region Static properties + + public static bool IsSupported => UnityTouchScreenKeyboard.isSupported; + + public static bool IsVisible { get; private set; } + + #endregion + + #region Static events + + [ClearOnReload] + public static event Callback OnKeyboardDidShow = null; + + [ClearOnReload] + public static event Callback OnKeyboardWillHide = null; + + #endregion + + #region Static methods + + public static int GetKeyboardHeight(bool includeInput) + { +#if UNITY_EDITOR + return (s_sharedInstance && s_sharedInstance.m_simulateInEditor) ? (int)(Screen.height * s_sharedInstance.m_editorKeyboardHeightRatio) : 0; +#elif UNITY_IOS + return (int)TouchScreenKeyboard.area.height; +#elif UNITY_ANDROID + using (AndroidJavaClass unityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) + { + AndroidJavaObject unityPlayer = unityClass.GetStatic("currentActivity").Get("mUnityPlayer"); + AndroidJavaObject view = unityPlayer.Call("getView"); + AndroidJavaObject dialog = unityPlayer.Get("mSoftInputDialog"); + if (view == null || dialog == null) + return 0; + var decorHeight = 0; + if (includeInput) + { + AndroidJavaObject decorView = dialog.Call("getWindow").Call("getDecorView"); + if (decorView != null) + decorHeight = decorView.Call("getHeight"); + } + using (AndroidJavaObject rect = new AndroidJavaObject("android.graphics.Rect")) + { + view.Call("getWindowVisibleDisplayFrame", rect); + return Screen.height - rect.Call("height") + decorHeight; + } + } +#else + return 0; +#endif + } + + private static bool IsKeyboardVisibleInternal() + { +#if UNITY_EDITOR + return (s_sharedInstance != null) && s_sharedInstance.m_simulateInEditor; +#elif UNITY_IOS || UNITY_ANDROID + return UnityTouchScreenKeyboard.visible; +#else + return false; +#endif + } + + private static bool IsKeyboardActiveInternal() + { + if (Application.platform == RuntimePlatform.IPhonePlayer) + { + return GetKeyboardHeight(includeInput: false) > 0; + } + + return IsKeyboardVisibleInternal(); + } + + #endregion + + #region Unity methods + + private void Awake() + { + // set shared instance + s_sharedInstance = this; +#if UNITY_EDITOR + IsVisible = (Application.isEditor && m_simulateInEditor); +#endif + } + + private void Start() + { + // check whether this feature is supported + if (!IsSupported) + { + enabled = false; + } + } + + private void Update() + { + if (IsKeyboardVisibleInternal()) + { + if (!IsVisible && IsKeyboardActiveInternal()) + { + IsVisible = true; + + SendKeyboardDidShow(); + } + } + else if (IsVisible) + { + IsVisible = false; + + SendKeyboardWillHide(); + } + } + + private void OnDestroy() + { + // reset shared instance + if (s_sharedInstance == this) + { + s_sharedInstance = null; + } + } + + #endregion + + #region Private methods + + private void SendKeyboardDidShow() + { + if (OnKeyboardDidShow != null) + { + OnKeyboardDidShow.Invoke(); + } + } + + private void SendKeyboardWillHide() + { + if (OnKeyboardWillHide != null) + { + OnKeyboardWillHide.Invoke(); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Controllers/TouchScreenKeyboardController.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Controllers/TouchScreenKeyboardController.cs.meta new file mode 100644 index 00000000..1f23bf74 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Controllers/TouchScreenKeyboardController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 867485d1ec0ad48129d30cf6cb2e276b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels.meta new file mode 100644 index 00000000..1c8fd09d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3480eb129209e4b8db3f89becd938afc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/CircularRegion.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/CircularRegion.cs new file mode 100644 index 00000000..10e20584 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/CircularRegion.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + /// + /// A circular geographic region, specified as a center point and radius. + /// + [Serializable] + public struct CircularRegion + { + #region Fields + + [SerializeField] + private LocationCoordinate m_center; + + [SerializeField] + private float m_radius; + + [SerializeField] + private string m_regionId; + + #endregion + + #region Properties + + /// + /// The center point of the geographic region to monitor. + /// + public LocationCoordinate Center + { + get => m_center; + set => m_center = value; + } + + /// + /// The distance (measured in meters) from the center point of the geographic region to the edge of the circular boundary. + /// + public float Radius + { + get => m_radius; + set => m_radius = value; + } + + /// + /// The identifier for the region object. + /// + public string RegionId + { + get => m_regionId; + set => m_regionId = value; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/CircularRegion.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/CircularRegion.cs.meta new file mode 100644 index 00000000..594ad67e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/CircularRegion.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d2a6ea98fae6a4ba8bde124af2b661f4 +timeCreated: 1576157288 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/DateComponents.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/DateComponents.cs new file mode 100644 index 00000000..c0959848 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/DateComponents.cs @@ -0,0 +1,214 @@ +using System; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + /// + /// A date or time specified in terms of units (such as year, month, day, hour, and minute) to be evaluated in a calendar system and time zone. + /// + [Serializable] + public class DateComponents + { + #region Fields + + [SerializeField] + private Calendar m_calendar; + + [SerializeField] + private int m_year; + + [SerializeField] + private int m_month; + + [SerializeField] + private int m_day; + + [SerializeField] + private int m_hour; + + [SerializeField] + private int m_minute; + + [SerializeField] + private int m_second; + + [SerializeField] + private int m_nanosecond; + + [SerializeField] + private int m_weekday; + + [SerializeField] + private int m_weekOfMonth; + + [SerializeField] + private int m_weekOfYear; + + #endregion + + #region Properties + + /// + /// Gets or sets the calendar. + /// + /// The calendar. + public Calendar Calendar + { + get => m_calendar; + set => m_calendar = value; + } + + /// + /// Gets or sets the year. + /// + /// The year. + public int Year + { + get => m_year; + set => m_year = value; + } + + /// + /// Gets or sets the month. + /// + /// The month. + public int Month + { + get => m_month; + set => m_month = value; + } + + /// + /// Gets or sets the day. + /// + /// The day. + public int Day + { + get => m_day; + set => m_day = value; + } + + /// + /// Gets or sets the hour. + /// + /// The hour. + public int Hour + { + get => m_hour; + set => m_hour = value; + } + + /// + /// Gets or sets the minute. + /// + /// The minute. + public int Minute + { + get => m_minute; + set => m_minute = value; + } + + /// + /// Gets or sets the second. + /// + /// The second. + public int Second + { + get => m_second; + set => m_second = value; + } + + /// + /// Gets or sets the nanosecond. + /// + /// The nanosecond. + public int Nanosecond + { + get => m_nanosecond; + set => m_nanosecond = value; + } + + /// + /// Gets or sets the weekday. + /// Note: Weekday starts from Monday(1) to Sunday(7) - As per ISO 8601 standard + /// + /// The weekday. + [Obsolete("Use DayOfWeek property instead", true)] + public int Weekday + { + get => m_weekday; + + set + { + if(value == 0) + { + DebugLogger.LogError(CoreLibraryDomain.NativePlugins, "Weekday cannot be 0. Weekday starts from Monday(1) to Sunday(7)"); + } + + m_weekday = value; + } + } + + /// + /// Gets or sets the weekday. + /// Note: DayOfWeek starts from Monday(1) to Sunday(7) - As per ISO 8601 standard + /// + /// The day of the week. + public int DayOfWeek + { + get => m_weekday; + + set + { + if(value == 0) + { + DebugLogger.LogError(CoreLibraryDomain.NativePlugins, "DayOfWeek cannot be 0. DayOfWeek starts from Monday(1) to Sunday(7) (ISO 8601 standard)"); + } + + m_weekday = value; + } + } + + /// + /// Gets or sets the week of month. + /// + /// The week of month. + public int WeekOfMonth + { + get => m_weekOfMonth; + set => m_weekOfMonth = value; + } + + /// + /// Gets or sets the week of year. + /// + /// The week of year. + public int WeekOfYear + { + get => m_weekOfYear; + set => m_weekOfYear = value; + } + + #endregion + + #region Constructors + + public DateComponents() + { + // set default values + m_calendar = (Calendar)0; + m_year = -1; + m_month = -1; + m_day = -1; + m_hour = -1; + m_minute = -1; + m_second = -1; + m_nanosecond = -1; + m_weekday = -1; + m_weekOfMonth = -1; + m_weekOfYear = -1; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/DateComponents.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/DateComponents.cs.meta new file mode 100644 index 00000000..c0e343a6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/DateComponents.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7c9275e3d5c9040bd81845e9659841bc +timeCreated: 1576157288 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/LocationCoordinate.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/LocationCoordinate.cs new file mode 100644 index 00000000..748d80c7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/LocationCoordinate.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + [Serializable] + public struct LocationCoordinate + { + #region Fields + + [SerializeField] + private double m_latitude; + + [SerializeField] + private double m_longitude; + + #endregion + + #region Properties + + /// + /// The latitude in degrees. + /// + public double Latitude + { + get => m_latitude; + set => m_latitude = value; + } + + /// + /// The longitude in degrees. + /// + public double Longitude + { + get => m_longitude; + set => m_longitude = value; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/LocationCoordinate.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/LocationCoordinate.cs.meta new file mode 100644 index 00000000..e14c500f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/LocationCoordinate.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 776bfa20243a0448b8e0b6f8679945f5 +timeCreated: 1576157288 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/NativePlatformConstantSet.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/NativePlatformConstantSet.cs new file mode 100644 index 00000000..746087f3 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/NativePlatformConstantSet.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + [Serializable, Obsolete("This class is deprecated. Instead use RuntimePlatformConstantSet.", true)] + public class NativePlatformConstantSet + { + #region Fields + + [SerializeField] + private string m_ios; + + [SerializeField] + private string m_tvos; + + [SerializeField] + private string m_android; + + #endregion + + #region Constructors + + public NativePlatformConstantSet(string ios = null, string tvos = null, string android = null) + { + // set properties + m_ios = ios; + m_tvos = tvos; + m_android = android; + } + + #endregion + + #region Public methods + + public string GetConstantForActivePlatform(string defaultValue = null) + { + var platform = PlatformMappingServices.GetActivePlatform(); + return GetConstantForPlatform(platform, defaultValue); + } + + public string GetConstantForPlatform(NativePlatform platform, string defaultValue = null) + { + string targetValue = null; + switch (platform) + { + case NativePlatform.iOS: + targetValue = m_ios; + break; + + case NativePlatform.tvOS: + targetValue = m_tvos; + break; + + case NativePlatform.Android: + targetValue = m_android; + break; + + default: + throw VBException.SwitchCaseNotImplemented(platform); + } + + return string.IsNullOrEmpty(targetValue) ? defaultValue : targetValue; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/NativePlatformConstantSet.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/NativePlatformConstantSet.cs.meta new file mode 100644 index 00000000..a1ad76c3 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/NativePlatformConstantSet.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 41ed7eccdda15444aa9e0a6e413bbfca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/PlatformConstant.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/PlatformConstant.cs new file mode 100644 index 00000000..555f1ac6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/PlatformConstant.cs @@ -0,0 +1,130 @@ +using System; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + /// + /// Object represents an immutable, read-only object that combines a string value with a platform. + /// + [Serializable, Obsolete("This class is deprecated. Instead use RuntimePlatformConstant.", true)] + public class PlatformConstant + { + #region Fields + + [SerializeField] + private NativePlatform m_platform = NativePlatform.Unknown; + + [SerializeField] + private string m_value = string.Empty; + + #endregion + + #region Properties + + /// + /// Gets the runtime platform associated with string value. + /// + /// The enum value indicates the platform to which string value belongs. + public NativePlatform Platform + { + get => m_platform; + private set => m_platform = value; + } + + /// + /// Gets the string value. + /// + /// The string value. + public string Value + { + get => m_value; + private set => m_value = value; + } + + #endregion + + #region Constructors + + public PlatformConstant(NativePlatform platform, string value) + { + // set properties + m_platform = platform; + m_value = value; + } + + #endregion + + #region Static methods + + /// + /// Returns a new instance of , containing a string value functional only on iOS platform. + /// + /// The instance of . + /// The string value associated with iOS platform. + public static PlatformConstant iOS(string value) + { + return new PlatformConstant(NativePlatform.iOS, value); + } + + /// + /// Returns a new instance of , containing a string value functional only on tvOS platform. + /// + /// The instance of . + /// The string value associated with tvOS platform. + public static PlatformConstant tvOS(string value) + { + return new PlatformConstant(NativePlatform.tvOS, value); + } + + /// + /// Returns a new instance of , containing a string value functional only on Android platform. + /// + /// The instance of . + /// The string value associated with Android platform. + public static PlatformConstant Android(string value) + { + return new PlatformConstant(NativePlatform.Android, value); + } + + /// + /// Returns a new instance of , containing a string value functional on all supported platform. + /// + /// The instance of . + /// The string value associated with all supported platforms. + public static PlatformConstant All(string value) + { + return new PlatformConstant(NativePlatform.All, value); + } + + /// + /// Returns a new instance of , containing a string value associated with active platform. + /// + /// The instance of . + /// The string value associated with active platform. + public static PlatformConstant Current(string value) + { + var currentPlatform = PlatformMappingServices.GetActivePlatform(); + return new PlatformConstant(currentPlatform, value); + } + + #endregion + + #region Public methods + + public bool IsEqualToPlatform(NativePlatform other) + { + return ((other & m_platform) != 0); + } + + #endregion + + #region Base class methods + + public override string ToString() + { + return m_value; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/PlatformConstant.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/PlatformConstant.cs.meta new file mode 100644 index 00000000..fd0daa1b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/DataModels/PlatformConstant.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 41d8b8d5e6d154b8483e8852a1576cd8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces.meta new file mode 100644 index 00000000..1299137c --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6446a8969499a4ddbbe44b75c2b1efbb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeFeatureInterface.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeFeatureInterface.cs new file mode 100644 index 00000000..fb9bb47d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeFeatureInterface.cs @@ -0,0 +1,15 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + public interface INativeFeatureInterface : INativeObject + { + #region Properties + + bool IsAvailable { get; } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeFeatureInterface.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeFeatureInterface.cs.meta new file mode 100644 index 00000000..9c7f3217 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeFeatureInterface.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c94273cdd69cf45f79888beedf3d4ef7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeFeatureInterfaceProvider.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeFeatureInterfaceProvider.cs new file mode 100644 index 00000000..00bbfda8 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeFeatureInterfaceProvider.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + public interface INativeFeatureInterfaceProvider + { + INativeFeatureInterface CreateInterface(Type interfaceType, RuntimePlatform platform); + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeFeatureInterfaceProvider.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeFeatureInterfaceProvider.cs.meta new file mode 100644 index 00000000..bc82741d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeFeatureInterfaceProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 35b1f5a2d9a8645a0ae651a699f3a594 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeFeatureUsagePermissionHandler.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeFeatureUsagePermissionHandler.cs new file mode 100644 index 00000000..0fffe22a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeFeatureUsagePermissionHandler.cs @@ -0,0 +1,12 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + public interface INativeFeatureUsagePermissionHandler + { + void ShowPrepermissionDialog(string permissionType, Callback onAllowCallback, Callback onDenyCallback); + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeFeatureUsagePermissionHandler.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeFeatureUsagePermissionHandler.cs.meta new file mode 100644 index 00000000..90ae0641 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeFeatureUsagePermissionHandler.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 27e6f057169d34e1e93b6ade55a7eb7d +timeCreated: 1590818662 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeObject.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeObject.cs new file mode 100644 index 00000000..a5f08f5b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeObject.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + public interface INativeObject : IDisposable + { + #region Properties + + NativeObjectRef NativeObjectRef { get; } + + #endregion + + #region Methods + + IntPtr AddrOfNativeObject(); + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeObject.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeObject.cs.meta new file mode 100644 index 00000000..b3c27776 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Interfaces/INativeObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 88e8c8b8bb8644860be7a19fff49ee9e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Misc.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Misc.meta new file mode 100644 index 00000000..687e3267 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Misc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1fe5ec3cda7e342b6b71849ff61e3099 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Misc/Diagnostics.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Misc/Diagnostics.cs new file mode 100644 index 00000000..f5087bc6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Misc/Diagnostics.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + public static class Diagnostics + { + #region Constants + + public static readonly Error kFeatureNotSupported = new Error(description: "The requested operation could not be completed because this feature is not supported on current platform."); + + public const string kCreateNativeObjectError = "Failed to create native object."; + + #endregion + + #region Exception methods + + public static VBException PluginNotConfiguredException(string name = "Native") + { + return new VBException($"Please configure {name} plugin, before you start using it in your project."); + } + + #endregion + + #region Log methods + + public static void LogNotSupportedInEditor(string featureName = "This") + { + DebugLogger.LogWarning(CoreLibraryDomain.NativePlugins, $"{featureName} feature is not supported by simulator."); + } + + public static void LogNotSupported(string featureName = "This") + { + DebugLogger.LogWarning(CoreLibraryDomain.NativePlugins, $"{featureName} feature is not supported."); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Misc/Diagnostics.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Misc/Diagnostics.cs.meta new file mode 100644 index 00000000..10f8969e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Misc/Diagnostics.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d39da2d9f38df4eea8716af130b9bb33 +timeCreated: 1596368684 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Misc/ManagedObjectReferencePool.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Misc/ManagedObjectReferencePool.cs new file mode 100644 index 00000000..bcec4cd7 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Misc/ManagedObjectReferencePool.cs @@ -0,0 +1,50 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.EssentialKit +{ + internal static class ManagedObjectReferencePool + { + #region Static fields + + [ClearOnReload] + private static List s_objectList; + + #endregion + + #region Static methods + + public static void Retain(object obj) + { + // Validate arguments + Assert.IsArgNotNull(obj, "obj"); + + EnsureInitialized(); + s_objectList.Add(obj); + } + + public static void Release(object obj) + { + // Validate arguments + Assert.IsArgNotNull(obj, "obj"); + + EnsureInitialized(); + s_objectList.Remove(obj); + } + + #endregion + + #region Private static methods + + private static void EnsureInitialized() + { + if (s_objectList != null) return; + + s_objectList = new List(capacity: 8); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Misc/ManagedObjectReferencePool.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Misc/ManagedObjectReferencePool.cs.meta new file mode 100644 index 00000000..7f6c3df2 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Misc/ManagedObjectReferencePool.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 07e137e50cc514c1589bc07411d60d9f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged.meta new file mode 100644 index 00000000..930084ac --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: af612c1e8ec284a528a1c4baa7a8bbb0 +folderAsset: yes +timeCreated: 1576156074 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeArray.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeArray.cs new file mode 100644 index 00000000..8cb6e0a8 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeArray.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + [StructLayout(LayoutKind.Sequential)] + public struct NativeArray + { + #region Properties + + public IntPtr Pointer { get; set; } + + public int Length { get; set; } + + #endregion + + #region Public methods + + public T[] GetStructArray() where T : struct + { + if (Pointer == IntPtr.Zero) + { + return null; + } + + T[] structArray = new T[Length]; + + // copy data to managed array + var managedArray = new IntPtr[Length]; + Marshal.Copy(Pointer, managedArray, 0, Length); + + for (int i = 0; i < Length; i++) + { + structArray[i] = MarshalUtility.PtrToStructure(managedArray[i]); + } + return structArray; + } + + public string[] GetStringArray() + { + // Marshal ptr to array + return MarshalUtility.CreateStringArray(Pointer, Length); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeArray.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeArray.cs.meta new file mode 100644 index 00000000..c6bb0727 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeArray.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1dee3e63646dc48399a88782207714e8 +timeCreated: 1578652458 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeError.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeError.cs new file mode 100644 index 00000000..fab5c922 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeError.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + [StructLayout(LayoutKind.Sequential)] + public struct NativeError + { + #region Properties + + public int Code { get; set; } + + public IntPtr DescriptionPtr { get; set; } + + #endregion + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeError.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeError.cs.meta new file mode 100644 index 00000000..1113a3f6 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeError.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c238f39ac276047e2b72c8a2cff60d38 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeErrorExtensions.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeErrorExtensions.cs new file mode 100644 index 00000000..04d6df65 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeErrorExtensions.cs @@ -0,0 +1,17 @@ +using System; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + public static class NativeErrorExtensions + { + public static Error Convert(this NativeError nativeError, string domain = null) + { + if(nativeError.DescriptionPtr == IntPtr.Zero) + { + return null; + } + + return new Error(domain, nativeError.Code, nativeError.DescriptionPtr.AsString()); + } + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeErrorExtensions.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeErrorExtensions.cs.meta new file mode 100644 index 00000000..431b5d5f --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeErrorExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 613ef4643e3ea4946ae9c26c065198e0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeInstanceMap.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeInstanceMap.cs new file mode 100644 index 00000000..10365cc1 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeInstanceMap.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + public static class NativeInstanceMap + { + #region Static fields + + [ClearOnReload] + private static Dictionary s_instanceMap; + + #endregion + + #region Constructors + + static NativeInstanceMap() + { + Initialize(); + } + + #endregion + + #region Static methods + + public static void AddInstance(IntPtr nativePtr, object owner) + { + s_instanceMap.Add(nativePtr, owner); + } + + public static bool RemoveInstance(IntPtr nativePtr) + { + return s_instanceMap.Remove(nativePtr); + } + + public static T GetOwner(IntPtr nativePtr) where T : class + { + s_instanceMap.TryGetValue(nativePtr, out object owner); + + return owner as T; + } + + #endregion + + #region Private static methods + + [ExecuteOnReload] + private static void Initialize() + { + // Set properties + s_instanceMap = new Dictionary(capacity: 4); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeInstanceMap.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeInstanceMap.cs.meta new file mode 100644 index 00000000..01b52ca3 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeInstanceMap.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: cf1da258f945f4d67afd6d8cb6483c37 +timeCreated: 1554526179 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeSize.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeSize.cs new file mode 100644 index 00000000..fee11bc8 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeSize.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + [StructLayout(LayoutKind.Sequential)] + public struct NativeSize + { + #region Properties + + public float Width { get; set; } + + public float Height { get; set; } + + #endregion + + #region Constructors + + public NativeSize(float width, float height) + { + Width = width; + Height = height; + } + + #endregion + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeSize.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeSize.cs.meta new file mode 100644 index 00000000..4d8fd369 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/NativeSize.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 44b8264bf69004a9bb6827fb203f9a27 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityAttachment.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityAttachment.cs new file mode 100644 index 00000000..7e58b9a8 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityAttachment.cs @@ -0,0 +1,23 @@ +using System.Collections; +using System.Collections.Generic; +using System; +using System.Runtime.InteropServices; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + [StructLayout(LayoutKind.Sequential)] + public struct UnityAttachment + { + #region Properties + + public int DataArrayLength { get; set; } + + public IntPtr DataArrayPtr { get; set; } + + public IntPtr MimeTypePtr { get; set; } + + public IntPtr FileNamePtr { get; set; } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityAttachment.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityAttachment.cs.meta new file mode 100644 index 00000000..3c43d04d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityAttachment.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e80263f11eaf5435cbe9e5a12216fbc3 +timeCreated: 1576157288 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityCircularRegion.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityCircularRegion.cs new file mode 100644 index 00000000..a1508a07 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityCircularRegion.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + [StructLayout(LayoutKind.Sequential)] + public struct UnityCircularRegion + { + #region Properties + + public double Latitude { get; set; } + + public double Longitude { get; set; } + + public float Radius { get; set; } + + public IntPtr RegionIdPtr { get; set; } + + #endregion + + #region Operator methods + + public static implicit operator UnityCircularRegion(CircularRegion circularRegion) + { + return new UnityCircularRegion() + { + Latitude = circularRegion.Center.Latitude, + Longitude = circularRegion.Center.Longitude, + Radius = circularRegion.Radius, + RegionIdPtr = circularRegion.RegionId == null ? IntPtr.Zero : Marshal.StringToHGlobalAuto(circularRegion.RegionId), + }; + } + + public static implicit operator CircularRegion(UnityCircularRegion circularRegion) + { + return new CircularRegion() + { + Center = new LocationCoordinate() { Latitude = circularRegion.Latitude, Longitude = circularRegion.Longitude }, + Radius = circularRegion.Radius, + RegionId = MarshalUtility.ToString(circularRegion.RegionIdPtr), + }; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityCircularRegion.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityCircularRegion.cs.meta new file mode 100644 index 00000000..5cf78cce --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityCircularRegion.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 608db460057f2437495e09818bd1f88d +timeCreated: 1576157288 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityColor.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityColor.cs new file mode 100644 index 00000000..b3155441 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityColor.cs @@ -0,0 +1,43 @@ +using System.Collections; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + [StructLayout(LayoutKind.Sequential)] + public struct UnityColor + { + #region Properties + + public float Red { get; set; } + + public float Green { get; set; } + + public float Blue { get; set; } + + public float Alpha { get; set; } + + #endregion + + #region Operators + + public static implicit operator Color(UnityColor nativeColor) + { + return new Color(nativeColor.Red, nativeColor.Green, nativeColor.Blue, nativeColor.Alpha); + } + + public static explicit operator UnityColor(Color color) + { + return new UnityColor() + { + Red = color.r, + Green = color.g, + Blue = color.b, + Alpha = color.a, + }; + } + + #endregion + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityColor.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityColor.cs.meta new file mode 100644 index 00000000..708d53b4 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityColor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f16ac326669ac4f82a08e4aaf35122ce +timeCreated: 1576157288 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityDateComponent.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityDateComponent.cs new file mode 100644 index 00000000..ed7b0097 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityDateComponent.cs @@ -0,0 +1,78 @@ +using System.Collections; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + [StructLayout(LayoutKind.Sequential)] + public struct UnityDateComponents + { + #region Properties + + public Calendar Calendar { get; set; } + + public long Year { get; set; } + + public long Month { get; set; } + + public long Day { get; set; } + + public long Hour { get; set; } + + public long Minute { get; set; } + + public long Second { get; set; } + + public long Nanosecond { get; set; } + + public long DayOfWeek { get; set; } + + public long WeekOfMonth { get; set; } + + public long WeekOfYear { get; set; } + + #endregion + + #region Operator methods + + public static implicit operator UnityDateComponents(DateComponents dateComponents) + { + return new UnityDateComponents() + { + Calendar = dateComponents.Calendar, + Year = dateComponents.Year, + Month = dateComponents.Month, + Day = dateComponents.Day, + Hour = dateComponents.Hour, + Minute = dateComponents.Minute, + Second = dateComponents.Second, + Nanosecond = dateComponents.Nanosecond, + DayOfWeek = dateComponents.DayOfWeek, + WeekOfMonth = dateComponents.WeekOfMonth, + WeekOfYear = dateComponents.WeekOfYear, + }; + } + + public static implicit operator DateComponents(UnityDateComponents dateComponents) + { + return new DateComponents() + { + Calendar = dateComponents.Calendar, + Year = (int)dateComponents.Year, + Month = (int)dateComponents.Month, + Day = (int)dateComponents.Day, + Hour = (int)dateComponents.Hour, + Minute = (int)dateComponents.Minute, + Second = (int)dateComponents.Second, + Nanosecond = (int)dateComponents.Nanosecond, + DayOfWeek = (int)dateComponents.DayOfWeek, + WeekOfMonth = (int)dateComponents.WeekOfMonth, + WeekOfYear = (int)dateComponents.WeekOfYear, + }; + } + + #endregion + + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityDateComponent.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityDateComponent.cs.meta new file mode 100644 index 00000000..c1a554bc --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityDateComponent.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8c2328e7413e9460b95a51b3f3d8b645 +timeCreated: 1576157288 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityRect.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityRect.cs new file mode 100644 index 00000000..48d8f788 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityRect.cs @@ -0,0 +1,43 @@ +using System.Collections; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + [StructLayout(LayoutKind.Sequential)] + public struct UnityRect + { + #region Properties + + public float X { get; set; } + + public float Y { get; set; } + + public float Width { get; set; } + + public float Height { get; set; } + + #endregion + + #region Operators + + public static implicit operator Rect(UnityRect nativeRect) + { + return new Rect(nativeRect.X, nativeRect.Y, nativeRect.Width, nativeRect.Height); + } + + public static explicit operator UnityRect(Rect rect) + { + return new UnityRect() + { + X = rect.x, + Y = rect.y, + Width = rect.width, + Height = rect.height, + }; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityRect.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityRect.cs.meta new file mode 100644 index 00000000..da665fcf --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Unmanaged/UnityRect.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 497b88e3e95064649b6f4f73c7b48907 +timeCreated: 1576157288 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities.meta new file mode 100644 index 00000000..1a938d3a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fda0bc5760ce84e3b9fd93c18bbc3eeb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/IntPtrUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/IntPtrUtility.cs new file mode 100644 index 00000000..ccbc04d9 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/IntPtrUtility.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Runtime.InteropServices; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + public static class IntPtrUtility + { + private const string kZuluFormat = "yyyy-MM-dd HH:mm:ss zzz"; + + public static string AsString(this IntPtr ptr) + { + return MarshalUtility.ToString(ptr); + } + + public static DateTime AsDateTime(this IntPtr ptr) + { + var value = ptr.AsString(); + + if (value != null) + { + return DateTime.ParseExact(value, kZuluFormat, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal).ToUniversalTime(); + } + + return default; + } + + public static DateTime? AsOptionalDateTime(this IntPtr ptr) + { + if(ptr == IntPtr.Zero) + return null; + + return AsDateTime(ptr); + } + + public static T AsStruct(this IntPtr ptr) where T : struct + { + return MarshalUtility.PtrToStructure(ptr); + } + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/IntPtrUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/IntPtrUtility.cs.meta new file mode 100644 index 00000000..777f17df --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/IntPtrUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 187b0939526b04e8abbd980d291bb1c5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/MarshalUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/MarshalUtility.cs new file mode 100644 index 00000000..2d5fe258 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/MarshalUtility.cs @@ -0,0 +1,177 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + public static class MarshalUtility + { + #region Marshalling methods + + public static string ToString(IntPtr stringPtr) + { + if (IntPtr.Zero == stringPtr) + { + return null; + } + + return Marshal.PtrToStringAuto(stringPtr); + } + + public static IntPtr GetIntPtr(object value) + { + if (null == value) + { + return IntPtr.Zero; + } + + return GCHandle.ToIntPtr(value: GCHandle.Alloc(value)); + } + + public static void FreeUnmanagedStringArray(IntPtr unmanagedArrayPtr, int count) + { + DebugLogger.Log(CoreLibraryDomain.NativePlugins, $"Releasing unmanaged array: {unmanagedArrayPtr}."); + + // release each strings allocated in unmanaged space + var unmanagedArrayHandle = GCHandle.FromIntPtr(unmanagedArrayPtr); + var dataArray = (IntPtr[])unmanagedArrayHandle.Target; + for (int iter = 0; iter < count; iter++) + { + Marshal.FreeHGlobal(dataArray[iter]); + } + + // release handle + unmanagedArrayHandle.Free(); + } + + public static IntPtr CreateUnmanagedArray(IntPtr[] managedArray) + { + int arrayLength = managedArray.Length; + int size = Marshal.SizeOf(managedArray[0]) * arrayLength; + var unmanagedPtr = Marshal.AllocHGlobal(size); + + // copy + Marshal.Copy(managedArray, 0, unmanagedPtr, arrayLength); + + return unmanagedPtr; + } + + public static void ReleaseUnmanagedArray(IntPtr unmanagedArrayPtr) + { + Marshal.FreeHGlobal(unmanagedArrayPtr); + } + + public static IntPtr[] CreateManagedArray(IntPtr arrayPtr, int length) + { + // check whether array is valid + if (length == -1) //Not checking arrayPtr is zero or not - as it's possible to have an array with no elements too. If null needs to be created, length needs to be -1. + { + return null; + } + + // copy data to managed array + var managedArray = new IntPtr[length]; + Marshal.Copy(arrayPtr, managedArray, 0, length); + + return managedArray; + } + + public static string[] CreateStringArray(IntPtr arrayPtr, int length) + { + if (length == -1) //Not checking arrayPtr is zero or not - as it's possible to have an array with no elements too. If null needs to be created, length needs to be -1. + { + return null; + } + + // create array + var managedArray = new IntPtr[length]; + Marshal.Copy(arrayPtr, managedArray, 0, length); + + var stringArray = new string[length]; + for (int iter = 0; iter < length; iter++) + { + stringArray[iter] = ToString(managedArray[iter]); + } + + return stringArray; + } + + #endregion + + #region Structures + + public static T PtrToStructure(IntPtr ptr) where T : struct + { + return (T)Marshal.PtrToStructure(ptr, typeof(T)); + } + + public static TOutput[] ConvertNativeArrayItems(IntPtr arrayPtr, int length, Converter converter, bool includeNullObjects) + where TInput : struct + where TOutput : class + { + if (IntPtr.Zero == arrayPtr) + { + return null; + } + + // create original data array from native data + var outputObjects = new List(length); + int sizeOfInputObject = Marshal.SizeOf(typeof(TInput)); + long arrayPtrAddr = arrayPtr.ToInt64(); + int offset = 0; + for (int iter = 0; iter < length; iter++) + { + var inputObject = PtrToStructure(new IntPtr(arrayPtrAddr + offset)); + var outputObject = converter(inputObject); + if (EqualityComparer.Default.Equals(outputObject, default(TOutput)) && !includeNullObjects) + { + DebugLogger.LogWarning(CoreLibraryDomain.NativePlugins, $"Failed to convert object with data {inputObject}."); + continue; + } + + // add object to list + outputObjects.Add(outputObject); + + // update pointer + offset += sizeOfInputObject; + } + + return outputObjects.ToArray(); + } + + public static TOutput[] ConvertNativeArrayItems(IntPtr arrayPtr, int length, Converter converter, bool includeNullObjects) + where TOutput : class + { + // check whether array is valid + if (arrayPtr == IntPtr.Zero) + { + return null; + } + + // copy data to managed array + var managedArray = new IntPtr[length]; + Marshal.Copy(arrayPtr, managedArray, 0, length); + + // convert items to specified type using converter method + var outputObjects = new List(length); + for (int iter = 0; iter < length; iter++) + { + var nativePtr = managedArray[iter]; + var outputObject = converter(nativePtr); + if (EqualityComparer.Default.Equals(outputObject, default(TOutput)) && !includeNullObjects) + { + DebugLogger.LogWarning(CoreLibraryDomain.NativePlugins, $"Failed to convert object with data {nativePtr}."); + continue; + } + + // add object to list + outputObjects.Add(outputObject); + } + + return outputObjects.ToArray(); + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/MarshalUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/MarshalUtility.cs.meta new file mode 100644 index 00000000..bb727907 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/MarshalUtility.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ef4d5675c6e30431484773e937db4147 +timeCreated: 1550585821 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/PlatformConstantUtility.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/PlatformConstantUtility.cs new file mode 100644 index 00000000..d696e657 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/PlatformConstantUtility.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + [Obsolete("This class is deprecated. Instead use RuntimePlatformConstantUtility.", true)] + public static class PlatformConstantUtility + { + #region Static methods + + public static PlatformConstant FindConstantForActivePlatform(PlatformConstant[] array) + { + var activePlatform = PlatformMappingServices.GetActivePlatform(); + return FindConstantForPlatform(array, activePlatform); + } + + public static PlatformConstant FindConstantForPlatform(PlatformConstant[] array, NativePlatform platform) + { + if (array != null) + { + return Array.Find(array, (item) => item.IsEqualToPlatform(platform)); + } + + return null; + } + + public static string GetActivePlatformConstantValue(PlatformConstant[] array) + { + var targetConstant = FindConstantForActivePlatform(array); + return (targetConstant != null) ? targetConstant.Value : null; + } + + public static string GetPlatformConstantValue(PlatformConstant[] array, NativePlatform platform) + { + var targetConstant = FindConstantForPlatform(array, platform); + return (targetConstant != null) ? targetConstant.Value : null; + } + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/PlatformConstantUtility.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/PlatformConstantUtility.cs.meta new file mode 100644 index 00000000..73b3352e --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/PlatformConstantUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f529ce1b5ec1e4834a33da7f8e53fdab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/PlatformMappingServices.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/PlatformMappingServices.cs new file mode 100644 index 00000000..fadca70a --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/PlatformMappingServices.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace VoxelBusters.CoreLibrary.NativePlugins +{ + public static class PlatformMappingServices + { + #region Platform methods + + public static NativePlatform GetActivePlatform() + { + return ConvertRuntimePlatformToNativePlatform(Application.platform); + } + + public static NativePlatform ConvertRuntimePlatformToNativePlatform(RuntimePlatform platform) + { + switch (platform) + { +#if UNITY_EDITOR + case RuntimePlatform.OSXEditor: + case RuntimePlatform.WindowsEditor: + case RuntimePlatform.LinuxEditor: + return ConvertBuildTargetToNativePlatform(EditorUserBuildSettings.activeBuildTarget); +#endif + case RuntimePlatform.IPhonePlayer: + return NativePlatform.iOS; + + case RuntimePlatform.tvOS: + return NativePlatform.tvOS; + + case RuntimePlatform.Android: + return NativePlatform.Android; + + default: + return NativePlatform.Unknown; + } + } + + #endregion + + #region Editor methods + +#if UNITY_EDITOR + public static NativePlatform ConvertBuildTargetToNativePlatform(BuildTarget buildTarget) + { + switch (buildTarget) + { + case BuildTarget.iOS: + return NativePlatform.iOS; + + case BuildTarget.tvOS: + return NativePlatform.tvOS; + + case BuildTarget.Android: + return NativePlatform.Android; + + default: + return NativePlatform.Unknown; + } + } +#endif + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/PlatformMappingServices.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/PlatformMappingServices.cs.meta new file mode 100644 index 00000000..ab4d7826 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/Core/Utilities/PlatformMappingServices.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6c8eede7cc82e45cd9e8b7ff46a26463 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit.meta new file mode 100644 index 00000000..8271ada5 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2807845595d714aafab40c3bc2bb2cfd +folderAsset: yes +timeCreated: 1576851380 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/ConsoleRect.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/ConsoleRect.cs new file mode 100644 index 00000000..bd44ae3d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/ConsoleRect.cs @@ -0,0 +1,73 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + +namespace VoxelBusters.CoreLibrary.NativePlugins.DemoKit +{ + public class ConsoleRect : MonoBehaviour + { + #region Constants + private const int MAX_LENGTH = 10000; + + #endregion + + #region Properties + + [SerializeField] + private Text m_text = null; + + [SerializeField] + private ScrollRect m_textScroller = null; + + #endregion + + #region Unity methods + + private void Awake() + { + Reset(); + } + + #endregion + + #region Public methods + + public void Log(string message, bool append) + { + if (append && m_text.text.Length < MAX_LENGTH) + { + m_text.text = m_text.text + "\n---------------\n" + message; + } + else + { + m_text.text = message; + } + + StartCoroutine(MoveScrollerToBottom()); + } + + #endregion + + #region Private methods + + private IEnumerator MoveScrollerToBottom() + { + yield return null; + + // set position + m_textScroller.verticalNormalizedPosition = 0; + } + + private void Reset() + { + if (m_text) + { + m_text.text = "Console"; + } + } + + #endregion + } + +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/ConsoleRect.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/ConsoleRect.cs.meta new file mode 100644 index 00000000..297f04a3 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/ConsoleRect.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 030d6e213de734b1ab4bfb8f6a416dc9 +timeCreated: 1549317823 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/DemoActionBehaviour.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/DemoActionBehaviour.cs new file mode 100644 index 00000000..7b66bc9b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/DemoActionBehaviour.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Events; +using UnityEngine.UI; +using UnityEngine.Serialization; + +namespace VoxelBusters.CoreLibrary.NativePlugins.DemoKit +{ + public class DemoActionBehaviour : MonoBehaviour where TActionType : struct, IConvertible + { + #region Fields + + [SerializeField] + private TActionType m_actionType = default(TActionType); + + #endregion + + #region Properties + + public Selectable Selectable + { + get; + private set; + } + + public TActionType ActionType + { + get + { + return m_actionType; + } + } + + #endregion + + #region Events + + [SerializeField, FormerlySerializedAs("onSelect")] + private SelectEvent m_onSelect = new SelectEvent(); + public SelectEvent OnSelect + { + get + { + return m_onSelect; + } + } + + #endregion + + #region Unity methods + + private void Awake() + { + // cache components + Selectable = GetComponent(); + + RegisterForCallback(Selectable); + } + + #endregion + + #region Private methods + + private void RegisterForCallback(Selectable selectable) + { + // cache component + if (selectable is Button) + { + ((Button)selectable).onClick.AddListener(OnSelectInternal); + } + if (selectable is Toggle) + { + ((Toggle)selectable).onValueChanged.AddListener((value) => OnSelectInternal()); + } + if (selectable is Dropdown) + { + ((Dropdown)selectable).onValueChanged.AddListener((value) => OnSelectInternal()); + } + } + + private void OnSelectInternal() + { + // send event + if (m_onSelect != null) + { + m_onSelect.Invoke(Selectable); + } + } + + #endregion + + #region Nested types + + [Serializable] + public class SelectEvent : UnityEvent + { } + + #endregion + } +} diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/DemoActionBehaviour.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/DemoActionBehaviour.cs.meta new file mode 100644 index 00000000..83d224cd --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/DemoActionBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2753d359fc4064fa5ad1bdc2c1d95d9a +timeCreated: 1562570180 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/DemoActionPanelBase{TAction,TActionType}.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/DemoActionPanelBase{TAction,TActionType}.cs new file mode 100644 index 00000000..ef7a5418 --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/DemoActionPanelBase{TAction,TActionType}.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +using VoxelBusters.CoreLibrary; + +namespace VoxelBusters.CoreLibrary.NativePlugins.DemoKit +{ + public abstract class DemoActionPanelBase : DemoPanel where TAction : DemoActionBehaviour where TActionType : struct, System.IConvertible + { + #region Constants + + private const string kLogCreateInstance = "Create instance by calling {0})"; + + #endregion + + #region Fields + + private ConsoleRect m_consoleRect = null; + + private TAction[] m_actions = null; + + #endregion + + #region Unity methods + + protected virtual void Awake() + { + // set properties + m_consoleRect = GetComponentInChildren(); + m_actions = GetComponentsInChildren(); + + // init + SetActionCallbacks(); + } + + protected virtual void Start() + { } + + protected virtual void OnEnable() + { } + + protected virtual void OnDisable() + { } + + #endregion + + #region Base methods + + public override void Rebuild() + { + SetActionCallbacks(); + } + + #endregion + + #region Private methods + + protected virtual string GetCreateInstanceCodeSnippet() + { + throw VBException.NotImplemented(); + } + + protected TAction FindActionOfType(TActionType actionType) + { + return Array.Find(m_actions, (item) => EqualityComparer.Default.Equals(actionType, item.ActionType)); + } + + protected void Log(string message, bool append = true) + { + #if NATIVE_PLUGINS_DEBUG + Debug.Log(message); + #endif + m_consoleRect.Log(message, append); + } + + protected void LogMissingInstance(bool append = true) + { + m_consoleRect.Log(string.Format(kLogCreateInstance, GetCreateInstanceCodeSnippet()), append); + } + + protected bool AssertPropertyIsValid(string property, string value) + { + return AssertPropertyIsValid(property, () => string.IsNullOrEmpty(value)); + } + + protected bool AssertPropertyIsValid(string property, Func condition) + { + if (condition()) + { + m_consoleRect.Log($"Property \"{property}\" value is invalid.", append: true); + return false; + } + return true; + } + + private void SetActionCallbacks() + { + // set button property + foreach (TAction actionButton in m_actions) + { + var selectEvent = actionButton.OnSelect; + selectEvent.RemoveAllListeners(); + selectEvent.AddListener(OnActionSelect); + } + } + + #endregion + + #region UI callback methods + + public void OnActionSelect(Selectable selectable) + { + TAction selectedAction = Array.Find(m_actions, (item) => selectable == item.Selectable); + if (selectedAction) + { + OnActionSelectInternal(selectedAction); + } + } + + protected virtual void OnActionSelectInternal(TAction selectedAction) + {} + + #endregion + } +} \ No newline at end of file diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/DemoActionPanelBase{TAction,TActionType}.cs.meta b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/DemoActionPanelBase{TAction,TActionType}.cs.meta new file mode 100644 index 00000000..75f2f86d --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/DemoActionPanelBase{TAction,TActionType}.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ad5a6450a250245f288f781b63435f20 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/DemoBackButton.cs b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/DemoBackButton.cs new file mode 100644 index 00000000..55f7038b --- /dev/null +++ b/EintooAR/Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/NativePlugins/DemoKit/DemoBackButton.cs @@ -0,0 +1,22 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.SceneManagement; + +namespace VoxelBusters.CoreLibrary.NativePlugins.DemoKit +{ + [RequireComponent(typeof(Button))] + public class DemoBackButton : MonoBehaviour + { + #region Unity methods + + private void Awake() + { + // set button + GetComponent