commit e0afef912e8c91bee465913954f103b65fe2395b Author: runette Date: Mon Apr 22 15:52:51 2024 +0100 20240422 diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..66fdabc --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*.cs] +indent_style = tab +insert_final_newline = true +trim_trailing_whitespace = true + +# avoid "this." if not necessary +dotnet_style_qualification_for_field = false:warning +dotnet_style_qualification_for_property = false:warning +dotnet_style_qualification_for_event = false:warning + +# newline settings +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true diff --git a/Core.meta b/Core.meta new file mode 100644 index 0000000..ec23c44 --- /dev/null +++ b/Core.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9baba017b10fa4eaeab33dade1902adb +folderAsset: yes +timeCreated: 1481925241 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/.gitignore b/Core/.gitignore new file mode 100644 index 0000000..71080b5 --- /dev/null +++ b/Core/.gitignore @@ -0,0 +1,2 @@ +# exlude obj.meta created by documentation creation +obj.meta diff --git a/Core/Plugins.meta b/Core/Plugins.meta new file mode 100644 index 0000000..3489c7a --- /dev/null +++ b/Core/Plugins.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 59e7e6a60c29840a5b9d84b2ee53671a +folderAsset: yes +timeCreated: 1491243030 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Android.meta b/Core/Plugins/Android.meta new file mode 100644 index 0000000..e4128b6 --- /dev/null +++ b/Core/Plugins/Android.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e191eb758d41cba41b7f997ada0d41eb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Android/UniAndroidPermission.meta b/Core/Plugins/Android/UniAndroidPermission.meta new file mode 100644 index 0000000..c581b47 --- /dev/null +++ b/Core/Plugins/Android/UniAndroidPermission.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 4aa6de0d65164fe48a9b01246c856fc8 +folderAsset: yes +timeCreated: 1521070590 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Android/UniAndroidPermission/AndroidManifest-uniRP.xml b/Core/Plugins/Android/UniAndroidPermission/AndroidManifest-uniRP.xml new file mode 100644 index 0000000..4aa919a --- /dev/null +++ b/Core/Plugins/Android/UniAndroidPermission/AndroidManifest-uniRP.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/Core/Plugins/Android/UniAndroidPermission/AndroidManifest-uniRP.xml.meta b/Core/Plugins/Android/UniAndroidPermission/AndroidManifest-uniRP.xml.meta new file mode 100644 index 0000000..cb3e6e4 --- /dev/null +++ b/Core/Plugins/Android/UniAndroidPermission/AndroidManifest-uniRP.xml.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9a957c06543b147a1b950f050282d728 +timeCreated: 1458403910 +licenseType: Free +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission.cs b/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission.cs new file mode 100644 index 0000000..245b067 --- /dev/null +++ b/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission.cs @@ -0,0 +1,111 @@ +using System; +using UnityEngine; + +public class UniAndroidPermission : MonoBehaviour +{ + const string PackageName = "net.sanukin.PermissionManager"; + + static Action onAllowCallback; + static Action onDenyCallback; + static Action onDenyAndNeverAskAgainCallback; + + void Awake() + { + DontDestroyOnLoad(gameObject); + } + + public static bool IsPermitted(AndroidPermission permission) + { +#if !UNITY_EDITOR && UNITY_ANDROID + using (var permissionManager = new AndroidJavaClass(PackageName)) + { + return permissionManager.CallStatic("hasPermission", GetPermittionStr(permission)); + } +#else + return true; +#endif + } + + public static void RequestPermission(AndroidPermission permission, Action onAllow = null, Action onDeny = null, Action onDenyAndNeverAskAgain = null) + { +#if !UNITY_EDITOR && UNITY_ANDROID + using (var permissionManager = new AndroidJavaClass(PackageName)) + { + permissionManager.CallStatic("requestPermission", GetPermittionStr(permission)); + onAllowCallback = onAllow; + onDenyCallback = onDeny; + onDenyAndNeverAskAgainCallback = onDenyAndNeverAskAgain; + } +#else + Debug.LogWarning("UniAndroidPermission works only Androud Devices."); +#endif + } + + private static string GetPermittionStr(AndroidPermission permittion) + { + return "android.permission." + permittion.ToString(); + } + + private void OnAllow() + { + if (onAllowCallback != null) + { + onAllowCallback(); + } + ResetAllCallBacks(); + } + + private void OnDeny() + { + if (onDenyCallback != null) + { + onDenyCallback(); + } + ResetAllCallBacks(); + } + + private void OnDenyAndNeverAskAgain() + { + if (onDenyAndNeverAskAgainCallback != null) + { + onDenyAndNeverAskAgainCallback(); + } + ResetAllCallBacks(); + } + + private void ResetAllCallBacks(){ + onAllowCallback = null; + onDenyCallback = null; + onDenyAndNeverAskAgainCallback = null; + } +} + +// Protection level: dangerous permissions 2015/11/25 +// http://developer.android.com/intl/ja/reference/android/Manifest.permission.html +public enum AndroidPermission +{ + ACCESS_COARSE_LOCATION, + ACCESS_FINE_LOCATION, + ADD_VOICEMAIL, + BODY_SENSORS, + CALL_PHONE, + CAMERA, + GET_ACCOUNTS, + PROCESS_OUTGOING_CALLS, + READ_CALENDAR, + READ_CALL_LOG, + READ_CONTACTS, + READ_EXTERNAL_STORAGE, + READ_PHONE_STATE, + READ_SMS, + RECEIVE_MMS, + RECEIVE_SMS, + RECEIVE_WAP_PUSH, + RECORD_AUDIO, + SEND_SMS, + USE_SIP, + WRITE_CALENDAR, + WRITE_CALL_LOG, + WRITE_CONTACTS, + WRITE_EXTERNAL_STORAGE +} diff --git a/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission.cs.meta b/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission.cs.meta new file mode 100644 index 0000000..245fad8 --- /dev/null +++ b/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7df6f555c4d344871bf935752b861a45 +timeCreated: 1448444718 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission.prefab b/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission.prefab new file mode 100644 index 0000000..ffbe304 --- /dev/null +++ b/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission.prefab @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &134968 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 408032} + - component: {fileID: 11480548} + m_Layer: 0 + m_Name: UniAndroidPermission + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &408032 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 134968} + 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 &11480548 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 134968} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7df6f555c4d344871bf935752b861a45, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !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: 134968} + m_IsPrefabParent: 1 diff --git a/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission.prefab.meta b/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission.prefab.meta new file mode 100644 index 0000000..0e191e2 --- /dev/null +++ b/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a83b9ab9f1dc0439fa3caaf9912be67d +timeCreated: 1448447048 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission_v1_2.jar b/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission_v1_2.jar new file mode 100644 index 0000000..e8e9374 Binary files /dev/null and b/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission_v1_2.jar differ diff --git a/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission_v1_2.jar.meta b/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission_v1_2.jar.meta new file mode 100644 index 0000000..43c98c7 --- /dev/null +++ b/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission_v1_2.jar.meta @@ -0,0 +1,31 @@ +fileFormatVersion: 2 +guid: d6467263296c74b919030e7bfae469ca +timeCreated: 1516304615 +licenseType: Pro +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Android: Android + second: + enabled: 1 + settings: {} + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Android/mapbox-android-core-5.0.2.aar b/Core/Plugins/Android/mapbox-android-core-5.0.2.aar new file mode 100644 index 0000000..158ecc8 Binary files /dev/null and b/Core/Plugins/Android/mapbox-android-core-5.0.2.aar differ diff --git a/Core/Plugins/Android/mapbox-android-core-5.0.2.aar.meta b/Core/Plugins/Android/mapbox-android-core-5.0.2.aar.meta new file mode 100644 index 0000000..79a5eae --- /dev/null +++ b/Core/Plugins/Android/mapbox-android-core-5.0.2.aar.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: ca612e075d0834fd7bc292f91065077c +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Android: Android + second: + enabled: 1 + settings: {} + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Android/mapbox-android-telemetry-8.1.5.aar b/Core/Plugins/Android/mapbox-android-telemetry-8.1.5.aar new file mode 100644 index 0000000..99a0a38 Binary files /dev/null and b/Core/Plugins/Android/mapbox-android-telemetry-8.1.5.aar differ diff --git a/Core/Plugins/Android/mapbox-android-telemetry-8.1.5.aar.meta b/Core/Plugins/Android/mapbox-android-telemetry-8.1.5.aar.meta new file mode 100644 index 0000000..a0385f5 --- /dev/null +++ b/Core/Plugins/Android/mapbox-android-telemetry-8.1.5.aar.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: 47b0d1b4b61fc49f390843172d421aef +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Android: Android + second: + enabled: 1 + settings: {} + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Mapbox.meta b/Core/Plugins/Mapbox.meta new file mode 100644 index 0000000..0d769c9 --- /dev/null +++ b/Core/Plugins/Mapbox.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2a5f99af2ce83514f822383e20066c54 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Mapbox/MapboxAccounts.meta b/Core/Plugins/Mapbox/MapboxAccounts.meta new file mode 100644 index 0000000..53df8ad --- /dev/null +++ b/Core/Plugins/Mapbox/MapboxAccounts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 379fde954e5274342ba547171ed89a78 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Mapbox/MapboxAccounts/net35.meta b/Core/Plugins/Mapbox/MapboxAccounts/net35.meta new file mode 100644 index 0000000..b9f880e --- /dev/null +++ b/Core/Plugins/Mapbox/MapboxAccounts/net35.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: f957f1079856147339d60a82ed5500b5 +folderAsset: yes +timeCreated: 1567722208 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Mapbox/MapboxAccounts/net35/MapboxAccountsUnity.dll b/Core/Plugins/Mapbox/MapboxAccounts/net35/MapboxAccountsUnity.dll new file mode 100644 index 0000000..f683315 Binary files /dev/null and b/Core/Plugins/Mapbox/MapboxAccounts/net35/MapboxAccountsUnity.dll differ diff --git a/Core/Plugins/Mapbox/MapboxAccounts/net35/MapboxAccountsUnity.dll.meta b/Core/Plugins/Mapbox/MapboxAccounts/net35/MapboxAccountsUnity.dll.meta new file mode 100644 index 0000000..44494f5 --- /dev/null +++ b/Core/Plugins/Mapbox/MapboxAccounts/net35/MapboxAccountsUnity.dll.meta @@ -0,0 +1,112 @@ +fileFormatVersion: 2 +guid: a4d62bb9038704a8c84da77840aa84d1 +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: 0 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 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: 1 + 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: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - 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: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Mapbox/MapboxAccounts/net4x.meta b/Core/Plugins/Mapbox/MapboxAccounts/net4x.meta new file mode 100644 index 0000000..7cc0e7b --- /dev/null +++ b/Core/Plugins/Mapbox/MapboxAccounts/net4x.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: cc3724da731c645189d6f773016d164e +folderAsset: yes +timeCreated: 1567722324 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Mapbox/MapboxAccounts/net4x/MapboxAccountsUnity.dll b/Core/Plugins/Mapbox/MapboxAccounts/net4x/MapboxAccountsUnity.dll new file mode 100644 index 0000000..dd44c12 Binary files /dev/null and b/Core/Plugins/Mapbox/MapboxAccounts/net4x/MapboxAccountsUnity.dll differ diff --git a/Core/Plugins/Mapbox/MapboxAccounts/net4x/MapboxAccountsUnity.dll.meta b/Core/Plugins/Mapbox/MapboxAccounts/net4x/MapboxAccountsUnity.dll.meta new file mode 100644 index 0000000..83c0158 --- /dev/null +++ b/Core/Plugins/Mapbox/MapboxAccounts/net4x/MapboxAccountsUnity.dll.meta @@ -0,0 +1,116 @@ +fileFormatVersion: 2 +guid: 8d4cadd22d7994af2ae2a249b9d2a913 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux: 0 + Exclude Linux64: 0 + Exclude LinuxUniversal: 0 + Exclude OSXUniversal: 0 + Exclude WebGL: 0 + Exclude Win: 0 + Exclude Win64: 0 + Exclude iOS: 0 + - first: + Android: Android + second: + enabled: 1 + 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: 1 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 1 + settings: {} + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + WebGL: WebGL + second: + enabled: 1 + settings: {} + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 1 + settings: + AddToEmbeddedBinaries: false + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Mapbox/vector-tile-cs.meta b/Core/Plugins/Mapbox/vector-tile-cs.meta new file mode 100644 index 0000000..99e8e9d --- /dev/null +++ b/Core/Plugins/Mapbox/vector-tile-cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5bf0a0cf94d3de74c8fe0a4ad76cfa8f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Mapbox/vector-tile-cs/net46.meta b/Core/Plugins/Mapbox/vector-tile-cs/net46.meta new file mode 100644 index 0000000..747a3b3 --- /dev/null +++ b/Core/Plugins/Mapbox/vector-tile-cs/net46.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cf3b967d3d4405a4093e868e0440cf8a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.ExtensionMethods.dll b/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.ExtensionMethods.dll new file mode 100644 index 0000000..9f27d27 Binary files /dev/null and b/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.ExtensionMethods.dll differ diff --git a/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.ExtensionMethods.dll.meta b/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.ExtensionMethods.dll.meta new file mode 100644 index 0000000..7051eef --- /dev/null +++ b/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.ExtensionMethods.dll.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: c864373fac3727545b44f740cc59abab +timeCreated: 18446744011573954816 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 0 + Exclude Linux: 0 + Exclude Linux64: 0 + Exclude LinuxUniversal: 0 + Exclude OSXUniversal: 0 + Exclude WebGL: 0 + Exclude Win: 0 + Exclude Win64: 0 + Exclude WindowsStoreApps: 1 + Exclude iOS: 0 + - first: + Android: Android + second: + enabled: 1 + settings: {} + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 1 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + WebGL: WebGL + second: + enabled: 1 + settings: {} + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.Geometry.dll b/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.Geometry.dll new file mode 100644 index 0000000..c63dd97 Binary files /dev/null and b/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.Geometry.dll differ diff --git a/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.Geometry.dll.meta b/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.Geometry.dll.meta new file mode 100644 index 0000000..624d68c --- /dev/null +++ b/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.Geometry.dll.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 902ec3a15243ce7459db8517c8de3f12 +timeCreated: 18446744011573954816 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 0 + Exclude Linux: 0 + Exclude Linux64: 0 + Exclude LinuxUniversal: 0 + Exclude OSXUniversal: 0 + Exclude WebGL: 0 + Exclude Win: 0 + Exclude Win64: 0 + Exclude WindowsStoreApps: 1 + Exclude iOS: 0 + - first: + Android: Android + second: + enabled: 1 + settings: {} + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 1 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + WebGL: WebGL + second: + enabled: 1 + settings: {} + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.PbfReader.dll b/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.PbfReader.dll new file mode 100644 index 0000000..43a24a4 Binary files /dev/null and b/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.PbfReader.dll differ diff --git a/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.PbfReader.dll.meta b/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.PbfReader.dll.meta new file mode 100644 index 0000000..fccb1a4 --- /dev/null +++ b/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.PbfReader.dll.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 34fcb52f9df13934786c32587147e4a0 +timeCreated: 18446744011573954816 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 0 + Exclude Linux: 0 + Exclude Linux64: 0 + Exclude LinuxUniversal: 0 + Exclude OSXUniversal: 0 + Exclude WebGL: 0 + Exclude Win: 0 + Exclude Win64: 0 + Exclude WindowsStoreApps: 1 + Exclude iOS: 0 + - first: + Android: Android + second: + enabled: 1 + settings: {} + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 1 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + WebGL: WebGL + second: + enabled: 1 + settings: {} + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.VectorTileReader.dll b/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.VectorTileReader.dll new file mode 100644 index 0000000..bc1e8ff Binary files /dev/null and b/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.VectorTileReader.dll differ diff --git a/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.VectorTileReader.dll.meta b/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.VectorTileReader.dll.meta new file mode 100644 index 0000000..58dd434 --- /dev/null +++ b/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.VectorTileReader.dll.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 57cd912f9e6427a44ac217871c381c40 +timeCreated: 18446744011573954816 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 0 + Exclude Linux: 0 + Exclude Linux64: 0 + Exclude LinuxUniversal: 0 + Exclude OSXUniversal: 0 + Exclude WebGL: 0 + Exclude Win: 0 + Exclude Win64: 0 + Exclude WindowsStoreApps: 1 + Exclude iOS: 0 + - first: + Android: Android + second: + enabled: 1 + settings: {} + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 1 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + WebGL: WebGL + second: + enabled: 1 + settings: {} + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10.meta b/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10.meta new file mode 100644 index 0000000..3c92cd2 --- /dev/null +++ b/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 97ce4689e1585a044b7e4dffd6bbc56c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.ExtensionMethods.dll b/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.ExtensionMethods.dll new file mode 100644 index 0000000..918eb94 Binary files /dev/null and b/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.ExtensionMethods.dll differ diff --git a/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.ExtensionMethods.dll.meta b/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.ExtensionMethods.dll.meta new file mode 100644 index 0000000..9957370 --- /dev/null +++ b/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.ExtensionMethods.dll.meta @@ -0,0 +1,93 @@ +fileFormatVersion: 2 +guid: aa8511f503d809c42a273bde2c2f2021 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + 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 WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude WindowsStoreApps: 0 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 1 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.Geometry.dll b/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.Geometry.dll new file mode 100644 index 0000000..3f69e54 Binary files /dev/null and b/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.Geometry.dll differ diff --git a/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.Geometry.dll.meta b/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.Geometry.dll.meta new file mode 100644 index 0000000..ca3f26e --- /dev/null +++ b/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.Geometry.dll.meta @@ -0,0 +1,105 @@ +fileFormatVersion: 2 +guid: 752172c26201c084c8526c6e9a837897 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + 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 WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude WindowsStoreApps: 0 + - 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: None + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 1 + settings: + CPU: AnyCPU + DontProcess: false + PlaceholderPath: Assets/Mapbox/Core/Plugins/Mapbox/vector-tile-cs/net46/Mapbox.VectorTile.Geometry.dll + SDK: AnySDK + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.PbfReader.dll b/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.PbfReader.dll new file mode 100644 index 0000000..308efa4 Binary files /dev/null and b/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.PbfReader.dll differ diff --git a/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.PbfReader.dll.meta b/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.PbfReader.dll.meta new file mode 100644 index 0000000..a261da2 --- /dev/null +++ b/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.PbfReader.dll.meta @@ -0,0 +1,93 @@ +fileFormatVersion: 2 +guid: 11d5b9a726730e34ea222ff8e6b1def9 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + 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 WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude WindowsStoreApps: 0 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 1 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.VectorTileReader.dll b/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.VectorTileReader.dll new file mode 100644 index 0000000..ed33611 Binary files /dev/null and b/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.VectorTileReader.dll differ diff --git a/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.VectorTileReader.dll.meta b/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.VectorTileReader.dll.meta new file mode 100644 index 0000000..574e652 --- /dev/null +++ b/Core/Plugins/Mapbox/vector-tile-cs/portable-net45+uap10/Mapbox.VectorTile.VectorTileReader.dll.meta @@ -0,0 +1,93 @@ +fileFormatVersion: 2 +guid: ea87c215fce9c204abdb685f22703bd0 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + 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 WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude WindowsStoreApps: 0 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 1 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/ThirdParty.meta b/Core/Plugins/ThirdParty.meta new file mode 100644 index 0000000..848e350 --- /dev/null +++ b/Core/Plugins/ThirdParty.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c104ec983f3ab8449b282d2575d121be +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/ThirdParty/Mapbox.IO.Compression.meta b/Core/Plugins/ThirdParty/Mapbox.IO.Compression.meta new file mode 100644 index 0000000..467d11e --- /dev/null +++ b/Core/Plugins/ThirdParty/Mapbox.IO.Compression.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d48f48be6a9fdf541a5f1be3255c1fab +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/ThirdParty/Mapbox.IO.Compression/net35.meta b/Core/Plugins/ThirdParty/Mapbox.IO.Compression/net35.meta new file mode 100644 index 0000000..695e390 --- /dev/null +++ b/Core/Plugins/ThirdParty/Mapbox.IO.Compression/net35.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 24c715a612ec20a42a86ac2009f2abb7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/ThirdParty/Mapbox.IO.Compression/net35/Mapbox.IO.Compression.dll b/Core/Plugins/ThirdParty/Mapbox.IO.Compression/net35/Mapbox.IO.Compression.dll new file mode 100644 index 0000000..bc7328d Binary files /dev/null and b/Core/Plugins/ThirdParty/Mapbox.IO.Compression/net35/Mapbox.IO.Compression.dll differ diff --git a/Core/Plugins/ThirdParty/Mapbox.IO.Compression/net35/Mapbox.IO.Compression.dll.meta b/Core/Plugins/ThirdParty/Mapbox.IO.Compression/net35/Mapbox.IO.Compression.dll.meta new file mode 100644 index 0000000..f00e32e --- /dev/null +++ b/Core/Plugins/ThirdParty/Mapbox.IO.Compression/net35/Mapbox.IO.Compression.dll.meta @@ -0,0 +1,133 @@ +fileFormatVersion: 2 +guid: 5702dec8310c4074e984765a688fa0d2 +timeCreated: 1489780328 +licenseType: Pro +PluginImporter: + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + data: + first: + Android: Android + second: + enabled: 1 + settings: + CPU: AnyCPU + data: + first: + Any: + second: + enabled: 0 + settings: {} + data: + first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + data: + first: + Facebook: WebGL + second: + enabled: 1 + settings: {} + data: + first: + Facebook: Win + second: + enabled: 1 + settings: + CPU: AnyCPU + data: + first: + Facebook: Win64 + second: + enabled: 1 + settings: + CPU: AnyCPU + data: + first: + Standalone: Linux + second: + enabled: 1 + settings: + CPU: x86 + data: + first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: x86_64 + data: + first: + Standalone: LinuxUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + data: + first: + Standalone: OSXIntel + second: + enabled: 1 + settings: + CPU: AnyCPU + data: + first: + Standalone: OSXIntel64 + second: + enabled: 1 + settings: + CPU: AnyCPU + data: + first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + data: + first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: AnyCPU + data: + first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: AnyCPU + data: + first: + WebGL: WebGL + second: + enabled: 1 + settings: {} + data: + first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + data: + first: + iPhone: iOS + second: + enabled: 1 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/ThirdParty/Mapbox.IO.Compression/uap10.meta b/Core/Plugins/ThirdParty/Mapbox.IO.Compression/uap10.meta new file mode 100644 index 0000000..46e00ae --- /dev/null +++ b/Core/Plugins/ThirdParty/Mapbox.IO.Compression/uap10.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fcefe66a47d635d4e80cca2549f55493 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/ThirdParty/Mapbox.IO.Compression/uap10/Mapbox.IO.Compression.dll b/Core/Plugins/ThirdParty/Mapbox.IO.Compression/uap10/Mapbox.IO.Compression.dll new file mode 100644 index 0000000..cd7f7ba Binary files /dev/null and b/Core/Plugins/ThirdParty/Mapbox.IO.Compression/uap10/Mapbox.IO.Compression.dll differ diff --git a/Core/Plugins/ThirdParty/Mapbox.IO.Compression/uap10/Mapbox.IO.Compression.dll.meta b/Core/Plugins/ThirdParty/Mapbox.IO.Compression/uap10/Mapbox.IO.Compression.dll.meta new file mode 100644 index 0000000..2962b55 --- /dev/null +++ b/Core/Plugins/ThirdParty/Mapbox.IO.Compression/uap10/Mapbox.IO.Compression.dll.meta @@ -0,0 +1,100 @@ +fileFormatVersion: 2 +guid: ce2a229872b27d142b0962c2e5e2ebc2 +timeCreated: 1490036479 +licenseType: Pro +PluginImporter: + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + data: + first: + Any: + second: + enabled: 0 + settings: {} + data: + first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + data: + first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + data: + first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + data: + first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: x86 + data: + first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: x86_64 + data: + first: + Standalone: OSXIntel + second: + enabled: 0 + settings: + CPU: AnyCPU + data: + first: + Standalone: OSXIntel64 + second: + enabled: 0 + settings: + CPU: AnyCPU + data: + first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + data: + first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + data: + first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 1 + settings: + CPU: AnyCPU + data: + first: + iPhone: iOS + second: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/ThirdParty/Mapbox.Json.meta b/Core/Plugins/ThirdParty/Mapbox.Json.meta new file mode 100644 index 0000000..05b8c31 --- /dev/null +++ b/Core/Plugins/ThirdParty/Mapbox.Json.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bdaa6d5093c737940a8a9f76e2c9e5ce +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/ThirdParty/Mapbox.Json/Net35.meta b/Core/Plugins/ThirdParty/Mapbox.Json/Net35.meta new file mode 100644 index 0000000..07a6ae9 --- /dev/null +++ b/Core/Plugins/ThirdParty/Mapbox.Json/Net35.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d1e6581f49522654daece42d507c423d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/ThirdParty/Mapbox.Json/Net35/Mapbox.Json.dll b/Core/Plugins/ThirdParty/Mapbox.Json/Net35/Mapbox.Json.dll new file mode 100644 index 0000000..4d03b8a Binary files /dev/null and b/Core/Plugins/ThirdParty/Mapbox.Json/Net35/Mapbox.Json.dll differ diff --git a/Core/Plugins/ThirdParty/Mapbox.Json/Net35/Mapbox.Json.dll.meta b/Core/Plugins/ThirdParty/Mapbox.Json/Net35/Mapbox.Json.dll.meta new file mode 100644 index 0000000..db44d22 --- /dev/null +++ b/Core/Plugins/ThirdParty/Mapbox.Json/Net35/Mapbox.Json.dll.meta @@ -0,0 +1,70 @@ +fileFormatVersion: 2 +guid: 5c4fdb215216a4b30aa29f0fa1b4ab1d +timeCreated: 1489780328 +licenseType: Pro +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 1 + settings: + CPU: x86 + Android: + enabled: 1 + settings: + CPU: AnyCPU + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + WebGL: + enabled: 1 + settings: {} + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 1 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + iOS: + enabled: 1 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/ThirdParty/Mapbox.Json/Portable.meta b/Core/Plugins/ThirdParty/Mapbox.Json/Portable.meta new file mode 100644 index 0000000..db5cca2 --- /dev/null +++ b/Core/Plugins/ThirdParty/Mapbox.Json/Portable.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 21756548d9556494f90734f953cd7fcf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/ThirdParty/Mapbox.Json/Portable/Mapbox.Json.dll b/Core/Plugins/ThirdParty/Mapbox.Json/Portable/Mapbox.Json.dll new file mode 100644 index 0000000..1e140a0 Binary files /dev/null and b/Core/Plugins/ThirdParty/Mapbox.Json/Portable/Mapbox.Json.dll differ diff --git a/Core/Plugins/ThirdParty/Mapbox.Json/Portable/Mapbox.Json.dll.meta b/Core/Plugins/ThirdParty/Mapbox.Json/Portable/Mapbox.Json.dll.meta new file mode 100644 index 0000000..f530498 --- /dev/null +++ b/Core/Plugins/ThirdParty/Mapbox.Json/Portable/Mapbox.Json.dll.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 17a28c5bac36f4e7bbf6e500e16cf2f3 +timeCreated: 1490036479 +licenseType: Pro +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: AnyCPU + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/iOS.meta b/Core/Plugins/iOS.meta new file mode 100644 index 0000000..6591da8 --- /dev/null +++ b/Core/Plugins/iOS.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9e8a419c652caf246ad3b669af2971f6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/iOS/MapboxMetricsClient.m b/Core/Plugins/iOS/MapboxMetricsClient.m new file mode 100644 index 0000000..cb5ed5c --- /dev/null +++ b/Core/Plugins/iOS/MapboxMetricsClient.m @@ -0,0 +1,18 @@ +#import + +void initialize(const char* accessToken, const char* userAgentBase, const char* hostSDKVersion) { + [[MMEEventsManager sharedManager] initializeWithAccessToken:[NSString stringWithUTF8String:accessToken] + userAgentBase:[NSString stringWithUTF8String:userAgentBase] + hostSDKVersion:[NSString stringWithUTF8String:hostSDKVersion]]; +} + +void sendTurnstileEvent() { + [[MMEEventsManager sharedManager] sendTurnstileEvent]; +} + +void setLocationCollectionState(bool enable) { + [MMEEventsManager sharedManager].metricsEnabled = enable; +} +void setSkuId(const char* skuId){ + [MMEEventsManager sharedManager].skuId = [NSString stringWithUTF8String:skuId]; +} diff --git a/Core/Plugins/iOS/MapboxMetricsClient.m.meta b/Core/Plugins/iOS/MapboxMetricsClient.m.meta new file mode 100644 index 0000000..30936fb --- /dev/null +++ b/Core/Plugins/iOS/MapboxMetricsClient.m.meta @@ -0,0 +1,26 @@ +fileFormatVersion: 2 +guid: 4172b185b7b5c4f4ab2f6d7bd134ea29 +timeCreated: 1495158819 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + data: + enabled: 0 + settings: {} + iOS: + enabled: 1 + settings: {} + tvOS: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/iOS/MapboxMobileEvents.meta b/Core/Plugins/iOS/MapboxMobileEvents.meta new file mode 100644 index 0000000..3158b41 --- /dev/null +++ b/Core/Plugins/iOS/MapboxMobileEvents.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 3fd6399794525486eb643e088be91043 +folderAsset: yes +timeCreated: 1570559658 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/iOS/MapboxMobileEvents/include.meta b/Core/Plugins/iOS/MapboxMobileEvents/include.meta new file mode 100644 index 0000000..38bd597 --- /dev/null +++ b/Core/Plugins/iOS/MapboxMobileEvents/include.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: e7e2d4a394d304e08bdabe8230a7df35 +folderAsset: yes +timeCreated: 1570559763 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents.meta b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents.meta new file mode 100644 index 0000000..71f9c92 --- /dev/null +++ b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 942001b48b74c4874a534a287e791e27 +folderAsset: yes +timeCreated: 1570559763 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMEConstants.h b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMEConstants.h new file mode 100644 index 0000000..a3f3b3d --- /dev/null +++ b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMEConstants.h @@ -0,0 +1,197 @@ +#import +#import "MMETypes.h" + +extern NSString * const MMEAPIClientBaseURL; +extern NSString * const MMEAPIClientBaseAPIURL; +extern NSString * const MMEAPIClientBaseChinaEventsURL; +extern NSString * const MMEAPIClientBaseChinaAPIURL; +extern NSString * const MMEAPIClientEventsPath; +extern NSString * const MMEAPIClientEventsConfigPath; +extern NSString * const MMEAPIClientAttachmentsPath; +extern NSString * const MMEAPIClientHeaderFieldUserAgentKey; +extern NSString * const MMEAPIClientHeaderFieldContentTypeKey; +extern NSString * const MMEAPIClientHeaderFieldContentTypeValue; +extern NSString * const MMEAPIClientAttachmentsHeaderFieldContentTypeValue; +extern NSString * const MMEAPIClientHeaderFieldContentEncodingKey; +extern NSString * const MMEAPIClientHTTPMethodPost; +extern NSString * const MMEAPIClientHTTPMethodGet; + +// Debug types +extern NSString * const MMEDebugEventType; +extern NSString * const MMEDebugEventTypeError; +extern NSString * const MMEDebugEventTypeFlush; +extern NSString * const MMEDebugEventTypePush; +extern NSString * const MMEDebugEventTypePost; +extern NSString * const MMEDebugEventTypePostFailed; +extern NSString * const MMEDebugEventTypeTurnstile; +extern NSString * const MMEDebugEventTypeTurnstileFailed; +extern NSString * const MMEDebugEventTypeBackgroundTask; +extern NSString * const MMEDebugEventTypeMetricCollection; +extern NSString * const MMEDebugEventTypeLocationManager; +extern NSString * const MMEDebugEventTypeTelemetryMetrics; +extern NSString * const MMEDebugEventTypeCertPinning; + +// Event types +extern NSString * const MMEEventTypeAppUserTurnstile; +extern NSString * const MMEEventTypeTelemetryMetrics; +extern NSString * const MMEEventTypeMapLoad; +extern NSString * const MMEEventTypeLocation; +extern NSString * const MMEEventTypeVisit; +extern NSString * const MMEEventTypeLocalDebug; +extern NSString * const MMEventTypeOfflineDownloadStart; +extern NSString * const MMEventTypeOfflineDownloadEnd; + +// Event keys +extern NSString * const MMEEventKeyArrivalDate; +extern NSString * const MMEEventKeyDepartureDate; +extern NSString * const MMEEventKeyLatitude; +extern NSString * const MMEEventKeyLongitude; +extern NSString * const MMEEventKeyZoomLevel; +extern NSString * const MMEEventKeyMaxZoomLevel; +extern NSString * const MMEEventKeyMinZoomLevel; +extern NSString * const MMEEventKeyEvent; +extern NSString * const MMEEventKeyCreated; +extern NSString * const MMEEventKeyStyleURL; +extern NSString * const MMEEventKeyVendorId; +extern NSString * const MMEEventKeyModel; +extern NSString * const MMEEventKeyDevice; +extern NSString * const MMEEventKeySkuId; +extern NSString * const MMEEventKeyEnabledTelemetry; +extern NSString * const MMEEventKeyOperatingSystem; +extern NSString * const MMEEventKeyResolution; +extern NSString * const MMEEventKeyAccessibilityFontScale; +extern NSString * const MMEEventKeyOrientation; +extern NSString * const MMEEventKeyPluggedIn; +extern NSString * const MMEEventKeyWifi; +extern NSString * const MMEEventKeyShapeForOfflineRegion; +extern NSString * const MMEEventKeySource; +extern NSString * const MMEEventKeySessionId; +extern NSString * const MMEEventKeyApplicationState; +extern NSString * const MMEEventKeyAltitude; +extern NSString * const MMEEventKeyLocationAuthorization; +extern NSString * const MMEEventKeyLocationEnabled; +extern NSString * const MMEEventHorizontalAccuracy; +extern NSString * const MMEEventSDKIdentifier; +extern NSString * const MMEEventSDKVersion; +extern NSString * const MMEEventKeyLocalDebugDescription; +extern NSString * const MMEEventKeyErrorCode; +extern NSString * const MMEEventKeyErrorDomain; +extern NSString * const MMEEventKeyErrorDescription; +extern NSString * const MMEEventKeyErrorFailureReason; +extern NSString * const MMEEventKeyErrorNoReason; +extern NSString * const MMEEventKeyErrorNoDomain; +extern NSString * const MMEEventKeyFailedRequests; +extern NSString * const MMEEventKeyHeader; +extern NSString * const MMEEventKeyPlatform; +extern NSString * const MMEEventKeyUserAgent; +extern NSString * const MMEEventKeyiOS; +extern NSString * const MMEEventKeyMac; +extern NSString * const MMENavigationEventPrefix; +extern NSString * const MMEVisionEventPrefix; +extern NSString * const MMEEventTypeNavigationDepart; +extern NSString * const MMEEventTypeNavigationArrive; +extern NSString * const MMEEventTypeNavigationCancel; +extern NSString * const MMEEventTypeNavigationFeedback; +extern NSString * const MMEEventTypeNavigationReroute; +extern NSString * const MMEventTypeNavigationCarplayConnect; +extern NSString * const MMEventTypeNavigationCarplayDisconnect; +extern NSString * const MMEEventTypeSearchSelected; +extern NSString * const MMEEventTypeSearchFeedback; +extern NSString * const MMESearchEventPrefix; +extern NSString * const MMEEventDateUTC; +extern NSString * const MMEEventRequests; +extern NSString * const MMEEventTotalDataSent; +extern NSString * const MMEEventCellDataSent; +extern NSString * const MMEEventWiFiDataSent; +extern NSString * const MMEEventTotalDataReceived; +extern NSString * const MMEEventCellDataReceived; +extern NSString * const MMEEventWiFiDataReceived; +extern NSString * const MMEEventAppWakeups; +extern NSString * const MMEEventEventCountPerType; +extern NSString * const MMEEventEventCountFailed; +extern NSString * const MMEEventEventCountTotal; +extern NSString * const MMEEventEventCountMax; +extern NSString * const MMEEventDeviceLat; +extern NSString * const MMEEventDeviceLon; +extern NSString * const MMEEventDeviceTimeDrift; +extern NSString * const MMEEventConfigResponse; +extern NSString * const MMEEventStatusDenied; +extern NSString * const MMEEventStatusRestricted; +extern NSString * const MMEEventStatusNotDetermined; +extern NSString * const MMEEventStatusAuthorizedAlways; +extern NSString * const MMEEventStatusAuthorizedWhenInUse; +extern NSString * const MMEEventUnknown; + +extern NSString * const MMEResponseKey; + +/*! @brief SDK event source */ +extern NSString * const MMEEventSource; + +#pragma mark - mobile.crash Keys + +extern NSString * const MMEEventMobileCrash; +extern NSString * const MMEEventKeyOSVersion; +extern NSString * const MMEEventKeyBuildType; +extern NSString * const MMEEventKeyIsSilentCrash; +extern NSString * const MMEEventKeyStackTrace; +extern NSString * const MMEEventKeyStackTraceHash; +extern NSString * const MMEEventKeyInstallationId; +extern NSString * const MMEEventKeyThreadDetails; +extern NSString * const MMEEventKeyAppId; +extern NSString * const MMEEventKeyAppVersion; +extern NSString * const MMEEventKeyAppStartDate; +extern NSString * const MMEEventKeyCustomData; + +#pragma mark - MMEErrorDomain + +/*! @brief NSErrorDomain for MapboxMobileEvents */ +extern NSErrorDomain const MMEErrorDomain; + +/*! @brief MMEErrorDomain Error Numbers + - MMENoError: No Error + - MMEErrorException for exceptions + - MMEErrorEventInit for errors when initlizing events + - MMEErrorEventInitMissingKey if the event attributes dictionary does not include the event key, + - MMEErrorEventInitException if an exception occured durring initWithAttributes:error:, + - MMEErrorEventInitInvalid if the provided eventAttributes cannot be converted to JSON objects +*/ +typedef NS_ENUM(NSInteger, MMEErrorNumber) { + MMENoError = 0, + MMEErrorException = 10001, + MMEErrorEventInit = 10002, + MMEErrorEventInitMissingKey = 10003, + MMEErrorEventInitException = 10004, + MMEErrorEventInitInvalid = 10005, + MMEErrorEventEncoding = 10006, + MMEErrorEventCounting = 10007 +}; + +/*! @brief key for MMEErrorEventInit userInfo dictionary containing the attributes which failed to create the event */ +extern NSString * const MMEErrorEventAttributesKey; + +/*! @brief key for MMEErrorDomain userInfo dictionary containing the underlying exception which triggered the error */ +extern NSString * const MMEErrorUnderlyingExceptionKey; + +#pragma mark - Deprecated + +extern NSString * const MMEErrorDescriptionKey; MME_DEPRECATED_MSG("Use NSLocalizedDescriptionKey") + +extern NSString * const MMEEventKeyVendorID MME_DEPRECATED_MSG("Use MMEEventKeyVendorId"); +extern NSString * const MMEEventKeyInstallationID MME_DEPRECATED_MSG("Use MMEEventKeyInstallationId"); +extern NSString * const MMEEventKeyAppID MME_DEPRECATED_MSG("Use MMEEventKeyInstallationId"); + +extern NSString * const MMELoggerHTML MME_DEPRECATED; +extern NSString * const MMELoggerShareableHTML MME_DEPRECATED; + +extern NSString * const MMEEventKeyGestureId MME_DEPRECATED; +extern NSString * const MMEEventKeyGestureID MME_DEPRECATED; +extern NSString * const MMEEventGestureSingleTap MME_DEPRECATED; +extern NSString * const MMEEventGestureDoubleTap MME_DEPRECATED; +extern NSString * const MMEEventGestureTwoFingerSingleTap MME_DEPRECATED; +extern NSString * const MMEEventGestureQuickZoom MME_DEPRECATED; +extern NSString * const MMEEventGesturePanStart MME_DEPRECATED; +extern NSString * const MMEEventGesturePinchStart MME_DEPRECATED; +extern NSString * const MMEEventGestureRotateStart MME_DEPRECATED; +extern NSString * const MMEEventGesturePitchStart MME_DEPRECATED; +extern NSString * const MMEEventTypeMapTap MME_DEPRECATED; +extern NSString * const MMEEventTypeMapDragEnd MME_DEPRECATED; diff --git a/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMEConstants.h.meta b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMEConstants.h.meta new file mode 100644 index 0000000..5d663a6 --- /dev/null +++ b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMEConstants.h.meta @@ -0,0 +1,26 @@ +fileFormatVersion: 2 +guid: 6718394795f184698a40cb2aaeb50e0f +timeCreated: 1570560566 +licenseType: Pro +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMEEvent.h b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMEEvent.h new file mode 100644 index 0000000..d2a85e4 --- /dev/null +++ b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMEEvent.h @@ -0,0 +1,172 @@ +#import +#import "MMETypes.h" + +NS_ASSUME_NONNULL_BEGIN + +@class MMECommonEventData; + +/*! @brief represents a telemetry event, with a name, date and attributes */ +@interface MMEEvent : NSObject + +/*! @brief date on which the event occured - MMEEventKeyDateCreated */ +@property (nonatomic, readonly, copy) NSDate *date; + +/*! @brief name of the event, from MMEConstants.h - MMEEventKeyEvent */ +@property (nonatomic, readonly, copy) NSString *name; + +/*! @brief attributes of the event, a dictionary for which [NSJSONSerialization isValidJSONObject:] returns YES */ +@property (nonatomic, readonly, copy) NSDictionary *attributes; + +/*! @brief Designated Initilizer for events + @param eventAttributes attributes of the event + @param error present if the event could not be created with the properties provided + @return a new event with the date, name and attributes provided +*/ +- (instancetype)initWithAttributes:(NSDictionary *)eventAttributes error:(NSError **)error NS_DESIGNATED_INITIALIZER; + +#pragma mark - Generic Events + +/*! @brief eventWithAttributes: - initilization errors are reported to the EventsManagerDelegate + @param attributes attrs + @return event +*/ ++ (instancetype)eventWithAttributes:(NSDictionary *)attributes; + +/*! @brief eventWithAttributes: - initilization errors are reported to the EventsManagerDelegate + @param attributes attrs + @return event +*/ ++ (instancetype)eventWithAttributes:(NSDictionary *)attributes error:(NSError **)error; + +#pragma mark - Custom Events + +/*! @brief turnstileEventWithAttributes: + @param attributes event attrs + @return turnstile event +*/ ++ (instancetype)turnstileEventWithAttributes:(NSDictionary *)attributes; + +/*! @brief visitEventWithAttributes: + @param attributes attrs + @return event +*/ ++ (instancetype)visitEventWithAttributes:(NSDictionary *)attributes; + +#pragma mark - Crash Events + +/*! @brief crashEventReporting:error: + @param eventsError error to report + @param createError pointer to an error creating the report + @return event +*/ ++ (instancetype)crashEventReporting:(NSError *)eventsError error:(NSError **)createError; + +#pragma mark - Debug Devents + +/*! @brief debugEventWithAttributes: debug logging event with attributes provided + @param attributes attrs + @return event +*/ ++ (instancetype)debugEventWithAttributes:(NSDictionary *)attributes MME_DEPRECATED; + +/*! @brief debugEventWithError: debug logging event with the error provided + @param error error + @return event +*/ ++ (instancetype)debugEventWithError:(NSError *)error MME_DEPRECATED; + +/*! @brief debugEventWithException: debug logging event the the exception provided + @param except exception + @return event +*/ ++ (instancetype)debugEventWithException:(NSException *)except MME_DEPRECATED; + +#pragma mark - Deprecated + +#pragma mark - Deprecated (MMECommonEventData) + +/*! @brief deprecated in MabboxMobileEvents 1.0.0 or later + @note please use eventWithAttributes:error: +*/ ++ (instancetype)locationEventWithAttributes:(NSDictionary *)attributes instanceIdentifer:(NSString *)instanceIdentifer commonEventData:(MMECommonEventData *)commonEventData + MME_DEPRECATED_GOTO("use eventWithAttributes:error:", "-eventWithAttributes:error:"); + +/*! @brief deprecated in MabboxMobileEvents 1.0.0 or later + @note replacment TBD +*/ ++ (instancetype)mapLoadEventWithDateString:(NSString *)dateString commonEventData:(MMECommonEventData *)commonEventData + MME_DEPRECATED_GOTO("use eventWithAttributes:error:", "-eventWithAttributes:error:"); + +#pragma mark - Deprecated (Event Name) + +/*! @brief deprecated in MabboxMobileEvents 1.0.0 or later + @note please use eventWithAttributes:error: +*/ ++ (instancetype)eventWithName:(NSString *)eventName attributes:(NSDictionary *)attributes + MME_DEPRECATED_GOTO("use eventWithAttributes:error:", "-eventWithAttributes:error:"); + +/*! @brief deprecated in MabboxMobileEvents 1.0.0 or later + @note please use eventWithAttributes:error: +*/ ++ (instancetype)navigationEventWithName:(NSString *)name attributes:(NSDictionary *)attributes + MME_DEPRECATED_GOTO("use eventWithAttributes:error:", "-eventWithAttributes:error:"); + +/*! @brief deprecated in MabboxMobileEvents 1.0.0 or later + @note please use eventWithAttributes:error: +*/ ++ (instancetype)visionEventWithName:(NSString *)name attributes:(NSDictionary *)attributes + MME_DEPRECATED_GOTO("use eventWithAttributes:error:", "-eventWithAttributes:error:"); + +/*! @brief deprecated in MabboxMobileEvents 1.0.0 or later + @note please use eventWithAttributes:error: +*/ ++ (instancetype)searchEventWithName:(NSString *)name attributes:(NSDictionary *)attributes + MME_DEPRECATED_GOTO("use eventWithAttributes:error:", "-eventWithAttributes:error:"); + +/*! brief deprecated in MabboxMobileEvents 1.0.0 or later + @note please use eventWithAttributes:error: +*/ ++ (instancetype)carplayEventWithName:(NSString *)name attributes:(NSDictionary *)attributes + MME_DEPRECATED_GOTO("use eventWithAttributes:error:", "-eventWithAttributes:error:"); + +#pragma mark - Deprecated (Date String) + +/*! @brief deprecated in MabboxMobileEvents 1.0.0 or later + @note please use eventWithName:attributes: +*/ ++ (instancetype)telemetryMetricsEventWithDateString:(NSString *)dateString attributes:(NSDictionary *)attributes + MME_DEPRECATED_GOTO("use eventWithAttributes:error:", "-eventWithAttributes:error:"); + +/*! @brief deprecated in MabboxMobileEvents 1.0.0 or later + @note map gesture events are no longer supported +*/ ++ (instancetype)mapTapEventWithDateString:(NSString *)dateString attributes:(NSDictionary *)attributes + MME_DEPRECATED_MSG("map gesture events are no longer supported"); + +/*! @brief deprecated in MabboxMobileEvents 1.0.0 or later + @note map gesture events are no longer supported +*/ ++ (instancetype)mapDragEndEventWithDateString:(NSString *)dateString attributes:(NSDictionary *)attributes + MME_DEPRECATED_MSG("map gesture events are no longer supported"); + +/*! @brief deprecated in MabboxMobileEvents 1.0.0 or later + @note please use eventWithName:attributes: +*/ ++ (instancetype)mapOfflineDownloadStartEventWithDateString:(NSString *)dateString attributes:(NSDictionary *)attributes + MME_DEPRECATED_GOTO("use eventWithAttributes:error:", "-eventWithAttributes:error:"); + +/*! @brief deprecated in MabboxMobileEvents 1.0.0 or later + @note please use eventWithName:attributes: +*/ ++ (instancetype)mapOfflineDownloadEndEventWithDateString:(NSString *)dateString attributes:(NSDictionary *)attributes + MME_DEPRECATED_GOTO("use eventWithAttributes:error:", "-eventWithAttributes:error:"); + +/*! @brief deprecated in MabboxMobileEvents 1.0.0 or later + @note please use eventWithName:attributes: +*/ ++ (instancetype)eventWithDateString:(NSString *)dateString name:(NSString *)name attributes:(NSDictionary *)attributes + MME_DEPRECATED_GOTO("use eventWithAttributes:error:", "-eventWithAttributes:error:"); + +@end + +NS_ASSUME_NONNULL_END diff --git a/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMEEvent.h.meta b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMEEvent.h.meta new file mode 100644 index 0000000..99867fb --- /dev/null +++ b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMEEvent.h.meta @@ -0,0 +1,26 @@ +fileFormatVersion: 2 +guid: 6c1879202f10e4c3da36b4eac7f010e1 +timeCreated: 1570560566 +licenseType: Pro +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMEEventsManager.h b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMEEventsManager.h new file mode 100644 index 0000000..ea13bdc --- /dev/null +++ b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMEEventsManager.h @@ -0,0 +1,152 @@ +#import +#import + +#import "MMETypes.h" + +@class MMEEvent; +@protocol MMEEventsManagerDelegate; + +NS_ASSUME_NONNULL_BEGIN + +/*! @brief Mapbox Mobile Events Manager */ +@interface MMEEventsManager : NSObject + +/*! @brief events manager delegate */ +@property (nonatomic, weak) id delegate; + +/*! @brief YES if metrics collection is enabled */ +@property (nonatomic, getter=isMetricsEnabled) BOOL metricsEnabled; + +/*! @brief YES if metrics collection is enabled in the simulator */ +@property (nonatomic, getter=isMetricsEnabledInSimulator) BOOL metricsEnabledInSimulator; + +/*! @brief YES if metrics collection is enabled when the app is in use */ +@property (nonatomic, getter=isMetricsEnabledForInUsePermissions) BOOL metricsEnabledForInUsePermissions; + +/*! @brief YES if debug logging is enabled */ +@property (nonatomic, getter=isDebugLoggingEnabled) BOOL debugLoggingEnabled; + +/*! @brief UserAgent base string, in RFC 2616 format + @link https://www.ietf.org/rfc/rfc2616.txt */ +@property (nonatomic, readonly) NSString *userAgentBase; + +/*! @brief SDK version, in Semantic Versioning 2.0.0 format + @link https://semver.org */ +@property (nonatomic, readonly) NSString *hostSDKVersion; + +/*! @brief SKU Identifier */ +@property (nonatomic, copy) NSString *skuId; + +/*! @brief Mapbox Access Token + @link https://account.mapbox.com */ +@property (nonatomic, copy) NSString *accessToken; + +/*! @brief baseURL */ +@property (nonatomic, null_resettable) NSURL *baseURL; + +/*! @brief accountType */ +@property (nonatomic) NSInteger accountType; + +#pragma mark - + +/*! @brief Shared Mabpox Mobile Events Manager */ ++ (instancetype)sharedManager; + +#pragma mark - Exception Free API + +/*! + @brief designated initilizer + @param accessToken Mapbox Access Token + @param userAgentBase UserAgent base string, in RFC 2616 format + @param hostSDKVersion SDK version, in Semantic Versioning 2.0.0 format + @throws no exceptions +*/ +- (void)initializeWithAccessToken:(NSString *)accessToken userAgentBase:(NSString *)userAgentBase hostSDKVersion:(NSString *)hostSDKVersion; + +/*! @brief pauseOrResumeMetricsCollectionIfRequired + @throws no exceptions */ +- (void)pauseOrResumeMetricsCollectionIfRequired; + +/*! @brief flush the events pipeline, sending any pending events + @throws no exceptions */ +- (void)flush; + +/*! @brief resetEventQueuing + @throws no exceptions */ +- (void)resetEventQueuing; + +/*! @brief sendTurnstileEvent + @throws no exceptions */ +- (void)sendTurnstileEvent; + +/*! @brief sendTelemetryMetricsEvent + @throws no exceptions */ +- (void)sendTelemetryMetricsEvent; + +/*! @brief disableLocationMetrics */ +- (void)disableLocationMetrics; + +#pragma mark - + +/*! @brief enqueueEventWithName: + @param name event name */ +- (void)enqueueEventWithName:(NSString *)name; + +/*! @brief enqueueEventWithName:attributes: + @param name event name + @param attributes event attributes */ +- (void)enqueueEventWithName:(NSString *)name attributes:(MMEMapboxEventAttributes *)attributes; + +/*! @brief postMetadata:filePaths:completionHander: + @param metadata array of metadat + @param filePaths array of file paths + @param completionHandler completion handler block +*/ +- (void)postMetadata:(NSArray *)metadata filePaths:(NSArray *)filePaths completionHandler:(nullable void (^)(NSError * _Nullable error))completionHandler; + +- (void)displayLogFileFromDate:(NSDate *)logDate MME_DEPRECATED; + +#pragma mark - Error & Exception Reporting + +/*! @brief report an error to the telemetry service + @return the report event, for inspection or logging + @throws no exceptions */ +- (MMEEvent *)reportError:(NSError *)eventsError; + +/*! @brief report an exception to the telemetry service + @return the report event, for inspection or logging + @throws no exceptions */ +- (MMEEvent *)reportException:(NSException *)eventException; + +@end + +#pragma mark - + +/*! @brief delegate methods for MMEEventsManager */ +@protocol MMEEventsManagerDelegate + +@optional + +/*! @brief eventsManager:didUpdateLocations: reports location updates to the delegate + @param eventsManager shared manager + @param locations array of CLLocations +*/ +- (void)eventsManager:(MMEEventsManager *)eventsManager didUpdateLocations:(NSArray *)locations; + +#if TARGET_OS_IOS +/*! @brief eventsManager:didVisit: reports visits to the delegate + @param eventsManager shared manager + @param visit CLVisit +*/ +- (void)eventsManager:(MMEEventsManager *)eventsManager didVisit:(CLVisit *)visit; +#endif + +/** @brief reports errors encoutered by the Events Manager to the delegate + @param eventsManager the shared events manager + @param error the encountered NSError object +*/ +- (void)eventsManager:(MMEEventsManager *)eventsManager didEncounterError:(NSError *)error; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMEEventsManager.h.meta b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMEEventsManager.h.meta new file mode 100644 index 0000000..73df47a --- /dev/null +++ b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMEEventsManager.h.meta @@ -0,0 +1,26 @@ +fileFormatVersion: 2 +guid: 3edca867bab9748d6be5abf6b6006229 +timeCreated: 1570560566 +licenseType: Pro +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMETypes.h b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMETypes.h new file mode 100644 index 0000000..ab032c5 --- /dev/null +++ b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMETypes.h @@ -0,0 +1,54 @@ +#import + +#ifndef NS_ARRAY_OF + // Foundation collection classes adopted lightweight generics in iOS 9.0 and OS X 10.11 SDKs. + #if __has_feature(objc_generics) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 90000 || __MAC_OS_X_VERSION_MAX_ALLOWED >= 101100) + /** Inserts a type specifier for a pointer to a lightweight generic with the given collection and object classes. Use a `*` for any non-`id` object classes but no `*` for the collection class. */ + #define NS_ARRAY_OF(ObjectClass...) NSArray + #define NS_MUTABLE_ARRAY_OF(ObjectClass...) NSMutableArray + #define NS_SET_OF(ObjectClass...) NSSet + #define NS_MUTABLE_SET_OF(ObjectClass...) NSMutableSet + #define NS_DICTIONARY_OF(ObjectClass...) NSDictionary + #define NS_MUTABLE_DICTIONARY_OF(ObjectClass...) NSMutableDictionary + #else + #define NS_ARRAY_OF(ObjectClass...) NSArray + #define NS_MUTABLE_ARRAY_OF(ObjectClass...) NSMutableArray + #define NS_SET_OF(ObjectClass...) NSSet + #define NS_MUTABLE_SET_OF(ObjectClass...) NSMutableSet + #define NS_DICTIONARY_OF(ObjectClass...) NSDictionary + #define NS_MUTABLE_DICTIONARY_OF(ObjectClass...) NSMutableDictionary + #endif +#endif + +typedef NS_DICTIONARY_OF(NSString *, id) MMEMapboxEventAttributes; +typedef NS_MUTABLE_DICTIONARY_OF(NSString *, id) MMEMutableMapboxEventAttributes; + +#ifdef MME_DEPRECATION_WARNINGS + +#ifndef MME_DEPRECATED + #define MME_DEPRECATED __attribute__((deprecated)) +#endif + +#ifndef MME_DEPRECATED_MSG + #define MME_DEPRECATED_MSG(msg) __attribute((deprecated((msg)))) +#endif + +#ifndef MME_DEPRECATED_GOTO + #define MME_DEPRECATED_GOTO(msg,label) __attribute((deprecated((msg),(label)))) +#endif + +#else + +#ifndef MME_DEPRECATED + #define MME_DEPRECATED +#endif + +#ifndef MME_DEPRECATED_MSG + #define MME_DEPRECATED_MSG(msg) +#endif + +#ifndef MME_DEPRECATED_GOTO + #define MME_DEPRECATED_GOTO(msg,label) +#endif + +#endif // MME_DEPRECATION_WARNINGS diff --git a/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMETypes.h.meta b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMETypes.h.meta new file mode 100644 index 0000000..8e637fb --- /dev/null +++ b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MMETypes.h.meta @@ -0,0 +1,26 @@ +fileFormatVersion: 2 +guid: 7743c930e90e943f4941ec6e3ad1a58f +timeCreated: 1570560566 +licenseType: Pro +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MapboxMobileEvents.h b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MapboxMobileEvents.h new file mode 100644 index 0000000..a90ea2b --- /dev/null +++ b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MapboxMobileEvents.h @@ -0,0 +1,14 @@ +#import + +//! Project version number for MapboxMobileEvents. +FOUNDATION_EXPORT double MapboxMobileEventsVersionNumber; + +//! Project version string for MapboxMobileEvents +FOUNDATION_EXPORT const unsigned char MapboxMobileEventsVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import +#import +#import +#import diff --git a/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MapboxMobileEvents.h.meta b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MapboxMobileEvents.h.meta new file mode 100644 index 0000000..f9ed3dc --- /dev/null +++ b/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents/MapboxMobileEvents.h.meta @@ -0,0 +1,26 @@ +fileFormatVersion: 2 +guid: 458ba4499a3bc4d2aafae9f55ca4c37e +timeCreated: 1570560566 +licenseType: Pro +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/iOS/MapboxMobileEvents/libMapboxMobileEventsStatic.a b/Core/Plugins/iOS/MapboxMobileEvents/libMapboxMobileEventsStatic.a new file mode 100644 index 0000000..5185661 Binary files /dev/null and b/Core/Plugins/iOS/MapboxMobileEvents/libMapboxMobileEventsStatic.a differ diff --git a/Core/Plugins/iOS/MapboxMobileEvents/libMapboxMobileEventsStatic.a.meta b/Core/Plugins/iOS/MapboxMobileEvents/libMapboxMobileEventsStatic.a.meta new file mode 100644 index 0000000..4fcd74d --- /dev/null +++ b/Core/Plugins/iOS/MapboxMobileEvents/libMapboxMobileEventsStatic.a.meta @@ -0,0 +1,106 @@ +fileFormatVersion: 2 +guid: 902cd5fd1c6e74a17a41d7527de5b07b +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 WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + - 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: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - 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: 1 + settings: + AddToEmbeddedBinaries: false + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/link.xml b/Core/Plugins/link.xml new file mode 100644 index 0000000..d316281 --- /dev/null +++ b/Core/Plugins/link.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Core/Plugins/link.xml.meta b/Core/Plugins/link.xml.meta new file mode 100644 index 0000000..9a564e6 --- /dev/null +++ b/Core/Plugins/link.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4cdb20be19794f045b7be9be4b5c0411 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/sqlite.meta b/Core/Plugins/sqlite.meta new file mode 100644 index 0000000..75588d9 --- /dev/null +++ b/Core/Plugins/sqlite.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9b6db522e589f6648ac1c512b86ffee7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/sqlite/Android.meta b/Core/Plugins/sqlite/Android.meta new file mode 100644 index 0000000..fc385e8 --- /dev/null +++ b/Core/Plugins/sqlite/Android.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f9aa937fca8cbd945a3a1c9a32a2aeca +folderAsset: yes +timeCreated: 1445131378 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/sqlite/Android/libs.meta b/Core/Plugins/sqlite/Android/libs.meta new file mode 100644 index 0000000..cffbabb --- /dev/null +++ b/Core/Plugins/sqlite/Android/libs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8ecc37cde00565d439803ae86521a2be +folderAsset: yes +timeCreated: 1445131378 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/sqlite/Android/libs/arm64-v8a.meta b/Core/Plugins/sqlite/Android/libs/arm64-v8a.meta new file mode 100644 index 0000000..9a815b8 --- /dev/null +++ b/Core/Plugins/sqlite/Android/libs/arm64-v8a.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2325a98c27e0cd84a821f71d86995361 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/sqlite/Android/libs/arm64-v8a/libsqlite3.so b/Core/Plugins/sqlite/Android/libs/arm64-v8a/libsqlite3.so new file mode 100644 index 0000000..246d027 Binary files /dev/null and b/Core/Plugins/sqlite/Android/libs/arm64-v8a/libsqlite3.so differ diff --git a/Core/Plugins/sqlite/Android/libs/arm64-v8a/libsqlite3.so.meta b/Core/Plugins/sqlite/Android/libs/arm64-v8a/libsqlite3.so.meta new file mode 100644 index 0000000..6c5aaed --- /dev/null +++ b/Core/Plugins/sqlite/Android/libs/arm64-v8a/libsqlite3.so.meta @@ -0,0 +1,94 @@ +fileFormatVersion: 2 +guid: aff4a781acb7b3e44ad44913092f0136 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Android: Android + second: + enabled: 1 + settings: + CPU: ARM64 + - 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: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/sqlite/Android/libs/armeabi-v7a.meta b/Core/Plugins/sqlite/Android/libs/armeabi-v7a.meta new file mode 100644 index 0000000..9c3fb54 --- /dev/null +++ b/Core/Plugins/sqlite/Android/libs/armeabi-v7a.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 08b2651045c57a441975bfde798f2859 +folderAsset: yes +timeCreated: 1445131378 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/sqlite/Android/libs/armeabi-v7a/libsqlite3.so b/Core/Plugins/sqlite/Android/libs/armeabi-v7a/libsqlite3.so new file mode 100644 index 0000000..d69ba56 Binary files /dev/null and b/Core/Plugins/sqlite/Android/libs/armeabi-v7a/libsqlite3.so differ diff --git a/Core/Plugins/sqlite/Android/libs/armeabi-v7a/libsqlite3.so.meta b/Core/Plugins/sqlite/Android/libs/armeabi-v7a/libsqlite3.so.meta new file mode 100644 index 0000000..db7f4be --- /dev/null +++ b/Core/Plugins/sqlite/Android/libs/armeabi-v7a/libsqlite3.so.meta @@ -0,0 +1,70 @@ +fileFormatVersion: 2 +guid: a00620409803a41f598cabed0c2ecf9f +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARMv7 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/sqlite/Android/libs/x86.meta b/Core/Plugins/sqlite/Android/libs/x86.meta new file mode 100644 index 0000000..d396f99 --- /dev/null +++ b/Core/Plugins/sqlite/Android/libs/x86.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 450e0a9c89bf4a040b26f1fef13f5655 +folderAsset: yes +timeCreated: 1445131378 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/sqlite/Android/libs/x86/libsqlite3.so b/Core/Plugins/sqlite/Android/libs/x86/libsqlite3.so new file mode 100644 index 0000000..d4d1203 Binary files /dev/null and b/Core/Plugins/sqlite/Android/libs/x86/libsqlite3.so differ diff --git a/Core/Plugins/sqlite/Android/libs/x86/libsqlite3.so.meta b/Core/Plugins/sqlite/Android/libs/x86/libsqlite3.so.meta new file mode 100644 index 0000000..2c6eee9 --- /dev/null +++ b/Core/Plugins/sqlite/Android/libs/x86/libsqlite3.so.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: fa9cbdc3a67e5fd4baeb5d0dd3f4cf71 +timeCreated: 1445131383 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: x86 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/sqlite/x64.meta b/Core/Plugins/sqlite/x64.meta new file mode 100644 index 0000000..049d532 --- /dev/null +++ b/Core/Plugins/sqlite/x64.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d080ad26255213a459eabfbd537e41b5 +folderAsset: yes +timeCreated: 1445131378 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/sqlite/x64/sqlite3.dll b/Core/Plugins/sqlite/x64/sqlite3.dll new file mode 100644 index 0000000..6f07d5e Binary files /dev/null and b/Core/Plugins/sqlite/x64/sqlite3.dll differ diff --git a/Core/Plugins/sqlite/x64/sqlite3.dll.meta b/Core/Plugins/sqlite/x64/sqlite3.dll.meta new file mode 100644 index 0000000..245e977 --- /dev/null +++ b/Core/Plugins/sqlite/x64/sqlite3.dll.meta @@ -0,0 +1,63 @@ +fileFormatVersion: 2 +guid: a3fee75616c5ab0449e841e6fc8a5172 +timeCreated: 1445131383 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Editor: + enabled: 1 + settings: + CPU: x86_64 + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 1 + settings: + CPU: x86 + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: None + Win64: + enabled: 1 + settings: + CPU: AnyCPU + data: + enabled: 0 + settings: {} + iOS: + enabled: 1 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/sqlite/x86.meta b/Core/Plugins/sqlite/x86.meta new file mode 100644 index 0000000..a43b7b4 --- /dev/null +++ b/Core/Plugins/sqlite/x86.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 854bb0734038dc44e81cdde1d571a00f +folderAsset: yes +timeCreated: 1445131378 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Plugins/sqlite/x86/sqlite3.dll b/Core/Plugins/sqlite/x86/sqlite3.dll new file mode 100644 index 0000000..4cd5a11 Binary files /dev/null and b/Core/Plugins/sqlite/x86/sqlite3.dll differ diff --git a/Core/Plugins/sqlite/x86/sqlite3.dll.meta b/Core/Plugins/sqlite/x86/sqlite3.dll.meta new file mode 100644 index 0000000..e2f1296 --- /dev/null +++ b/Core/Plugins/sqlite/x86/sqlite3.dll.meta @@ -0,0 +1,63 @@ +fileFormatVersion: 2 +guid: 34afd3dfc3051f3438965ecf7bd8c8df +timeCreated: 1445131383 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Editor: + enabled: 1 + settings: + CPU: x86 + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 1 + settings: + CPU: x86 + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: None + data: + enabled: 0 + settings: {} + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/cheap-ruler-cs.meta b/Core/cheap-ruler-cs.meta new file mode 100644 index 0000000..3b9d2a3 --- /dev/null +++ b/Core/cheap-ruler-cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 49cd92bb9fe9ed9428a22e83866f702c +folderAsset: yes +timeCreated: 1510755841 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/cheap-ruler-cs/CheapRuler.cs b/Core/cheap-ruler-cs/CheapRuler.cs new file mode 100644 index 0000000..9850c99 --- /dev/null +++ b/Core/cheap-ruler-cs/CheapRuler.cs @@ -0,0 +1,164 @@ +namespace Mapbox.CheapRulerCs +{ + + using System; + + + public enum CheapRulerUnits + { + Kilometers, + Miles, + NauticalMiles, + Meters, + Yards, + Feet, + Inches + } + + public class CheapRuler + { + + + private double _kx; + private double _ky; + + + /// + /// Creates a ruler object that will approximate measurements around the given latitude. Units are one of: kilometers + /// + /// + public CheapRuler(double latitude, CheapRulerUnits outputUnits = CheapRulerUnits.Kilometers) + { + + double factor; + + switch (outputUnits) + { + case CheapRulerUnits.Kilometers: + factor = 1.0d; + break; + case CheapRulerUnits.Miles: + factor = 1000.0d / 1609.344; + break; + case CheapRulerUnits.NauticalMiles: + factor = 1000.0d / 1852.0d; + break; + case CheapRulerUnits.Meters: + factor = 1000.0d; + break; + case CheapRulerUnits.Yards: + factor = 1000.0d / 0.9144; + break; + case CheapRulerUnits.Feet: + factor = 1000.0d / 0.3048; + break; + case CheapRulerUnits.Inches: + factor = 1000.0d / 0.0254; + break; + default: + factor = 1.0d; + break; + } + + var cos = Math.Cos(latitude * Math.PI / 180); + var cos2 = 2 * cos * cos - 1; + var cos3 = 2 * cos * cos2 - cos; + var cos4 = 2 * cos * cos3 - cos2; + var cos5 = 2 * cos * cos4 - cos3; + + // multipliers for converting longitude and latitude degrees into distance (http://1.usa.gov/1Wb1bv7) + _kx = factor * (111.41513 * cos - 0.09455 * cos3 + 0.00012 * cos5); + _ky = factor * (111.13209 - 0.56605 * cos2 + 0.0012 * cos4); + } + + + /// + /// Creates a ruler object from tile coordinates. + /// + /// Y TileId + /// Zoom Level + /// + /// + public static CheapRuler FromTile(int y, int z, CheapRulerUnits units = CheapRulerUnits.Kilometers) + { + var n = Math.PI * (1 - 2 * (y + 0.5) / Math.Pow(2, z)); + var lat = Math.Atan(0.5 * (Math.Exp(n) - Math.Exp(-n))) * 180 / Math.PI; + return new CheapRuler(lat, units); + } + + + /// + /// Given two points returns the distance. + /// + /// point [longitude, latitude] + /// point [longitude, latitude] + /// Distance + public double Distance(double[] a, double[] b) + { + var dx = (a[0] - b[0]) * _kx; + var dy = (a[1] - b[1]) * _ky; + return Math.Sqrt(dx * dx + dy * dy); + } + + + /// + /// Returns the bearing between two points in angles. + /// + /// a point [longitude, latitude] + /// b point [longitude, latitude] + /// Bearing + public double Bearing(double[] a, double[] b) + { + var dx = (b[0] - a[0]) * _kx; + var dy = (b[1] - a[1]) * _ky; + if (dx == 0 && dy == 0) + { + return 0; + } + var bearing = Math.Atan2(dx, dy) * 180 / Math.PI; + if (bearing > 180) + { + bearing -= 360; + } + return bearing; + } + + + /// + /// Returns a new point given distance and bearing from the starting point. + /// + /// + /// + /// point [longitude, latitude] + /// + public double[] Destination(double[] p, double distance, double bearing) + { + var a = (90 - bearing) * Math.PI / 180; + return offset( + p + , Math.Cos(a) * distance + , Math.Sin(a) * distance + ); + } + + + /// + /// Returns a new point given easting and northing offsets (in ruler units) from the starting point. + /// + /// point [longitude, latitude] + /// dx easting + /// dy northing + /// point [longitude, latitude] + private double[] offset(double[] p, double dx, double dy) + { + return new double[] + { + p[0] + dx / _kx, + p[1] + dy / _ky + }; + } + + + + } +} diff --git a/Core/cheap-ruler-cs/CheapRuler.cs.meta b/Core/cheap-ruler-cs/CheapRuler.cs.meta new file mode 100644 index 0000000..d8e07f9 --- /dev/null +++ b/Core/cheap-ruler-cs/CheapRuler.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 70ae2609c58a0494fa3d7f9f58915037 +timeCreated: 1510756014 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/cheap-ruler-cs/Tests.meta b/Core/cheap-ruler-cs/Tests.meta new file mode 100644 index 0000000..240aa35 --- /dev/null +++ b/Core/cheap-ruler-cs/Tests.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: ad956bac3800e2347b757d68a78545fe +folderAsset: yes +timeCreated: 1515511351 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/cheap-ruler-cs/Tests/Editor.meta b/Core/cheap-ruler-cs/Tests/Editor.meta new file mode 100644 index 0000000..5f57978 --- /dev/null +++ b/Core/cheap-ruler-cs/Tests/Editor.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 4f535415528489e4994bafd61109a75e +folderAsset: yes +timeCreated: 1515511390 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/cheap-ruler-cs/Tests/Editor/MapboxUnitTests_CheapRulerCs.cs b/Core/cheap-ruler-cs/Tests/Editor/MapboxUnitTests_CheapRulerCs.cs new file mode 100644 index 0000000..36ef2e3 --- /dev/null +++ b/Core/cheap-ruler-cs/Tests/Editor/MapboxUnitTests_CheapRulerCs.cs @@ -0,0 +1,122 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +// TODO: figure out how run tests outside of Unity with .NET framework, something like '#if !UNITY' + +namespace Mapbox.CheapRulerCs.UnitTest +{ + + + using NUnit.Framework; + using System.Collections.Generic; + using UnityEngine; + using Mapbox.CheapRulerCs; + using Mapbox.Json.Linq; + + [TestFixture] + internal class CheapRulerCsTest + { + + + // TODO more tests //////////////////// + // see https://github.com/mapbox/cheap-ruler/blob/master/test/test.js + ////////////////////////// + + + internal class point { public double x; public double y; } + internal class line + { + public List vertices = new List(); + public void Add(double x, double y) { vertices.Add(new point() { x = x, y = y }); } + } + + private List _lineFixtures; + + [SetUp] + public void SetUp() + { + _lineFixtures = loadFixtures(); + } + + + + [Test, Order(1)] + public void FixturesLoaded() + { + Assert.AreEqual(58, _lineFixtures.Count); + } + + + + [Test] + public void DistanceInMiles() + { + CheapRuler ruler = new CheapRuler(32.8351); + CheapRuler rulerMiles = new CheapRuler(32.8351, CheapRulerUnits.Miles); + + double distKm = ruler.Distance(new double[] { 30.5, 32.8351 }, new double[] { 30.51, 32.8451 }); + double distMiles = rulerMiles.Distance(new double[] { 30.5, 32.8351 }, new double[] { 30.51, 32.8451 }); + + Debug.LogFormat("{0} {1}", distKm, distMiles); + Assert.AreEqual(1.609344, distKm / distMiles, 1e-12, "wrong distance in miles"); + } + + + [Test] + public void DistanceInNauticalMiles() + { + CheapRuler ruler = new CheapRuler(32.8351); + CheapRuler rulerMiles = new CheapRuler(32.8351, CheapRulerUnits.Miles); + CheapRuler rulerNauticalMiles = new CheapRuler(32.8351, CheapRulerUnits.NauticalMiles); + + double distKm = ruler.Distance(new double[] { 30.5, 32.8351 }, new double[] { 30.51, 32.8451 }); + double distMiles = rulerMiles.Distance(new double[] { 30.5, 32.8351 }, new double[] { 30.51, 32.8451 }); + double distNauticalMiles = rulerNauticalMiles.Distance(new double[] { 30.5, 32.8351 }, new double[] { 30.51, 32.8451 }); + + Debug.LogFormat("{0} {1}", distKm, distNauticalMiles); + Assert.AreEqual(1.852, distKm / distNauticalMiles, 1e-12, "wrong distance km vs nautical miles"); + Assert.AreEqual(1.15078, distMiles / distNauticalMiles, 1e-6, "wrong distance miles vs nautical miles"); + } + + + [Test] + public void FromTile() + { + CheapRuler ruler1 = new CheapRuler(50.5); + CheapRuler ruler2 = CheapRuler.FromTile(11041, 15); + + var p1 = new double[] { 30.5, 50.5 }; + var p2 = new double[] { 30.51, 50.51 }; + + Assert.AreEqual(ruler1.Distance(p1, p2), ruler2.Distance(p1, p2), 3e-5, "CheapRuler.FromTile distance"); + } + + + + private List loadFixtures() + { + TextAsset fixturesAsset = Resources.Load("ChearRulerCs_fixtures"); + var json = JArray.Parse(fixturesAsset.text); + List fixtures = new List(); + + foreach (var line in json) + { + line fixtureLine = new line(); + + foreach (var coordinates in line) + { + fixtureLine.Add(coordinates[0].Value(), coordinates[1].Value()); + } + fixtures.Add(fixtureLine); + } + + return fixtures; + } + + + + } +} diff --git a/Core/cheap-ruler-cs/Tests/Editor/MapboxUnitTests_CheapRulerCs.cs.meta b/Core/cheap-ruler-cs/Tests/Editor/MapboxUnitTests_CheapRulerCs.cs.meta new file mode 100644 index 0000000..4d882e8 --- /dev/null +++ b/Core/cheap-ruler-cs/Tests/Editor/MapboxUnitTests_CheapRulerCs.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a618de68ec1d47d4895ef5b3200b2c88 +timeCreated: 1522309080 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs.meta b/Core/mapbox-sdk-cs.meta new file mode 100644 index 0000000..de99404 --- /dev/null +++ b/Core/mapbox-sdk-cs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0573f298307b74fceabb0e3093a486d5 +folderAsset: yes +timeCreated: 1491243030 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Directions.meta b/Core/mapbox-sdk-cs/Directions.meta new file mode 100644 index 0000000..727165f --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 17120e4ab0b97434486f85ff6e0a9196 +folderAsset: yes +timeCreated: 1491243030 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Directions/DirectionResource.cs b/Core/mapbox-sdk-cs/Directions/DirectionResource.cs new file mode 100644 index 0000000..6bb31f3 --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/DirectionResource.cs @@ -0,0 +1,244 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Directions +{ + using System; + using System.Collections.Generic; + using Mapbox.Utils; + using Platform; + + /// A directions request. + public class DirectionResource : Resource + { + private string apiEndpoint = "directions/v5/"; + + // Required + private RoutingProfile profile; + + // Optional + private Vector2d[] coordinates; + + // Optional + private bool? alternatives; + + // Optional + private BearingFilter[] bearings; + + // Optional + private bool? continueStraight; + + // Optional + private Overview overview; + + // Optional + private double[] radiuses; + + // Optional + private bool? steps; + + /// Initializes a new instance of the class. + /// + /// Array of LatLng points along route, between 2 and 25 elements in length. + /// + /// + /// A routing profile, for all profile options. + /// + public DirectionResource(Vector2d[] coordinates, RoutingProfile profile) + { + this.Coordinates = coordinates; + this.RoutingProfile = profile; + } + + /// Gets the API endpoint as a partial URL path. + public override string ApiEndpoint { + get { + return this.apiEndpoint; + } + } + + /// + /// Gets or sets the coordinates. Array of LatLng points along route, + /// between 2 and 25 elements in length. + /// + public Vector2d[] Coordinates { + get { + return this.coordinates; + } + + set { + if (value.Length < 2 || value.Length > 25) + { + throw new Exception("Must be between 2 and 25 elements in coordinates array."); + } + + this.coordinates = value; + } + } + + /// + /// Gets or sets the routing profile, for all profile options. + /// + public RoutingProfile RoutingProfile { + get { + return this.profile; + } + + set { + this.profile = value; + } + } + + /// + /// Gets or sets the alternative option. Controls whether direction request should + /// return alternative routes. + /// + public bool? Alternatives { + get { + return this.alternatives; + } + + set { + this.alternatives = value; + } + } + + /// + /// Gets or sets the bearing option. An array of bearing filters. Each filter is composed of + /// a bearing as decimal degrees clockwise between 0 and 360, and a range of variation from + /// the bearing as decimal degrees between 0 and 180. + /// + public BearingFilter[] Bearings { + get { + return this.bearings; + } + + set { + if (value != null && value.Length != this.coordinates.Length) + { + throw new Exception("There must be as many bearings as there are coordinates in the request."); + } + + this.bearings = value; + } + } + + /// + /// Gets or sets the continue_straight option. Controls whether to route will + /// continue in same direction of travel or if route may continue in opposite + /// direction of travel at intermediate waypoints. + /// + public bool? ContinueStraight { + get { + return this.continueStraight; + } + + set { + this.continueStraight = value; + } + } + + /// + /// Gets or sets the overview option. See for all overview options. + /// + public Overview Overview { + get { + return this.overview; + } + + set { + this.overview = value; + } + } + + /// + /// Gets or sets the radiuses option. Controls maximum distance in meters that + /// each coordinate is allowed to move when snapped to a nearby road segment. + /// + public double[] Radiuses { + get { + return this.radiuses; + } + + set { + if (value != null) + { + if (value.Length != this.coordinates.Length) + { + throw new Exception("There must be as many radiuses as there are coordinates in the request."); + } + + for (int i = 0; i < value.Length; i++) + { + if (value[i] <= 0) + { + throw new Exception("Radius must be greater than 0"); + } + } + } + + this.radiuses = value; + } + } + + /// Gets or sets the steps option. Controls whether to return steps and turn-by-turn instructions. + public bool? Steps { + get { + return this.steps; + } + + set { + this.steps = value; + } + } + + /// + /// Gets the URL string. + /// + /// The URL string. + public override string GetUrl() + { + Dictionary opts = new Dictionary(); + + if (this.Alternatives != null) + { + opts.Add("alternatives", this.Alternatives.ToString().ToLower()); + } + + if (this.Bearings != null) + { + opts.Add("bearings", GetUrlQueryFromArray(this.Bearings, ";")); + } + + if (this.ContinueStraight != null) + { + opts.Add("continue_straight", this.ContinueStraight.ToString().ToLower()); + } + + if (this.Overview != null) + { + opts.Add("overview", this.Overview.ToString()); + } + + if (this.Radiuses != null) + { + opts.Add("radiuses", GetUrlQueryFromArray(this.Radiuses)); + } + + if (this.Steps != null) + { + opts.Add("steps", this.Steps.ToString().ToLower()); + } + + return Constants.BaseAPI + + this.ApiEndpoint + + this.RoutingProfile + + GetUrlQueryFromArray(this.Coordinates, ";") + + ".json" + + EncodeQueryString(opts); + } + } +} diff --git a/Core/mapbox-sdk-cs/Directions/DirectionResource.cs.meta b/Core/mapbox-sdk-cs/Directions/DirectionResource.cs.meta new file mode 100644 index 0000000..5b13be9 --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/DirectionResource.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 78ecfcb30aefc4289b8d2a83619a2d89 +timeCreated: 1493218361 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Directions/Directions.cs b/Core/mapbox-sdk-cs/Directions/Directions.cs new file mode 100644 index 0000000..0906539 --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Directions.cs @@ -0,0 +1,69 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Directions +{ + using System; + using System.Text; + using Mapbox.Json; + using Mapbox.Platform; + using Mapbox.Utils.JsonConverters; + + /// + /// Wrapper around the + /// Mapbox Directions API. The Mapbox Directions API will show you how to get where + /// you're going. + /// + public sealed class Directions + { + private readonly IFileSource fileSource; + + /// Initializes a new instance of the class. + /// Network access abstraction. + public Directions(IFileSource fileSource) + { + this.fileSource = fileSource; + } + + /// Performs asynchronously a directions lookup. + /// Direction resource. + /// Callback to be called after the request is completed. + /// + /// Returns a that can be used for canceling a pending + /// request. This handle can be completely ignored if there is no intention of ever + /// canceling the request. + /// + public IAsyncRequest Query(DirectionResource direction, Action callback) + { + return this.fileSource.Request( + direction.GetUrl(), + (Response response) => + { + var str = Encoding.UTF8.GetString(response.Data); + + var data = Deserialize(str); + + callback(data); + }); + } + + /// + /// Deserialize the geocode response string into a . + /// + /// JSON String. + /// A . + public DirectionsResponse Deserialize(string str) + { + return JsonConvert.DeserializeObject(str, JsonConverters.Converters); + } + + public string Serialize(DirectionsResponse response) + { + return JsonConvert.SerializeObject(response, JsonConverters.Converters); + } + + } +} diff --git a/Core/mapbox-sdk-cs/Directions/Directions.cs.meta b/Core/mapbox-sdk-cs/Directions/Directions.cs.meta new file mode 100644 index 0000000..1f1a8d8 --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Directions.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a4fc862e3db034a0b8591a58cd15afdc +timeCreated: 1491243034 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Directions/Overview.cs b/Core/mapbox-sdk-cs/Directions/Overview.cs new file mode 100644 index 0000000..d836788 --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Overview.cs @@ -0,0 +1,38 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Directions +{ + /// + /// Type of returned overview geometry. Can be full (the most detailed geometry available), + /// simplified (a simplified version of the full geometry), or false (no overview geometry). + /// + public sealed class Overview + { + /// Use the most detailed geometry available. + public static readonly Overview Full = new Overview("full"); + + /// Use simplified geometry. This is the default value. + public static readonly Overview Simplified = new Overview("simplified"); + + /// Use no overview geometry. + public static readonly Overview False = new Overview("false"); + + private readonly string overview; + + private Overview(string overview) + { + this.overview = overview; + } + + /// Converts the overview type to a string. + /// A string to use as an optional value in the direction query URL. + public override string ToString() + { + return this.overview; + } + } +} diff --git a/Core/mapbox-sdk-cs/Directions/Overview.cs.meta b/Core/mapbox-sdk-cs/Directions/Overview.cs.meta new file mode 100644 index 0000000..e087bb7 --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Overview.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 794258e75ed8d4cee96d4b5ba225cfc8 +timeCreated: 1491243034 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Directions/Response.meta b/Core/mapbox-sdk-cs/Directions/Response.meta new file mode 100644 index 0000000..1ef48ec --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Response.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 41da431a6ab1548a29eecc30eebabe26 +folderAsset: yes +timeCreated: 1491243031 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Directions/Response/Annotation.cs b/Core/mapbox-sdk-cs/Directions/Response/Annotation.cs new file mode 100644 index 0000000..139c8a7 --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Response/Annotation.cs @@ -0,0 +1,38 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Directions +{ + using System.Collections.Generic; + using Mapbox.Json; + + /// + /// An annotations object contains additional details about each line segment along the route geometry. + /// Each entry in an annotations field corresponds to a coordinate along the route geometry. + /// + public class Annotation + { + + + [JsonProperty("distance")] + public double[] Distance { get; set; } + + + [JsonProperty("duration")] + public double[] Duration { get; set; } + + + [JsonProperty("speed")] + public string[] Speed { get; set; } + + + [JsonProperty("congestion")] + public string[] Congestion { get; set; } + + + + } +} diff --git a/Core/mapbox-sdk-cs/Directions/Response/Annotation.cs.meta b/Core/mapbox-sdk-cs/Directions/Response/Annotation.cs.meta new file mode 100644 index 0000000..85ed38a --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Response/Annotation.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 204896b65f98440449415ca9b9c1d643 +timeCreated: 1508343130 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Directions/Response/DirectionsResponse.cs b/Core/mapbox-sdk-cs/Directions/Response/DirectionsResponse.cs new file mode 100644 index 0000000..7043825 --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Response/DirectionsResponse.cs @@ -0,0 +1,41 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Directions { + using System; + using System.Collections.Generic; + using Mapbox.Json; + + /// + /// Directions response. + /// +#if !WINDOWS_UWP + // http://stackoverflow.com/a/12903628 + [Serializable] +#endif + public class DirectionsResponse { + /// + /// Gets or sets the routes. + /// + /// The routes. + [JsonProperty("routes")] + public List Routes { get; set; } + + /// + /// Gets or sets the waypoints. + /// + /// The waypoints. + [JsonProperty("waypoints")] + public List Waypoints { get; set; } + + /// + /// Gets or sets the code. + /// + /// The code. + [JsonProperty("code")] + public string Code { get; set; } + } +} \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/Directions/Response/DirectionsResponse.cs.meta b/Core/mapbox-sdk-cs/Directions/Response/DirectionsResponse.cs.meta new file mode 100644 index 0000000..61d74ba --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Response/DirectionsResponse.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f69de6bfcf63e4d2ab766574bca2caf6 +timeCreated: 1491243035 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Directions/Response/Intersection.cs b/Core/mapbox-sdk-cs/Directions/Response/Intersection.cs new file mode 100644 index 0000000..a533a8d --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Response/Intersection.cs @@ -0,0 +1,55 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Directions +{ + using System.Collections.Generic; + using Mapbox.Json; + using Mapbox.Utils; + using Mapbox.Utils.JsonConverters; + + /// + /// An Intersection from a Directions API call. + /// + public class Intersection + { + /// + /// Gets or sets the out. + /// + /// The out. + [JsonProperty("out", Order = 0)] + public int Out { get; set; } + + /// + /// Gets or sets the entry. + /// + /// The entry. + [JsonProperty("entry", Order = 1)] + public List Entry { get; set; } + + /// + /// Gets or sets the bearings. + /// + /// The bearings. + [JsonProperty("bearings", Order = 2)] + public List Bearings { get; set; } + + /// + /// Gets or sets the location. + /// + /// The location. + [JsonProperty("location", Order = 3)] + [JsonConverter(typeof(LonLatToVector2dConverter))] + public Vector2d Location { get; set; } + + /// + /// Gets or sets the in. + /// + /// The in. + [JsonProperty("in", Order = 4, NullValueHandling = NullValueHandling.Ignore)] + public int? In { get; set; } + } +} diff --git a/Core/mapbox-sdk-cs/Directions/Response/Intersection.cs.meta b/Core/mapbox-sdk-cs/Directions/Response/Intersection.cs.meta new file mode 100644 index 0000000..7c9b26c --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Response/Intersection.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 38b89d19d5fc44375966036ad1331f3d +timeCreated: 1493218361 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Directions/Response/Leg.cs b/Core/mapbox-sdk-cs/Directions/Response/Leg.cs new file mode 100644 index 0000000..aebeab8 --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Response/Leg.cs @@ -0,0 +1,58 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Directions +{ + using System.Collections.Generic; + using Mapbox.Json; + + + /// + /// A Leg from a Directions API call. + /// + public class Leg + { + + + /// + /// Depending on the steps parameter, either an Array of RouteStep objects (true, default) or an empty array (false) + /// + /// The steps. + [JsonProperty("steps")] + public List Steps { get; set; } + + + /// + /// Depending on the summary parameter, either a String summarizing the route (true, default) or an empty String (false). + /// + /// The summary. + [JsonProperty("summary")] + public string Summary { get; set; } + + + /// + /// Number indicating the estimated travel time in seconds. + /// + [JsonProperty("duration")] + public double Duration { get; set; } + + + /// + /// Number indicating the distance traveled in meters. + /// + [JsonProperty("distance")] + public double Distance { get; set; } + + + /// + /// An annotations object that contains additional details about each line segment along the route geometry. Each entry in an annotations field corresponds to a coordinate along the route geometry. + /// + [JsonProperty("annotation")] + public Annotation Annotation { get; set; } + + + } +} diff --git a/Core/mapbox-sdk-cs/Directions/Response/Leg.cs.meta b/Core/mapbox-sdk-cs/Directions/Response/Leg.cs.meta new file mode 100644 index 0000000..c63fac2 --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Response/Leg.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7847e2706c04347a19461bd848b5e1bd +timeCreated: 1491243034 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Directions/Response/Maneuver.cs b/Core/mapbox-sdk-cs/Directions/Response/Maneuver.cs new file mode 100644 index 0000000..1cf756d --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Response/Maneuver.cs @@ -0,0 +1,59 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Directions +{ + using Mapbox.Json; + using Mapbox.Utils; + + /// + /// A Maneuver from a directions API call. + /// + public class Maneuver + { + /// + /// Gets or sets the bearing after. + /// + /// The bearing after. + [JsonProperty("bearing_after")] + public int BearingAfter { get; set; } + + /// + /// Gets or sets the type. + /// + /// The type. + [JsonProperty("type")] + public string Type { get; set; } + + /// + /// Gets or sets the modifier. + /// + /// The modifier. + [JsonProperty("modifier")] + public string Modifier { get; set; } + + /// + /// Gets or sets the bearing before. + /// + /// The bearing before. + [JsonProperty("bearing_before")] + public int BearingBefore { get; set; } + + /// + /// Gets or sets the location. + /// + /// The location. + [JsonProperty("Location")] + public Vector2d Location { get; set; } + + /// + /// Gets or sets the instruction. + /// + /// The instruction. + [JsonProperty("instruction")] + public string Instruction { get; set; } + } +} diff --git a/Core/mapbox-sdk-cs/Directions/Response/Maneuver.cs.meta b/Core/mapbox-sdk-cs/Directions/Response/Maneuver.cs.meta new file mode 100644 index 0000000..fb03330 --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Response/Maneuver.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 41f778a9c28ef4b17ace4d80f89dbc7a +timeCreated: 1493218361 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Directions/Response/Route.cs b/Core/mapbox-sdk-cs/Directions/Response/Route.cs new file mode 100644 index 0000000..7b53669 --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Response/Route.cs @@ -0,0 +1,61 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Directions +{ + using System.Collections.Generic; + using Mapbox.Json; + using Mapbox.Utils; + using Mapbox.Utils.JsonConverters; + + /// + /// A Route from a Directions API call. + /// + public class Route + { + /// + /// Gets or sets the legs. + /// + /// The legs. + [JsonProperty("legs")] + public List Legs { get; set; } + + /// + /// Gets or sets the geometry. Polyline is an array of LatLng's. + /// + /// The geometry. + [JsonProperty("geometry")] + [JsonConverter(typeof(PolylineToVector2dListConverter))] + public List Geometry { get; set; } + + /// + /// Gets or sets the duration. + /// + /// The duration. + [JsonProperty("duration")] + public double Duration { get; set; } + + /// + /// Gets or sets the distance. + /// + /// The distance. + [JsonProperty("distance")] + public double Distance { get; set; } + + /// + /// Float indicating the weight in units described by 'weight_name'. + /// + [JsonProperty("weight")] + public float Weight { get; set; } + + /// + /// String indicating which weight was used. The default is routability which is duration based, with additional penalties for less desirable maneuvers. + /// + [JsonProperty("weight_name")] + public string WeightName { get; set; } + + } +} \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/Directions/Response/Route.cs.meta b/Core/mapbox-sdk-cs/Directions/Response/Route.cs.meta new file mode 100644 index 0000000..df9799c --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Response/Route.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 67e17dbf44b85417d90ee1b71d9749f3 +timeCreated: 1493218361 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Directions/Response/Step.cs b/Core/mapbox-sdk-cs/Directions/Response/Step.cs new file mode 100644 index 0000000..a928e17 --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Response/Step.cs @@ -0,0 +1,69 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Directions +{ + using System.Collections.Generic; + using Mapbox.Json; + using Mapbox.Utils; + using Mapbox.Utils.JsonConverters; + + /// + /// A step from a Directions API call. + /// + public class Step + { + /// + /// Gets or sets the intersections. + /// + /// The intersections. + [JsonProperty("intersections")] + public List Intersections { get; set; } + + /// + /// Gets or sets the geometry. + /// + /// The geometry. + [JsonProperty("geometry")] + [JsonConverter(typeof(PolylineToVector2dListConverter))] + public List Geometry { get; set; } + + /// + /// Gets or sets the maneuver. + /// + /// The maneuver. + [JsonProperty("maneuver")] + public Maneuver Maneuver { get; set; } + + /// + /// Gets or sets the duration. + /// + /// The duration. + [JsonProperty("duration")] + public double Duration { get; set; } + + /// + /// Gets or sets the distance. + /// + /// The distance. + [JsonProperty("distance")] + public double Distance { get; set; } + + /// + /// Gets or sets the name. + /// + /// The name. + [JsonProperty("name")] + public string Name { get; set; } + + /// + /// Gets or sets the mode. + /// + /// The mode. + [JsonProperty("mode")] + public string Mode { get; set; } + } +} diff --git a/Core/mapbox-sdk-cs/Directions/Response/Step.cs.meta b/Core/mapbox-sdk-cs/Directions/Response/Step.cs.meta new file mode 100644 index 0000000..cdb7ec8 --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Response/Step.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: cb67b81b6de1f41fca077297633b5a7d +timeCreated: 1493218361 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Directions/Response/Waypoint.cs b/Core/mapbox-sdk-cs/Directions/Response/Waypoint.cs new file mode 100644 index 0000000..a0cd87e --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Response/Waypoint.cs @@ -0,0 +1,33 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Directions +{ + using Mapbox.Json; + using Mapbox.Utils; + using Mapbox.Utils.JsonConverters; + + /// + /// A Waypoint from a Directions API call. + /// + public class Waypoint + { + /// + /// Gets or sets the name. + /// + /// The name. + [JsonProperty("name")] + public string Name { get; set; } + + /// + /// Gets or sets the location. + /// + /// The location. + [JsonProperty("location")] + [JsonConverter(typeof(LonLatToVector2dConverter))] + public Vector2d Location { get; set; } + } +} diff --git a/Core/mapbox-sdk-cs/Directions/Response/Waypoint.cs.meta b/Core/mapbox-sdk-cs/Directions/Response/Waypoint.cs.meta new file mode 100644 index 0000000..c6b395d --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/Response/Waypoint.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 813ff4647909949fdbd67f232221cab3 +timeCreated: 1493218361 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Directions/RoutingProfile.cs b/Core/mapbox-sdk-cs/Directions/RoutingProfile.cs new file mode 100644 index 0000000..e9280bc --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/RoutingProfile.cs @@ -0,0 +1,38 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Directions +{ + /// + /// Routing profile, affects how the route is calculated, prioritizing routes that fit + /// the profile the best. + /// + public sealed class RoutingProfile + { + /// The driving profile. + public static readonly RoutingProfile Driving = new RoutingProfile("mapbox/driving/"); + + /// The walking profile. + public static readonly RoutingProfile Walking = new RoutingProfile("mapbox/walking/"); + + /// The cycling profile. + public static readonly RoutingProfile Cycling = new RoutingProfile("mapbox/cycling/"); + + private readonly string profile; + + private RoutingProfile(string profile) + { + this.profile = profile; + } + + /// Converts the profile to a URL snippet. + /// A string to be appened to the direction query URL. + public override string ToString() + { + return this.profile; + } + } +} diff --git a/Core/mapbox-sdk-cs/Directions/RoutingProfile.cs.meta b/Core/mapbox-sdk-cs/Directions/RoutingProfile.cs.meta new file mode 100644 index 0000000..76ea7ba --- /dev/null +++ b/Core/mapbox-sdk-cs/Directions/RoutingProfile.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 02efec76b920540358fd490e1c105268 +timeCreated: 1491243033 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Geocoding.meta b/Core/mapbox-sdk-cs/Geocoding.meta new file mode 100644 index 0000000..54d218a --- /dev/null +++ b/Core/mapbox-sdk-cs/Geocoding.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d1dc4d11759e044eabaa4d5496a96275 +folderAsset: yes +timeCreated: 1491243031 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Geocoding/ForwardGeocodeResource.cs b/Core/mapbox-sdk-cs/Geocoding/ForwardGeocodeResource.cs new file mode 100644 index 0000000..300425c --- /dev/null +++ b/Core/mapbox-sdk-cs/Geocoding/ForwardGeocodeResource.cs @@ -0,0 +1,206 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Geocoding +{ + using System; + using System.Collections.Generic; + using Mapbox.Utils; + using UnityEngine; + + /// A forward geocode request. + public sealed class ForwardGeocodeResource : GeocodeResource + { + /// + /// ISO 3166-1 alpha-2 country codes. + /// See for all options. + /// + private static readonly List CountryCodes = new List() + { + "ad", "ae", "af", "ag", "ai", "al", "am", "ao", "aq", "ar", "as", "at", "au", "aw", "ax", "az", "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bl", "bm", "bn", "bo", "bq", "br", "bs", "bt", "bv", "bw", "by", "bz", "ca", "cc", "cd", "cf", "cg", "ch", "ci", "ck", "cl", "cm", "cn", "co", "cr", "cu", "cv", "cw", "cx", "cy", "cz", "de", "dj", "dk", "dm", "do", "dz", "ec", "ee", "eg", "eh", "er", "es", "et", "fi", "fj", "fk", "fm", "fo", "fr", "ga", "gb", "gd", "ge", "gf", "gg", "gh", "gi", "gl", "gm", "gn", "gp", "gq", "gr", "gs", "gt", "gu", "gw", "gy", "hk", "hm", "hn", "hr", "ht", "hu", "id", "ie", "il", "im", "in", "io", "iq", "ir", "is", "it", "je", "jm", "jo", "jp", "ke", "kg", "kh", "ki", "km", "kn", "kp", "kr", "kw", "ky", "kz", "la", "lb", "lc", "li", "lk", "lr", "ls", "lt", "lu", "lv", "ly", "ma", "mc", "md", "me", "mf", "mg", "mh", "mk", "ml", "mm", "mn", "mo", "mp", "mq", "mr", "ms", "mt", "mu", "mv", "mw", "mx", "my", "mz", "na", "nc", "ne", "nf", "ng", "ni", "nl", "no", "np", "nr", "nu", "nz", "om", "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pm", "pn", "pr", "ps", "pt", "pw", "py", "qa", "re", "ro", "rs", "ru", "rw", "sa", "sb", "sc", "sd", "se", "sg", "sh", "si", "sj", "sk", "sl", "sm", "sn", "so", "sr", "ss", "st", "sv", "sx", "sy", "sz", "tc", "td", "tf", "tg", "th", "tj", "tk", "tl", "tm", "tn", "to", "tr", "tt", "tv", "tw", "tz", "ua", "ug", "um", "us", "uy", "uz", "va", "vc", "ve", "vg", "vi", "vn", "vu", "wf", "ws", "ye", "yt", "za", "zm", "zw" + }; + + // Required + private string query; + + // Optional + private bool? autocomplete; + + // Optional + private string[] country; + + // Optional + private Vector2d? proximity; + + // Optional + private Vector2dBounds? bbox; + + /// Initializes a new instance of the class. + /// Place name for forward geocoding. + public ForwardGeocodeResource(string query) + { + this.Query = query; + } + + /// Gets or sets the place name for forward geocoding. + public override string Query + { + get + { + return this.query; + } + + set + { + this.query = value; + } + } + + /// Gets or sets the autocomplete option. + public bool? Autocomplete + { + get + { + return this.autocomplete; + } + + set + { + this.autocomplete = value; + } + } + + /// + /// Gets or sets the bounding box option. Bounding box is a rectangle within which to + /// limit results, given as . + /// + public Vector2dBounds? Bbox + { + get + { + return this.bbox; + } + + set + { + this.bbox = value; + } + } + + /// + /// Gets or sets the country option. Country is an Array of ISO 3166 alpha 2 country codes. + /// For all possible values, . + /// + public string[] Country + { + get + { + return this.country; + } + + set + { + if (value == null) + { + this.country = value; + return; + } + + for (int i = 0; i < value.Length; i++) + { + // Validate that provided countries exist + if (!CountryCodes.Contains(value[i])) + { + throw new Exception("Invalid country shortcode. See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2."); + } + } + + this.country = value; + } + } + + /// + /// Gets or sets the proximity option, which is a location around which to bias results, + /// given as . + /// + public Vector2d? Proximity + { + get + { + return this.proximity; + } + + set + { + this.proximity = value; + } + } + + /// Builds a forward geocode URL string. + /// A complete, valid forward geocode URL. + public override string GetUrl() + { + Dictionary opts = new Dictionary(); + + if (this.Autocomplete != null) + { + opts.Add("autocomplete", this.Autocomplete.ToString().ToLower()); + } + + if (this.Bbox != null) + { + var nonNullableBbox = (Vector2dBounds)this.Bbox; + opts.Add("bbox", nonNullableBbox.ToString()); + } + + if (this.Country != null) + { + opts.Add("country", ForwardGeocodeResource.GetUrlQueryFromArray(this.Country)); + } + + if (this.Proximity != null) + { + var nonNullableProx = (Vector2d)this.Proximity; + opts.Add("proximity", nonNullableProx.ToString()); + } + + if (this.Types != null) + { + opts.Add("types", GetUrlQueryFromArray(this.Types)); + } + + // !!!!!!!!!! HACK !!!!!!! + // we are seeing super weird behaviour on some iOS devices: + // crashes with properly escaped whitespaces %20 and commas %2C - and other special characters + // 'NSAllowsArbitraryLoads' and 'NSURLConnection finished with error - code - 1002' + // Use 'CFNETWORK_DIAGNOSTICS=1' in XCode to get more details https://stackoverflow.com/a/46748461 + + // trying to get rid of at least the most common characters - other will still crash +#if UNITY_IOS + Query = Query + .Replace(",", " ") + .Replace(".", " ") + .Replace("-", " "); +#endif + + return + Constants.BaseAPI + + ApiEndpoint + + Mode + +#if UNITY_IOS +#if UNITY_2017_1_OR_NEWER + UnityEngine.Networking.UnityWebRequest.EscapeURL(Query) + +#else + WWW.EscapeURL(Query) + +#endif +#else + Uri.EscapeDataString(Query) + +#endif + ".json" + + EncodeQueryString(opts); + } + } +} diff --git a/Core/mapbox-sdk-cs/Geocoding/ForwardGeocodeResource.cs.meta b/Core/mapbox-sdk-cs/Geocoding/ForwardGeocodeResource.cs.meta new file mode 100644 index 0000000..527f7c6 --- /dev/null +++ b/Core/mapbox-sdk-cs/Geocoding/ForwardGeocodeResource.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 33cb5b2bc4f6f4397a21fdd87dfa0048 +timeCreated: 1493833265 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Geocoding/GeocodeResource.cs b/Core/mapbox-sdk-cs/Geocoding/GeocodeResource.cs new file mode 100644 index 0000000..d800aaf --- /dev/null +++ b/Core/mapbox-sdk-cs/Geocoding/GeocodeResource.cs @@ -0,0 +1,73 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Geocoding +{ + using System; + using System.Collections.Generic; + using Mapbox.Platform; + + /// Base geocode class. + /// Type of Query field (either string or LatLng). + public abstract class GeocodeResource : Resource + { + /// A List of all possible geocoding feature types. + public static readonly List FeatureTypes = new List + { + "country", "region", "postcode", "place", "locality", "neighborhood", "address", "poi" + }; + + private readonly string apiEndpoint = "geocoding/v5/"; + + private readonly string mode = "mapbox.places/"; + + // Optional + private string[] types; + + /// Gets or sets the query. + public abstract T Query { get; set; } + + /// Gets the API endpoint as a partial URL path. + public override string ApiEndpoint { + get { + return this.apiEndpoint; + } + } + + /// Gets the mode. + public string Mode { + get { + return this.mode; + } + } + + /// Gets or sets which feature types to return results for. + public string[] Types { + get { + return this.types; + } + + set { + if (value == null) + { + this.types = value; + return; + } + + for (int i = 0; i < value.Length; i++) + { + // Validate provided types + if (!FeatureTypes.Contains(value[i])) + { + throw new Exception("Invalid type. Must be \"country\", \"region\", \"postcode\", \"place\", \"locality\", \"neighborhood\", \"address\", or \"poi\"."); + } + } + + this.types = value; + } + } + } +} diff --git a/Core/mapbox-sdk-cs/Geocoding/GeocodeResource.cs.meta b/Core/mapbox-sdk-cs/Geocoding/GeocodeResource.cs.meta new file mode 100644 index 0000000..f735cd3 --- /dev/null +++ b/Core/mapbox-sdk-cs/Geocoding/GeocodeResource.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: aba88323b8d91474fb3b991eb0bd9349 +timeCreated: 1491243034 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Geocoding/Geocoder.cs b/Core/mapbox-sdk-cs/Geocoding/Geocoder.cs new file mode 100644 index 0000000..893d478 --- /dev/null +++ b/Core/mapbox-sdk-cs/Geocoding/Geocoder.cs @@ -0,0 +1,87 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Geocoding +{ + using System; + using System.Text; + using Mapbox.Json; + using Mapbox.Platform; + using Mapbox.Utils.JsonConverters; + + /// + /// Wrapper around the + /// Mapbox Geocoding API. The Geocoder does two things: geocoding and reverse geocoding. + /// + public sealed class Geocoder + { + private readonly IFileSource fileSource; + + /// Initializes a new instance of the class. + /// Network access abstraction. + public Geocoder(IFileSource fileSource) + { + this.fileSource = fileSource; + } + + /// Performs asynchronously a geocoding lookup. + /// Geocode resource. + /// Callback to be called after the request is completed. + /// String or LngLat. Should be automatically inferred. + /// + /// Returns a that can be used for canceling a pending + /// request. This handle can be completely ignored if there is no intention of ever + /// canceling the request. + /// + public IAsyncRequest Geocode(GeocodeResource geocode, Action callback) + { + return this.fileSource.Request( + geocode.GetUrl(), + (Response response) => + { + var str = Encoding.UTF8.GetString(response.Data); + + var data = Deserialize(str); + + callback(data); + }); + } + + /// Performs asynchronously a geocoding lookup. + /// Geocode resource. + /// Callback to be called after the request is completed. + /// String or LngLat. Should be automatically inferred. + /// + /// Returns a that can be used for canceling a pending + /// request. This handle can be completely ignored if there is no intention of ever + /// canceling the request. + /// + public IAsyncRequest Geocode(GeocodeResource geocode, Action callback) + { + return this.fileSource.Request( + geocode.GetUrl(), + (Response response) => + { + var str = Encoding.UTF8.GetString(response.Data); + + var data = Deserialize(str); + + callback(data); + }); + } + + /// + /// Deserialize the geocode response string into a . + /// + /// JSON String. + /// A . + /// Forward or reverse geocode. + public T Deserialize(string str) + { + return JsonConvert.DeserializeObject(str, JsonConverters.Converters); + } + } +} diff --git a/Core/mapbox-sdk-cs/Geocoding/Geocoder.cs.meta b/Core/mapbox-sdk-cs/Geocoding/Geocoder.cs.meta new file mode 100644 index 0000000..6c6b64c --- /dev/null +++ b/Core/mapbox-sdk-cs/Geocoding/Geocoder.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d304b174589dd496993060116409b23c +timeCreated: 1491336250 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Geocoding/Response.meta b/Core/mapbox-sdk-cs/Geocoding/Response.meta new file mode 100644 index 0000000..d9c5e71 --- /dev/null +++ b/Core/mapbox-sdk-cs/Geocoding/Response.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 5ef566ef707b848c4bac9b1f13fccf17 +folderAsset: yes +timeCreated: 1491243031 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Geocoding/Response/Feature.cs b/Core/mapbox-sdk-cs/Geocoding/Response/Feature.cs new file mode 100644 index 0000000..c215539 --- /dev/null +++ b/Core/mapbox-sdk-cs/Geocoding/Response/Feature.cs @@ -0,0 +1,96 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Geocoding { + using System; + using System.Collections.Generic; + using Mapbox.Json; + using Mapbox.Utils; + using Mapbox.Utils.JsonConverters; + + /// A GeoJSON FeatureCollection of points returned by geocoding API. +#if !WINDOWS_UWP + //http://stackoverflow.com/a/12903628 + [Serializable] +#endif + public class Feature { + /// Gets or sets the id. Ids are unique in the Mapbox geocoder. + /// The id. + [JsonProperty("id")] + public string Id { get; set; } + + /// + /// Gets or sets feature type. One of country, region, postcode, place, locality, neighborhood, address, poi. + /// + /// The type. + [JsonProperty("type")] + public string Type { get; set; } + + /// + /// Gets or sets the text. + /// + /// The text. + [JsonProperty("text")] + public string Text { get; set; } + + /// + /// Gets or sets the name of the place. + /// + /// The name of the place. + [JsonProperty("place_name")] + public string PlaceName { get; set; } + + /// + /// Gets or sets the relevance. + /// + /// The relevance. + [JsonProperty("relevance")] + public double Relevance { get; set; } + + /// + /// Gets or sets the properties. + /// + /// The properties. + [JsonProperty("properties")] + public Dictionary Properties { get; set; } + + /// + /// Gets or sets the bbox. + /// + /// The bbox. + [JsonProperty("bbox", NullValueHandling = NullValueHandling.Ignore)] + [JsonConverter(typeof(BboxToVector2dBoundsConverter))] + public Vector2dBounds? Bbox { get; set; } + + /// + /// Gets or sets the center. + /// + /// The center. + [JsonProperty("center")] + [JsonConverter(typeof(LonLatToVector2dConverter))] + public Vector2d Center { get; set; } + + /// + /// Gets or sets the geometry. + /// + /// The geometry. + [JsonProperty("geometry")] + public Geometry Geometry { get; set; } + + /// + /// Gets or sets the address. + /// + [JsonProperty("address", NullValueHandling = NullValueHandling.Ignore)] + public string Address { get; set; } + + /// + /// Gets or sets the context. + /// + /// The context. + [JsonProperty("context", NullValueHandling = NullValueHandling.Ignore)] + public List> Context { get; set; } + } +} diff --git a/Core/mapbox-sdk-cs/Geocoding/Response/Feature.cs.meta b/Core/mapbox-sdk-cs/Geocoding/Response/Feature.cs.meta new file mode 100644 index 0000000..2c3e1f2 --- /dev/null +++ b/Core/mapbox-sdk-cs/Geocoding/Response/Feature.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f0645486f47864cd390751dd94d0302f +timeCreated: 1493218361 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Geocoding/Response/GeocodeResponse.cs b/Core/mapbox-sdk-cs/Geocoding/Response/GeocodeResponse.cs new file mode 100644 index 0000000..10a7402 --- /dev/null +++ b/Core/mapbox-sdk-cs/Geocoding/Response/GeocodeResponse.cs @@ -0,0 +1,71 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Geocoding { + using System; + using System.Collections.Generic; + using Mapbox.Json; + + /// Base geocode response. +#if !WINDOWS_UWP + //http://stackoverflow.com/a/12903628 + [Serializable] +#endif + public abstract class GeocodeResponse { + /// + /// Gets or sets the type. + /// + /// The type. + [JsonProperty("type", Order = 0)] + public string Type { get; set; } + + /// + /// Gets or sets the features. + /// + /// The features. + [JsonProperty("features", Order = 2)] + public List Features { get; set; } + + /// + /// Gets or sets the attribution. + /// + /// The attribution. + [JsonProperty("attribution", Order = 3)] + public string Attribution { get; set; } + } + + /// + /// Reverse Geocode response. + /// +#if !WINDOWS_UWP + //http://stackoverflow.com/a/12903628 + [Serializable] +#endif + public class ReverseGeocodeResponse : GeocodeResponse { + /// + /// Gets or sets the query. + /// + /// The query. + [JsonProperty("query", Order = 1)] + public List Query { get; set; } + } + + /// + /// Forward geocode response. + /// +#if !WINDOWS_UWP + //http://stackoverflow.com/a/12903628 + [Serializable] +#endif + public class ForwardGeocodeResponse : GeocodeResponse { + /// + /// Gets or sets the query. + /// + /// The query. + [JsonProperty("query", Order = 1)] + public List Query { get; set; } + } +} \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/Geocoding/Response/GeocodeResponse.cs.meta b/Core/mapbox-sdk-cs/Geocoding/Response/GeocodeResponse.cs.meta new file mode 100644 index 0000000..05bcd49 --- /dev/null +++ b/Core/mapbox-sdk-cs/Geocoding/Response/GeocodeResponse.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f1cccf508c40144308be9518f5085a69 +timeCreated: 1491243035 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Geocoding/Response/Geometry.cs b/Core/mapbox-sdk-cs/Geocoding/Response/Geometry.cs new file mode 100644 index 0000000..a22397e --- /dev/null +++ b/Core/mapbox-sdk-cs/Geocoding/Response/Geometry.cs @@ -0,0 +1,34 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Geocoding { + using System; + using Mapbox.Json; + using Mapbox.Utils; + using Mapbox.Utils.JsonConverters; + + /// Point geometry representing location of geocode result. +#if !WINDOWS_UWP + //http://stackoverflow.com/a/12903628 + [Serializable] +#endif + public class Geometry { + /// + /// Gets or sets type. Geocode results will always be type: point. + /// + /// The GeoJSON geometry type. + [JsonProperty("type")] + public string Type { get; set; } + + /// + /// Gets or sets coordinates. Because they are points, Geocode results will always be a single Geocoordinate. + /// + /// The coordinates. + [JsonConverter(typeof(LonLatToVector2dConverter))] + [JsonProperty("coordinates")] + public Vector2d Coordinates { get; set; } + } +} diff --git a/Core/mapbox-sdk-cs/Geocoding/Response/Geometry.cs.meta b/Core/mapbox-sdk-cs/Geocoding/Response/Geometry.cs.meta new file mode 100644 index 0000000..158cea7 --- /dev/null +++ b/Core/mapbox-sdk-cs/Geocoding/Response/Geometry.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b599e78a14b3d42c8822cec5d5775397 +timeCreated: 1493218361 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Geocoding/ReverseGeocodeResource.cs b/Core/mapbox-sdk-cs/Geocoding/ReverseGeocodeResource.cs new file mode 100644 index 0000000..8d60464 --- /dev/null +++ b/Core/mapbox-sdk-cs/Geocoding/ReverseGeocodeResource.cs @@ -0,0 +1,55 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Geocoding +{ + using System.Collections.Generic; + using Mapbox.Utils; + + /// A reverse geocode request. + public sealed class ReverseGeocodeResource : GeocodeResource + { + // Required + private Vector2d query; + + /// Initializes a new instance of the class. + /// Location to reverse geocode. + public ReverseGeocodeResource(Vector2d query) + { + this.Query = query; + } + + /// Gets or sets the location. + public override Vector2d Query { + get { + return this.query; + } + + set { + this.query = value; + } + } + + /// Builds a complete reverse geocode URL string. + /// A complete, valid reverse geocode URL string. + public override string GetUrl() + { + Dictionary opts = new Dictionary(); + + if (this.Types != null) + { + opts.Add("types", GetUrlQueryFromArray(this.Types)); + } + + return Constants.BaseAPI + + this.ApiEndpoint + + this.Mode + + this.Query.ToString() + + ".json" + + EncodeQueryString(opts); + } + } +} \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/Geocoding/ReverseGeocodeResource.cs.meta b/Core/mapbox-sdk-cs/Geocoding/ReverseGeocodeResource.cs.meta new file mode 100644 index 0000000..e77ee51 --- /dev/null +++ b/Core/mapbox-sdk-cs/Geocoding/ReverseGeocodeResource.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 23c6d0bd3662648d3859495c35635b64 +timeCreated: 1493833265 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Map.meta b/Core/mapbox-sdk-cs/Map.meta new file mode 100644 index 0000000..5043e9f --- /dev/null +++ b/Core/mapbox-sdk-cs/Map.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 67003c49d480847189c0d8e81c14da83 +folderAsset: yes +timeCreated: 1491243031 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Map/CanonicalTileId.cs b/Core/mapbox-sdk-cs/Map/CanonicalTileId.cs new file mode 100644 index 0000000..20f1f25 --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/CanonicalTileId.cs @@ -0,0 +1,117 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Map +{ + using System; + using Mapbox.Utils; + + /// + /// Data type to store Web Mercator tile scheme. + /// See tile IDs in action. + /// + public struct CanonicalTileId : IEquatable + { + /// The zoom level. + public readonly int Z; + + /// The X coordinate in the tile grid. + public readonly int X; + + /// The Y coordinate in the tile grid. + public readonly int Y; + + /// + /// Initializes a new instance of the struct, + /// representing a tile coordinate in a slippy map. + /// + /// The z coordinate or the zoom level. + /// The x coordinate. + /// The y coordinate. + public CanonicalTileId(int z, int x, int y) + { + this.Z = z; + this.X = x; + this.Y = y; + } + + internal CanonicalTileId(UnwrappedTileId unwrapped) + { + var z = unwrapped.Z; + var x = unwrapped.X; + var y = unwrapped.Y; + + var wrap = (x < 0 ? x - (1 << z) + 1 : x) / (1 << z); + + this.Z = z; + this.X = x - wrap * (1 << z); + this.Y = y < 0 ? 0 : Math.Min(y, (1 << z) - 1); + } + + /// + /// Get the cordinate at the top left of corner of the tile. + /// + /// The coordinate. + public Vector2d ToVector2d() + { + double n = Math.PI - ((2.0 * Math.PI * this.Y) / Math.Pow(2.0, this.Z)); + + double lat = 180.0 / Math.PI * Math.Atan(Math.Sinh(n)); + double lng = (this.X / Math.Pow(2.0, this.Z) * 360.0) - 180.0; + + // FIXME: Super hack because of rounding issues. + return new Vector2d(lat - 0.0001, lng + 0.0001); + } + + /// + /// Returns a that represents the current + /// . + /// + /// + /// A that represents the current + /// . + /// + public override string ToString() + { + return this.Z + "/" + this.X + "/" + this.Y; + } + + #region Equality + public bool Equals(CanonicalTileId other) + { + return this.X == other.X && this.Y == other.Y && this.Z == other.Z; + } + + public override int GetHashCode() + { + return X ^ Y ^ Z; + } + + public static bool operator ==(CanonicalTileId a, CanonicalTileId b) + { + return a.X == b.X && a.Y == b.Y && a.Z == b.Z; + } + + public static bool operator !=(CanonicalTileId a, CanonicalTileId b) + { + return !(a == b); + } + + public override bool Equals(object obj) + { + if (obj is CanonicalTileId) + { + return this.Equals((CanonicalTileId)obj); + } + else + { + return false; + } + } + + #endregion + } +} diff --git a/Core/mapbox-sdk-cs/Map/CanonicalTileId.cs.meta b/Core/mapbox-sdk-cs/Map/CanonicalTileId.cs.meta new file mode 100644 index 0000000..8b00bd2 --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/CanonicalTileId.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b032ac6adcdd94a899ef544e06b9e828 +timeCreated: 1493952209 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Map/ClassicRasterTile.cs b/Core/mapbox-sdk-cs/Map/ClassicRasterTile.cs new file mode 100644 index 0000000..ffdf335 --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/ClassicRasterTile.cs @@ -0,0 +1,22 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Map +{ + /// + /// A raster tile from the Mapbox Map API, a encoded image representing a geographic + /// bounding box. Usually JPEG or PNG encoded. + /// See for usage. + /// Read more about static classic maps . + /// + public class ClassicRasterTile : RasterTile + { + internal override TileResource MakeTileResource(string tilesetId) + { + return TileResource.MakeClassicRaster(Id, tilesetId); + } + } +} diff --git a/Core/mapbox-sdk-cs/Map/ClassicRasterTile.cs.meta b/Core/mapbox-sdk-cs/Map/ClassicRasterTile.cs.meta new file mode 100644 index 0000000..c721171 --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/ClassicRasterTile.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 26ff02ff702b3417b9d4514af452c64f +timeCreated: 1494603018 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Map/ClassicRetinaRasterTile.cs b/Core/mapbox-sdk-cs/Map/ClassicRetinaRasterTile.cs new file mode 100644 index 0000000..945ca4e --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/ClassicRetinaRasterTile.cs @@ -0,0 +1,22 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Map +{ + /// + /// A retina-resolution raster tile from the Mapbox Map API, a encoded image representing a geographic + /// bounding box. Usually JPEG or PNG encoded. + /// Like , but higher resolution. + /// See retina documentation . + /// + public class ClassicRetinaRasterTile : ClassicRasterTile + { + internal override TileResource MakeTileResource(string tilesetId) + { + return TileResource.MakeClassicRetinaRaster(Id, tilesetId); + } + } +} diff --git a/Core/mapbox-sdk-cs/Map/ClassicRetinaRasterTile.cs.meta b/Core/mapbox-sdk-cs/Map/ClassicRetinaRasterTile.cs.meta new file mode 100644 index 0000000..1969c52 --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/ClassicRetinaRasterTile.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 83237273afa4e4a8a9a0600d8c694e38 +timeCreated: 1494603018 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Map/Map.cs b/Core/mapbox-sdk-cs/Map/Map.cs new file mode 100644 index 0000000..dbed73c --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/Map.cs @@ -0,0 +1,236 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Map +{ + using System; + using System.Collections.Generic; + using Mapbox.Platform; + using Mapbox.Utils; + + /// + /// The Mapbox Map abstraction will take care of fetching and decoding + /// data for a geographic bounding box at a certain zoom level. + /// + /// + /// The tile type, currently or + /// . + /// + /// + /// Request a map of the whole world: + /// + /// var map = new Map<RasterTile>(MapboxAccess.Instance); + /// map.Zoom = 2 + /// map.Vector2dBounds = Vector2dBounds.World(); + /// map.TilesetId = "mapbox://styles/mapbox/streets-v10 + /// + /// // Register for tile updates. + /// map.Subscribe(this); + /// + /// // Trigger the request. + /// map.Update(); + /// + /// + public sealed class Map : Mapbox.Utils.IObservable where T : Tile, new() + { + /// + /// Arbitrary limit of tiles this class will handle simultaneously. + /// + public const int TileMax = 256; + + private readonly IFileSource fs; + private Vector2dBounds latLngBounds; + private int zoom; + private string tilesetId; + + private HashSet tiles = new HashSet(); + private List> observers = new List>(); + + /// + /// Initializes a new instance of the class. + /// + /// The data source abstraction. + public Map(IFileSource fs) + { + this.fs = fs; + this.latLngBounds = new Vector2dBounds(); + this.zoom = 0; + } + + /// + /// Gets or sets the tileset ID. If not set, it will use the default + /// tileset ID for the tile type. I.e. "mapbox.satellite" for raster tiles + /// and "mapbox.mapbox-streets-v7" for vector tiles. + /// + /// + /// The tileset ID, usually in the format "user.mapid". Exceptionally, + /// will take the full style URL + /// from where the tile is composited from, like "mapbox://styles/mapbox/streets-v9". + /// + public string TilesetId + { + get + { + return this.tilesetId; + } + + set + { + if (this.tilesetId == value) + { + return; + } + + this.tilesetId = value; + + foreach (Tile tile in this.tiles) + { + tile.Cancel(); + } + + this.tiles.Clear(); + } + } + + /// + /// Gets the tiles, vector or raster. Tiles might be + /// in a incomplete state. + /// + /// The tiles. + public HashSet Tiles + { + get + { + return this.tiles; + } + } + + /// Gets or sets a geographic bounding box. + /// New geographic bounding box. + public Vector2dBounds Vector2dBounds + { + get + { + return this.latLngBounds; + } + + set + { + this.latLngBounds = value; + } + } + + /// Gets or sets the central coordinate of the map. + /// The central coordinate. + public Vector2d Center + { + get + { + return this.latLngBounds.Center; + } + + set + { + this.latLngBounds.Center = value; + } + } + + /// Gets or sets the map zoom level. + /// The new zoom level. + public int Zoom + { + get + { + return this.zoom; + } + + set + { + this.zoom = Math.Max(0, Math.Min(20, value)); + } + } + + /// + /// Sets the coordinates bounds and zoom at once. + /// + /// Coordinates bounds. + /// Zoom level. + public void SetVector2dBoundsZoom(Vector2dBounds bounds, int zoom) + { + this.latLngBounds = bounds; + this.zoom = zoom; + } + + /// Add an to the observer list. + /// The object subscribing to events. + public void Subscribe(Mapbox.Utils.IObserver observer) + { + this.observers.Add(observer); + } + + /// Remove an to the observer list. + /// The object unsubscribing to events. + public void Unsubscribe(Mapbox.Utils.IObserver observer) + { + this.observers.Remove(observer); + } + + private void NotifyNext(T next) + { + var copy = new List>(this.observers); + + foreach (Mapbox.Utils.IObserver observer in copy) + { + observer.OnNext(next); + } + } + + /// + /// Request tiles after changing map properties. + /// + public void Update() + { + var cover = TileCover.Get(this.latLngBounds, this.zoom); + + if (cover.Count > TileMax) + { + return; + } + + // Do not request tiles that we are already requesting + // but at the same time exclude the ones we don't need + // anymore, cancelling the network request. + this.tiles.RemoveWhere((T tile) => + { + if (cover.Remove(tile.Id)) + { + return false; + } + else + { + tile.Cancel(); + this.NotifyNext(tile); + + return true; + } + }); + + foreach (CanonicalTileId id in cover) + { + var tile = new T(); + + Tile.Parameters param; + param.Id = id; + param.TilesetId = this.tilesetId; + param.Fs = this.fs; + + tile.Initialize(param, () => { this.NotifyNext(tile); }); + + this.tiles.Add(tile); + } + } + } +} diff --git a/Core/mapbox-sdk-cs/Map/Map.cs.meta b/Core/mapbox-sdk-cs/Map/Map.cs.meta new file mode 100644 index 0000000..44379ba --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/Map.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 24bb3ef727dad4e1385a77beef324ff0 +timeCreated: 1494441866 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Map/MapUtils.cs b/Core/mapbox-sdk-cs/Map/MapUtils.cs new file mode 100644 index 0000000..cdfb48d --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/MapUtils.cs @@ -0,0 +1,58 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Map +{ + using System; + using Mapbox.Utils; + + /// + /// Utilities for working with Map APIs. + /// + public static class MapUtils + { + /// + /// Normalizes a static style URL. + /// + /// The static style URL. + /// A url, either a Mapbox URI (mapbox://{username}/{styleid}) or a full url to a map. + public static string NormalizeStaticStyleURL(string url) + { + bool isMapboxUrl = url.StartsWith("mapbox://", StringComparison.Ordinal); + + // Support full Mapbox URLs by returning here if a mapbox URL is not detected. + if (!isMapboxUrl) + { + return url; + } + + string[] split = url.Split('/'); + var user = split[3]; + var style = split[4]; + var draft = string.Empty; + + if (split.Length > 5) + { + draft = "/draft"; + } + + return Constants.BaseAPI + "styles/v1/" + user + "/" + style + draft + "/tiles"; + } + + /// + /// Converts a TilesetId to a URL. + /// + /// The identifier to URL. + /// The style id. + public static string TilesetIdToUrl(string id) + { + // TODO: Validate that id is a real id + const string MapBaseApi = Constants.BaseAPI + "v4/"; + + return MapBaseApi + id; + } + } +} diff --git a/Core/mapbox-sdk-cs/Map/MapUtils.cs.meta b/Core/mapbox-sdk-cs/Map/MapUtils.cs.meta new file mode 100644 index 0000000..7a22493 --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/MapUtils.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a237cc1b965e34670a7c74ecf2bdbee3 +timeCreated: 1491243034 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Map/RasterTile.cs b/Core/mapbox-sdk-cs/Map/RasterTile.cs new file mode 100644 index 0000000..cc98398 --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/RasterTile.cs @@ -0,0 +1,69 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Map +{ + /// + /// A raster tile from the Mapbox Style API, an encoded image representing a geographic + /// bounding box. Usually JPEG or PNG encoded. + /// + /// + /// Making a RasterTile request: + /// + /// var parameters = new Tile.Parameters(); + /// parameters.Fs = MapboxAccess.Instance; + /// parameters.Id = new CanonicalTileId(_zoom, _tileCoorindateX, _tileCoordinateY); + /// parameters.TilesetId = "mapbox://styles/mapbox/satellite-v9"; + /// var rasterTile = new RasterTile(); + /// + /// // Make the request. + /// rasterTile.Initialize(parameters, (Action)(() => + /// { + /// if (!string.IsNullOrEmpty(rasterTile.Error)) + /// { + /// // Handle the error. + /// } + /// + /// // Consume the . + /// })); + /// + /// + public class RasterTile : Tile + { + private byte[] data; + + /// Gets the raster tile raw data. + /// The raw data, usually an encoded JPEG or PNG. + /// + /// Consuming data in Unity to create a Texture2D: + /// + /// var texture = new Texture2D(0, 0); + /// texture.LoadImage(rasterTile.Data); + /// _sampleMaterial.mainTexture = texture; + /// + /// + public byte[] Data + { + get + { + return this.data; + } + } + + internal override TileResource MakeTileResource(string tilesetId) + { + return TileResource.MakeRaster(Id, tilesetId); + } + + internal override bool ParseTileData(byte[] data) + { + // We do not parse raster tiles as they are + this.data = data; + + return true; + } + } +} diff --git a/Core/mapbox-sdk-cs/Map/RasterTile.cs.meta b/Core/mapbox-sdk-cs/Map/RasterTile.cs.meta new file mode 100644 index 0000000..f543bd3 --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/RasterTile.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 01d65e8417e21498f88939119e4fe3ab +timeCreated: 1493756686 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Map/RawPngRasterTile.cs b/Core/mapbox-sdk-cs/Map/RawPngRasterTile.cs new file mode 100644 index 0000000..b7e8bbe --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/RawPngRasterTile.cs @@ -0,0 +1,36 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Map +{ + /// + /// A raster tile containing an encoded RGBA PNG. + /// Read about global elevation data. + /// + /// + /// Print the real world height, in meters, for each pixel: + /// + /// var texture = new Texture2D(0, 0); + /// texture.LoadImage(tile.Data); + /// for (int i = 0; i < texture.width; i++) + /// { + /// for (int j = 0; j < texture.height; j++) + /// { + /// var color = texture.GetPixel(i, j); + /// var height = Conversions.GetAbsoluteHeightFromColor(color); + /// Console.Write("Height: " + height); + /// } + /// } + /// + /// + public sealed class RawPngRasterTile : RasterTile + { + internal override TileResource MakeTileResource(string tilesetId) + { + return TileResource.MakeRawPngRaster(Id, tilesetId); + } + } +} diff --git a/Core/mapbox-sdk-cs/Map/RawPngRasterTile.cs.meta b/Core/mapbox-sdk-cs/Map/RawPngRasterTile.cs.meta new file mode 100644 index 0000000..c820bc5 --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/RawPngRasterTile.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ab4a5e34c15df42b3b4d5bf5c9b6b9b1 +timeCreated: 1493952209 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Map/RetinaRasterTile.cs b/Core/mapbox-sdk-cs/Map/RetinaRasterTile.cs new file mode 100644 index 0000000..e0ea43c --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/RetinaRasterTile.cs @@ -0,0 +1,22 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Map +{ + /// + /// A retin-resolution raster tile from the Mapbox Style API, an encoded image representing a geographic + /// bounding box. Usually JPEG or PNG encoded. + /// Like , but higher resolution. + /// See retina documentation . + /// + public class RetinaRasterTile : RasterTile + { + internal override TileResource MakeTileResource(string tilesetId) + { + return TileResource.MakeRetinaRaster(Id, tilesetId); + } + } +} diff --git a/Core/mapbox-sdk-cs/Map/RetinaRasterTile.cs.meta b/Core/mapbox-sdk-cs/Map/RetinaRasterTile.cs.meta new file mode 100644 index 0000000..c16fe7f --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/RetinaRasterTile.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9cd3514d26c4b4c7685f804af02d388b +timeCreated: 1494603018 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Map/Tile.cs b/Core/mapbox-sdk-cs/Map/Tile.cs new file mode 100644 index 0000000..fc697bc --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/Tile.cs @@ -0,0 +1,277 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Map +{ + using System; + using Mapbox.Platform; + using System.Linq; + using System.Collections.Generic; + using System.Collections.ObjectModel; + using Mapbox.Unity.Utilities; + + + /// + /// A Map tile, a square with vector or raster data representing a geographic + /// bounding box. More info + /// here . + /// + public abstract class Tile : IAsyncRequest + { + + + private CanonicalTileId _id; + private List _exceptions; + private State _state = State.New; + private IAsyncRequest _request; + private Action _callback; + + /// Tile state. + public enum State + { + /// New tile, not yet initialized. + New, + /// Loading data. + Loading, + /// Data loaded and parsed. + Loaded, + /// Data loading cancelled. + Canceled, + /// Data has been loaded before and got updated. + Updated + } + + /// Gets the identifier. + /// The canonical tile identifier. + public CanonicalTileId Id + { + get { return _id; } + set { _id = value; } + } + + + /// Flag to indicate if the request was successful + public bool HasError + { + get + { + return _exceptions == null ? false : _exceptions.Count > 0; + } + } + + + /// Exceptions that might have occured during creation of the tile. + public ReadOnlyCollection Exceptions + { + get { return null == _exceptions ? null : _exceptions.AsReadOnly(); } + } + + + /// Messages of exceptions otherwise empty string. + public string ExceptionsAsString + { + get + { + if (null == _exceptions || _exceptions.Count == 0) { return string.Empty; } + return string.Join(Environment.NewLine, _exceptions.Select(e => e.Message).ToArray()); + } + } + + + /// + /// Sets the error message. + /// + /// + internal void AddException(Exception ex) + { + if (null == _exceptions) { _exceptions = new List(); } + _exceptions.Add(ex); + } + + + /// + /// Gets the current state. When fully loaded, you must + /// check if the data actually arrived and if the tile + /// is accusing any error. + /// + /// The tile state. + public State CurrentState + { + get + { + return _state; + } + } + + + public HttpRequestType RequestType { get { return _request.RequestType; } } + + + public bool IsCompleted + { + get + { + return _state == State.Loaded; + } + } + + /// + /// Initializes the object. It will + /// start a network request and fire the callback when completed. + /// + /// Initialization parameters. + /// The completion callback. + public void Initialize(Parameters param, Action callback) + { + Cancel(); + + _state = State.Loading; + _id = param.Id; + _callback = callback; + _request = param.Fs.Request(MakeTileResource(param.TilesetId).GetUrl(), HandleTileResponse, tileId: _id, tilesetId: param.TilesetId); + } + + internal void Initialize(IFileSource fileSource, CanonicalTileId canonicalTileId, string tilesetId, Action p) + { + Cancel(); + + _state = State.Loading; + _id = canonicalTileId; + _callback = p; + _request = fileSource.Request(MakeTileResource(tilesetId).GetUrl(), HandleTileResponse, tileId: _id, tilesetId: tilesetId); + } + + /// + /// Returns a that represents the current + /// . + /// + /// + /// A that represents the current + /// . + /// + public override string ToString() + { + return Id.ToString(); + } + + + /// + /// Cancels the request for the object. + /// It will stop a network request and set the tile's state to Canceled. + /// + /// + /// + /// // Do not request tiles that we are already requesting + /// // but at the same time exclude the ones we don't need + /// // anymore, cancelling the network request. + /// tiles.RemoveWhere((T tile) => + /// { + /// if (cover.Remove(tile.Id)) + /// { + /// return false; + /// } + /// else + /// { + /// tile.Cancel(); + /// NotifyNext(tile); + /// return true; + /// } + /// }); + /// + /// + public void Cancel() + { + if (_request != null) + { + _request.Cancel(); + _request = null; + } + + _state = State.Canceled; + } + + + // Get the tile resource (raster/vector/etc). + internal abstract TileResource MakeTileResource(string tilesetId); + + + // Decode the tile. + internal abstract bool ParseTileData(byte[] data); + + + // TODO: Currently the tile decoding is done on the main thread. We must implement + // a Worker class to abstract this, so on platforms that support threads (like Unity + // on the desktop, Android, etc) we can use worker threads and when building for + // the browser, we keep it single-threaded. + List ids = new List(); + private void HandleTileResponse(Response response) + { + + if (response.HasError) + { + if (!ids.Contains(_id.ToString())) + ids.Add(_id.ToString()); + else + return; + + response.Exceptions.ToList().ForEach(e => AddException(e)); + } + else + { + // only try to parse if request was successful + + // current implementation doesn't need to check if parsing is successful: + // * Mapbox.Map.VectorTile.ParseTileData() already adds any exception to the list + // * Mapbox.Map.RasterTile.ParseTileData() doesn't do any parsing + ParseTileData(response.Data); + } + + // Cancelled is not the same as loaded! + if (_state != State.Canceled) + { + if (response.IsUpdate) + { + _state = State.Updated; + } + else + { + _state = State.Loaded; + } + } + _callback(); + } + + + /// + /// Parameters for initializing a Tile object. + /// + /// + /// + /// var parameters = new Tile.Parameters(); + /// parameters.Fs = MapboxAccess.Instance; + /// parameters.Id = new CanonicalTileId(_zoom, _tileCoorindateX, _tileCoordinateY); + /// parameters.TilesetId = "mapbox.mapbox-streets-v7"; + /// + /// + public struct Parameters + { + /// The tile id. + public CanonicalTileId Id; + + /// + /// The tileset ID, usually in the format "user.mapid". Exceptionally, + /// will take the full style URL + /// from where the tile is composited from, like mapbox://styles/mapbox/streets-v9. + /// + public string TilesetId; + + /// The data source abstraction. + public IFileSource Fs; + } + + + } +} diff --git a/Core/mapbox-sdk-cs/Map/Tile.cs.meta b/Core/mapbox-sdk-cs/Map/Tile.cs.meta new file mode 100644 index 0000000..35484c6 --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/Tile.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8010c0fffeba24190a0e4a5a5f4317c6 +timeCreated: 1494951007 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Map/TileCover.cs b/Core/mapbox-sdk-cs/Map/TileCover.cs new file mode 100644 index 0000000..40f25d6 --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/TileCover.cs @@ -0,0 +1,159 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Map +{ + using System; + using System.Collections.Generic; + using Mapbox.Utils; + using UnityEngine; + + /// + /// Helper funtions to get a tile cover, i.e. a set of tiles needed for + /// covering a bounding box. + /// + public static class TileCover + { + /// Get a tile cover for the specified bounds and zoom. + /// Geographic bounding box. + /// Zoom level. + /// The tile cover set. + /// + /// Build a map of Colorado using TileCover: + /// + /// var sw = new Vector2d(36.997749, -109.0524961); + /// var ne = new Vector2d(41.0002612, -102.0609668); + /// var coloradoBounds = new Vector2dBounds(sw, ne); + /// var tileCover = TileCover.Get(coloradoBounds, 8); + /// Console.Write("Tiles Needed: " + tileCover.Count); + /// foreach (var id in tileCover) + /// { + /// var tile = new RasterTile(); + /// var parameters = new Tile.Parameters(); + /// parameters.Id = id; + /// parameters.Fs = MapboxAccess.Instance; + /// parameters.TilesetId = "mapbox://styles/mapbox/outdoors-v10"; + /// tile.Initialize(parameters, (Action)(() => + /// { + /// // Place tiles and load textures. + /// })); + /// } + /// + /// + public static HashSet Get(Vector2dBounds bounds, int zoom) + { + var tiles = new HashSet(); + + if (bounds.IsEmpty() || + bounds.South > Constants.LatitudeMax || + bounds.North < -Constants.LatitudeMax) + { + return tiles; + } + + var hull = Vector2dBounds.FromCoordinates( + new Vector2d(Math.Max(bounds.South, -Constants.LatitudeMax), bounds.West), + new Vector2d(Math.Min(bounds.North, Constants.LatitudeMax), bounds.East)); + + var sw = CoordinateToTileId(hull.SouthWest, zoom); + var ne = CoordinateToTileId(hull.NorthEast, zoom); + + // Scanlines. + for (var x = sw.X; x <= ne.X; ++x) + { + for (var y = ne.Y; y <= sw.Y; ++y) + { + tiles.Add(new UnwrappedTileId(zoom, x, y).Canonical); + } + } + + return tiles; + } + + + public static HashSet GetWithWebMerc(Vector2dBounds bounds, int zoom) + { + HashSet tiles = new HashSet(); + HashSet canonicalTiles = new HashSet(); + + if (bounds.IsEmpty()) { return tiles; } + + //stay within WebMerc bounds + Vector2d swWebMerc = new Vector2d(Math.Max(bounds.SouthWest.x, -Constants.WebMercMax), Math.Max(bounds.SouthWest.y, -Constants.WebMercMax)); + Vector2d neWebMerc = new Vector2d(Math.Min(bounds.NorthEast.x, Constants.WebMercMax), Math.Min(bounds.NorthEast.y, Constants.WebMercMax)); + + UnwrappedTileId swTile = WebMercatorToTileId(swWebMerc, zoom); + UnwrappedTileId neTile = WebMercatorToTileId(neWebMerc, zoom); + + for (int x = swTile.X; x <= neTile.X; x++) + { + for (int y = neTile.Y; y <= swTile.Y; y++) + { + UnwrappedTileId uwtid = new UnwrappedTileId(zoom, x, y); + //hack: currently too many tiles are created at lower zoom levels + //investigate formulas, this worked before + if (!canonicalTiles.Contains(uwtid.Canonical)) + { + tiles.Add(uwtid); + canonicalTiles.Add(uwtid.Canonical); + } + } + } + + return tiles; + } + + + /// Converts a coordinate to a tile identifier. + /// Geographic coordinate. + /// Zoom level. + /// The to tile identifier. + /// + /// Convert a geocoordinate to a TileId: + /// + /// var unwrappedTileId = TileCover.CoordinateToTileId(new Vector2d(40.015, -105.2705), 18); + /// Console.Write("UnwrappedTileId: " + unwrappedTileId.ToString()); + /// + /// + public static UnwrappedTileId CoordinateToTileId(Vector2d coord, int zoom) + { + var lat = coord.x; + var lng = coord.y; + + // See: http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames + var x = (int)Math.Floor((lng + 180.0) / 360.0 * Math.Pow(2.0, zoom)); + var y = (int)Math.Floor((1.0 - Math.Log(Math.Tan(lat * Math.PI / 180.0) + + 1.0 / Math.Cos(lat * Math.PI / 180.0)) / Math.PI) / 2.0 * Math.Pow(2.0, zoom)); + + return new UnwrappedTileId(zoom, x, y); + } + + + + /// + /// Converts a Web Mercator coordinate to a tile identifier. https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Derivation_of_tile_names + /// + /// Web Mercator coordinate + /// Zoom level + /// The to tile identifier. + public static UnwrappedTileId WebMercatorToTileId(Vector2d webMerc, int zoom) + { + // See: https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Derivation_of_tile_names + double tileCount = Math.Pow(2, zoom); + + //this SDK defines Vector2d.x as latitude and Vector2d.y as longitude + //same for WebMerc, so we have to flip x/y to make this formula work + double dblX = webMerc.x / Constants.WebMercMax; + double dblY = webMerc.y / Constants.WebMercMax; + + int x = (int)Math.Floor((1 + dblX) / 2 * tileCount); + int y = (int)Math.Floor((1 - dblY) / 2 * tileCount); + return new UnwrappedTileId(zoom, x, y); + } + + + } +} diff --git a/Core/mapbox-sdk-cs/Map/TileCover.cs.meta b/Core/mapbox-sdk-cs/Map/TileCover.cs.meta new file mode 100644 index 0000000..e19e3f4 --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/TileCover.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: fc67290bfffab4457b83802ef2f4c824 +timeCreated: 1494945808 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Map/TileErrorEventArgs.cs b/Core/mapbox-sdk-cs/Map/TileErrorEventArgs.cs new file mode 100644 index 0000000..c01a1a9 --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/TileErrorEventArgs.cs @@ -0,0 +1,63 @@ +namespace Mapbox.Map +{ + using System; + using Mapbox.Unity.MeshGeneration.Data; + using System.Collections.Generic; + using System.Collections.ObjectModel; + + public class TileErrorEventArgs : EventArgs + { + + /// + /// The tile identifier. + /// + public CanonicalTileId TileId; + /// + /// The exceptions. + /// + public List Exceptions; + /// + /// The unity tile instance. + /// + public UnityTile UnityTileInstance; + /// + /// The type of the tile. + /// + public Type TileType; + + /// + /// Initializes a new instance of the class. + /// + /// Tile identifier. + /// Tile type. + /// Unity tile instance. + /// Exceptions as a List + public TileErrorEventArgs(CanonicalTileId TileId, Type TileType, UnityTile UnityTileInstance, List Exceptions) + { + this.TileId = TileId; + this.Exceptions = Exceptions; + this.UnityTileInstance = UnityTileInstance; + this.TileType = TileType; + } + + /// + /// Initializes a new instance of the class. + /// + /// Tile identifier. + /// Tile type. + /// Unity tile instance. + /// Exceptions as a ReadOnlyCollection + public TileErrorEventArgs(CanonicalTileId TileId, Type TileType, UnityTile UnityTileInstance, ReadOnlyCollection Exceptions) + { + this.TileId = TileId; + List _exceptions = new List(); + foreach (var exception in Exceptions) + { + _exceptions.Add(exception); + } + this.Exceptions = _exceptions; + this.UnityTileInstance = UnityTileInstance; + this.TileType = TileType; + } + } +} diff --git a/Core/mapbox-sdk-cs/Map/TileErrorEventArgs.cs.meta b/Core/mapbox-sdk-cs/Map/TileErrorEventArgs.cs.meta new file mode 100644 index 0000000..1c57d97 --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/TileErrorEventArgs.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 59c42a951767c4031966d5ae5c20a47a +timeCreated: 1509068021 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Map/TileResource.cs b/Core/mapbox-sdk-cs/Map/TileResource.cs new file mode 100644 index 0000000..f1e7e85 --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/TileResource.cs @@ -0,0 +1,67 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- +namespace Mapbox.Map +{ + using Platform; + using System; + using Mapbox.Unity.Telemetry; + + public sealed class TileResource : IResource + { + readonly string _query; + + internal TileResource(string query) + { + _query = query; + } + + public static TileResource MakeRaster(CanonicalTileId id, string styleUrl) + { + return new TileResource(string.Format("{0}/{1}", MapUtils.NormalizeStaticStyleURL(styleUrl ?? "mapbox://styles/mapbox/satellite-v9"), id)); + } + + internal static TileResource MakeRetinaRaster(CanonicalTileId id, string styleUrl) + { + return new TileResource(string.Format("{0}/{1}@2x", MapUtils.NormalizeStaticStyleURL(styleUrl ?? "mapbox://styles/mapbox/satellite-v9"), id)); + } + + public static TileResource MakeClassicRaster(CanonicalTileId id, string tilesetId) + { + return new TileResource(string.Format("{0}/{1}.png", MapUtils.TilesetIdToUrl(tilesetId ?? "mapbox.satellite"), id)); + } + + internal static TileResource MakeClassicRetinaRaster(CanonicalTileId id, string tilesetId) + { + return new TileResource(string.Format("{0}/{1}@2x.png", MapUtils.TilesetIdToUrl(tilesetId ?? "mapbox.satellite"), id)); + } + + public static TileResource MakeRawPngRaster(CanonicalTileId id, string tilesetId) + { + return new TileResource(string.Format("{0}/{1}.pngraw", MapUtils.TilesetIdToUrl(tilesetId ?? "mapbox.terrain-rgb"), id)); + } + + public static TileResource MakeVector(CanonicalTileId id, string tilesetId) + { + return new TileResource(string.Format("{0}/{1}.vector.pbf", MapUtils.TilesetIdToUrl(tilesetId ?? "mapbox.mapbox-streets-v7"), id)); + } + + internal static TileResource MakeStyleOptimizedVector(CanonicalTileId id, string tilesetId, string optimizedStyleId, string modifiedDate) + { + return new TileResource(string.Format("{0}/{1}.vector.pbf?style={2}@{3}", MapUtils.TilesetIdToUrl(tilesetId ?? "mapbox.mapbox-streets-v7"), id, optimizedStyleId, modifiedDate)); + } + + public string GetUrl() + { + var uriBuilder = new UriBuilder(_query); + if (uriBuilder.Query != null && uriBuilder.Query.Length > 1) + { + uriBuilder.Query = uriBuilder.Query.Substring(1); + } + //return uriBuilder.ToString(); + return uriBuilder.Uri.ToString(); + } + } +} diff --git a/Core/mapbox-sdk-cs/Map/TileResource.cs.meta b/Core/mapbox-sdk-cs/Map/TileResource.cs.meta new file mode 100644 index 0000000..1a41326 --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/TileResource.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b56f5c7f0b51844c19d1267530b5acb1 +timeCreated: 1494603018 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Map/UnwrappedTileId.cs b/Core/mapbox-sdk-cs/Map/UnwrappedTileId.cs new file mode 100644 index 0000000..c0aa3c2 --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/UnwrappedTileId.cs @@ -0,0 +1,147 @@ +using System; + +namespace Mapbox.Map +{ + /// + /// Unwrapped tile identifier in a slippy map. Similar to , + /// but might go around the globe. + /// + public struct UnwrappedTileId : IEquatable + { + /// The zoom level. + public readonly int Z; + + /// The X coordinate in the tile grid. + public readonly int X; + + /// The Y coordinate in the tile grid. + public readonly int Y; + + /// + /// Initializes a new instance of the struct, + /// representing a tile coordinate in a slippy map that might go around the + /// globe. + /// + /// The z coordinate. + /// The x coordinate. + /// The y coordinate. + public UnwrappedTileId(int z, int x, int y) + { + this.Z = z; + this.X = x; + this.Y = y; + } + + /// Gets the canonical tile identifier. + /// The canonical tile identifier. + public CanonicalTileId Canonical + { + get + { + return new CanonicalTileId(this); + } + } + + /// + /// Returns a that represents the current + /// . + /// + /// + /// A that represents the current + /// . + /// + public override string ToString() + { + return this.Z + "/" + this.X + "/" + this.Y; + } + + public bool Equals(UnwrappedTileId other) + { + return this.X == other.X && this.Y == other.Y && this.Z == other.Z; + } + + public override int GetHashCode() + { + return (X << 6) ^ (Y << 16) ^ (Z << 8); + } + + public override bool Equals(object obj) + { + return this.X == ((UnwrappedTileId)obj).X && this.Y == ((UnwrappedTileId)obj).Y && this.Z == ((UnwrappedTileId)obj).Z; + } + + public static bool operator ==(UnwrappedTileId a, UnwrappedTileId b) + { + return a.X == b.X && a.Y == b.Y && a.Z == b.Z; + } + + public static bool operator !=(UnwrappedTileId a, UnwrappedTileId b) + { + return !(a == b); + } + + public UnwrappedTileId North + { + get + { + return new UnwrappedTileId(Z, X, Y - 1); + } + } + + public UnwrappedTileId East + { + get + { + return new UnwrappedTileId(Z, X + 1, Y); + } + } + + public UnwrappedTileId South + { + get + { + return new UnwrappedTileId(Z, X, Y + 1); + } + } + + public UnwrappedTileId West + { + get + { + return new UnwrappedTileId(Z, X - 1, Y); + } + } + + public UnwrappedTileId NorthEast + { + get + { + return new UnwrappedTileId(Z, X + 1, Y - 1); + } + } + + public UnwrappedTileId SouthEast + { + get + { + return new UnwrappedTileId(Z, X + 1, Y + 1); + } + } + + public UnwrappedTileId NorthWest + { + get + { + return new UnwrappedTileId(Z, X - 1, Y - 1); + } + } + + public UnwrappedTileId SouthWest + { + get + { + return new UnwrappedTileId(Z, X - 1, Y + 1); + } + } + } +} diff --git a/Core/mapbox-sdk-cs/Map/UnwrappedTileId.cs.meta b/Core/mapbox-sdk-cs/Map/UnwrappedTileId.cs.meta new file mode 100644 index 0000000..0d4a8ad --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/UnwrappedTileId.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b05b9f9c791be434db474b25089ff310 +timeCreated: 1494945808 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Map/VectorTile.cs b/Core/mapbox-sdk-cs/Map/VectorTile.cs new file mode 100644 index 0000000..5dca85a --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/VectorTile.cs @@ -0,0 +1,211 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Map +{ + using System.Collections.ObjectModel; + using Mapbox.Utils; + using Mapbox.VectorTile; + using Mapbox.VectorTile.ExtensionMethods; + using System; + + /// + /// A decoded vector tile, as specified by the + /// + /// Mapbox Vector Tile specification. + /// See available layers and features here. + /// The tile might be incomplete if the network request and parsing are still pending. + /// + /// + /// Making a VectorTile request: + /// + /// var parameters = new Tile.Parameters(); + /// parameters.Fs = MapboxAccess.Instance; + /// parameters.Id = new CanonicalTileId(_zoom, _tileCoorindateX, _tileCoordinateY); + /// parameters.TilesetId = "mapbox.mapbox-streets-v7"; + /// var vectorTile = new VectorTile(); + /// + /// // Make the request. + /// vectorTile.Initialize(parameters, (Action)(() => + /// { + /// if (!string.IsNullOrEmpty(vectorTile.Error)) + /// { + /// // Handle the error. + /// } + /// + /// // Consume the . + /// })); + /// + /// + public sealed class VectorTile : Tile, IDisposable + { + // FIXME: Namespace here is very confusing and conflicts (sematically) + // with his class. Something has to be renamed here. + private Mapbox.VectorTile.VectorTile data; + + bool _isStyleOptimized = false; + + string _optimizedStyleId; + + string _modifiedDate; + + private bool isDisposed = false; + + /// Gets the vector decoded using Mapbox.VectorTile library. + /// The GeoJson data. + public Mapbox.VectorTile.VectorTile Data + { + get + { + return this.data; + } + } + + public VectorTile() + { + _isStyleOptimized = false; + } + + public VectorTile(string styleId, string modifiedDate) + { + if (string.IsNullOrEmpty(styleId) || string.IsNullOrEmpty(modifiedDate)) + { + UnityEngine.Debug.LogWarning("Style Id or Modified Time cannot be empty for style optimized tilesets. Switching to regular tilesets!"); + _isStyleOptimized = false; + } + else + { + _isStyleOptimized = true; + _optimizedStyleId = styleId; + _modifiedDate = modifiedDate; + } + } + + //TODO: uncomment if 'VectorTile' class changes from 'sealed' + //protected override void Dispose(bool disposeManagedResources) + //~VectorTile() + //{ + // Dispose(false); + //} + + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + //TODO: change signature if 'VectorTile' class changes from 'sealed' + //protected override void Dispose(bool disposeManagedResources) + public void Dispose(bool disposeManagedResources) + { + if (!isDisposed) + { + if (disposeManagedResources) + { + //TODO implement IDisposable with Mapbox.VectorTile.VectorTile + if (null != data) + { + data = null; + } + } + } + } + + + /// + /// Gets the vector in a GeoJson format. + /// + /// This method should be avoided as it fully decodes the whole tile and might pose performance and memory bottle necks. + /// + /// + /// The GeoJson data. + /// + /// Inspect the GeoJson. + /// + /// var json = VectorTile.GeoJson; + /// Console.Write("GeoJson: " + json); + /// + /// + public string GeoJson + { + get + { + return this.data.ToGeoJson((ulong)Id.Z, (ulong)Id.X, (ulong)Id.Y, 0); + } + } + + + /// + /// Gets all availble layer names. + /// See available layers and features here. + /// + /// Collection of availble layers. + /// + /// Inspect the LayerNames. + /// + /// var layerNames = vectorTile.LayerNames(); + /// foreach (var layer in layerNames) + /// { + /// Console.Write("Layer: " + layer); + /// } + /// + /// + public ReadOnlyCollection LayerNames() + { + return this.data.LayerNames(); + } + + // FIXME: Why don't these work? + /// + /// Decodes the requested layer. + /// + /// Name of the layer to decode. + /// Decoded VectorTileLayer or 'null' if an invalid layer name was specified. + /// + /// Inspect a layer of the vector tile. + /// + /// var countryLabelLayer = vectorTile.GetLayer("country_label"); + /// var count = countryLabelLayer.Keys.Count; + /// for (int i = 0; i < count; i++) + /// { + /// Console.Write(string.Format("{0}:{1}", countryLabelLayer.Keys[i], countryLabelLayer.Values[i])); + /// } + /// + /// + public VectorTileLayer GetLayer(string layerName) + { + return this.data.GetLayer(layerName); + } + + + internal override TileResource MakeTileResource(string tilesetId) + { + + return (_isStyleOptimized) ? + TileResource.MakeStyleOptimizedVector(Id, tilesetId, _optimizedStyleId, _modifiedDate) + : TileResource.MakeVector(Id, tilesetId); + } + + + internal override bool ParseTileData(byte[] data) + { + try + { + var decompressed = Compression.Decompress(data); + this.data = new Mapbox.VectorTile.VectorTile(decompressed); + return true; + } + catch (Exception ex) + { + AddException(ex); + return false; + } + } + + + } +} diff --git a/Core/mapbox-sdk-cs/Map/VectorTile.cs.meta b/Core/mapbox-sdk-cs/Map/VectorTile.cs.meta new file mode 100644 index 0000000..fc053b5 --- /dev/null +++ b/Core/mapbox-sdk-cs/Map/VectorTile.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: bfd8ce307104a47389d62ff6cd67802c +timeCreated: 1494951007 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/MapMatching.meta b/Core/mapbox-sdk-cs/MapMatching.meta new file mode 100644 index 0000000..0ce8cec --- /dev/null +++ b/Core/mapbox-sdk-cs/MapMatching.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 2878fdebfe9305f4cab4f21e3c398837 +folderAsset: yes +timeCreated: 1508237858 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/MapMatching/MapMatcher.cs b/Core/mapbox-sdk-cs/MapMatching/MapMatcher.cs new file mode 100644 index 0000000..d1794d3 --- /dev/null +++ b/Core/mapbox-sdk-cs/MapMatching/MapMatcher.cs @@ -0,0 +1,74 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2017 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapMatching +{ + using System; + using System.Text; + using Mapbox.Json; + using Mapbox.Platform; + using Mapbox.Utils.JsonConverters; + + /// + /// Wrapper around the + /// Mapbox Map Matching API. + /// + public class MapMatcher + { + private readonly IFileSource _fileSource; + private int _timeout; + + /// Initializes a new instance of the class. + /// Network access abstraction. + public MapMatcher(IFileSource fileSource, int timeout) + { + _fileSource = fileSource; + _timeout = timeout; + } + + /// Performs asynchronously a geocoding lookup. + /// Geocode resource. + /// Callback to be called after the request is completed. + /// String or LngLat. Should be automatically inferred. + /// + /// Returns a that can be used for canceling a pending + /// request. This handle can be completely ignored if there is no intention of ever + /// canceling the request. + /// + public IAsyncRequest Match(MapMatchingResource match, Action callback) + { + string url = match.GetUrl(); + return _fileSource.Request( + url, + (Response response) => + { + var str = Encoding.UTF8.GetString(response.Data); + var data = Deserialize(str); + + if (response.HasError) + { + data.SetRequestExceptions(response.Exceptions); + } + + callback(data); + }, + _timeout + ); + } + + + /// + /// Deserialize the map match response string into a . + /// + /// JSON String. + /// A . + /// Map Matcher. + internal T Deserialize(string str) + { + return JsonConvert.DeserializeObject(str, JsonConverters.Converters); + } + } +} diff --git a/Core/mapbox-sdk-cs/MapMatching/MapMatcher.cs.meta b/Core/mapbox-sdk-cs/MapMatching/MapMatcher.cs.meta new file mode 100644 index 0000000..a0a8a9f --- /dev/null +++ b/Core/mapbox-sdk-cs/MapMatching/MapMatcher.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: dfdfc6d95bc72494e8ae78580d2e6b44 +timeCreated: 1508239177 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/MapMatching/MapMatchingParameters.cs b/Core/mapbox-sdk-cs/MapMatching/MapMatchingParameters.cs new file mode 100644 index 0000000..eb15242 --- /dev/null +++ b/Core/mapbox-sdk-cs/MapMatching/MapMatchingParameters.cs @@ -0,0 +1,115 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2017 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- +using System; +using System.ComponentModel; +using Mapbox.VectorTile.Geometry; + +namespace Mapbox.MapMatching +{ + /// Directions profile id + public enum Profile + { + [Description("mapbox/driving")] + MapboxDriving, + [Description("mapbox/driving-traffic")] + MapboxDrivingTraffic, + [Description("mapbox/walking")] + MapboxWalking, + [Description("mapbox/cycling")] + MapboxCycling + } + + + /// Format of the returned geometry. Default value 'Polyline' with precision 5. + public enum Geometries + { + /// Default, precision 5. + [Description("polyline")] + Polyline, + /// Precision 6. + [Description("polyline6")] + Polyline6, + /// Geojson. + [Description("geojson")] + GeoJson + } + + + /// Type of returned overview geometry. + public enum Overview + { + /// The most detailed geometry available + [Description("full")] + Full, + /// A simplified version of the full geometry + [Description("simplified")] + Simplified, + /// No overview geometry + [Description("false")] + None + } + + + /// Whether or not to return additional metadata along the route. Several annotations can be used. + [System.Flags] + public enum Annotations + { + [Description("duration")] + Duration, + [Description("distance")] + Distance, + [Description("speed")] + Speed, + [Description("congestion")] + Congestion + } + + + /// + /// https://www.mapbox.com/api-documentation/navigation/#retrieve-directions + /// + public enum InstructionLanguages + { + [Description("de")] + German, + [Description("en")] + English, + [Description("eo")] + Esperanto, + [Description("es")] + Spanish, + [Description("es-ES")] + SpanishSpain, + [Description("fr")] + French, + [Description("id")] + Indonesian, + [Description("it")] + Italian, + [Description("nl")] + Dutch, + [Description("pl")] + Polish, + [Description("pt-BR")] + PortugueseBrazil, + [Description("ro")] + Romanian, + [Description("ru")] + Russian, + [Description("sv")] + Swedish, + [Description("tr")] + Turkish, + [Description("uk")] + Ukrainian, + [Description("vi")] + Vietnamese, + [Description("zh-Hans")] + ChineseSimplified + } + + +} diff --git a/Core/mapbox-sdk-cs/MapMatching/MapMatchingParameters.cs.meta b/Core/mapbox-sdk-cs/MapMatching/MapMatchingParameters.cs.meta new file mode 100644 index 0000000..2bef666 --- /dev/null +++ b/Core/mapbox-sdk-cs/MapMatching/MapMatchingParameters.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 991f42eef2c18204cb4a6b79c6f98eed +timeCreated: 1508237904 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/MapMatching/MapMatchingResource.cs b/Core/mapbox-sdk-cs/MapMatching/MapMatchingResource.cs new file mode 100644 index 0000000..bbb9e1e --- /dev/null +++ b/Core/mapbox-sdk-cs/MapMatching/MapMatchingResource.cs @@ -0,0 +1,209 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2017 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapMatching +{ + using System; + using System.Collections.Generic; + using System.Linq; + using Mapbox.Platform; + using Mapbox.Utils; + using Mapbox.VectorTile.ExtensionMethods; + + /// Base geocode class. + /// Type of Query field (either string or LatLng). + public class MapMatchingResource : Resource + { + + private readonly string _apiEndpoint = "matching/v5/"; + private Vector2d[] _coordinates; + private uint[] _radiuses; + private long[] _timestamps; + + + /// Gets the API endpoint as a partial URL path. + public override string ApiEndpoint + { + get { return _apiEndpoint; } + } + + + /// A directions profile ID. + public Profile Profile = Profile.MapboxDriving; + + + /// Coordinate to visit in order; there can be between 2 and 100 coordinates. + public Vector2d[] Coordinates + { + get { return _coordinates; } + set + { + if (null == value) + { + throw new Exception("Coordinates cannot be null."); + } + if (value.Length < 2 || value.Length > 100) + { + throw new Exception("Must be between 2 and 100 elements in coordinates array"); + } + + _coordinates = value; + } + } + + + /// + /// Format of the returned geometry. + /// Allowed values are: geojson (as LineString ), polyline with precision 5, polyline6 (polyline with precision 6). + /// The default value is polyline. + /// + public Nullable Geometries; + + + /// + /// A list of uints in meters indicating the assumed precision of the used tracking device. + /// There must be as many radiuses as there are coordinates in the request. + /// Values can be a number between 0 and 30. + /// Use higher numbers (20-30) for noisy traces and lower numbers (1-10) for clean traces. + /// The default value is 5. + /// + public uint[] Radiuses + { + get { return _radiuses; } + set + { + if (null == _coordinates) { throw new Exception("Coordinates not set"); } + //allow for nulling radiuses + if (null == value) + { + _radiuses = null; + return; + } + if (value.Length != _coordinates.Length) { throw new Exception("There must be as many radiuses as there are coordinates in the request."); } + if (value.Where(r => r == 0).Count() > 0) { throw new Exception("Radius must be greater than 0"); } + + _radiuses = value; + } + } + + + /// + /// Whether to return steps and turn-by-turn instructions. + /// Can be true or false. + /// The default is false. + /// + public bool? Steps; + + + /// + /// Type of returned overview geometry. + /// Can be full (the most detailed geometry available), simplified (a simplified version of the full geometry), or none (no overview geometry). + /// The default is simplified. + /// + public Nullable Overview; + + + /// + /// Timestamps corresponding to each coordinate provided in the request. + /// Must be numbers in Unix time (seconds since the Unix epoch). + /// There must be as many timestamps as there are coordinates in the request. + /// + public long[] Timestamps + { + get { return _timestamps; } + set + { + if (null == _coordinates) { throw new Exception("Coordinates not set"); } + //allow for nulling timestamps + if (null == value) + { + _timestamps = null; + return; + } + if (value.Length != _coordinates.Length) { throw new Exception("There must be as many timestapms as there are coordinates in the request."); } + + _timestamps = value; + } + } + + + /// + /// Whether or not to return additional metadata along the route. + /// Possible values are: duration, distance and speed. + /// Several annotations can be used. + /// Combine via '|'. + /// + public Nullable Annotations; + + + /// + /// Whether or not to transparently remove clusters and re-sample traces for improved map matching results. + /// Removed tracepoints are set to 'null' in the response! + /// Can be true or false. + /// The default is false. + /// + public bool? Tidy; + + + /// + /// Language of returned turn-by-turn text instructions. + /// The default is English. + /// + public Nullable Language; + + + public override string GetUrl() + { + if (null == _coordinates) + { + throw new Exception("Coordinates cannot be null."); + } + + Dictionary options = new Dictionary(); + + if (Geometries.HasValue) { options.Add("geometries", Geometries.Value.Description()); } + if (null != _radiuses) { options.Add("radiuses", GetUrlQueryFromArray(_radiuses, ";")); } + if (Steps.HasValue) { options.Add("steps", Steps.ToString().ToLower()); } + if (Overview.HasValue) { options.Add("overview", Overview.Value.Description()); } + if (null != _timestamps) { options.Add("timestamps", GetUrlQueryFromArray(_timestamps, ";")); } + if (Annotations.HasValue) { options.Add("annotations", getUrlQueryFromAnnotations(Annotations.Value, ",")); } + if (Tidy.HasValue) { options.Add("tidy", Tidy.Value.ToString().ToLower()); } + if (Language.HasValue) { options.Add("language", Language.Value.Description()); } + + return + Constants.BaseAPI + + _apiEndpoint + + Profile.Description() + "/" + + GetUrlQueryFromArray(_coordinates, ";") + + ".json" + + EncodeQueryString(options); + } + + + + /// + /// Convert Annotations (several could be combined) into a string of their descriptions. + /// + /// Current annotation + /// Character to use for separating items in string. + /// + private string getUrlQueryFromAnnotations(Annotations anno, string separator) + { + List descriptions = new List(); + + //iterate through all possible 'Annotations' values + foreach (var a in Enum.GetValues(typeof(Annotations)).Cast()) + { + //if current value is set, add its description + if (a == (anno & a)) { descriptions.Add(a.Description()); } + } + + return string.Join(separator, descriptions.ToArray()); + } + + + } +} diff --git a/Core/mapbox-sdk-cs/MapMatching/MapMatchingResource.cs.meta b/Core/mapbox-sdk-cs/MapMatching/MapMatchingResource.cs.meta new file mode 100644 index 0000000..83c2217 --- /dev/null +++ b/Core/mapbox-sdk-cs/MapMatching/MapMatchingResource.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 8762d1b8a83c7ba4b91f9a1c64717bee +timeCreated: 1508240506 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/MapMatching/MapMatchingResponse.cs b/Core/mapbox-sdk-cs/MapMatching/MapMatchingResponse.cs new file mode 100644 index 0000000..ef4d14d --- /dev/null +++ b/Core/mapbox-sdk-cs/MapMatching/MapMatchingResponse.cs @@ -0,0 +1,72 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapMatching +{ + using System; + using System.Collections.Generic; + using System.Collections.ObjectModel; + using Mapbox.Json; + + /// Base geocode response. +#if !WINDOWS_UWP + //http://stackoverflow.com/a/12903628 + [Serializable] +#endif + public class MapMatchingResponse + { + /// Simple constructor for deserialization + public MapMatchingResponse() { } + + [JsonProperty("code")] + public string Code; + [JsonProperty("message")] + public string Message; + [JsonProperty("tracepoints")] + public Tracepoint[] Tracepoints; + [JsonProperty("matchings")] + public MatchObject[] Matchings; +#if !WINDOWS_UWP + /// Error occured during matching + public bool HasMatchingError { get { return !"ok".Equals(Code, StringComparison.InvariantCultureIgnoreCase); } } +#else + /// Error occured during matching + public bool HasMatchingError { get { return !"ok".Equals(Code, StringComparison.OrdinalIgnoreCase); } } +#endif + + public string MatchingError + { + get + { + string matchCode = Code.ToLower(); + switch (matchCode) + { + case "ok": return ""; + case "nomatch": return "The input did not produce any matches. features will be an empty array."; + case "toomanycoordinates": return "There are to many points in the request."; + case "InvalidInput": return "Invalid input: 'message' will hold an explanation of the invalid input."; + case "ProfileNotFound": return "Invalid profile."; + case "nosegment": return "Could not find a matching segment for input coordinates."; + default: + return "Unexpected error: check 'message'"; + } + } + } + + /// Errors occured during web request + public bool HasRequestError { get { return _requestExceptions.Count > 0; } } + + private ReadOnlyCollection _requestExceptions = new List().AsReadOnly(); + /// Errors of underlying web request + public ReadOnlyCollection RequestExceptions { get { return _requestExceptions; } } + /// Assign errors of underlying web request + public void SetRequestExceptions(ReadOnlyCollection exceptions) { _requestExceptions = exceptions; } + } + + + + +} \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/MapMatching/MapMatchingResponse.cs.meta b/Core/mapbox-sdk-cs/MapMatching/MapMatchingResponse.cs.meta new file mode 100644 index 0000000..9bf6932 --- /dev/null +++ b/Core/mapbox-sdk-cs/MapMatching/MapMatchingResponse.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 6b0f824b73d2d8f41aeed79f2a15666d +timeCreated: 1508247612 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/MapMatching/MatchObject.cs b/Core/mapbox-sdk-cs/MapMatching/MatchObject.cs new file mode 100644 index 0000000..142dc06 --- /dev/null +++ b/Core/mapbox-sdk-cs/MapMatching/MatchObject.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2017 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapMatching +{ + using Mapbox.Directions; + using Mapbox.Json; + + /// + /// A Match object from a Map Matching API call. + /// + public class MatchObject : Route + { + /// + /// A number between 0 (low) and 1 (high) indicating level of confidence in the returned match + /// + [JsonProperty("confidence")] + public float Confidence { get; set; } + + + } +} diff --git a/Core/mapbox-sdk-cs/MapMatching/MatchObject.cs.meta b/Core/mapbox-sdk-cs/MapMatching/MatchObject.cs.meta new file mode 100644 index 0000000..8cd1ebe --- /dev/null +++ b/Core/mapbox-sdk-cs/MapMatching/MatchObject.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: d6d1f89031e0a60479b516a76cf1a96a +timeCreated: 1508309612 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/MapMatching/Tracepoint.cs b/Core/mapbox-sdk-cs/MapMatching/Tracepoint.cs new file mode 100644 index 0000000..092a13b --- /dev/null +++ b/Core/mapbox-sdk-cs/MapMatching/Tracepoint.cs @@ -0,0 +1,39 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2017 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapMatching +{ + using Mapbox.Directions; + using Mapbox.Json; + using Mapbox.Utils; + using Mapbox.Utils.JsonConverters; + + /// + /// A Waypoint from a Directions API call. + /// + public class Tracepoint: Waypoint + { + /// + /// Index of the waypoint inside the matched route. + /// + [JsonProperty("waypoint_index")] + public int WaypointIndex { get; set; } + + /// + /// Index to the match object in matchings the sub-trace was matched to. + /// + [JsonProperty("matchings_index")] + public int MatchingsIndex { get; set; } + + /// + /// Number of probable alternative matchings for this trace point. A value of zero indicates that this point was matched unambiguously. Split the trace at these points for incremental map matching. + /// + [JsonProperty("alternatives_count")] + public int AlternativesCount { get; set; } + + + } +} diff --git a/Core/mapbox-sdk-cs/MapMatching/Tracepoint.cs.meta b/Core/mapbox-sdk-cs/MapMatching/Tracepoint.cs.meta new file mode 100644 index 0000000..cf819f4 --- /dev/null +++ b/Core/mapbox-sdk-cs/MapMatching/Tracepoint.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: cd23eaecbb5aa1947ad2b7a595c2393e +timeCreated: 1508251969 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform.meta b/Core/mapbox-sdk-cs/Platform.meta new file mode 100644 index 0000000..10ba2ec --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 271709ca6cfd047e9ab142950d086b5f +folderAsset: yes +timeCreated: 1491243031 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/Cache.meta b/Core/mapbox-sdk-cs/Platform/Cache.meta new file mode 100644 index 0000000..b553e89 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Cache.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 15f35c4d53ec8ae459a497d0bee43f77 +folderAsset: yes +timeCreated: 1495030845 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/Cache/CacheItem.cs b/Core/mapbox-sdk-cs/Platform/Cache/CacheItem.cs new file mode 100644 index 0000000..b3be547 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Cache/CacheItem.cs @@ -0,0 +1,19 @@ + +namespace Mapbox.Platform.Cache +{ + + using System; + + + public class CacheItem + { + /// Raw response data- + public byte[] Data; + /// UTC ticks when item was added to the cache. + public long AddedToCacheTicksUtc; + /// ETag value of API response. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag + public string ETag; + /// Can be 'null' as not all APIs populated this value. Last-Modified value of API response in GMT: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified + public DateTime? LastModified; + } +} diff --git a/Core/mapbox-sdk-cs/Platform/Cache/CacheItem.cs.meta b/Core/mapbox-sdk-cs/Platform/Cache/CacheItem.cs.meta new file mode 100644 index 0000000..4525837 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Cache/CacheItem.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 3bad456c58de85d47b4ff050dbd99915 +timeCreated: 1510665832 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/Cache/CachingWebFileSource.cs b/Core/mapbox-sdk-cs/Platform/Cache/CachingWebFileSource.cs new file mode 100644 index 0000000..b881516 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Cache/CachingWebFileSource.cs @@ -0,0 +1,321 @@ +namespace Mapbox.Platform.Cache +{ + using System; + using Mapbox.Platform; + using System.Collections.Generic; + using Mapbox.Unity.Utilities; + using Mapbox.Map; + using System.Collections; + using System.Linq; + + + public class CachingWebFileSource : IFileSource, IDisposable + { + + +#if MAPBOX_DEBUG_CACHE + private string _className; +#endif + private bool _disposed; + private List _caches = new List(); + private string _accessToken; + private Func _getMapsSkuToken; + private bool _autoRefreshCache; + + + public CachingWebFileSource(string accessToken, Func getMapsSkuToken, bool autoRefreshCache) + { +#if MAPBOX_DEBUG_CACHE + _className = this.GetType().Name; +#endif + _accessToken = accessToken; + _getMapsSkuToken = getMapsSkuToken; + _autoRefreshCache = autoRefreshCache; + } + + +#region idisposable + + + ~CachingWebFileSource() + { + Dispose(false); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposeManagedResources) + { + if (!_disposed) + { + if (disposeManagedResources) + { + for (int i = 0; i < _caches.Count; i++) + { + IDisposable cache = _caches[i] as IDisposable; + if (null != cache) + { + cache.Dispose(); + cache = null; + } + } + } + _disposed = true; + } + } + + +#endregion + + + /// + /// Add an ICache instance + /// + /// Implementation of ICache + /// + public CachingWebFileSource AddCache(ICache cache) + { + // don't add cache when cache size is 0 + if (0 == cache.MaxCacheSize) + { + return this; + } + + _caches.Add(cache); + return this; + } + + + /// + /// Clear all caches + /// + public void Clear() + { + foreach (var cache in _caches) + { + cache.Clear(); + } + } + + + public void ReInit() { + foreach (var cache in _caches) + { + cache.ReInit(); + } + } + + + public IAsyncRequest Request( + string uri + , Action callback + , int timeout = 10 + , CanonicalTileId tileId = new CanonicalTileId() + , string tilesetId = null + ) + { + + if (string.IsNullOrEmpty(tilesetId)) + { + throw new Exception("Cannot cache without a tileset id"); + } + + CacheItem cachedItem = null; + + // go through existing caches and check if we already have the requested tile available + foreach (var cache in _caches) + { + cachedItem = cache.Get(tilesetId, tileId); + if (null != cachedItem) + { + break; + } + } + + var uriBuilder = new UriBuilder(uri); + if (!string.IsNullOrEmpty(_accessToken)) + { + string accessTokenQuery = "access_token=" + _accessToken; + string mapsSkuToken = "sku=" + _getMapsSkuToken(); + if (uriBuilder.Query != null && uriBuilder.Query.Length > 1) + { + uriBuilder.Query = uriBuilder.Query.Substring(1) + "&" + accessTokenQuery + "&" + mapsSkuToken; + } + else + { + uriBuilder.Query = accessTokenQuery + "&" + mapsSkuToken; + } + } + string finalUrl = uriBuilder.ToString(); + +#if MAPBOX_DEBUG_CACHE + string methodName = _className + "." + new System.Diagnostics.StackFrame().GetMethod().Name; +#endif + + // if tile was available call callback with it, propagate to all other caches and check if a newer one is available + if (null != cachedItem) + { +#if MAPBOX_DEBUG_CACHE + UnityEngine.Debug.LogFormat("{0} {1} {2} {3}", methodName, tilesetId, tileId, null != cachedItem.Data ? cachedItem.Data.Length.ToString() : "cachedItem.Data is NULL"); +#endif + // immediately return cached tile + callback(Response.FromCache(cachedItem.Data)); + + // check for updated tiles online if this is enabled in the settings + if (_autoRefreshCache) + { + // check if tile on the web is newer than the one we already have locally + IAsyncRequestFactory.CreateRequest( + finalUrl, + (Response headerOnly) => + { + // on error getting information from API just return. tile we have locally has already been returned above + if (headerOnly.HasError) + { + return; + } + + // TODO: remove Debug.Log before PR + //UnityEngine.Debug.LogFormat( + // "{1}{0}cached:{2}{0}header:{3}" + // , Environment.NewLine + // , finalUrl + // , cachedItem.ETag + // , headerOnly.Headers["ETag"] + //); + + // data from cache is the same as on the web: + // * tile has already been returned above + // * make sure all all other caches have it too, but don't force insert via cache.add(false) + // additional ETag empty check: for backwards compability with old caches + if (!string.IsNullOrEmpty(cachedItem.ETag) && cachedItem.ETag.Equals(headerOnly.Headers["ETag"])) + { + foreach (var cache in _caches) + { + cache.Add(tilesetId, tileId, cachedItem, false); + } + } + else + { + // TODO: remove Debug.Log before PR + UnityEngine.Debug.LogWarningFormat( + "updating cached tile {1} tilesetId:{2}{0}cached etag:{3}{0}remote etag:{4}{0}{5}" + , Environment.NewLine + , tileId + , tilesetId + , cachedItem.ETag + , headerOnly.Headers["ETag"] + , finalUrl + ); + + // request updated tile and pass callback to return new data to subscribers + requestTileAndCache(finalUrl, tilesetId, tileId, timeout, callback); + } + } + , timeout + , HttpRequestType.Head + ); + } + + return new MemoryCacheAsyncRequest(uri); + } + else + { + // requested tile is not in any of the caches yet, get it +#if MAPBOX_DEBUG_CACHE + UnityEngine.Debug.LogFormat("{0} {1} {2} not cached", methodName, tilesetId, tileId); +#endif + return requestTileAndCache(finalUrl, tilesetId, tileId, timeout, callback); + } + } + + + private IAsyncRequest requestTileAndCache(string url, string tilesetId, CanonicalTileId tileId, int timeout, Action callback) + { + return IAsyncRequestFactory.CreateRequest( + url, + (Response r) => + { + // if the request was successful add tile to all caches + if (!r.HasError && null != r.Data) + { + string eTag = string.Empty; + DateTime? lastModified = null; + + if (!r.Headers.ContainsKey("ETag")) + { + UnityEngine.Debug.LogWarningFormat("no 'ETag' header present in response for {0}", url); + } + else + { + eTag = r.Headers["ETag"]; + } + + // not all APIs populate 'Last-Modified' header + // don't log error if it's missing + if (r.Headers.ContainsKey("Last-Modified")) + { + lastModified = DateTime.ParseExact(r.Headers["Last-Modified"], "r", null); + } + + // propagate to all caches forcing update + foreach (var cache in _caches) + { + cache.Add( + tilesetId + , tileId + , new CacheItem() + { + Data = r.Data, + ETag = eTag, + LastModified = lastModified + } + , true // force insert/update + ); + } + } + if (null != callback) + { + r.IsUpdate = true; + callback(r); + } + }, timeout); + } + + + class MemoryCacheAsyncRequest : IAsyncRequest + { + + + public string RequestUrl { get; private set; } + + + public MemoryCacheAsyncRequest(string requestUrl) + { + RequestUrl = requestUrl; + } + + + public bool IsCompleted + { + get + { + return true; + } + } + + + public HttpRequestType RequestType { get { return HttpRequestType.Get; } } + + + public void Cancel() + { + // Empty. We can't cancel an instantaneous response. + } + } + } +} diff --git a/Core/mapbox-sdk-cs/Platform/Cache/CachingWebFileSource.cs.meta b/Core/mapbox-sdk-cs/Platform/Cache/CachingWebFileSource.cs.meta new file mode 100644 index 0000000..ccfbe27 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Cache/CachingWebFileSource.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 149bb7da83149324dab3982be7bc8cca +timeCreated: 1494581732 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/Cache/ICache.cs b/Core/mapbox-sdk-cs/Platform/Cache/ICache.cs new file mode 100644 index 0000000..d94192c --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Cache/ICache.cs @@ -0,0 +1,53 @@ + +namespace Mapbox.Platform.Cache +{ + + using Mapbox.Map; + using System; + + + public interface ICache + { + + /// + /// Maximum number of tiles to store + /// + uint MaxCacheSize { get; } + + + /// + /// Add tile data to the cache + /// + /// Tile set name + /// Item to cache + /// Force insert even if item already exists. + void Add(string tilesetId, CanonicalTileId tileId, CacheItem item, bool replaceIfExists); + + + /// + /// Get tile + /// + /// + /// + /// byte[] with tile data. Null if requested tile is not in cache + CacheItem Get(string tilesetId, CanonicalTileId tileId); + + + /// Clear cache for all tile sets + void Clear(); + + + /// + /// Clear cache for one tile set + /// + /// + void Clear(string tilesetId); + + + /// + /// Reinitialize cache. Might be needed after 'Clear', eg for SQLiteCache + /// + void ReInit(); + } +} diff --git a/Core/mapbox-sdk-cs/Platform/Cache/ICache.cs.meta b/Core/mapbox-sdk-cs/Platform/Cache/ICache.cs.meta new file mode 100644 index 0000000..6a38569 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Cache/ICache.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4ebb2d197f248a7469620904e2adb43e +timeCreated: 1494580896 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/Cache/MemoryCache.cs b/Core/mapbox-sdk-cs/Platform/Cache/MemoryCache.cs new file mode 100644 index 0000000..9a32546 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Cache/MemoryCache.cs @@ -0,0 +1,112 @@ +using Mapbox.Map; +using System; +using System.Collections.Generic; +using System.Linq; + + +namespace Mapbox.Platform.Cache +{ + + + public class MemoryCache : ICache + { + + + // TODO: add support for disposal strategy (timestamp, distance, etc.) + public MemoryCache(uint maxCacheSize) + { +#if MAPBOX_DEBUG_CACHE + _className = this.GetType().Name; +#endif + _maxCacheSize = maxCacheSize; + _cachedResponses = new Dictionary(); + } + + +#if MAPBOX_DEBUG_CACHE + private string _className; +#endif + private uint _maxCacheSize; + private object _lock = new object(); + private Dictionary _cachedResponses; + + + public uint MaxCacheSize + { + get { return _maxCacheSize; } + } + + + public void ReInit() + { + _cachedResponses = new Dictionary(); + } + + + public void Add(string mapdId, CanonicalTileId tilesetId, CacheItem item, bool forceInsert) + { + string key = mapdId + "||" + tilesetId; + + lock (_lock) + { + if (_cachedResponses.Count >= _maxCacheSize) + { + _cachedResponses.Remove(_cachedResponses.OrderBy(c => c.Value.AddedToCacheTicksUtc).First().Key); + } + + // TODO: forceInsert + if (!_cachedResponses.ContainsKey(key)) + { + item.AddedToCacheTicksUtc = DateTime.UtcNow.Ticks; + _cachedResponses.Add(key, item); + } + } + } + + + public CacheItem Get(string tilesetId, CanonicalTileId tileId) + { + string key = tilesetId + "||" + tileId; + +#if MAPBOX_DEBUG_CACHE + string methodName = _className + "." + new System.Diagnostics.StackFrame().GetMethod().Name; + UnityEngine.Debug.LogFormat("{0} {1}", methodName, key); +#endif + + lock (_lock) + { + if (!_cachedResponses.ContainsKey(key)) + { + return null; + } + + return _cachedResponses[key]; + } + } + + + public void Clear() + { + lock (_lock) + { + _cachedResponses.Clear(); + } + } + + + public void Clear(string tilesetId) + { + lock (_lock) + { + tilesetId += "||"; + List toDelete = _cachedResponses.Keys.Where(k => k.Contains(tilesetId)).ToList(); + foreach (string key in toDelete) + { + _cachedResponses.Remove(key); + } + } + } + + + } +} diff --git a/Core/mapbox-sdk-cs/Platform/Cache/MemoryCache.cs.meta b/Core/mapbox-sdk-cs/Platform/Cache/MemoryCache.cs.meta new file mode 100644 index 0000000..6880288 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Cache/MemoryCache.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2bd70b309ec2fd645af3e189d1d7ea5f +timeCreated: 1494580911 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache.meta b/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache.meta new file mode 100644 index 0000000..cf805fc --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: c6f1c408c0acc43538b678d17f6ea53d +folderAsset: yes +timeCreated: 1497883478 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs b/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs new file mode 100644 index 0000000..a221ce1 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs @@ -0,0 +1,485 @@ +namespace Mapbox.Platform.Cache +{ + + using Mapbox.Map; + using Mapbox.Utils; + using SQLite4Unity3d; + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using UnityEngine; + + public class SQLiteCache : ICache, IDisposable + { + + + /// + /// maximum number tiles that get cached + /// + public uint MaxCacheSize { get { return _maxTileCount; } } + + + /// + /// Check cache size every n inserts + /// + public uint PruneCacheDelta { get { return _pruneCacheDelta; } } + + +#if MAPBOX_DEBUG_CACHE + private string _className; +#endif + private bool _disposed; + private string _dbName; + private string _dbPath; + private SQLiteConnection _sqlite; + private readonly uint _maxTileCount; + /// check cache size only every '_pruneCacheDelta' calls to 'Add()' to avoid being too chatty with the database + private const int _pruneCacheDelta = 20; + /// counter to keep track of calls to `Add()` + private int _pruneCacheCounter = 0; + private object _lock = new object(); + + + public SQLiteCache(uint? maxTileCount = null, string dbName = "cache.db") + { + _maxTileCount = maxTileCount ?? 3000; + _dbName = dbName; + init(); + } + + + #region idisposable + + + ~SQLiteCache() + { + Dispose(false); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposeManagedResources) + { + if (!_disposed) + { + if (disposeManagedResources) + { + if (null != _sqlite) + { + _sqlite.Execute("VACUUM;"); // compact db to keep file size small + _sqlite.Close(); + _sqlite.Dispose(); + _sqlite = null; + } + } + _disposed = true; + } + } + + + #endregion + + + private void init() + { + +#if MAPBOX_DEBUG_CACHE + _className = this.GetType().Name; +#endif + openOrCreateDb(_dbName); + + //hrmpf: multiple PKs not supported by sqlite.net + //https://github.com/praeclarum/sqlite-net/issues/282 + //do it via plain SQL + + List colInfoTileset = _sqlite.GetTableInfo(typeof(tilesets).Name); + if (0 == colInfoTileset.Count) + { + string cmdCreateTableTilesets = @"CREATE TABLE tilesets( +id INTEGER PRIMARY KEY ASC AUTOINCREMENT NOT NULL UNIQUE, +name STRING NOT NULL +);"; + _sqlite.Execute(cmdCreateTableTilesets); + string cmdCreateIdxNames = @"CREATE UNIQUE INDEX idx_names ON tilesets (name ASC);"; + _sqlite.Execute(cmdCreateIdxNames); + } + + List colInfoTiles = _sqlite.GetTableInfo(typeof(tiles).Name); + if (0 == colInfoTiles.Count) + { + + string cmdCreateTableTiles = @"CREATE TABLE tiles( +tile_set INTEGER REFERENCES tilesets (id) ON DELETE CASCADE ON UPDATE CASCADE, +zoom_level INTEGER NOT NULL, +tile_column BIGINT NOT NULL, +tile_row BIGINT NOT NULL, +tile_data BLOB NOT NULL, +timestamp INTEGER NOT NULL, +etag TEXT, +lastmodified INTEGER, + PRIMARY KEY( + tile_set ASC, + zoom_level ASC, + tile_column ASC, + tile_row ASC + ) +);"; + _sqlite.Execute(cmdCreateTableTiles); + + string cmdIdxTileset = "CREATE INDEX idx_tileset ON tiles (tile_set ASC);"; + _sqlite.Execute(cmdIdxTileset); + string cmdIdxTimestamp = "CREATE INDEX idx_timestamp ON tiles (timestamp ASC);"; + _sqlite.Execute(cmdIdxTimestamp); + } + + + // some pragmas to speed things up a bit :-) + // inserting 1,000 tiles takes 1-2 sec as opposed to ~20 sec + string[] cmds = new string[] + { + "PRAGMA synchronous=OFF", + "PRAGMA count_changes=OFF", + "PRAGMA journal_mode=MEMORY", + "PRAGMA temp_store=MEMORY" + }; + foreach (var cmd in cmds) + { + try + { + _sqlite.Execute(cmd); + } + catch (SQLiteException ex) + { + // workaround for sqlite.net's exeception: + // https://stackoverflow.com/a/23839503 + if (ex.Result != SQLite3.Result.Row) + { + UnityEngine.Debug.LogErrorFormat("{0}: {1}", cmd, ex); + // TODO: when mapbox-sdk-cs gets backported to its own repo -> throw + //throw; // to throw or not to throw??? + } + } + } + } + + + private void openOrCreateDb(string dbName) + { + _dbPath = GetFullDbPath(dbName); + _sqlite = new SQLiteConnection(_dbPath, SQLiteOpenFlags.ReadWrite | SQLiteOpenFlags.Create); + } + + + /// + /// Reinitialize cache. + /// This is needed after 'Clear()' to recreate the cache database. + /// And has been implemented on purpose to not hold on to any references to the cache directory after 'Clear()' + /// + public void ReInit() + { + if (null != _sqlite) + { + _sqlite.Dispose(); + _sqlite = null; + } + + init(); + } + + + public static string GetFullDbPath(string dbName) + { + string dbPath = Path.Combine(Application.persistentDataPath, "cache"); +#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_WSA + dbPath = Path.GetFullPath(dbPath); +#endif + if (!Directory.Exists(dbPath)) { Directory.CreateDirectory(dbPath); } + dbPath = Path.Combine(dbPath, dbName); + + return dbPath; + } + + + + public void Add(string tilesetName, CanonicalTileId tileId, CacheItem item, bool forceInsert = false) + { + +#if MAPBOX_DEBUG_CACHE + string methodName = _className + "." + new System.Diagnostics.StackFrame().GetMethod().Name; + UnityEngine.Debug.LogFormat("{0} {1} {2} forceInsert:{3}", methodName, tileset, tileId, forceInsert); +#endif + try + { + // tile exists and we don't want to overwrite -> exit early + if ( + TileExists(tilesetName, tileId) + && !forceInsert + ) + { + return; + } + + int? tilesetId = null; + lock (_lock) + { + tilesetId = getTilesetId(tilesetName); + if (!tilesetId.HasValue) + { + tilesetId = insertTileset(tilesetName); + } + } + + if (tilesetId < 0) + { + Debug.LogErrorFormat("could not get tilesetID for [{0}] tile: {1}", tilesetName, tileId); + return; + } + + int rowsAffected = _sqlite.InsertOrReplace(new tiles + { + tile_set = tilesetId.Value, + zoom_level = tileId.Z, + tile_column = tileId.X, + tile_row = tileId.Y, + tile_data = item.Data, + timestamp = (int)UnixTimestampUtils.To(DateTime.Now), + etag = item.ETag + }); + if (1 != rowsAffected) + { + throw new Exception(string.Format("tile [{0} / {1}] was not inserted, rows affected:{2}", tilesetName, tileId, rowsAffected)); + } + } + catch (Exception ex) + { + Debug.LogErrorFormat("Error inserting {0} {1} {2} ", tilesetName, tileId, ex); + } + + // update counter only when new tile gets inserted + if (!forceInsert) + { + _pruneCacheCounter++; + } + if (0 == _pruneCacheCounter % _pruneCacheDelta) + { + _pruneCacheCounter = 0; + prune(); + } + } + + + private void prune() + { + + long tileCnt = _sqlite.ExecuteScalar("SELECT COUNT(zoom_level) FROM tiles"); + + if (tileCnt < _maxTileCount) { return; } + + long toDelete = tileCnt - _maxTileCount; + +#if MAPBOX_DEBUG_CACHE + string methodName = _className + "." + new System.Diagnostics.StackFrame().GetMethod().Name; + Debug.LogFormat("{0} {1} about to prune()", methodName, _tileset); +#endif + + try + { + // no 'ORDER BY' or 'LIMIT' possible if sqlite hasn't been compiled with 'SQLITE_ENABLE_UPDATE_DELETE_LIMIT' + // https://sqlite.org/compile.html#enable_update_delete_limit + _sqlite.Execute("DELETE FROM tiles WHERE rowid IN ( SELECT rowid FROM tiles ORDER BY timestamp ASC LIMIT ? );", toDelete); + } + catch (Exception ex) + { + Debug.LogErrorFormat("error pruning: {0}", ex); + } + } + + + /// + /// Returns the tile data, otherwise null + /// + /// Canonical tile id to identify the tile + /// tile data as byte[], if tile is not cached returns null + public CacheItem Get(string tilesetName, CanonicalTileId tileId) + { +#if MAPBOX_DEBUG_CACHE + string methodName = _className + "." + new System.Diagnostics.StackFrame().GetMethod().Name; + Debug.LogFormat("{0} {1} {2}", methodName, _tileset, tileId); +#endif + tiles tile = null; + + try + { + int? tilesetId = getTilesetId(tilesetName); + if (!tilesetId.HasValue) + { + return null; + } + + tile = _sqlite + .Table() + .Where(t => + t.tile_set == tilesetId.Value + && t.zoom_level == tileId.Z + && t.tile_column == tileId.X + && t.tile_row == tileId.Y + ) + .FirstOrDefault(); + } + catch (Exception ex) + { + Debug.LogErrorFormat("error getting tile {1} {2} from cache{0}{3}", Environment.NewLine, tilesetName, tileId, ex); + return null; + } + if (null == tile) + { + return null; + } + + DateTime? lastModified = null; + if (tile.lastmodified.HasValue) { lastModified = UnixTimestampUtils.From((double)tile.lastmodified.Value); } + + return new CacheItem() + { + Data = tile.tile_data, + AddedToCacheTicksUtc = tile.timestamp, + ETag = tile.etag, + LastModified = lastModified + }; + } + + + /// + /// Check if tile exists + /// + /// Canonical tile id + /// True if tile exists + public bool TileExists(string tilesetName, CanonicalTileId tileId) + { + int? tilesetId = getTilesetId(tilesetName); + if (!tilesetId.HasValue) + { + return false; + } + + return null != _sqlite + .Table() + .Where(t => + t.tile_set == tilesetId.Value + && t.zoom_level == tileId.Z + && t.tile_column == tileId.X + && t.tile_row == tileId.Y + ) + .FirstOrDefault(); + } + + + private int insertTileset(string tilesetName) + { + try + { + _sqlite.BeginTransaction(true); + tilesets newTileset = new tilesets { name = tilesetName }; + int rowsAffected = _sqlite.Insert(newTileset); + if (1 != rowsAffected) + { + throw new Exception(string.Format("tileset [{0}] was not inserted, rows affected:{1}", tilesetName, rowsAffected)); + } + return newTileset.id; + } + catch (Exception ex) + { + Debug.LogErrorFormat("could not insert tileset [{0}]: {1}", tilesetName, ex); + return -1; + } + finally + { + _sqlite.Commit(); + } + } + + + private int? getTilesetId(string tilesetName) + { + tilesets tileset = _sqlite + .Table() + .Where(ts => ts.name.Equals(tilesetName)) + .FirstOrDefault(); + return null == tileset ? (int?)null : tileset.id; + } + + + /// + /// FOR INTERNAL DEBUGGING ONLY - DON'T RELY ON IN PRODUCTION + /// + /// + /// + public long TileCount(string tilesetName) + { + int? tilesetId = getTilesetId(tilesetName); + if (!tilesetId.HasValue) { return 0; } + + return _sqlite + .Table() + .Where(t => t.tile_set == tilesetId.Value) + .LongCount(); + } + + + /// + /// Clear cache for one tile set + /// + /// + public void Clear(string tilesetName) + { + int? tilesetId = getTilesetId(tilesetName); + if (!tilesetId.HasValue) { return; } + //just delete on table 'tilesets', we've setup cascading which should take care of tabls 'tiles' + _sqlite.Delete(tilesetId.Value); + } + + + /// + /// Delete the database file. + /// Call 'ReInit()' if you intend to continue using the cache after 'Clear()! + /// + public void Clear() + { + //already disposed + if (null == _sqlite) { return; } + + _sqlite.Close(); + _sqlite.Dispose(); + _sqlite = null; + + Debug.LogFormat("deleting {0}", _dbPath); + + // try several times in case SQLite needs a bit more time to dispose + for (int i = 0; i < 5; i++) + { + try + { + File.Delete(_dbPath); + return; + } + catch + { +#if !WINDOWS_UWP + System.Threading.Thread.Sleep(100); +#else + System.Threading.Tasks.Task.Delay(100).Wait(); +#endif + } + } + + // if we got till here, throw on last try + File.Delete(_dbPath); + } + + } +} diff --git a/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs.meta b/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs.meta new file mode 100644 index 0000000..93776d8 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/SQLiteCache.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8aeee08edfa6c46648cf1dc623b72a1e +timeCreated: 1497883479 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/Tiles.cs b/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/Tiles.cs new file mode 100644 index 0000000..1862952 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/Tiles.cs @@ -0,0 +1,40 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using SQLite4Unity3d; + +namespace Mapbox.Platform.Cache +{ + + /// + /// Don't change the class name: sqlite-net uses it for table creation + /// + public class tiles + { + + public int tile_set { get; set; } + + //hrmpf: multiple PKs not supported by sqlite.net + //https://github.com/praeclarum/sqlite-net/issues/282 + //TODO: do it via plain SQL + //[PrimaryKey] + public int zoom_level { get; set; } + + //[PrimaryKey] + public long tile_column { get; set; } + + //[PrimaryKey] + public long tile_row { get; set; } + + public byte[] tile_data { get; set; } + + /// Unix epoch for simple FIFO pruning + public int timestamp { get; set; } + + /// ETag Header value of the reponse for auto updating cache + public string etag { get; set; } + + /// Last-Modified header value of API response. Not all APIs populate it, will be -1 in that case. + public int? lastmodified { get; set; } + } +} diff --git a/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/Tiles.cs.meta b/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/Tiles.cs.meta new file mode 100644 index 0000000..0bac323 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/Tiles.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7d8f9ca4f2240481ba4023eff7781487 +timeCreated: 1497883479 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/Tilesets.cs b/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/Tilesets.cs new file mode 100644 index 0000000..ebd47aa --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/Tilesets.cs @@ -0,0 +1,23 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using SQLite4Unity3d; + +namespace Mapbox.Platform.Cache +{ + + /// + /// Don't change the class name: sqlite-net uses it for table creation + /// + public class tilesets + { + + //hrmpf: multiple PKs not supported by sqlite.net + //https://github.com/praeclarum/sqlite-net/issues/282 + //TODO: do it via plain SQL + [PrimaryKey, AutoIncrement] + public int id { get; set; } + + public string name { get; set; } + } +} diff --git a/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/Tilesets.cs.meta b/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/Tilesets.cs.meta new file mode 100644 index 0000000..6ee5789 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Cache/SQLiteCache/Tilesets.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: bb0cc61c516c1984f8ab3ac0ce3c3e64 +timeCreated: 1527515199 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/FileSource.cs b/Core/mapbox-sdk-cs/Platform/FileSource.cs new file mode 100644 index 0000000..3225832 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/FileSource.cs @@ -0,0 +1,255 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +using Mapbox.Unity; + +namespace Mapbox.Platform +{ + using Mapbox.Map; + using Mapbox.Unity.Utilities; + using System; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Security; +#if !NETFX_CORE + using System.Security.Cryptography.X509Certificates; +#endif +#if !UNITY_5_3_OR_NEWER + using System.Threading; +#endif +#if UNITY_EDITOR + using UnityEditor; +#endif +#if UNITY_5_3_OR_NEWER + using UnityEngine; +#endif + + /// + /// Mono implementation of the FileSource class. It will use Mono's + /// runtime to + /// asynchronously fetch data from the network via HTTP or HTTPS requests. + /// + /// + /// This implementation requires .NET 4.5 and later. The access token is expected to + /// be exported to the environment as MAPBOX_ACCESS_TOKEN. + /// + public sealed class FileSource : IFileSource + { + + private Func _getMapsSkuToken; + private readonly Dictionary _requests = new Dictionary(); + private readonly string _accessToken; + private readonly object _lock = new object(); + + /// Length of rate-limiting interval in seconds. https://www.mapbox.com/api-documentation/#rate-limit-headers +#pragma warning disable 0414 + private int? XRateLimitInterval; + /// Maximum number of requests you may make in the current interval before reaching the limit. https://www.mapbox.com/api-documentation/#rate-limit-headers + private long? XRateLimitLimit; + /// Timestamp of when the current interval will end and the ratelimit counter is reset. https://www.mapbox.com/api-documentation/#rate-limit-headers + private DateTime? XRateLimitReset; +#pragma warning restore 0414 + + + public FileSource(Func getMapsSkuToken, string acessToken = null) + { + _getMapsSkuToken = getMapsSkuToken; + if (string.IsNullOrEmpty(acessToken)) + { + _accessToken = Environment.GetEnvironmentVariable("MAPBOX_ACCESS_TOKEN"); + } + else + { + _accessToken = acessToken; + } + } + + /// Performs a request asynchronously. + /// The HTTP/HTTPS url. + /// Callback to be called after the request is completed. + /// + /// Returns a that can be used for canceling a pending + /// request. This handle can be completely ignored if there is no intention of ever + /// canceling the request. + /// + public IAsyncRequest Request( + string url + , Action callback + , int timeout = 10 + , CanonicalTileId tileId = new CanonicalTileId() + , string tilesetId = null + ) + { + if (!string.IsNullOrEmpty(_accessToken)) + { + var uriBuilder = new UriBuilder(url); + string accessTokenQuery = "access_token=" + _accessToken; + string skuToken = "sku=" + _getMapsSkuToken(); + if (uriBuilder.Query != null && uriBuilder.Query.Length > 1) + { + uriBuilder.Query = uriBuilder.Query.Substring(1) + "&" + accessTokenQuery + "&" + skuToken;; + } + else + { + uriBuilder.Query = accessTokenQuery + "&" + skuToken; + } + + url = uriBuilder.ToString(); + } + + // TODO: + // * add queue for requests + // * evaluate rate limits (headers and status code) + // * throttle requests accordingly + //var request = new HTTPRequest(url, callback); + //IEnumerator proxy = proxyResponse(url, callback); + //proxy.MoveNext(); + //IAsyncRequest request = proxy.Current; + + //return request; + + return proxyResponse(url, callback, timeout, tileId, tilesetId); + } + + + // TODO: look at requests and implement throttling if needed + //private IEnumerator proxyResponse(string url, Action callback) { + private IAsyncRequest proxyResponse( + string url + , Action callback + , int timeout + , CanonicalTileId tileId + , string tilesetId + ) + { + + // TODO: plugin caching somewhere around here + + var request = IAsyncRequestFactory.CreateRequest( + url + , (Response response) => + { + if (response.XRateLimitInterval.HasValue) { XRateLimitInterval = response.XRateLimitInterval; } + if (response.XRateLimitLimit.HasValue) { XRateLimitLimit = response.XRateLimitLimit; } + if (response.XRateLimitReset.HasValue) { XRateLimitReset = response.XRateLimitReset; } + callback(response); + lock (_lock) + { + //another place to catch if request has been cancelled + try + { + _requests.Remove(response.Request); + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine(ex); + } + } + } + , timeout + ); + lock (_lock) + { + //sometimes we get here after the request has already finished + if (!request.IsCompleted) + { + _requests.Add(request, 0); + } + } + //yield return request; + return request; + } + + +#if UNITY_5_3_OR_NEWER + /// + /// Block until all the requests are processed. + /// + public IEnumerator WaitForAllRequests() + { + while (_requests.Count > 0) + { + lock (_lock) + { + List reqs = _requests.Keys.ToList(); + for (int i = reqs.Count - 1; i > -1; i--) + { + if (reqs[i].IsCompleted) + { + // another place to watch out if request has been cancelled + try + { + _requests.Remove(reqs[i]); + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine(ex); + } + } + } + } + yield return new WaitForSeconds(0.2f); + } + } +#endif + + + +#if !UNITY_5_3_OR_NEWER + /// + /// Block until all the requests are processed. + /// + public void WaitForAllRequests() + { + int waitTimeMs = 200; + while (_requests.Count > 0) + { + lock (_lock) + { + List reqs = _requests.Keys.ToList(); + for (int i = reqs.Count - 1; i > -1; i--) + { + if (reqs[i].IsCompleted) + { + // another place to watch out if request has been cancelled + try + { + _requests.Remove(reqs[i]); + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine(ex); + } + } + } + } + +#if WINDOWS_UWP + System.Threading.Tasks.Task.Delay(waitTimeMs).Wait(); +#else + //Thread.Sleep(50); + // TODO: get rid of DoEvents!!! and find non-blocking wait that works for Net3.5 + //System.Windows.Forms.Application.DoEvents(); + + var resetEvent = new ManualResetEvent(false); + ThreadPool.QueueUserWorkItem(new WaitCallback(delegate + { + Thread.Sleep(waitTimeMs); + resetEvent.Set(); + }), null); + UnityEngine.Debug.Log("before waitOne " + DateTime.Now.Ticks); + resetEvent.WaitOne(); + UnityEngine.Debug.Log("after waitOne " + DateTime.Now.Ticks); + resetEvent.Close(); + resetEvent = null; +#endif + } + } +#endif + } +} diff --git a/Core/mapbox-sdk-cs/Platform/FileSource.cs.meta b/Core/mapbox-sdk-cs/Platform/FileSource.cs.meta new file mode 100644 index 0000000..165abc8 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/FileSource.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a17c999e5ca80474584c39dfa7d5a62a +timeCreated: 1494952070 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/HTTPRequestNonThreaded.cs b/Core/mapbox-sdk-cs/Platform/HTTPRequestNonThreaded.cs new file mode 100644 index 0000000..3421f99 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/HTTPRequestNonThreaded.cs @@ -0,0 +1,236 @@ +#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_ANDROID || UNITY_WP_8_1 || UNITY_WSA || UNITY_WEBGL || UNITY_IOS || UNITY_PS4 || UNITY_SAMSUNGTV || UNITY_XBOXONE || UNITY_TIZEN || UNITY_TVOS +#define UNITY +#endif + +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// Based on http://stackoverflow.com/a/12606963 and http://wiki.unity3d.com/index.php/WebAsync +// +//----------------------------------------------------------------------- + +#if !UNITY + +namespace Mapbox.Platform { + + + using System; + using System.Net; +#if !UNITY && !NETFX_CORE + using System.Net.Cache; +#endif + using System.IO; + using System.Collections.Generic; + using System.Threading; + using System.ComponentModel; + using Utils; +#if NETFX_CORE + using System.Net.Http; + using System.Linq; +#endif + + internal sealed class HTTPRequestNonThreaded : IAsyncRequest { + + + public bool IsCompleted { get; private set; } + + + private Action _callback; +#if !NETFX_CORE + private HttpWebRequest _request; +#else + private HttpClient _request; + private CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource(); +#endif +#if !UNITY + private SynchronizationContext _sync = AsyncOperationManager.SynchronizationContext; +#endif + private int _timeOut; + private string _requestUrl; + private readonly string _userAgent = "mapbox-sdk-cs"; + + + /// + /// + /// + /// + /// + /// seconds + public HTTPRequestNonThreaded(string url, Action callback, int timeOut = 10) { + + IsCompleted = false; + _callback = callback; + _timeOut = timeOut; + _requestUrl = url; + + setupRequest(); + + Action a = () => { getResponseNonThreaded(_request, EvaluateResponse); }; + //Fire and forget ;-) + a.BeginInvoke(a.EndInvoke, null); + } + + + private void setupRequest() { + +#if !NETFX_CORE + _request = WebRequest.Create(_requestUrl) as HttpWebRequest; + _request.UserAgent = _userAgent; + //_hwr.UserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36"; + //_hwr.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore); + _request.Credentials = CredentialCache.DefaultCredentials; + _request.KeepAlive = true; + _request.ProtocolVersion = HttpVersion.Version11; // improved performance + + // improved performance. + // ServicePointManager.DefaultConnectionLimit doesn't seem to change anything + // set ConnectionLimit per request + // https://msdn.microsoft.com/en-us/library/system.net.httpwebrequest(v=vs.90).aspx#Remarks + // use a value that is 12 times the number of CPUs on the local computer + _request.ServicePoint.ConnectionLimit = Environment.ProcessorCount * 6; + + _request.ServicePoint.UseNagleAlgorithm = true; + _request.ServicePoint.Expect100Continue = false; + _request.ServicePoint.MaxIdleTime = 2000; + _request.Method = "GET"; + _request.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate"); + _request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; + //_hwr.Timeout = timeOut * 1000; doesn't work in async calls, see below + +#else + HttpClientHandler handler = new HttpClientHandler() { + AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate, + AllowAutoRedirect = true, + UseDefaultCredentials = true + + }; + _request = new HttpClient(handler); + _request.DefaultRequestHeaders.Add("User-Agent", _userAgent); + _request.Timeout = TimeSpan.FromSeconds(_timeOut); + + // TODO: how to set ConnectionLimit? ServicePoint.ConnectionLimit doesn't seem to be available. +#endif + +#if !UNITY && !NETFX_CORE + // 'NoCacheNoStore' greatly reduced the number of faulty request + // seems that .Net caching and Mapbox API don't play well together + _request.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore); +#endif + } + + + +#if NETFX_CORE + private async void getResponseNonThreaded(HttpClient request, Action gotResponse) { + + // TODO: implement a strategy similar to the full .Net one to avoid blocking of 'GetAsync()' + // see 'Remarks' https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient.timeout?view=netcore-1.1#System_Net_Http_HttpClient_Timeout + // "A Domain Name System (DNS) query may take up to 15 seconds to return or time out." + + HttpResponseMessage response = null; + try { + response = await request.GetAsync(_requestUrl, _cancellationTokenSource.Token); + gotResponse(response, null); + } + catch (Exception ex) { + gotResponse(response, ex); + } + + } + + + private async void EvaluateResponse(HttpResponseMessage apiResponse, Exception apiEx) { + + var response = await Response.FromWebResponse(this, apiResponse, apiEx); + + // post (async) callback back to the main/UI thread + // Unity: SynchronizationContext doesn't do anything + // use the Dispatcher +#if !UNITY + _sync.Post(delegate { callCallbackAndcleanUp(response); }, null); +#else + UnityToolbag.Dispatcher.InvokeAsync(() => { callCallbackAndcleanUp(response); }); +#endif + } + +#endif + + +#if !NETFX_CORE + private void getResponseNonThreaded(HttpWebRequest request, Action gotResponse) { + + HttpWebResponse response = null; + try { + response = (HttpWebResponse)request.GetResponse(); + gotResponse(response, null); + } + catch (WebException wex) { + //another place to watchout for HttpWebRequest.Abort to occur + if (wex.Status == WebExceptionStatus.RequestCanceled) { + gotResponse(null, wex); + } else { + HttpWebResponse hwr = wex.Response as HttpWebResponse; + if (null == hwr) { + gotResponse(null, wex); + } else { + gotResponse(hwr, wex); + } + } + } + catch (Exception ex) { + gotResponse(response, ex); + } + } + + + private void EvaluateResponse(HttpWebResponse apiResponse, Exception apiEx) { + + var response = Response.FromWebResponse(this, apiResponse, apiEx); + +#if !UNITY + // post (async) callback back to the main/UI thread + // Unity: SynchronizationContext doesn't do anything + // use the Dispatcher + _sync.Post(delegate { callCallbackAndcleanUp(response); }, null); +#else + // Unity is playing + if (UnityToolbag.Dispatcher._instanceExists) { + UnityToolbag.Dispatcher.InvokeAsync(() => { callCallbackAndcleanUp(response); }); + } else { // Unity is in Edit Mode +#if UNITY_EDITOR + Mapbox.Unity.DispatcherEditor.InvokeAsync(() => { callCallbackAndcleanUp(response); }); +#endif + } +#endif + } +#endif + + + private void callCallbackAndcleanUp(Response response) { + _callback(response); + IsCompleted = true; + _callback = null; +#if NETFX_CORE + if (null != _request) { + _request.Dispose(); + _request = null; + } +#endif + } + + + public void Cancel() { + +#if !NETFX_CORE + if (null != _request) { + _request.Abort(); + } +#else + _cancellationTokenSource.Cancel(); +#endif + } + + + } +} +#endif \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/Platform/HTTPRequestNonThreaded.cs.meta b/Core/mapbox-sdk-cs/Platform/HTTPRequestNonThreaded.cs.meta new file mode 100644 index 0000000..942353d --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/HTTPRequestNonThreaded.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ca6d4261d474b4de0b14637c81b1795c +timeCreated: 1494952070 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/HTTPRequestThreaded.cs b/Core/mapbox-sdk-cs/Platform/HTTPRequestThreaded.cs new file mode 100644 index 0000000..c8274b5 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/HTTPRequestThreaded.cs @@ -0,0 +1,318 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// Based on http://stackoverflow.com/a/12606963 and http://wiki.unity3d.com/index.php/WebAsync +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_ANDROID || UNITY_WP_8_1 || UNITY_WSA || UNITY_WEBGL || UNITY_IOS || UNITY_PS4 || UNITY_SAMSUNGTV || UNITY_XBOXONE || UNITY_TIZEN || UNITY_TVOS +#define UNITY +#endif + +#if !UNITY + +namespace Mapbox.Platform { + + + using System; + using System.Net; +#if !UNITY && !NETFX_CORE + using System.Net.Cache; +#endif + using System.IO; + using System.Collections.Generic; + using System.Threading; + using System.ComponentModel; + using Utils; +#if NETFX_CORE + using System.Net.Http; + using System.Linq; +#endif + + //using System.Windows.Threading; + + internal sealed class HTTPRequestThreaded : IAsyncRequest { + + + public bool IsCompleted { get; private set; } + + + private Action _callback; +#if !NETFX_CORE + private HttpWebRequest _request; +#else + private HttpClient _request; + private CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource(); +#endif +#if !UNITY + private SynchronizationContext _sync = AsyncOperationManager.SynchronizationContext; +#endif + private int _timeOut; + private string _requestUrl; + private readonly string _userAgent = "mapbox-sdk-cs"; + + + /// + /// + /// + /// + /// + /// seconds + public HTTPRequestThreaded(string url, Action callback, int timeOut = 10) { + + IsCompleted = false; + _callback = callback; + _timeOut = timeOut; + _requestUrl = url; + + setupRequest(); + getResponseAsync(_request, EvaluateResponse); + } + + + private void setupRequest() { + +#if !NETFX_CORE + _request = WebRequest.Create(_requestUrl) as HttpWebRequest; + _request.UserAgent = _userAgent; + //_hwr.UserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36"; + //_hwr.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore); + _request.Credentials = CredentialCache.DefaultCredentials; + _request.KeepAlive = true; + _request.ProtocolVersion = HttpVersion.Version11; // improved performance + + // improved performance. + // ServicePointManager.DefaultConnectionLimit doesn't seem to change anything + // set ConnectionLimit per request + // https://msdn.microsoft.com/en-us/library/system.net.httpwebrequest(v=vs.90).aspx#Remarks + // use a value that is 12 times the number of CPUs on the local computer + _request.ServicePoint.ConnectionLimit = Environment.ProcessorCount * 6; + + _request.ServicePoint.UseNagleAlgorithm = true; + _request.ServicePoint.Expect100Continue = false; + _request.ServicePoint.MaxIdleTime = 2000; + _request.Method = "GET"; + _request.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate"); + _request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; + //_hwr.Timeout = timeOut * 1000; doesn't work in async calls, see below + +#else + HttpClientHandler handler = new HttpClientHandler() { + AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate, + AllowAutoRedirect = true, + UseDefaultCredentials = true + + }; + _request = new HttpClient(handler); + _request.DefaultRequestHeaders.Add("User-Agent", _userAgent); + _request.Timeout = TimeSpan.FromSeconds(_timeOut); + + // TODO: how to set ConnectionLimit? ServicePoint.ConnectionLimit doesn't seem to be available. +#endif + +#if !UNITY && !NETFX_CORE + // 'NoCacheNoStore' greatly reduced the number of faulty request + // seems that .Net caching and Mapbox API don't play well together + _request.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore); +#endif + } + + + +#if NETFX_CORE + + private async void getResponseAsync(HttpClient request, Action gotResponse) { + + // TODO: implement a strategy similar to the full .Net one to avoid blocking of 'GetAsync()' + // see 'Remarks' https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient.timeout?view=netcore-1.1#System_Net_Http_HttpClient_Timeout + // "A Domain Name System (DNS) query may take up to 15 seconds to return or time out." + + HttpResponseMessage response = null; + try { + response = await request.GetAsync(_requestUrl, _cancellationTokenSource.Token); + gotResponse(response, null); + } + catch (Exception ex) { + gotResponse(response, ex); + } + + } + + + private async void EvaluateResponse(HttpResponseMessage apiResponse, Exception apiEx) { + + var response = await Response.FromWebResponse(this, apiResponse, apiEx); + + // post (async) callback back to the main/UI thread + // Unity: SynchronizationContext doesn't do anything + // use the Dispatcher +#if !UNITY + _sync.Post(delegate { + _callback(response); + IsCompleted = true; + _callback = null; +#if NETFX_CORE + if (null != _request) { + _request.Dispose(); + _request = null; + } +#endif + }, null); +#else + UnityToolbag.Dispatcher.InvokeAsync(() => { + _callback(response); + IsCompleted = true; + _callback = null; +#if NETFX_CORE + if (null != _request) { + _request.Dispose(); + _request = null; + } +#endif + }); +#endif + } + +#endif + + +#if !NETFX_CORE + private void getResponseAsync(HttpWebRequest request, Action gotResponse) { + + // create an additional action wrapper, because of: + // https://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.begingetresponse.aspx + // The BeginGetResponse method requires some synchronous setup tasks to complete (DNS resolution, + //proxy detection, and TCP socket connection, for example) before this method becomes asynchronous. + // As a result, this method should never be called on a user interface (UI) thread because it might + // take considerable time(up to several minutes depending on network settings) to complete the + // initial synchronous setup tasks before an exception for an error is thrown or the method succeeds. + + Action actionWrapper = () => { + try { + // BeginInvoke runs on a thread of the thread pool (!= main/UI thread) + // that's why we need SynchronizationContext when + // TODO: how to influence threadpool: nr of threads etc. + long startTicks = DateTime.Now.Ticks; + request.BeginGetResponse((asycnResult) => { + try { // there's a try/catch here because execution path is different from invokation one, exception here may cause a crash + long beforeEndGet = DateTime.Now.Ticks; + HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asycnResult); + //long finished = DateTime.Now.Ticks; + //long duration = finished - startTicks; + //TimeSpan ts = TimeSpan.FromTicks(duration); + //TimeSpan tsEndGet = TimeSpan.FromTicks(finished - beforeEndGet); + //TimeSpan tsBeginGet = TimeSpan.FromTicks(beforeEndGet - startTicks); + //UnityEngine.Debug.Log("received response - " + ts.Milliseconds + "ms" + " BeginGet: " + tsBeginGet.Milliseconds + " EndGet: " + tsEndGet.Milliseconds + " CompletedSynchronously: " + asycnResult.CompletedSynchronously); + gotResponse(response, null); + } + // EndGetResponse() throws on on some status codes, try to get response anyway (and status codes) + catch (WebException wex) { + //another place to watchout for HttpWebRequest.Abort to occur + if (wex.Status == WebExceptionStatus.RequestCanceled) { + gotResponse(null, wex); + } else { + HttpWebResponse hwr = wex.Response as HttpWebResponse; + if (null == hwr) { + throw; + } + gotResponse(hwr, wex); + } + } + catch (Exception ex) { + gotResponse(null, ex); + } + } + , null); + } + catch (Exception ex) { + //catch exception from HttpWebRequest.Abort + gotResponse(null, ex); + } + }; + + try { + actionWrapper.BeginInvoke(new AsyncCallback((iAsyncResult) => { + var action = (Action)iAsyncResult.AsyncState; + action.EndInvoke(iAsyncResult); + }) + , actionWrapper); + } + catch (Exception ex) { + gotResponse(null, ex); + } + } + + + + private void EvaluateResponse(HttpWebResponse apiResponse, Exception apiEx) { + + var response = Response.FromWebResponse(this, apiResponse,apiEx); + + // post (async) callback back to the main/UI thread + // Unity: SynchronizationContext doesn't do anything + // use the Dispatcher +#if !UNITY + _sync.Post(delegate { + _callback(response); + IsCompleted = true; + _callback = null; +#if NETFX_CORE + if (null != _request) { + _request.Dispose(); + _request = null; + } +#endif + }, null); +#else + // Unity is playing + if (UnityToolbag.Dispatcher._instanceExists) { + UnityToolbag.Dispatcher.InvokeAsync(() => { + _callback(response); + IsCompleted = true; + _callback = null; +#if NETFX_CORE + if (null != _request) { + _request.Dispose(); + _request = null; + } +#endif + }); + } else { // Unity is in Edit Mode +#if UNITY_EDITOR + Mapbox.Unity.DispatcherEditor.InvokeAsync(() => { + _callback(response); + IsCompleted = true; + _callback = null; +#if NETFX_CORE + if (null != _request) { + _request.Dispose(); + _request = null; + } +#endif + }); +#endif + + } +#endif + } +#endif + + + + public void Cancel() { + +#if !NETFX_CORE + if (null != _request) { + _request.Abort(); + } +#else + _cancellationTokenSource.Cancel(); +#endif + } + + + } +} + + +#endif \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/Platform/HTTPRequestThreaded.cs.meta b/Core/mapbox-sdk-cs/Platform/HTTPRequestThreaded.cs.meta new file mode 100644 index 0000000..7c2ae3b --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/HTTPRequestThreaded.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7952dd05dd1ff40d0bff547dacc6e714 +timeCreated: 1494952070 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/IAsyncRequest.cs b/Core/mapbox-sdk-cs/Platform/IAsyncRequest.cs new file mode 100644 index 0000000..f26596a --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/IAsyncRequest.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + + +namespace Mapbox.Platform { + + using Mapbox.Unity.Utilities; + + + /// A handle to an asynchronous request. + public interface IAsyncRequest { + + /// True after the request has finished. + bool IsCompleted { get; } + + /// Cancel the ongoing request, preventing it from firing a callback. + void Cancel(); + + /// Type of request: GET, HEAD, ... + HttpRequestType RequestType { get; } + } +} \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/Platform/IAsyncRequest.cs.meta b/Core/mapbox-sdk-cs/Platform/IAsyncRequest.cs.meta new file mode 100644 index 0000000..005955d --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/IAsyncRequest.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3687819725d334e82b70887393d8c63f +timeCreated: 1494951007 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/IAsyncRequestFactory.cs b/Core/mapbox-sdk-cs/Platform/IAsyncRequestFactory.cs new file mode 100644 index 0000000..195d1e4 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/IAsyncRequestFactory.cs @@ -0,0 +1,39 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_ANDROID || UNITY_WP_8_1 || UNITY_WSA || UNITY_WEBGL || UNITY_IOS || UNITY_PS4 || UNITY_SAMSUNGTV || UNITY_XBOXONE || UNITY_TIZEN || UNITY_TVOS +#define UNITY +#endif + +namespace Mapbox.Platform { + + using Mapbox.Map; + using Mapbox.Unity.Utilities; + using System; + + /// A handle to an asynchronous request. + public static class IAsyncRequestFactory { + + public static IAsyncRequest CreateRequest( + string url + , Action callback + , int timeout + , HttpRequestType requestType= HttpRequestType.Get + ) { +#if !UNITY + if (Environment.ProcessorCount > 2) { + return new HTTPRequestThreaded(url, callback, timeout); + } else { + return new HTTPRequestNonThreaded(url, callback, timeout); + } +#else + return new Mapbox.Unity.Utilities.HTTPRequest(url, callback, timeout, requestType); +#endif + } + + + } +} \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/Platform/IAsyncRequestFactory.cs.meta b/Core/mapbox-sdk-cs/Platform/IAsyncRequestFactory.cs.meta new file mode 100644 index 0000000..ebacba4 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/IAsyncRequestFactory.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2ee60049c3e114aed8e10d5b28d83efe +timeCreated: 1494952069 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/IFileSource.cs b/Core/mapbox-sdk-cs/Platform/IFileSource.cs new file mode 100644 index 0000000..64528bc --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/IFileSource.cs @@ -0,0 +1,30 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Platform +{ + using Mapbox.Map; + using System; + + /// + /// A data source abstraction. Used by classes that need to fetch data but really + /// don't care about from where the data is coming from. An implementation of + /// IFileSource could fetch the data from the network, disk cache or even generate + /// the data at runtime. + /// + public interface IFileSource + { + /// Performs a request asynchronously. + /// The resource description in the URI format. + /// Callback to be called after the request is completed. + /// + /// Returns a that can be used for canceling a pending + /// request. This handle can be completely ignored if there is no intention of ever + /// canceling the request. + /// + IAsyncRequest Request(string uri, Action callback, int timeout = 10, CanonicalTileId tileId = new CanonicalTileId(), string tilesetId = null); + } +} diff --git a/Core/mapbox-sdk-cs/Platform/IFileSource.cs.meta b/Core/mapbox-sdk-cs/Platform/IFileSource.cs.meta new file mode 100644 index 0000000..aba725e --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/IFileSource.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 891a55d979ad44487b2ad8e1384cfc65 +timeCreated: 1494951007 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/IResource.cs b/Core/mapbox-sdk-cs/Platform/IResource.cs new file mode 100644 index 0000000..f96aaf1 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/IResource.cs @@ -0,0 +1,21 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Platform +{ + using System; + + /// + /// Interface representing a Mapbox resource URL. Used to build request strings + /// and return full URLs to a Mapbox Web Service API resource. + /// + public interface IResource + { + /// Builds a complete, valid URL string. + /// URL string. + string GetUrl(); + } +} diff --git a/Core/mapbox-sdk-cs/Platform/IResource.cs.meta b/Core/mapbox-sdk-cs/Platform/IResource.cs.meta new file mode 100644 index 0000000..8cee1a6 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/IResource.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6c11ed4c71914479ebeb8b69bf0bb677 +timeCreated: 1491243034 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/Resource.cs b/Core/mapbox-sdk-cs/Platform/Resource.cs new file mode 100644 index 0000000..6ea1f7b --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Resource.cs @@ -0,0 +1,76 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Platform +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Collections.Specialized; + using System.Linq; +#if UNITY_IOS + using UnityEngine; +#endif + + /// Abstract class representing a Mapbox resource URL. + public abstract class Resource + { + /// Gets the API endpoint, which is a partial URL path. + public abstract string ApiEndpoint { get; } + + /// Builds a complete, valid URL string. + /// Returns URL string. + public abstract string GetUrl(); + + /// Encodes a URI with a querystring. + /// Querystring values. + /// Encoded URL. + protected static String EncodeQueryString(IEnumerable> values) + { + if (values != null) + { + // we are seeing super weird crashes on some iOS devices: + // see 'ForwardGeocodeResource' for more details + var encodedValues = from p in values +#if UNITY_IOS +#if UNITY_2017_1_OR_NEWER + let k = UnityEngine.Networking.UnityWebRequest.EscapeURL(p.Key.Trim()) + let v = UnityEngine.Networking.UnityWebRequest.EscapeURL(p.Value) +#else + let k = WWW.EscapeURL(p.Key.Trim()) + let v = WWW.EscapeURL(p.Value) +#endif +#else + let k = Uri.EscapeDataString(p.Key.Trim()) + let v = Uri.EscapeDataString(p.Value) +#endif + orderby k + select string.IsNullOrEmpty(v) ? k : string.Format("{0}={1}", k, v); + if (encodedValues.Count() == 0) + { + return string.Empty; + } + else + { + return "?" + string.Join( + "&", encodedValues.ToArray()); + } + } + + return string.Empty; + } + + /// Builds a string from an array of options for use in URLs. + /// Array of option strings. + /// Character to use for separating items in arry. Defaults to ",". + /// Comma-separated string of options. + /// Type in the array. + protected static string GetUrlQueryFromArray(U[] items, string separator = ",") + { + return string.Join(separator, items.Select(item => item.ToString()).ToArray()); + } + } +} diff --git a/Core/mapbox-sdk-cs/Platform/Resource.cs.meta b/Core/mapbox-sdk-cs/Platform/Resource.cs.meta new file mode 100644 index 0000000..6e96030 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Resource.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3c337c92960274b8098678fcfebbc8d0 +timeCreated: 1491243034 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/Response.cs b/Core/mapbox-sdk-cs/Platform/Response.cs new file mode 100644 index 0000000..5735aa7 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Response.cs @@ -0,0 +1,339 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_2017_1_OR_NEWER +#define UNITY +#endif + +namespace Mapbox.Platform +{ + + using System; + using System.Collections.Generic; + using System.Collections.ObjectModel; + using System.IO; + using System.Linq; + using System.Net; + using Utils; + +#if NETFX_CORE + using System.Net.Http; + using System.Threading.Tasks; +#endif +#if UNITY + using UnityEngine.Networking; + using Mapbox.Unity.Utilities; +#endif + + /// A response from a request. + public class Response + { + + + private Response() { } + + + public IAsyncRequest Request { get; private set; } + + + public bool RateLimitHit + { + get { return StatusCode.HasValue ? 429 == StatusCode.Value : false; } + } + + + /// Flag to indicate if the request was successful + public bool HasError + { + get { return _exceptions == null ? false : _exceptions.Count > 0; } + } + + /// Flag to indicate if the request was fullfilled from a local cache + public bool LoadedFromCache; + + /// Flag to indicate if the request was issued before but was issued again and updated + public bool IsUpdate = false; + + public string RequestUrl; + + + public int? StatusCode; + + + public string ContentType; + + + /// Length of rate-limiting interval in seconds. https://www.mapbox.com/api-documentation/#rate-limit-headers + public int? XRateLimitInterval; + + + /// Maximum number of requests you may make in the current interval before reaching the limit. https://www.mapbox.com/api-documentation/#rate-limit-headers + public long? XRateLimitLimit; + + + /// Timestamp of when the current interval will end and the ratelimit counter is reset. https://www.mapbox.com/api-documentation/#rate-limit-headers + public DateTime? XRateLimitReset; + + + private List _exceptions; + /// Exceptions that might have occured during the request. + public ReadOnlyCollection Exceptions + { + get { return null == _exceptions ? null : _exceptions.AsReadOnly(); } + } + + + /// Messages of exceptions otherwise empty string. + public string ExceptionsAsString + { + get + { + if (null == _exceptions || _exceptions.Count == 0) { return string.Empty; } + return string.Join(Environment.NewLine, _exceptions.Select(e => e.Message).ToArray()); + } + } + + + /// Headers of the response. + public Dictionary Headers; + + + /// Raw data fetched from the request. + public byte[] Data; + + public void AddException(Exception ex) + { + if (null == _exceptions) { _exceptions = new List(); } + _exceptions.Add(ex); + } + + // TODO: we should store timestamp of the cache! + public static Response FromCache(byte[] data) + { + Response response = new Response(); + response.Data = data; + response.LoadedFromCache = true; + return response; + } + +#if !NETFX_CORE && !UNITY // full .NET Framework + public static Response FromWebResponse(IAsyncRequest request, HttpWebResponse apiResponse, Exception apiEx) { + + Response response = new Response(); + response.Request = request; + + if (null != apiEx) { + response.AddException(apiEx); + } + + // timeout: API response is null + if (null == apiResponse) { + response.AddException(new Exception("No Reponse.")); + } else { + // https://www.mapbox.com/api-documentation/#rate-limit-headers + if (null != apiResponse.Headers) { + response.Headers = new Dictionary(); + for (int i = 0; i < apiResponse.Headers.Count; i++) { + // TODO: implement .Net Core / UWP implementation + string key = apiResponse.Headers.Keys[i]; + string val = apiResponse.Headers[i]; + response.Headers.Add(key, val); + if (key.Equals("X-Rate-Limit-Interval", StringComparison.InvariantCultureIgnoreCase)) { + int limitInterval; + if (int.TryParse(val, out limitInterval)) { response.XRateLimitInterval = limitInterval; } + } else if (key.Equals("X-Rate-Limit-Limit", StringComparison.InvariantCultureIgnoreCase)) { + long limitLimit; + if (long.TryParse(val, out limitLimit)) { response.XRateLimitLimit = limitLimit; } + } else if (key.Equals("X-Rate-Limit-Reset", StringComparison.InvariantCultureIgnoreCase)) { + double unixTimestamp; + if (double.TryParse(val, out unixTimestamp)) { + response.XRateLimitReset = UnixTimestampUtils.From(unixTimestamp); + } + } else if (key.Equals("Content-Type", StringComparison.InvariantCultureIgnoreCase)) { + response.ContentType = val; + } + } + } + + if (apiResponse.StatusCode != HttpStatusCode.OK) { + response.AddException(new Exception(string.Format("{0}: {1}", apiResponse.StatusCode, apiResponse.StatusDescription))); + } + int statusCode = (int)apiResponse.StatusCode; + response.StatusCode = statusCode; + if (429 == statusCode) { + response.AddException(new Exception("Rate limit hit")); + } + + if (null != apiResponse) { + using (Stream responseStream = apiResponse.GetResponseStream()) { + byte[] buffer = new byte[0x1000]; + int bytesRead; + using (MemoryStream ms = new MemoryStream()) { + while (0 != (bytesRead = responseStream.Read(buffer, 0, buffer.Length))) { + ms.Write(buffer, 0, bytesRead); + } + response.Data = ms.ToArray(); + } + } + apiResponse.Close(); + } + } + + return response; + } +#endif + +#if NETFX_CORE && !UNITY //UWP but not Unity + public static async Task FromWebResponse(IAsyncRequest request, HttpResponseMessage apiResponse, Exception apiEx) { + + Response response = new Response(); + response.Request = request; + + if (null != apiEx) { + response.AddException(apiEx); + } + + // timeout: API response is null + if (null == apiResponse) { + response.AddException(new Exception("No Reponse.")); + } else { + // https://www.mapbox.com/api-documentation/#rate-limit-headers + if (null != apiResponse.Headers) { + response.Headers = new Dictionary(); + foreach (var hdr in apiResponse.Headers) { + string key = hdr.Key; + string val = hdr.Value.FirstOrDefault(); + response.Headers.Add(key, val); + if (key.Equals("X-Rate-Limit-Interval", StringComparison.OrdinalIgnoreCase)) { + int limitInterval; + if (int.TryParse(val, out limitInterval)) { response.XRateLimitInterval = limitInterval; } + } else if (key.Equals("X-Rate-Limit-Limit", StringComparison.OrdinalIgnoreCase)) { + long limitLimit; + if (long.TryParse(val, out limitLimit)) { response.XRateLimitLimit = limitLimit; } + } else if (key.Equals("X-Rate-Limit-Reset", StringComparison.OrdinalIgnoreCase)) { + double unixTimestamp; + if (double.TryParse(val, out unixTimestamp)) { + DateTime beginningOfTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); + response.XRateLimitReset = beginningOfTime.AddSeconds(unixTimestamp).ToLocalTime(); + } + } else if (key.Equals("Content-Type", StringComparison.OrdinalIgnoreCase)) { + response.ContentType = val; + } + } + } + + if (apiResponse.StatusCode != HttpStatusCode.OK) { + response.AddException(new Exception(string.Format("{0}: {1}", apiResponse.StatusCode, apiResponse.ReasonPhrase))); + } + int statusCode = (int)apiResponse.StatusCode; + response.StatusCode = statusCode; + if (429 == statusCode) { + response.AddException(new Exception("Rate limit hit")); + } + + if (null != apiResponse) { + response.Data = await apiResponse.Content.ReadAsByteArrayAsync(); + } + } + + return response; + } +#endif + +#if UNITY // within Unity or UWP build from Unity + public static Response FromWebResponse(IAsyncRequest request, UnityWebRequest apiResponse, Exception apiEx) + { + + Response response = new Response(); + response.Request = request; + + if (null != apiEx) + { + response.AddException(apiEx); + } + + // additional string.empty check for apiResponse.error: + // on UWP isNetworkError is sometimes set to true despite all being well + if (apiResponse.isNetworkError && !string.IsNullOrEmpty(apiResponse.error)) + { + response.AddException(new Exception(apiResponse.error)); + } + + if (request.RequestType != HttpRequestType.Head) + { + if (null == apiResponse.downloadHandler.data) + { + response.AddException(new Exception("Response has no data.")); + } + } + +#if NETFX_CORE + StringComparison stringComp = StringComparison.OrdinalIgnoreCase; +#elif WINDOWS_UWP + StringComparison stringComp = StringComparison.OrdinalIgnoreCase; +#else + StringComparison stringComp = StringComparison.InvariantCultureIgnoreCase; +#endif + + Dictionary apiHeaders = apiResponse.GetResponseHeaders(); + if (null != apiHeaders) + { + response.Headers = new Dictionary(); + foreach (var apiHdr in apiHeaders) + { + string key = apiHdr.Key; + string val = apiHdr.Value; + response.Headers.Add(key, val); + if (key.Equals("X-Rate-Limit-Interval", stringComp)) + { + int limitInterval; + if (int.TryParse(val, out limitInterval)) { response.XRateLimitInterval = limitInterval; } + } + else if (key.Equals("X-Rate-Limit-Limit", stringComp)) + { + long limitLimit; + if (long.TryParse(val, out limitLimit)) { response.XRateLimitLimit = limitLimit; } + } + else if (key.Equals("X-Rate-Limit-Reset", stringComp)) + { + double unixTimestamp; + if (double.TryParse(val, out unixTimestamp)) + { + response.XRateLimitReset = UnixTimestampUtils.From(unixTimestamp); + } + } + else if (key.Equals("Content-Type", stringComp)) + { + response.ContentType = val; + } + } + } + + int statusCode = (int)apiResponse.responseCode; + response.StatusCode = statusCode; + + if (statusCode != 200) + { + response.AddException(new Exception(string.Format("Status Code {0}", apiResponse.responseCode))); + } + if (429 == statusCode) + { + response.AddException(new Exception("Rate limit hit")); + } + + if (request.RequestType != HttpRequestType.Head) + { + response.Data = apiResponse.downloadHandler.data; + } + + return response; + } +#endif + + + + } +} diff --git a/Core/mapbox-sdk-cs/Platform/Response.cs.meta b/Core/mapbox-sdk-cs/Platform/Response.cs.meta new file mode 100644 index 0000000..2d766d8 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/Response.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f904217270b634d929d1a92bee809d3e +timeCreated: 1494951007 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/SQLite.meta b/Core/mapbox-sdk-cs/Platform/SQLite.meta new file mode 100644 index 0000000..406bc7a --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/SQLite.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: e42bed265428942f4817d4918fbb7c41 +folderAsset: yes +timeCreated: 1497883478 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/SQLite/SQLite.cs b/Core/mapbox-sdk-cs/Platform/SQLite/SQLite.cs new file mode 100644 index 0000000..b28b443 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/SQLite/SQLite.cs @@ -0,0 +1,3638 @@ +// +// Copyright (c) 2009-2012 Krueger Systems, Inc. +// +// 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. +// +#if WINDOWS_PHONE && !USE_WP8_NATIVE_SQLITE +#define USE_CSHARP_SQLITE +#endif + +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Collections.Generic; +using System.Reflection; +using System.Linq; +using System.Linq.Expressions; +using System.Threading; + +#if USE_CSHARP_SQLITE +using Sqlite3 = Community.CsharpSqlite.Sqlite3; +using Sqlite3DatabaseHandle = Community.CsharpSqlite.Sqlite3.sqlite3; +using Sqlite3Statement = Community.CsharpSqlite.Sqlite3.Vdbe; +#elif USE_WP8_NATIVE_SQLITE +using Sqlite3 = Sqlite.Sqlite3; +using Sqlite3DatabaseHandle = Sqlite.Database; +using Sqlite3Statement = Sqlite.Statement; +#else +using Sqlite3DatabaseHandle = System.IntPtr; +using Sqlite3Statement = System.IntPtr; +#endif + +namespace SQLite4Unity3d +{ + public class SQLiteException : Exception + { + public SQLite3.Result Result { get; private set; } + + protected SQLiteException(SQLite3.Result r, string message) : base(message) + { + Result = r; + } + + public static SQLiteException New(SQLite3.Result r, string message) + { + return new SQLiteException(r, message); + } + } + + public class NotNullConstraintViolationException : SQLiteException + { + public IEnumerable Columns { get; protected set; } + + protected NotNullConstraintViolationException(SQLite3.Result r, string message) + : this(r, message, null, null) + { + + } + + protected NotNullConstraintViolationException(SQLite3.Result r, string message, TableMapping mapping, object obj) + : base(r, message) + { + if (mapping != null && obj != null) + { + this.Columns = from c in mapping.Columns + where c.IsNullable == false && c.GetValue(obj) == null + select c; + } + } + + public static new NotNullConstraintViolationException New(SQLite3.Result r, string message) + { + return new NotNullConstraintViolationException(r, message); + } + + public static NotNullConstraintViolationException New(SQLite3.Result r, string message, TableMapping mapping, object obj) + { + return new NotNullConstraintViolationException(r, message, mapping, obj); + } + + public static NotNullConstraintViolationException New(SQLiteException exception, TableMapping mapping, object obj) + { + return new NotNullConstraintViolationException(exception.Result, exception.Message, mapping, obj); + } + } + + [Flags] + public enum SQLiteOpenFlags + { + ReadOnly = 1, ReadWrite = 2, Create = 4, + NoMutex = 0x8000, FullMutex = 0x10000, + SharedCache = 0x20000, PrivateCache = 0x40000, + ProtectionComplete = 0x00100000, + ProtectionCompleteUnlessOpen = 0x00200000, + ProtectionCompleteUntilFirstUserAuthentication = 0x00300000, + ProtectionNone = 0x00400000 + } + + [Flags] + public enum CreateFlags + { + None = 0, + ImplicitPK = 1, // create a primary key for field called 'Id' (Orm.ImplicitPkName) + ImplicitIndex = 2, // create an index for fields ending in 'Id' (Orm.ImplicitIndexSuffix) + AllImplicit = 3, // do both above + + AutoIncPK = 4 // force PK field to be auto inc + } + + /// + /// Represents an open connection to a SQLite database. + /// + public partial class SQLiteConnection : IDisposable + { + private bool _open; + private TimeSpan _busyTimeout; + private Dictionary _mappings = null; + private Dictionary _tables = null; + private System.Diagnostics.Stopwatch _sw; + private long _elapsedMilliseconds = 0; + + private int _transactionDepth = 0; + private Random _rand = new Random(); + + public Sqlite3DatabaseHandle Handle { get; private set; } + internal static readonly Sqlite3DatabaseHandle NullHandle = default(Sqlite3DatabaseHandle); + + public string DatabasePath { get; private set; } + + public bool TimeExecution { get; set; } + + public bool Trace { get; set; } + + public bool StoreDateTimeAsTicks { get; private set; } + + /// + /// Constructs a new SQLiteConnection and opens a SQLite database specified by databasePath. + /// + /// + /// Specifies the path to the database file. + /// + /// + /// Specifies whether to store DateTime properties as ticks (true) or strings (false). You + /// absolutely do want to store them as Ticks in all new projects. The default of false is + /// only here for backwards compatibility. There is a *significant* speed advantage, with no + /// down sides, when setting storeDateTimeAsTicks = true. + /// + public SQLiteConnection(string databasePath, bool storeDateTimeAsTicks = false) + : this(databasePath, SQLiteOpenFlags.ReadWrite | SQLiteOpenFlags.Create, storeDateTimeAsTicks) + { + } + + /// + /// Constructs a new SQLiteConnection and opens a SQLite database specified by databasePath. + /// + /// + /// Specifies the path to the database file. + /// + /// + /// Specifies whether to store DateTime properties as ticks (true) or strings (false). You + /// absolutely do want to store them as Ticks in all new projects. The default of false is + /// only here for backwards compatibility. There is a *significant* speed advantage, with no + /// down sides, when setting storeDateTimeAsTicks = true. + /// + public SQLiteConnection(string databasePath, SQLiteOpenFlags openFlags, bool storeDateTimeAsTicks = false) + { + if (string.IsNullOrEmpty(databasePath)) + throw new ArgumentException("Must be specified", "databasePath"); + + DatabasePath = databasePath; + +#if NETFX_CORE + SQLite3.SetDirectory(/*temp directory type*/2, Windows.Storage.ApplicationData.Current.TemporaryFolder.Path); +#endif + + Sqlite3DatabaseHandle handle; + +#if SILVERLIGHT || USE_CSHARP_SQLITE + var r = SQLite3.Open (databasePath, out handle, (int)openFlags, IntPtr.Zero); +#else + // open using the byte[] + // in the case where the path may include Unicode + // force open to using UTF-8 using sqlite3_open_v2 + var databasePathAsBytes = GetNullTerminatedUtf8(DatabasePath); + var r = SQLite3.Open(databasePathAsBytes, out handle, (int)openFlags, IntPtr.Zero); +#endif + + Handle = handle; + if (r != SQLite3.Result.OK) + { + throw SQLiteException.New(r, String.Format("Could not open database file: {0} ({1})", DatabasePath, r)); + } + _open = true; + + StoreDateTimeAsTicks = storeDateTimeAsTicks; + + BusyTimeout = TimeSpan.FromSeconds(0.1); + } + + static SQLiteConnection() + { + if (_preserveDuringLinkMagic) + { + var ti = new ColumnInfo(); + ti.Name = "magic"; + } + } + + public void EnableLoadExtension(int onoff) + { + SQLite3.Result r = SQLite3.EnableLoadExtension(Handle, onoff); + if (r != SQLite3.Result.OK) + { + string msg = SQLite3.GetErrmsg(Handle); + throw SQLiteException.New(r, msg); + } + } + + static byte[] GetNullTerminatedUtf8(string s) + { + var utf8Length = System.Text.Encoding.UTF8.GetByteCount(s); + var bytes = new byte[utf8Length + 1]; + utf8Length = System.Text.Encoding.UTF8.GetBytes(s, 0, s.Length, bytes, 0); + return bytes; + } + + /// + /// Used to list some code that we want the MonoTouch linker + /// to see, but that we never want to actually execute. + /// +#pragma warning disable 0649 + static bool _preserveDuringLinkMagic; +#pragma warning restore 0649 + + /// + /// Sets a busy handler to sleep the specified amount of time when a table is locked. + /// The handler will sleep multiple times until a total time of has accumulated. + /// + public TimeSpan BusyTimeout + { + get { return _busyTimeout; } + set + { + _busyTimeout = value; + if (Handle != NullHandle) + { + SQLite3.BusyTimeout(Handle, (int)_busyTimeout.TotalMilliseconds); + } + } + } + + /// + /// Returns the mappings from types to tables that the connection + /// currently understands. + /// + public IEnumerable TableMappings + { + get + { + return _tables != null ? _tables.Values : Enumerable.Empty(); + } + } + + /// + /// Retrieves the mapping that is automatically generated for the given type. + /// + /// + /// The type whose mapping to the database is returned. + /// + /// + /// Optional flags allowing implicit PK and indexes based on naming conventions + /// + /// + /// The mapping represents the schema of the columns of the database and contains + /// methods to set and get properties of objects. + /// + public TableMapping GetMapping(Type type, CreateFlags createFlags = CreateFlags.None) + { + if (_mappings == null) + { + _mappings = new Dictionary(); + } + TableMapping map; + if (!_mappings.TryGetValue(type.FullName, out map)) + { + map = new TableMapping(type, createFlags); + _mappings[type.FullName] = map; + } + return map; + } + + /// + /// Retrieves the mapping that is automatically generated for the given type. + /// + /// + /// The mapping represents the schema of the columns of the database and contains + /// methods to set and get properties of objects. + /// + public TableMapping GetMapping() + { + return GetMapping(typeof(T)); + } + + private struct IndexedColumn + { + public int Order; + public string ColumnName; + } + + private struct IndexInfo + { + public string IndexName; + public string TableName; + public bool Unique; + public List Columns; + } + + /// + /// Executes a "drop table" on the database. This is non-recoverable. + /// + public int DropTable() + { + var map = GetMapping(typeof(T)); + + var query = string.Format("drop table if exists \"{0}\"", map.TableName); + + return Execute(query); + } + + /// + /// Executes a "create table if not exists" on the database. It also + /// creates any specified indexes on the columns of the table. It uses + /// a schema automatically generated from the specified type. You can + /// later access this schema by calling GetMapping. + /// + /// + /// The number of entries added to the database schema. + /// + public int CreateTable(CreateFlags createFlags = CreateFlags.None) + { + return CreateTable(typeof(T), createFlags); + } + + /// + /// Executes a "create table if not exists" on the database. It also + /// creates any specified indexes on the columns of the table. It uses + /// a schema automatically generated from the specified type. You can + /// later access this schema by calling GetMapping. + /// + /// Type to reflect to a database table. + /// Optional flags allowing implicit PK and indexes based on naming conventions. + /// + /// The number of entries added to the database schema. + /// + public int CreateTable(Type ty, CreateFlags createFlags = CreateFlags.None) + { + if (_tables == null) + { + _tables = new Dictionary(); + } + TableMapping map; + if (!_tables.TryGetValue(ty.FullName, out map)) + { + map = GetMapping(ty, createFlags); + _tables.Add(ty.FullName, map); + } + var query = "create table if not exists \"" + map.TableName + "\"(\n"; + + var decls = map.Columns.Select(p => Orm.SqlDecl(p, StoreDateTimeAsTicks)); + var decl = string.Join(",\n", decls.ToArray()); + query += decl; + query += ")"; + + var count = Execute(query); + + if (count == 0) + { //Possible bug: This always seems to return 0? + // Table already exists, migrate it + MigrateTable(map); + } + + var indexes = new Dictionary(); + foreach (var c in map.Columns) + { + foreach (var i in c.Indices) + { + var iname = i.Name ?? map.TableName + "_" + c.Name; + IndexInfo iinfo; + if (!indexes.TryGetValue(iname, out iinfo)) + { + iinfo = new IndexInfo + { + IndexName = iname, + TableName = map.TableName, + Unique = i.Unique, + Columns = new List() + }; + indexes.Add(iname, iinfo); + } + + if (i.Unique != iinfo.Unique) + throw new Exception("All the columns in an index must have the same value for their Unique property"); + + iinfo.Columns.Add(new IndexedColumn + { + Order = i.Order, + ColumnName = c.Name + }); + } + } + + foreach (var indexName in indexes.Keys) + { + var index = indexes[indexName]; + var columns = index.Columns.OrderBy(i => i.Order).Select(i => i.ColumnName).ToArray(); + count += CreateIndex(indexName, index.TableName, columns, index.Unique); + } + + return count; + } + + /// + /// Creates an index for the specified table and columns. + /// + /// Name of the index to create + /// Name of the database table + /// An array of column names to index + /// Whether the index should be unique + public int CreateIndex(string indexName, string tableName, string[] columnNames, bool unique = false) + { + const string sqlFormat = "create {2} index if not exists \"{3}\" on \"{0}\"(\"{1}\")"; + var sql = String.Format(sqlFormat, tableName, string.Join("\", \"", columnNames), unique ? "unique" : "", indexName); + return Execute(sql); + } + + /// + /// Creates an index for the specified table and column. + /// + /// Name of the index to create + /// Name of the database table + /// Name of the column to index + /// Whether the index should be unique + public int CreateIndex(string indexName, string tableName, string columnName, bool unique = false) + { + return CreateIndex(indexName, tableName, new string[] { columnName }, unique); + } + + /// + /// Creates an index for the specified table and column. + /// + /// Name of the database table + /// Name of the column to index + /// Whether the index should be unique + public int CreateIndex(string tableName, string columnName, bool unique = false) + { + return CreateIndex(tableName + "_" + columnName, tableName, columnName, unique); + } + + /// + /// Creates an index for the specified table and columns. + /// + /// Name of the database table + /// An array of column names to index + /// Whether the index should be unique + public int CreateIndex(string tableName, string[] columnNames, bool unique = false) + { + return CreateIndex(tableName + "_" + string.Join("_", columnNames), tableName, columnNames, unique); + } + + /// + /// Creates an index for the specified object property. + /// e.g. CreateIndex(c => c.Name); + /// + /// Type to reflect to a database table. + /// Property to index + /// Whether the index should be unique + public void CreateIndex(Expression> property, bool unique = false) + { + MemberExpression mx; + if (property.Body.NodeType == ExpressionType.Convert) + { + mx = ((UnaryExpression)property.Body).Operand as MemberExpression; + } + else + { + mx = (property.Body as MemberExpression); + } + var propertyInfo = mx.Member as PropertyInfo; + if (propertyInfo == null) + { + throw new ArgumentException("The lambda expression 'property' should point to a valid Property"); + } + + var propName = propertyInfo.Name; + + var map = GetMapping(); + var colName = map.FindColumnWithPropertyName(propName).Name; + + CreateIndex(map.TableName, colName, unique); + } + + public class ColumnInfo + { + // public int cid { get; set; } + + [Column("name")] + public string Name { get; set; } + + // [Column ("type")] + // public string ColumnType { get; set; } + + public int notnull { get; set; } + + // public string dflt_value { get; set; } + + // public int pk { get; set; } + + public override string ToString() + { + return Name; + } + } + + public List GetTableInfo(string tableName) + { + var query = "pragma table_info(\"" + tableName + "\")"; + return Query(query); + } + + void MigrateTable(TableMapping map) + { + var existingCols = GetTableInfo(map.TableName); + + var toBeAdded = new List(); + + foreach (var p in map.Columns) + { + var found = false; + foreach (var c in existingCols) + { + found = (string.Compare(p.Name, c.Name, StringComparison.OrdinalIgnoreCase) == 0); + if (found) + break; + } + if (!found) + { + toBeAdded.Add(p); + } + } + + foreach (var p in toBeAdded) + { + var addCol = "alter table \"" + map.TableName + "\" add column " + Orm.SqlDecl(p, StoreDateTimeAsTicks); + Execute(addCol); + } + } + + /// + /// Creates a new SQLiteCommand. Can be overridden to provide a sub-class. + /// + /// + protected virtual SQLiteCommand NewCommand() + { + return new SQLiteCommand(this); + } + + /// + /// Creates a new SQLiteCommand given the command text with arguments. Place a '?' + /// in the command text for each of the arguments. + /// + /// + /// The fully escaped SQL. + /// + /// + /// Arguments to substitute for the occurences of '?' in the command text. + /// + /// + /// A + /// + public SQLiteCommand CreateCommand(string cmdText, params object[] ps) + { + if (!_open) + throw SQLiteException.New(SQLite3.Result.Error, "Cannot create commands from unopened database"); + + var cmd = NewCommand(); + cmd.CommandText = cmdText; + foreach (var o in ps) + { + cmd.Bind(o); + } + return cmd; + } + + /// + /// Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' + /// in the command text for each of the arguments and then executes that command. + /// Use this method instead of Query when you don't expect rows back. Such cases include + /// INSERTs, UPDATEs, and DELETEs. + /// You can set the Trace or TimeExecution properties of the connection + /// to profile execution. + /// + /// + /// The fully escaped SQL. + /// + /// + /// Arguments to substitute for the occurences of '?' in the query. + /// + /// + /// The number of rows modified in the database as a result of this execution. + /// + public int Execute(string query, params object[] args) + { + var cmd = CreateCommand(query, args); + + if (TimeExecution) + { + if (_sw == null) + { + _sw = new Stopwatch(); + } + _sw.Reset(); + _sw.Start(); + } + + var r = cmd.ExecuteNonQuery(); + + if (TimeExecution) + { + _sw.Stop(); + _elapsedMilliseconds += _sw.ElapsedMilliseconds; + Debug.WriteLine(string.Format("Finished in {0} ms ({1:0.0} s total)", _sw.ElapsedMilliseconds, _elapsedMilliseconds / 1000.0)); + } + + return r; + } + + public T ExecuteScalar(string query, params object[] args) + { + var cmd = CreateCommand(query, args); + + if (TimeExecution) + { + if (_sw == null) + { + _sw = new Stopwatch(); + } + _sw.Reset(); + _sw.Start(); + } + + var r = cmd.ExecuteScalar(); + + if (TimeExecution) + { + _sw.Stop(); + _elapsedMilliseconds += _sw.ElapsedMilliseconds; + Debug.WriteLine(string.Format("Finished in {0} ms ({1:0.0} s total)", _sw.ElapsedMilliseconds, _elapsedMilliseconds / 1000.0)); + } + + return r; + } + + /// + /// Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' + /// in the command text for each of the arguments and then executes that command. + /// It returns each row of the result using the mapping automatically generated for + /// the given type. + /// + /// + /// The fully escaped SQL. + /// + /// + /// Arguments to substitute for the occurences of '?' in the query. + /// + /// + /// An enumerable with one result for each row returned by the query. + /// + public List Query(string query, params object[] args) where T : new() + { + var cmd = CreateCommand(query, args); + return cmd.ExecuteQuery(); + } + + /// + /// Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' + /// in the command text for each of the arguments and then executes that command. + /// It returns each row of the result using the mapping automatically generated for + /// the given type. + /// + /// + /// The fully escaped SQL. + /// + /// + /// Arguments to substitute for the occurences of '?' in the query. + /// + /// + /// An enumerable with one result for each row returned by the query. + /// The enumerator will call sqlite3_step on each call to MoveNext, so the database + /// connection must remain open for the lifetime of the enumerator. + /// + public IEnumerable DeferredQuery(string query, params object[] args) where T : new() + { + var cmd = CreateCommand(query, args); + return cmd.ExecuteDeferredQuery(); + } + + /// + /// Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' + /// in the command text for each of the arguments and then executes that command. + /// It returns each row of the result using the specified mapping. This function is + /// only used by libraries in order to query the database via introspection. It is + /// normally not used. + /// + /// + /// A to use to convert the resulting rows + /// into objects. + /// + /// + /// The fully escaped SQL. + /// + /// + /// Arguments to substitute for the occurences of '?' in the query. + /// + /// + /// An enumerable with one result for each row returned by the query. + /// + public List Query(TableMapping map, string query, params object[] args) + { + var cmd = CreateCommand(query, args); + return cmd.ExecuteQuery(map); + } + + /// + /// Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' + /// in the command text for each of the arguments and then executes that command. + /// It returns each row of the result using the specified mapping. This function is + /// only used by libraries in order to query the database via introspection. It is + /// normally not used. + /// + /// + /// A to use to convert the resulting rows + /// into objects. + /// + /// + /// The fully escaped SQL. + /// + /// + /// Arguments to substitute for the occurences of '?' in the query. + /// + /// + /// An enumerable with one result for each row returned by the query. + /// The enumerator will call sqlite3_step on each call to MoveNext, so the database + /// connection must remain open for the lifetime of the enumerator. + /// + public IEnumerable DeferredQuery(TableMapping map, string query, params object[] args) + { + var cmd = CreateCommand(query, args); + return cmd.ExecuteDeferredQuery(map); + } + + /// + /// Returns a queryable interface to the table represented by the given type. + /// + /// + /// A queryable object that is able to translate Where, OrderBy, and Take + /// queries into native SQL. + /// + public TableQuery Table() where T : new() + { + return new TableQuery(this); + } + + /// + /// Attempts to retrieve an object with the given primary key from the table + /// associated with the specified type. Use of this method requires that + /// the given type have a designated PrimaryKey (using the PrimaryKeyAttribute). + /// + /// + /// The primary key. + /// + /// + /// The object with the given primary key. Throws a not found exception + /// if the object is not found. + /// + public T Get(object pk) where T : new() + { + var map = GetMapping(typeof(T)); + return Query(map.GetByPrimaryKeySql, pk).First(); + } + + /// + /// Attempts to retrieve the first object that matches the predicate from the table + /// associated with the specified type. + /// + /// + /// A predicate for which object to find. + /// + /// + /// The object that matches the given predicate. Throws a not found exception + /// if the object is not found. + /// + public T Get(Expression> predicate) where T : new() + { + return Table().Where(predicate).First(); + } + + /// + /// Attempts to retrieve an object with the given primary key from the table + /// associated with the specified type. Use of this method requires that + /// the given type have a designated PrimaryKey (using the PrimaryKeyAttribute). + /// + /// + /// The primary key. + /// + /// + /// The object with the given primary key or null + /// if the object is not found. + /// + public T Find(object pk) where T : new() + { + var map = GetMapping(typeof(T)); + return Query(map.GetByPrimaryKeySql, pk).FirstOrDefault(); + } + + /// + /// Attempts to retrieve an object with the given primary key from the table + /// associated with the specified type. Use of this method requires that + /// the given type have a designated PrimaryKey (using the PrimaryKeyAttribute). + /// + /// + /// The primary key. + /// + /// + /// The TableMapping used to identify the object type. + /// + /// + /// The object with the given primary key or null + /// if the object is not found. + /// + public object Find(object pk, TableMapping map) + { + return Query(map, map.GetByPrimaryKeySql, pk).FirstOrDefault(); + } + + /// + /// Attempts to retrieve the first object that matches the predicate from the table + /// associated with the specified type. + /// + /// + /// A predicate for which object to find. + /// + /// + /// The object that matches the given predicate or null + /// if the object is not found. + /// + public T Find(Expression> predicate) where T : new() + { + return Table().Where(predicate).FirstOrDefault(); + } + + /// + /// Whether has been called and the database is waiting for a . + /// + public bool IsInTransaction + { + get { return _transactionDepth > 0; } + } + + /// + /// Begins a new transaction. Call to end the transaction. + /// + /// Throws if a transaction has already begun. + public void BeginTransaction(bool exclusive = false) + { + // The BEGIN command only works if the transaction stack is empty, + // or in other words if there are no pending transactions. + // If the transaction stack is not empty when the BEGIN command is invoked, + // then the command fails with an error. + // Rather than crash with an error, we will just ignore calls to BeginTransaction + // that would result in an error. + if (Interlocked.CompareExchange(ref _transactionDepth, 1, 0) == 0) + { + try + { + if (exclusive) + { + Execute("BEGIN EXCLUSIVE TRANSACTION;"); + } + else + { + Execute("begin transaction"); + } + } + catch (Exception ex) + { + var sqlExp = ex as SQLiteException; + if (sqlExp != null) + { + // It is recommended that applications respond to the errors listed below + // by explicitly issuing a ROLLBACK command. + // TODO: This rollback failsafe should be localized to all throw sites. + switch (sqlExp.Result) + { + case SQLite3.Result.IOError: + case SQLite3.Result.Full: + case SQLite3.Result.Busy: + case SQLite3.Result.NoMem: + case SQLite3.Result.Interrupt: + RollbackTo(null, true); + break; + } + } + else + { + // Call decrement and not VolatileWrite in case we've already + // created a transaction point in SaveTransactionPoint since the catch. + Interlocked.Decrement(ref _transactionDepth); + } + + throw; + } + } + else + { + // Calling BeginTransaction on an already open transaction is invalid + throw new InvalidOperationException("Cannot begin a transaction while already in a transaction."); + } + } + + /// + /// Creates a savepoint in the database at the current point in the transaction timeline. + /// Begins a new transaction if one is not in progress. + /// + /// Call to undo transactions since the returned savepoint. + /// Call to commit transactions after the savepoint returned here. + /// Call to end the transaction, committing all changes. + /// + /// A string naming the savepoint. + public string SaveTransactionPoint() + { + int depth = Interlocked.Increment(ref _transactionDepth) - 1; + string retVal = "S" + _rand.Next(short.MaxValue) + "D" + depth; + + try + { + Execute("savepoint " + retVal); + } + catch (Exception ex) + { + var sqlExp = ex as SQLiteException; + if (sqlExp != null) + { + // It is recommended that applications respond to the errors listed below + // by explicitly issuing a ROLLBACK command. + // TODO: This rollback failsafe should be localized to all throw sites. + switch (sqlExp.Result) + { + case SQLite3.Result.IOError: + case SQLite3.Result.Full: + case SQLite3.Result.Busy: + case SQLite3.Result.NoMem: + case SQLite3.Result.Interrupt: + RollbackTo(null, true); + break; + } + } + else + { + Interlocked.Decrement(ref _transactionDepth); + } + + throw; + } + + return retVal; + } + + /// + /// Rolls back the transaction that was begun by or . + /// + public void Rollback() + { + RollbackTo(null, false); + } + + /// + /// Rolls back the savepoint created by or SaveTransactionPoint. + /// + /// The name of the savepoint to roll back to, as returned by . If savepoint is null or empty, this method is equivalent to a call to + public void RollbackTo(string savepoint) + { + RollbackTo(savepoint, false); + } + + /// + /// Rolls back the transaction that was begun by . + /// + /// true to avoid throwing exceptions, false otherwise + void RollbackTo(string savepoint, bool noThrow) + { + // Rolling back without a TO clause rolls backs all transactions + // and leaves the transaction stack empty. + try + { + if (String.IsNullOrEmpty(savepoint)) + { + if (Interlocked.Exchange(ref _transactionDepth, 0) > 0) + { + Execute("rollback"); + } + } + else + { + DoSavePointExecute(savepoint, "rollback to "); + } + } + catch (SQLiteException) + { + if (!noThrow) + throw; + + } + // No need to rollback if there are no transactions open. + } + + /// + /// Releases a savepoint returned from . Releasing a savepoint + /// makes changes since that savepoint permanent if the savepoint began the transaction, + /// or otherwise the changes are permanent pending a call to . + /// + /// The RELEASE command is like a COMMIT for a SAVEPOINT. + /// + /// The name of the savepoint to release. The string should be the result of a call to + public void Release(string savepoint) + { + DoSavePointExecute(savepoint, "release "); + } + + void DoSavePointExecute(string savepoint, string cmd) + { + // Validate the savepoint + int firstLen = savepoint.IndexOf('D'); + if (firstLen >= 2 && savepoint.Length > firstLen + 1) + { + int depth; + if (Int32.TryParse(savepoint.Substring(firstLen + 1), out depth)) + { + // TODO: Mild race here, but inescapable without locking almost everywhere. + if (0 <= depth && depth < _transactionDepth) + { +#if NETFX_CORE + Volatile.Write (ref _transactionDepth, depth); +#elif SILVERLIGHT + _transactionDepth = depth; +#else + Thread.VolatileWrite(ref _transactionDepth, depth); +#endif + Execute(cmd + savepoint); + return; + } + } + } + + throw new ArgumentException("savePoint is not valid, and should be the result of a call to SaveTransactionPoint.", "savePoint"); + } + + /// + /// Commits the transaction that was begun by . + /// + public void Commit() + { + if (Interlocked.Exchange(ref _transactionDepth, 0) != 0) + { + Execute("commit"); + } + // Do nothing on a commit with no open transaction + } + + /// + /// Executes within a (possibly nested) transaction by wrapping it in a SAVEPOINT. If an + /// exception occurs the whole transaction is rolled back, not just the current savepoint. The exception + /// is rethrown. + /// + /// + /// The to perform within a transaction. can contain any number + /// of operations on the connection but should never call or + /// . + /// + public void RunInTransaction(Action action) + { + try + { + var savePoint = SaveTransactionPoint(); + action(); + Release(savePoint); + } + catch (Exception) + { + Rollback(); + throw; + } + } + + /// + /// Inserts all specified objects. + /// + /// + /// An of the objects to insert. + /// + /// + /// The number of rows added to the table. + /// + public int InsertAll(System.Collections.IEnumerable objects) + { + var c = 0; + RunInTransaction(() => + { + foreach (var r in objects) + { + c += Insert(r); + } + }); + return c; + } + + /// + /// Inserts all specified objects. + /// + /// + /// An of the objects to insert. + /// + /// + /// Literal SQL code that gets placed into the command. INSERT {extra} INTO ... + /// + /// + /// The number of rows added to the table. + /// + public int InsertAll(System.Collections.IEnumerable objects, string extra) + { + var c = 0; + RunInTransaction(() => + { + foreach (var r in objects) + { + c += Insert(r, extra); + } + }); + return c; + } + + /// + /// Inserts all specified objects. + /// + /// + /// An of the objects to insert. + /// + /// + /// The type of object to insert. + /// + /// + /// The number of rows added to the table. + /// + public int InsertAll(System.Collections.IEnumerable objects, Type objType) + { + var c = 0; + RunInTransaction(() => + { + foreach (var r in objects) + { + c += Insert(r, objType); + } + }); + return c; + } + + /// + /// Inserts the given object and retrieves its + /// auto incremented primary key if it has one. + /// + /// + /// The object to insert. + /// + /// + /// The number of rows added to the table. + /// + public int Insert(object obj) + { + if (obj == null) + { + return 0; + } + return Insert(obj, "", obj.GetType()); + } + + /// + /// Inserts the given object and retrieves its + /// auto incremented primary key if it has one. + /// If a UNIQUE constraint violation occurs with + /// some pre-existing object, this function deletes + /// the old object. + /// + /// + /// The object to insert. + /// + /// + /// The number of rows modified. + /// + public int InsertOrReplace(object obj) + { + if (obj == null) + { + return 0; + } + return Insert(obj, "OR REPLACE", obj.GetType()); + } + + /// + /// Inserts the given object and retrieves its + /// auto incremented primary key if it has one. + /// + /// + /// The object to insert. + /// + /// + /// The type of object to insert. + /// + /// + /// The number of rows added to the table. + /// + public int Insert(object obj, Type objType) + { + return Insert(obj, "", objType); + } + + /// + /// Inserts the given object and retrieves its + /// auto incremented primary key if it has one. + /// If a UNIQUE constraint violation occurs with + /// some pre-existing object, this function deletes + /// the old object. + /// + /// + /// The object to insert. + /// + /// + /// The type of object to insert. + /// + /// + /// The number of rows modified. + /// + public int InsertOrReplace(object obj, Type objType) + { + return Insert(obj, "OR REPLACE", objType); + } + + /// + /// Inserts the given object and retrieves its + /// auto incremented primary key if it has one. + /// + /// + /// The object to insert. + /// + /// + /// Literal SQL code that gets placed into the command. INSERT {extra} INTO ... + /// + /// + /// The number of rows added to the table. + /// + public int Insert(object obj, string extra) + { + if (obj == null) + { + return 0; + } + return Insert(obj, extra, obj.GetType()); + } + + /// + /// Inserts the given object and retrieves its + /// auto incremented primary key if it has one. + /// + /// + /// The object to insert. + /// + /// + /// Literal SQL code that gets placed into the command. INSERT {extra} INTO ... + /// + /// + /// The type of object to insert. + /// + /// + /// The number of rows added to the table. + /// + public int Insert(object obj, string extra, Type objType) + { + if (obj == null || objType == null) + { + return 0; + } + + + var map = GetMapping(objType); + +#if NETFX_CORE + if (map.PK != null && map.PK.IsAutoInc) + { + // no GetProperty so search our way up the inheritance chain till we find it + PropertyInfo prop; + while (objType != null) + { + var info = objType.GetTypeInfo(); + prop = info.GetDeclaredProperty(map.PK.PropertyName); + if (prop != null) + { + if (prop.GetValue(obj, null).Equals(Guid.Empty)) + { + prop.SetValue(obj, Guid.NewGuid(), null); + } + break; + } + + objType = info.BaseType; + } + } +#else + if (map.PK != null && map.PK.IsAutoInc) + { + var prop = objType.GetProperty(map.PK.PropertyName); + if (prop != null) + { + if (prop.GetValue(obj, null).Equals(Guid.Empty)) + { + prop.SetValue(obj, Guid.NewGuid(), null); + } + } + } +#endif + + + var replacing = string.Compare(extra, "OR REPLACE", StringComparison.OrdinalIgnoreCase) == 0; + + var cols = replacing ? map.InsertOrReplaceColumns : map.InsertColumns; + var vals = new object[cols.Length]; + for (var i = 0; i < vals.Length; i++) + { + vals[i] = cols[i].GetValue(obj); + } + + var insertCmd = map.GetInsertCommand(this, extra); + int count; + + try + { + count = insertCmd.ExecuteNonQuery(vals); + } + catch (SQLiteException ex) + { + + if (SQLite3.ExtendedErrCode(this.Handle) == SQLite3.ExtendedResult.ConstraintNotNull) + { + throw NotNullConstraintViolationException.New(ex.Result, ex.Message, map, obj); + } + throw; + } + + if (map.HasAutoIncPK) + { + var id = SQLite3.LastInsertRowid(Handle); + map.SetAutoIncPK(obj, id); + } + + return count; + } + + /// + /// Updates all of the columns of a table using the specified object + /// except for its primary key. + /// The object is required to have a primary key. + /// + /// + /// The object to update. It must have a primary key designated using the PrimaryKeyAttribute. + /// + /// + /// The number of rows updated. + /// + public int Update(object obj) + { + if (obj == null) + { + return 0; + } + return Update(obj, obj.GetType()); + } + + /// + /// Updates all of the columns of a table using the specified object + /// except for its primary key. + /// The object is required to have a primary key. + /// + /// + /// The object to update. It must have a primary key designated using the PrimaryKeyAttribute. + /// + /// + /// The type of object to insert. + /// + /// + /// The number of rows updated. + /// + public int Update(object obj, Type objType) + { + int rowsAffected = 0; + if (obj == null || objType == null) + { + return 0; + } + + var map = GetMapping(objType); + + var pk = map.PK; + + if (pk == null) + { + throw new NotSupportedException("Cannot update " + map.TableName + ": it has no PK"); + } + + var cols = from p in map.Columns + where p != pk + select p; + var vals = from c in cols + select c.GetValue(obj); + var ps = new List(vals); + ps.Add(pk.GetValue(obj)); + var q = string.Format("update \"{0}\" set {1} where {2} = ? ", map.TableName, string.Join(",", (from c in cols + select "\"" + c.Name + "\" = ? ").ToArray()), pk.Name); + + try + { + rowsAffected = Execute(q, ps.ToArray()); + } + catch (SQLiteException ex) + { + + if (ex.Result == SQLite3.Result.Constraint && SQLite3.ExtendedErrCode(this.Handle) == SQLite3.ExtendedResult.ConstraintNotNull) + { + throw NotNullConstraintViolationException.New(ex, map, obj); + } + + throw ex; + } + + return rowsAffected; + } + + /// + /// Updates all specified objects. + /// + /// + /// An of the objects to insert. + /// + /// + /// The number of rows modified. + /// + public int UpdateAll(System.Collections.IEnumerable objects) + { + var c = 0; + RunInTransaction(() => + { + foreach (var r in objects) + { + c += Update(r); + } + }); + return c; + } + + /// + /// Deletes the given object from the database using its primary key. + /// + /// + /// The object to delete. It must have a primary key designated using the PrimaryKeyAttribute. + /// + /// + /// The number of rows deleted. + /// + public int Delete(object objectToDelete) + { + var map = GetMapping(objectToDelete.GetType()); + var pk = map.PK; + if (pk == null) + { + throw new NotSupportedException("Cannot delete " + map.TableName + ": it has no PK"); + } + var q = string.Format("delete from \"{0}\" where \"{1}\" = ?", map.TableName, pk.Name); + return Execute(q, pk.GetValue(objectToDelete)); + } + + /// + /// Deletes the object with the specified primary key. + /// + /// + /// The primary key of the object to delete. + /// + /// + /// The number of objects deleted. + /// + /// + /// The type of object. + /// + public int Delete(object primaryKey) + { + var map = GetMapping(typeof(T)); + var pk = map.PK; + if (pk == null) + { + throw new NotSupportedException("Cannot delete " + map.TableName + ": it has no PK"); + } + var q = string.Format("delete from \"{0}\" where \"{1}\" = ?", map.TableName, pk.Name); + return Execute(q, primaryKey); + } + + /// + /// Deletes all the objects from the specified table. + /// WARNING WARNING: Let me repeat. It deletes ALL the objects from the + /// specified table. Do you really want to do that? + /// + /// + /// The number of objects deleted. + /// + /// + /// The type of objects to delete. + /// + public int DeleteAll() + { + var map = GetMapping(typeof(T)); + var query = string.Format("delete from \"{0}\"", map.TableName); + return Execute(query); + } + + ~SQLiteConnection() + { + Dispose(false); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + Close(); + } + + public void Close() + { + if (_open && Handle != NullHandle) + { + try + { + if (_mappings != null) + { + foreach (var sqlInsertCommand in _mappings.Values) + { + sqlInsertCommand.Dispose(); + } + } + var r = SQLite3.Close(Handle); + if (r != SQLite3.Result.OK) + { + string msg = SQLite3.GetErrmsg(Handle); + throw SQLiteException.New(r, msg); + } + } + finally + { + Handle = NullHandle; + _open = false; + } + } + } + } + + /// + /// Represents a parsed connection string. + /// + class SQLiteConnectionString + { + public string ConnectionString { get; private set; } + public string DatabasePath { get; private set; } + public bool StoreDateTimeAsTicks { get; private set; } + +#if NETFX_CORE + static readonly string MetroStyleDataPath = Windows.Storage.ApplicationData.Current.LocalFolder.Path; +#endif + + public SQLiteConnectionString(string databasePath, bool storeDateTimeAsTicks) + { + ConnectionString = databasePath; + StoreDateTimeAsTicks = storeDateTimeAsTicks; + +#if NETFX_CORE + DatabasePath = System.IO.Path.Combine (MetroStyleDataPath, databasePath); +#else + DatabasePath = databasePath; +#endif + } + } + + [AttributeUsage(AttributeTargets.Class)] + public class TableAttribute : Attribute + { + public string Name { get; set; } + + public TableAttribute(string name) + { + Name = name; + } + } + + [AttributeUsage(AttributeTargets.Property)] + public class ColumnAttribute : Attribute + { + public string Name { get; set; } + + public ColumnAttribute(string name) + { + Name = name; + } + } + + [AttributeUsage(AttributeTargets.Property)] + public class PrimaryKeyAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Property)] + public class AutoIncrementAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Property)] + public class IndexedAttribute : Attribute + { + public string Name { get; set; } + public int Order { get; set; } + public virtual bool Unique { get; set; } + + public IndexedAttribute() + { + } + + public IndexedAttribute(string name, int order) + { + Name = name; + Order = order; + } + } + + [AttributeUsage(AttributeTargets.Property)] + public class IgnoreAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Property)] + public class UniqueAttribute : IndexedAttribute + { + public override bool Unique + { + get { return true; } + set { /* throw? */ } + } + + public UniqueAttribute() : base() + { + } + + public UniqueAttribute(string name, int order) : base(name, order) + { + } + } + + [AttributeUsage(AttributeTargets.Property)] + public class MaxLengthAttribute : Attribute + { + public int Value { get; private set; } + + public MaxLengthAttribute(int length) + { + Value = length; + } + } + + [AttributeUsage(AttributeTargets.Property)] + public class CollationAttribute : Attribute + { + public string Value { get; private set; } + + public CollationAttribute(string collation) + { + Value = collation; + } + } + + [AttributeUsage(AttributeTargets.Property)] + public class NotNullAttribute : Attribute + { + } + + public class TableMapping + { + public Type MappedType { get; private set; } + + public string TableName { get; private set; } + + public Column[] Columns { get; private set; } + + public Column PK { get; private set; } + + public string GetByPrimaryKeySql { get; private set; } + + Column _autoPk; + Column[] _insertColumns; + Column[] _insertOrReplaceColumns; + + public TableMapping(Type type, CreateFlags createFlags = CreateFlags.None) + { + MappedType = type; + +#if NETFX_CORE + var tableAttr = (TableAttribute)System.Reflection.CustomAttributeExtensions + .GetCustomAttribute(type.GetTypeInfo(), typeof(TableAttribute), true); +#else + var tableAttr = (TableAttribute)type.GetCustomAttributes(typeof(TableAttribute), true).FirstOrDefault(); +#endif + + TableName = tableAttr != null ? tableAttr.Name : MappedType.Name; + +#if !NETFX_CORE + var props = MappedType.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.SetProperty); +#else + var props = from p in MappedType.GetRuntimeProperties() + where ((p.GetMethod != null && p.GetMethod.IsPublic) || (p.SetMethod != null && p.SetMethod.IsPublic) || (p.GetMethod != null && p.GetMethod.IsStatic) || (p.SetMethod != null && p.SetMethod.IsStatic)) + select p; +#endif + var cols = new List(); + foreach (var p in props) + { +#if !NETFX_CORE + var ignore = p.GetCustomAttributes(typeof(IgnoreAttribute), true).Length > 0; +#else + var ignore = p.GetCustomAttributes (typeof(IgnoreAttribute), true).Count() > 0; +#endif + if (p.CanWrite && !ignore) + { + cols.Add(new Column(p, createFlags)); + } + } + Columns = cols.ToArray(); + foreach (var c in Columns) + { + if (c.IsAutoInc && c.IsPK) + { + _autoPk = c; + } + if (c.IsPK) + { + PK = c; + } + } + + HasAutoIncPK = _autoPk != null; + + if (PK != null) + { + GetByPrimaryKeySql = string.Format("select * from \"{0}\" where \"{1}\" = ?", TableName, PK.Name); + } + else + { + // People should not be calling Get/Find without a PK + GetByPrimaryKeySql = string.Format("select * from \"{0}\" limit 1", TableName); + } + } + + public bool HasAutoIncPK { get; private set; } + + public void SetAutoIncPK(object obj, long id) + { + if (_autoPk != null) + { + _autoPk.SetValue(obj, Convert.ChangeType(id, _autoPk.ColumnType, null)); + } + } + + public Column[] InsertColumns + { + get + { + if (_insertColumns == null) + { + _insertColumns = Columns.Where(c => !c.IsAutoInc).ToArray(); + } + return _insertColumns; + } + } + + public Column[] InsertOrReplaceColumns + { + get + { + if (_insertOrReplaceColumns == null) + { + _insertOrReplaceColumns = Columns.ToArray(); + } + return _insertOrReplaceColumns; + } + } + + public Column FindColumnWithPropertyName(string propertyName) + { + var exact = Columns.FirstOrDefault(c => c.PropertyName == propertyName); + return exact; + } + + public Column FindColumn(string columnName) + { + var exact = Columns.FirstOrDefault(c => c.Name == columnName); + return exact; + } + + PreparedSqlLiteInsertCommand _insertCommand; + string _insertCommandExtra; + + public PreparedSqlLiteInsertCommand GetInsertCommand(SQLiteConnection conn, string extra) + { + if (_insertCommand == null) + { + _insertCommand = CreateInsertCommand(conn, extra); + _insertCommandExtra = extra; + } + else if (_insertCommandExtra != extra) + { + _insertCommand.Dispose(); + _insertCommand = CreateInsertCommand(conn, extra); + _insertCommandExtra = extra; + } + return _insertCommand; + } + + PreparedSqlLiteInsertCommand CreateInsertCommand(SQLiteConnection conn, string extra) + { + var cols = InsertColumns; + string insertSql; + if (!cols.Any() && Columns.Count() == 1 && Columns[0].IsAutoInc) + { + insertSql = string.Format("insert {1} into \"{0}\" default values", TableName, extra); + } + else + { + var replacing = string.Compare(extra, "OR REPLACE", StringComparison.OrdinalIgnoreCase) == 0; + + if (replacing) + { + cols = InsertOrReplaceColumns; + } + + insertSql = string.Format("insert {3} into \"{0}\"({1}) values ({2})", TableName, + string.Join(",", (from c in cols + select "\"" + c.Name + "\"").ToArray()), + string.Join(",", (from c in cols + select "?").ToArray()), extra); + + } + + var insertCommand = new PreparedSqlLiteInsertCommand(conn); + insertCommand.CommandText = insertSql; + return insertCommand; + } + + protected internal void Dispose() + { + if (_insertCommand != null) + { + _insertCommand.Dispose(); + _insertCommand = null; + } + } + + public class Column + { + PropertyInfo _prop; + + public string Name { get; private set; } + + public string PropertyName { get { return _prop.Name; } } + + public Type ColumnType { get; private set; } + + public string Collation { get; private set; } + + public bool IsAutoInc { get; private set; } + public bool IsAutoGuid { get; private set; } + + public bool IsPK { get; private set; } + + public IEnumerable Indices { get; set; } + + public bool IsNullable { get; private set; } + + public int? MaxStringLength { get; private set; } + + public Column(PropertyInfo prop, CreateFlags createFlags = CreateFlags.None) + { + var colAttr = (ColumnAttribute)prop.GetCustomAttributes(typeof(ColumnAttribute), true).FirstOrDefault(); + + _prop = prop; + Name = colAttr == null ? prop.Name : colAttr.Name; + //If this type is Nullable then Nullable.GetUnderlyingType returns the T, otherwise it returns null, so get the actual type instead + ColumnType = Nullable.GetUnderlyingType(prop.PropertyType) ?? prop.PropertyType; + Collation = Orm.Collation(prop); + + IsPK = Orm.IsPK(prop) || + (((createFlags & CreateFlags.ImplicitPK) == CreateFlags.ImplicitPK) && + string.Compare(prop.Name, Orm.ImplicitPkName, StringComparison.OrdinalIgnoreCase) == 0); + + var isAuto = Orm.IsAutoInc(prop) || (IsPK && ((createFlags & CreateFlags.AutoIncPK) == CreateFlags.AutoIncPK)); + IsAutoGuid = isAuto && ColumnType == typeof(Guid); + IsAutoInc = isAuto && !IsAutoGuid || isAuto; + + Indices = Orm.GetIndices(prop); + if (!Indices.Any() + && !IsPK + && ((createFlags & CreateFlags.ImplicitIndex) == CreateFlags.ImplicitIndex) + && Name.EndsWith(Orm.ImplicitIndexSuffix, StringComparison.OrdinalIgnoreCase) + ) + { + Indices = new IndexedAttribute[] { new IndexedAttribute() }; + } + IsNullable = !(IsPK || Orm.IsMarkedNotNull(prop)); + MaxStringLength = Orm.MaxStringLength(prop); + } + + public void SetValue(object obj, object val) + { + _prop.SetValue(obj, val, null); + } + + public object GetValue(object obj) + { + return _prop.GetValue(obj, null); + } + } + } + + public static class Orm + { + public const int DefaultMaxStringLength = 140; + public const string ImplicitPkName = "Id"; + public const string ImplicitIndexSuffix = "Id"; + + public static string SqlDecl(TableMapping.Column p, bool storeDateTimeAsTicks) + { + string decl = "\"" + p.Name + "\" " + SqlType(p, storeDateTimeAsTicks) + " "; + + if (p.IsPK) + { + decl += "primary key "; + } + if (p.IsAutoInc) + { + decl += "autoincrement "; + } + if (!p.IsNullable) + { + decl += "not null "; + } + if (!string.IsNullOrEmpty(p.Collation)) + { + decl += "collate " + p.Collation + " "; + } + + return decl; + } + + public static string SqlType(TableMapping.Column p, bool storeDateTimeAsTicks) + { + var clrType = p.ColumnType; + if (clrType == typeof(Boolean) || clrType == typeof(Byte) || clrType == typeof(UInt16) || clrType == typeof(SByte) || clrType == typeof(Int16) || clrType == typeof(Int32)) + { + return "integer"; + } + else if (clrType == typeof(UInt32) || clrType == typeof(Int64)) + { + return "bigint"; + } + else if (clrType == typeof(Single) || clrType == typeof(Double) || clrType == typeof(Decimal)) + { + return "float"; + } + else if (clrType == typeof(String)) + { + int? len = p.MaxStringLength; + + if (len.HasValue) + return "varchar(" + len.Value + ")"; + + return "varchar"; + } + else if (clrType == typeof(TimeSpan)) + { + return "bigint"; + } + else if (clrType == typeof(DateTime)) + { + return storeDateTimeAsTicks ? "bigint" : "datetime"; + } + else if (clrType == typeof(DateTimeOffset)) + { + return "bigint"; +#if !NETFX_CORE + } + else if (clrType.IsEnum) + { +#else + } else if (clrType.GetTypeInfo().IsEnum) { +#endif + return "integer"; + } + else if (clrType == typeof(byte[])) + { + return "blob"; + } + else if (clrType == typeof(Guid)) + { + return "varchar(36)"; + } + else + { + throw new NotSupportedException("Don't know about " + clrType); + } + } + + public static bool IsPK(MemberInfo p) + { + var attrs = p.GetCustomAttributes(typeof(PrimaryKeyAttribute), true); +#if !NETFX_CORE + return attrs.Length > 0; +#else + return attrs.Count() > 0; +#endif + } + + public static string Collation(MemberInfo p) + { + var attrs = p.GetCustomAttributes(typeof(CollationAttribute), true); +#if !NETFX_CORE + if (attrs.Length > 0) + { + return ((CollationAttribute)attrs[0]).Value; +#else + if (attrs.Count() > 0) { + return ((CollationAttribute)attrs.First()).Value; +#endif + } + else + { + return string.Empty; + } + } + + public static bool IsAutoInc(MemberInfo p) + { + var attrs = p.GetCustomAttributes(typeof(AutoIncrementAttribute), true); +#if !NETFX_CORE + return attrs.Length > 0; +#else + return attrs.Count() > 0; +#endif + } + + public static IEnumerable GetIndices(MemberInfo p) + { + var attrs = p.GetCustomAttributes(typeof(IndexedAttribute), true); + return attrs.Cast(); + } + + public static int? MaxStringLength(PropertyInfo p) + { + var attrs = p.GetCustomAttributes(typeof(MaxLengthAttribute), true); +#if !NETFX_CORE + if (attrs.Length > 0) + return ((MaxLengthAttribute)attrs[0]).Value; +#else + if (attrs.Count() > 0) + return ((MaxLengthAttribute)attrs.First()).Value; +#endif + + return null; + } + + public static bool IsMarkedNotNull(MemberInfo p) + { + var attrs = p.GetCustomAttributes(typeof(NotNullAttribute), true); +#if !NETFX_CORE + return attrs.Length > 0; +#else + return attrs.Count() > 0; +#endif + } + } + + public partial class SQLiteCommand + { + SQLiteConnection _conn; + private List _bindings; + + public string CommandText { get; set; } + + internal SQLiteCommand(SQLiteConnection conn) + { + _conn = conn; + _bindings = new List(); + CommandText = ""; + } + + public int ExecuteNonQuery() + { + if (_conn.Trace) + { + Debug.WriteLine("Executing: " + this); + } + + var r = SQLite3.Result.OK; + var stmt = Prepare(); + r = SQLite3.Step(stmt); + Finalize(stmt); + if (r == SQLite3.Result.Done) + { + int rowsAffected = SQLite3.Changes(_conn.Handle); + return rowsAffected; + } + else if (r == SQLite3.Result.Error) + { + string msg = SQLite3.GetErrmsg(_conn.Handle); + throw SQLiteException.New(r, msg); + } + else if (r == SQLite3.Result.Constraint) + { + if (SQLite3.ExtendedErrCode(_conn.Handle) == SQLite3.ExtendedResult.ConstraintNotNull) + { + throw NotNullConstraintViolationException.New(r, SQLite3.GetErrmsg(_conn.Handle)); + } + } + + throw SQLiteException.New(r, r.ToString()); + } + + public IEnumerable ExecuteDeferredQuery() + { + return ExecuteDeferredQuery(_conn.GetMapping(typeof(T))); + } + + public List ExecuteQuery() + { + return ExecuteDeferredQuery(_conn.GetMapping(typeof(T))).ToList(); + } + + public List ExecuteQuery(TableMapping map) + { + return ExecuteDeferredQuery(map).ToList(); + } + + /// + /// Invoked every time an instance is loaded from the database. + /// + /// + /// The newly created object. + /// + /// + /// This can be overridden in combination with the + /// method to hook into the life-cycle of objects. + /// + /// Type safety is not possible because MonoTouch does not support virtual generic methods. + /// + protected virtual void OnInstanceCreated(object obj) + { + // Can be overridden. + } + + public IEnumerable ExecuteDeferredQuery(TableMapping map) + { + if (_conn.Trace) + { + Debug.WriteLine("Executing Query: " + this); + } + + var stmt = Prepare(); + try + { + var cols = new TableMapping.Column[SQLite3.ColumnCount(stmt)]; + + for (int i = 0; i < cols.Length; i++) + { + var name = SQLite3.ColumnName16(stmt, i); + cols[i] = map.FindColumn(name); + } + + while (SQLite3.Step(stmt) == SQLite3.Result.Row) + { + var obj = Activator.CreateInstance(map.MappedType); + for (int i = 0; i < cols.Length; i++) + { + if (cols[i] == null) + continue; + var colType = SQLite3.ColumnType(stmt, i); + var val = ReadCol(stmt, i, colType, cols[i].ColumnType); + cols[i].SetValue(obj, val); + } + OnInstanceCreated(obj); + yield return (T)obj; + } + } + finally + { + SQLite3.Finalize(stmt); + } + } + + public T ExecuteScalar() + { + if (_conn.Trace) + { + Debug.WriteLine("Executing Query: " + this); + } + + T val = default(T); + + var stmt = Prepare(); + + try + { + var r = SQLite3.Step(stmt); + if (r == SQLite3.Result.Row) + { + var colType = SQLite3.ColumnType(stmt, 0); + val = (T)ReadCol(stmt, 0, colType, typeof(T)); + } + else if (r == SQLite3.Result.Done) + { + } + else + { + throw SQLiteException.New(r, SQLite3.GetErrmsg(_conn.Handle)); + } + } + finally + { + Finalize(stmt); + } + + return val; + } + + public void Bind(string name, object val) + { + _bindings.Add(new Binding + { + Name = name, + Value = val + }); + } + + public void Bind(object val) + { + Bind(null, val); + } + + public override string ToString() + { + var parts = new string[1 + _bindings.Count]; + parts[0] = CommandText; + var i = 1; + foreach (var b in _bindings) + { + parts[i] = string.Format(" {0}: {1}", i - 1, b.Value); + i++; + } + return string.Join(Environment.NewLine, parts); + } + + Sqlite3Statement Prepare() + { + var stmt = SQLite3.Prepare2(_conn.Handle, CommandText); + BindAll(stmt); + return stmt; + } + + void Finalize(Sqlite3Statement stmt) + { + SQLite3.Finalize(stmt); + } + + void BindAll(Sqlite3Statement stmt) + { + int nextIdx = 1; + foreach (var b in _bindings) + { + if (b.Name != null) + { + b.Index = SQLite3.BindParameterIndex(stmt, b.Name); + } + else + { + b.Index = nextIdx++; + } + + BindParameter(stmt, b.Index, b.Value, _conn.StoreDateTimeAsTicks); + } + } + + internal static IntPtr NegativePointer = new IntPtr(-1); + + internal static void BindParameter(Sqlite3Statement stmt, int index, object value, bool storeDateTimeAsTicks) + { + if (value == null) + { + SQLite3.BindNull(stmt, index); + } + else + { + if (value is Int32) + { + SQLite3.BindInt(stmt, index, (int)value); + } + else if (value is String) + { + SQLite3.BindText(stmt, index, (string)value, -1, NegativePointer); + } + else if (value is Byte || value is UInt16 || value is SByte || value is Int16) + { + SQLite3.BindInt(stmt, index, Convert.ToInt32(value)); + } + else if (value is Boolean) + { + SQLite3.BindInt(stmt, index, (bool)value ? 1 : 0); + } + else if (value is UInt32 || value is Int64) + { + SQLite3.BindInt64(stmt, index, Convert.ToInt64(value)); + } + else if (value is Single || value is Double || value is Decimal) + { + SQLite3.BindDouble(stmt, index, Convert.ToDouble(value)); + } + else if (value is TimeSpan) + { + SQLite3.BindInt64(stmt, index, ((TimeSpan)value).Ticks); + } + else if (value is DateTime) + { + if (storeDateTimeAsTicks) + { + SQLite3.BindInt64(stmt, index, ((DateTime)value).Ticks); + } + else + { + SQLite3.BindText(stmt, index, ((DateTime)value).ToString("yyyy-MM-dd HH:mm:ss"), -1, NegativePointer); + } + } + else if (value is DateTimeOffset) + { + SQLite3.BindInt64(stmt, index, ((DateTimeOffset)value).UtcTicks); +#if !NETFX_CORE + } + else if (value.GetType().IsEnum) + { +#else + } else if (value.GetType().GetTypeInfo().IsEnum) { +#endif + SQLite3.BindInt(stmt, index, Convert.ToInt32(value)); + } + else if (value is byte[]) + { + SQLite3.BindBlob(stmt, index, (byte[])value, ((byte[])value).Length, NegativePointer); + } + else if (value is Guid) + { + SQLite3.BindText(stmt, index, ((Guid)value).ToString(), 72, NegativePointer); + } + else + { + throw new NotSupportedException("Cannot store type: " + value.GetType()); + } + } + } + + class Binding + { + public string Name { get; set; } + + public object Value { get; set; } + + public int Index { get; set; } + } + + object ReadCol(Sqlite3Statement stmt, int index, SQLite3.ColType type, Type clrType) + { + if (type == SQLite3.ColType.Null) + { + return null; + } + else + { + if (clrType == typeof(String)) + { + return SQLite3.ColumnString(stmt, index); + } + else if (clrType == typeof(Int32)) + { + return (int)SQLite3.ColumnInt(stmt, index); + } + else if (clrType == typeof(Boolean)) + { + return SQLite3.ColumnInt(stmt, index) == 1; + } + else if (clrType == typeof(double)) + { + return SQLite3.ColumnDouble(stmt, index); + } + else if (clrType == typeof(float)) + { + return (float)SQLite3.ColumnDouble(stmt, index); + } + else if (clrType == typeof(TimeSpan)) + { + return new TimeSpan(SQLite3.ColumnInt64(stmt, index)); + } + else if (clrType == typeof(DateTime)) + { + if (_conn.StoreDateTimeAsTicks) + { + return new DateTime(SQLite3.ColumnInt64(stmt, index)); + } + else + { + var text = SQLite3.ColumnString(stmt, index); + return DateTime.Parse(text); + } + } + else if (clrType == typeof(DateTimeOffset)) + { + return new DateTimeOffset(SQLite3.ColumnInt64(stmt, index), TimeSpan.Zero); +#if !NETFX_CORE + } + else if (clrType.IsEnum) + { +#else + } else if (clrType.GetTypeInfo().IsEnum) { +#endif + return SQLite3.ColumnInt(stmt, index); + } + else if (clrType == typeof(Int64)) + { + return SQLite3.ColumnInt64(stmt, index); + } + else if (clrType == typeof(UInt32)) + { + return (uint)SQLite3.ColumnInt64(stmt, index); + } + else if (clrType == typeof(decimal)) + { + return (decimal)SQLite3.ColumnDouble(stmt, index); + } + else if (clrType == typeof(Byte)) + { + return (byte)SQLite3.ColumnInt(stmt, index); + } + else if (clrType == typeof(UInt16)) + { + return (ushort)SQLite3.ColumnInt(stmt, index); + } + else if (clrType == typeof(Int16)) + { + return (short)SQLite3.ColumnInt(stmt, index); + } + else if (clrType == typeof(sbyte)) + { + return (sbyte)SQLite3.ColumnInt(stmt, index); + } + else if (clrType == typeof(byte[])) + { + return SQLite3.ColumnByteArray(stmt, index); + } + else if (clrType == typeof(Guid)) + { + var text = SQLite3.ColumnString(stmt, index); + return new Guid(text); + } + else + { + throw new NotSupportedException("Don't know how to read " + clrType); + } + } + } + } + + /// + /// Since the insert never changed, we only need to prepare once. + /// + public class PreparedSqlLiteInsertCommand : IDisposable + { + public bool Initialized { get; set; } + + protected SQLiteConnection Connection { get; set; } + + public string CommandText { get; set; } + + protected Sqlite3Statement Statement { get; set; } + internal static readonly Sqlite3Statement NullStatement = default(Sqlite3Statement); + + internal PreparedSqlLiteInsertCommand(SQLiteConnection conn) + { + Connection = conn; + } + + public int ExecuteNonQuery(object[] source) + { + if (Connection.Trace) + { + Debug.WriteLine("Executing: " + CommandText); + } + + var r = SQLite3.Result.OK; + + if (!Initialized) + { + Statement = Prepare(); + Initialized = true; + } + + //bind the values. + if (source != null) + { + for (int i = 0; i < source.Length; i++) + { + SQLiteCommand.BindParameter(Statement, i + 1, source[i], Connection.StoreDateTimeAsTicks); + } + } + r = SQLite3.Step(Statement); + + if (r == SQLite3.Result.Done) + { + int rowsAffected = SQLite3.Changes(Connection.Handle); + SQLite3.Reset(Statement); + return rowsAffected; + } + else if (r == SQLite3.Result.Error) + { + string msg = SQLite3.GetErrmsg(Connection.Handle); + SQLite3.Reset(Statement); + throw SQLiteException.New(r, msg); + } + else if (r == SQLite3.Result.Constraint && SQLite3.ExtendedErrCode(Connection.Handle) == SQLite3.ExtendedResult.ConstraintNotNull) + { + SQLite3.Reset(Statement); + throw NotNullConstraintViolationException.New(r, SQLite3.GetErrmsg(Connection.Handle)); + } + else + { + SQLite3.Reset(Statement); + throw SQLiteException.New(r, r.ToString()); + } + } + + protected virtual Sqlite3Statement Prepare() + { + var stmt = SQLite3.Prepare2(Connection.Handle, CommandText); + return stmt; + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + private void Dispose(bool disposing) + { + if (Statement != NullStatement) + { + try + { + SQLite3.Finalize(Statement); + } + finally + { + Statement = NullStatement; + Connection = null; + } + } + } + + ~PreparedSqlLiteInsertCommand() + { + Dispose(false); + } + } + + public abstract class BaseTableQuery + { + protected class Ordering + { + public string ColumnName { get; set; } + public bool Ascending { get; set; } + } + } + + public class TableQuery : BaseTableQuery, IEnumerable + { + public SQLiteConnection Connection { get; private set; } + + public TableMapping Table { get; private set; } + + Expression _where; + List _orderBys; + int? _limit; + int? _offset; + + BaseTableQuery _joinInner; + Expression _joinInnerKeySelector; + BaseTableQuery _joinOuter; + Expression _joinOuterKeySelector; + Expression _joinSelector; + + Expression _selector; + + TableQuery(SQLiteConnection conn, TableMapping table) + { + Connection = conn; + Table = table; + } + + public TableQuery(SQLiteConnection conn) + { + Connection = conn; + Table = Connection.GetMapping(typeof(T)); + } + + public TableQuery Clone() + { + var q = new TableQuery(Connection, Table); + q._where = _where; + q._deferred = _deferred; + if (_orderBys != null) + { + q._orderBys = new List(_orderBys); + } + q._limit = _limit; + q._offset = _offset; + q._joinInner = _joinInner; + q._joinInnerKeySelector = _joinInnerKeySelector; + q._joinOuter = _joinOuter; + q._joinOuterKeySelector = _joinOuterKeySelector; + q._joinSelector = _joinSelector; + q._selector = _selector; + return q; + } + + public TableQuery Where(Expression> predExpr) + { + if (predExpr.NodeType == ExpressionType.Lambda) + { + var lambda = (LambdaExpression)predExpr; + var pred = lambda.Body; + var q = Clone(); + q.AddWhere(pred); + return q; + } + else + { + throw new NotSupportedException("Must be a predicate"); + } + } + + public TableQuery Take(int n) + { + var q = Clone(); + q._limit = n; + return q; + } + + public TableQuery Skip(int n) + { + var q = Clone(); + q._offset = n; + return q; + } + + public T ElementAt(int index) + { + return Skip(index).Take(1).First(); + } + + bool _deferred; + public TableQuery Deferred() + { + var q = Clone(); + q._deferred = true; + return q; + } + + public TableQuery OrderBy(Expression> orderExpr) + { + return AddOrderBy(orderExpr, true); + } + + public TableQuery OrderByDescending(Expression> orderExpr) + { + return AddOrderBy(orderExpr, false); + } + + public TableQuery ThenBy(Expression> orderExpr) + { + return AddOrderBy(orderExpr, true); + } + + public TableQuery ThenByDescending(Expression> orderExpr) + { + return AddOrderBy(orderExpr, false); + } + + private TableQuery AddOrderBy(Expression> orderExpr, bool asc) + { + if (orderExpr.NodeType == ExpressionType.Lambda) + { + var lambda = (LambdaExpression)orderExpr; + + MemberExpression mem = null; + + var unary = lambda.Body as UnaryExpression; + if (unary != null && unary.NodeType == ExpressionType.Convert) + { + mem = unary.Operand as MemberExpression; + } + else + { + mem = lambda.Body as MemberExpression; + } + + if (mem != null && (mem.Expression.NodeType == ExpressionType.Parameter)) + { + var q = Clone(); + if (q._orderBys == null) + { + q._orderBys = new List(); + } + q._orderBys.Add(new Ordering + { + ColumnName = Table.FindColumnWithPropertyName(mem.Member.Name).Name, + Ascending = asc + }); + return q; + } + else + { + throw new NotSupportedException("Order By does not support: " + orderExpr); + } + } + else + { + throw new NotSupportedException("Must be a predicate"); + } + } + + private void AddWhere(Expression pred) + { + if (_where == null) + { + _where = pred; + } + else + { + _where = Expression.AndAlso(_where, pred); + } + } + + public TableQuery Join( + TableQuery inner, + Expression> outerKeySelector, + Expression> innerKeySelector, + Expression> resultSelector) + { + var q = new TableQuery(Connection, Connection.GetMapping(typeof(TResult))) + { + _joinOuter = this, + _joinOuterKeySelector = outerKeySelector, + _joinInner = inner, + _joinInnerKeySelector = innerKeySelector, + _joinSelector = resultSelector, + }; + return q; + } + + public TableQuery Select(Expression> selector) + { + var q = Clone(); + q._selector = selector; + return q; + } + + private SQLiteCommand GenerateCommand(string selectionList) + { + if (_joinInner != null && _joinOuter != null) + { + throw new NotSupportedException("Joins are not supported."); + } + else + { + var cmdText = "select " + selectionList + " from \"" + Table.TableName + "\""; + var args = new List(); + if (_where != null) + { + var w = CompileExpr(_where, args); + cmdText += " where " + w.CommandText; + } + if ((_orderBys != null) && (_orderBys.Count > 0)) + { + var t = string.Join(", ", _orderBys.Select(o => "\"" + o.ColumnName + "\"" + (o.Ascending ? "" : " desc")).ToArray()); + cmdText += " order by " + t; + } + if (_limit.HasValue) + { + cmdText += " limit " + _limit.Value; + } + if (_offset.HasValue) + { + if (!_limit.HasValue) + { + cmdText += " limit -1 "; + } + cmdText += " offset " + _offset.Value; + } + return Connection.CreateCommand(cmdText, args.ToArray()); + } + } + + class CompileResult + { + public string CommandText { get; set; } + + public object Value { get; set; } + } + + private CompileResult CompileExpr(Expression expr, List queryArgs) + { + if (expr == null) + { + throw new NotSupportedException("Expression is NULL"); + } + else if (expr is BinaryExpression) + { + var bin = (BinaryExpression)expr; + + var leftr = CompileExpr(bin.Left, queryArgs); + var rightr = CompileExpr(bin.Right, queryArgs); + + //If either side is a parameter and is null, then handle the other side specially (for "is null"/"is not null") + string text; + if (leftr.CommandText == "?" && leftr.Value == null) + text = CompileNullBinaryExpression(bin, rightr); + else if (rightr.CommandText == "?" && rightr.Value == null) + text = CompileNullBinaryExpression(bin, leftr); + else + text = "(" + leftr.CommandText + " " + GetSqlName(bin) + " " + rightr.CommandText + ")"; + return new CompileResult { CommandText = text }; + } + else if (expr.NodeType == ExpressionType.Call) + { + + var call = (MethodCallExpression)expr; + var args = new CompileResult[call.Arguments.Count]; + var obj = call.Object != null ? CompileExpr(call.Object, queryArgs) : null; + + for (var i = 0; i < args.Length; i++) + { + args[i] = CompileExpr(call.Arguments[i], queryArgs); + } + + var sqlCall = ""; + + if (call.Method.Name == "Like" && args.Length == 2) + { + sqlCall = "(" + args[0].CommandText + " like " + args[1].CommandText + ")"; + } + else if (call.Method.Name == "Contains" && args.Length == 2) + { + sqlCall = "(" + args[1].CommandText + " in " + args[0].CommandText + ")"; + } + else if (call.Method.Name == "Contains" && args.Length == 1) + { + if (call.Object != null && call.Object.Type == typeof(string)) + { + sqlCall = "(" + obj.CommandText + " like ('%' || " + args[0].CommandText + " || '%'))"; + } + else + { + sqlCall = "(" + args[0].CommandText + " in " + obj.CommandText + ")"; + } + } + else if (call.Method.Name == "StartsWith" && args.Length == 1) + { + sqlCall = "(" + obj.CommandText + " like (" + args[0].CommandText + " || '%'))"; + } + else if (call.Method.Name == "EndsWith" && args.Length == 1) + { + sqlCall = "(" + obj.CommandText + " like ('%' || " + args[0].CommandText + "))"; + } + else if (call.Method.Name == "Equals" && args.Length == 1) + { + sqlCall = "(" + obj.CommandText + " = (" + args[0].CommandText + "))"; + } + else if (call.Method.Name == "ToLower") + { + sqlCall = "(lower(" + obj.CommandText + "))"; + } + else if (call.Method.Name == "ToUpper") + { + sqlCall = "(upper(" + obj.CommandText + "))"; + } + else + { + sqlCall = call.Method.Name.ToLower() + "(" + string.Join(",", args.Select(a => a.CommandText).ToArray()) + ")"; + } + return new CompileResult { CommandText = sqlCall }; + + } + else if (expr.NodeType == ExpressionType.Constant) + { + var c = (ConstantExpression)expr; + queryArgs.Add(c.Value); + return new CompileResult + { + CommandText = "?", + Value = c.Value + }; + } + else if (expr.NodeType == ExpressionType.Convert) + { + var u = (UnaryExpression)expr; + var ty = u.Type; + var valr = CompileExpr(u.Operand, queryArgs); + return new CompileResult + { + CommandText = valr.CommandText, + Value = valr.Value != null ? ConvertTo(valr.Value, ty) : null + }; + } + else if (expr.NodeType == ExpressionType.MemberAccess) + { + var mem = (MemberExpression)expr; + + if (mem.Expression != null && mem.Expression.NodeType == ExpressionType.Parameter) + { + // + // This is a column of our table, output just the column name + // Need to translate it if that column name is mapped + // + var columnName = Table.FindColumnWithPropertyName(mem.Member.Name).Name; + return new CompileResult { CommandText = "\"" + columnName + "\"" }; + } + else + { + object obj = null; + if (mem.Expression != null) + { + var r = CompileExpr(mem.Expression, queryArgs); + if (r.Value == null) + { + throw new NotSupportedException("Member access failed to compile expression"); + } + if (r.CommandText == "?") + { + queryArgs.RemoveAt(queryArgs.Count - 1); + } + obj = r.Value; + } + + // + // Get the member value + // + object val = null; + +#if !NETFX_CORE + if (mem.Member.MemberType == MemberTypes.Property) + { +#else + if (mem.Member is PropertyInfo) { +#endif + var m = (PropertyInfo)mem.Member; + val = m.GetValue(obj, null); +#if !NETFX_CORE + } + else if (mem.Member.MemberType == MemberTypes.Field) + { +#else + } else if (mem.Member is FieldInfo) { +#endif +#if SILVERLIGHT + val = Expression.Lambda (expr).Compile ().DynamicInvoke (); +#else + var m = (FieldInfo)mem.Member; + val = m.GetValue(obj); +#endif + } + else + { +#if !NETFX_CORE + throw new NotSupportedException("MemberExpr: " + mem.Member.MemberType); +#else + throw new NotSupportedException ("MemberExpr: " + mem.Member.DeclaringType); +#endif + } + + // + // Work special magic for enumerables + // + if (val != null && val is System.Collections.IEnumerable && !(val is string) && !(val is System.Collections.Generic.IEnumerable)) + { + var sb = new System.Text.StringBuilder(); + sb.Append("("); + var head = ""; + foreach (var a in (System.Collections.IEnumerable)val) + { + queryArgs.Add(a); + sb.Append(head); + sb.Append("?"); + head = ","; + } + sb.Append(")"); + return new CompileResult + { + CommandText = sb.ToString(), + Value = val + }; + } + else + { + queryArgs.Add(val); + return new CompileResult + { + CommandText = "?", + Value = val + }; + } + } + } + throw new NotSupportedException("Cannot compile: " + expr.NodeType.ToString()); + } + + static object ConvertTo(object obj, Type t) + { + Type nut = Nullable.GetUnderlyingType(t); + + if (nut != null) + { + if (obj == null) return null; + return Convert.ChangeType(obj, nut); + } + else + { + return Convert.ChangeType(obj, t); + } + } + + /// + /// Compiles a BinaryExpression where one of the parameters is null. + /// + /// The non-null parameter + private string CompileNullBinaryExpression(BinaryExpression expression, CompileResult parameter) + { + if (expression.NodeType == ExpressionType.Equal) + return "(" + parameter.CommandText + " is ?)"; + else if (expression.NodeType == ExpressionType.NotEqual) + return "(" + parameter.CommandText + " is not ?)"; + else + throw new NotSupportedException("Cannot compile Null-BinaryExpression with type " + expression.NodeType.ToString()); + } + + string GetSqlName(Expression expr) + { + var n = expr.NodeType; + if (n == ExpressionType.GreaterThan) + return ">"; + else if (n == ExpressionType.GreaterThanOrEqual) + { + return ">="; + } + else if (n == ExpressionType.LessThan) + { + return "<"; + } + else if (n == ExpressionType.LessThanOrEqual) + { + return "<="; + } + else if (n == ExpressionType.And) + { + return "&"; + } + else if (n == ExpressionType.AndAlso) + { + return "and"; + } + else if (n == ExpressionType.Or) + { + return "|"; + } + else if (n == ExpressionType.OrElse) + { + return "or"; + } + else if (n == ExpressionType.Equal) + { + return "="; + } + else if (n == ExpressionType.NotEqual) + { + return "!="; + } + else + { + throw new NotSupportedException("Cannot get SQL for: " + n); + } + } + + public int Count() + { + return GenerateCommand("count(*)").ExecuteScalar(); + } + + public int Count(Expression> predExpr) + { + return Where(predExpr).Count(); + } + + public IEnumerator GetEnumerator() + { + if (!_deferred) + return GenerateCommand("*").ExecuteQuery().GetEnumerator(); + + return GenerateCommand("*").ExecuteDeferredQuery().GetEnumerator(); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public T First() + { + var query = Take(1); + return query.ToList().First(); + } + + public T FirstOrDefault() + { + var query = Take(1); + return query.ToList().FirstOrDefault(); + } + } + + public static class SQLite3 + { + public enum Result : int + { + OK = 0, + Error = 1, + Internal = 2, + Perm = 3, + Abort = 4, + Busy = 5, + Locked = 6, + NoMem = 7, + ReadOnly = 8, + Interrupt = 9, + IOError = 10, + Corrupt = 11, + NotFound = 12, + Full = 13, + CannotOpen = 14, + LockErr = 15, + Empty = 16, + SchemaChngd = 17, + TooBig = 18, + Constraint = 19, + Mismatch = 20, + Misuse = 21, + NotImplementedLFS = 22, + AccessDenied = 23, + Format = 24, + Range = 25, + NonDBFile = 26, + Notice = 27, + Warning = 28, + Row = 100, + Done = 101 + } + + public enum ExtendedResult : int + { + IOErrorRead = (Result.IOError | (1 << 8)), + IOErrorShortRead = (Result.IOError | (2 << 8)), + IOErrorWrite = (Result.IOError | (3 << 8)), + IOErrorFsync = (Result.IOError | (4 << 8)), + IOErrorDirFSync = (Result.IOError | (5 << 8)), + IOErrorTruncate = (Result.IOError | (6 << 8)), + IOErrorFStat = (Result.IOError | (7 << 8)), + IOErrorUnlock = (Result.IOError | (8 << 8)), + IOErrorRdlock = (Result.IOError | (9 << 8)), + IOErrorDelete = (Result.IOError | (10 << 8)), + IOErrorBlocked = (Result.IOError | (11 << 8)), + IOErrorNoMem = (Result.IOError | (12 << 8)), + IOErrorAccess = (Result.IOError | (13 << 8)), + IOErrorCheckReservedLock = (Result.IOError | (14 << 8)), + IOErrorLock = (Result.IOError | (15 << 8)), + IOErrorClose = (Result.IOError | (16 << 8)), + IOErrorDirClose = (Result.IOError | (17 << 8)), + IOErrorSHMOpen = (Result.IOError | (18 << 8)), + IOErrorSHMSize = (Result.IOError | (19 << 8)), + IOErrorSHMLock = (Result.IOError | (20 << 8)), + IOErrorSHMMap = (Result.IOError | (21 << 8)), + IOErrorSeek = (Result.IOError | (22 << 8)), + IOErrorDeleteNoEnt = (Result.IOError | (23 << 8)), + IOErrorMMap = (Result.IOError | (24 << 8)), + LockedSharedcache = (Result.Locked | (1 << 8)), + BusyRecovery = (Result.Busy | (1 << 8)), + CannottOpenNoTempDir = (Result.CannotOpen | (1 << 8)), + CannotOpenIsDir = (Result.CannotOpen | (2 << 8)), + CannotOpenFullPath = (Result.CannotOpen | (3 << 8)), + CorruptVTab = (Result.Corrupt | (1 << 8)), + ReadonlyRecovery = (Result.ReadOnly | (1 << 8)), + ReadonlyCannotLock = (Result.ReadOnly | (2 << 8)), + ReadonlyRollback = (Result.ReadOnly | (3 << 8)), + AbortRollback = (Result.Abort | (2 << 8)), + ConstraintCheck = (Result.Constraint | (1 << 8)), + ConstraintCommitHook = (Result.Constraint | (2 << 8)), + ConstraintForeignKey = (Result.Constraint | (3 << 8)), + ConstraintFunction = (Result.Constraint | (4 << 8)), + ConstraintNotNull = (Result.Constraint | (5 << 8)), + ConstraintPrimaryKey = (Result.Constraint | (6 << 8)), + ConstraintTrigger = (Result.Constraint | (7 << 8)), + ConstraintUnique = (Result.Constraint | (8 << 8)), + ConstraintVTab = (Result.Constraint | (9 << 8)), + NoticeRecoverWAL = (Result.Notice | (1 << 8)), + NoticeRecoverRollback = (Result.Notice | (2 << 8)) + } + + + public enum ConfigOption : int + { + SingleThread = 1, + MultiThread = 2, + Serialized = 3 + } + +#if !USE_CSHARP_SQLITE && !USE_WP8_NATIVE_SQLITE + [DllImport("sqlite3", EntryPoint = "sqlite3_open", CallingConvention = CallingConvention.Cdecl)] + public static extern Result Open([MarshalAs(UnmanagedType.LPStr)] string filename, out IntPtr db); + + [DllImport("sqlite3", EntryPoint = "sqlite3_open_v2", CallingConvention = CallingConvention.Cdecl)] + public static extern Result Open([MarshalAs(UnmanagedType.LPStr)] string filename, out IntPtr db, int flags, IntPtr zvfs); + + [DllImport("sqlite3", EntryPoint = "sqlite3_open_v2", CallingConvention = CallingConvention.Cdecl)] + public static extern Result Open(byte[] filename, out IntPtr db, int flags, IntPtr zvfs); + + [DllImport("sqlite3", EntryPoint = "sqlite3_open16", CallingConvention = CallingConvention.Cdecl)] + public static extern Result Open16([MarshalAs(UnmanagedType.LPWStr)] string filename, out IntPtr db); + + [DllImport("sqlite3", EntryPoint = "sqlite3_enable_load_extension", CallingConvention = CallingConvention.Cdecl)] + public static extern Result EnableLoadExtension(IntPtr db, int onoff); + + [DllImport("sqlite3", EntryPoint = "sqlite3_close", CallingConvention = CallingConvention.Cdecl)] + public static extern Result Close(IntPtr db); + + [DllImport("sqlite3", EntryPoint = "sqlite3_initialize", CallingConvention = CallingConvention.Cdecl)] + public static extern Result Initialize(); + + [DllImport("sqlite3", EntryPoint = "sqlite3_shutdown", CallingConvention = CallingConvention.Cdecl)] + public static extern Result Shutdown(); + + [DllImport("sqlite3", EntryPoint = "sqlite3_config", CallingConvention = CallingConvention.Cdecl)] + public static extern Result Config(ConfigOption option); + + [DllImport("sqlite3", EntryPoint = "sqlite3_win32_set_directory", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)] + public static extern int SetDirectory(uint directoryType, string directoryPath); + + [DllImport("sqlite3", EntryPoint = "sqlite3_busy_timeout", CallingConvention = CallingConvention.Cdecl)] + public static extern Result BusyTimeout(IntPtr db, int milliseconds); + + [DllImport("sqlite3", EntryPoint = "sqlite3_changes", CallingConvention = CallingConvention.Cdecl)] + public static extern int Changes(IntPtr db); + + [DllImport("sqlite3", EntryPoint = "sqlite3_prepare_v2", CallingConvention = CallingConvention.Cdecl)] + public static extern Result Prepare2(IntPtr db, [MarshalAs(UnmanagedType.LPStr)] string sql, int numBytes, out IntPtr stmt, IntPtr pzTail); + +#if NETFX_CORE + [DllImport ("sqlite3", EntryPoint = "sqlite3_prepare_v2", CallingConvention = CallingConvention.Cdecl)] + public static extern Result Prepare2 (IntPtr db, byte[] queryBytes, int numBytes, out IntPtr stmt, IntPtr pzTail); +#endif + + public static IntPtr Prepare2(IntPtr db, string query) + { + IntPtr stmt; +#if NETFX_CORE + byte[] queryBytes = System.Text.UTF8Encoding.UTF8.GetBytes (query); + var r = Prepare2 (db, queryBytes, queryBytes.Length, out stmt, IntPtr.Zero); +#else + var r = Prepare2(db, query, System.Text.UTF8Encoding.UTF8.GetByteCount(query), out stmt, IntPtr.Zero); +#endif + if (r != Result.OK) + { + throw SQLiteException.New(r, GetErrmsg(db)); + } + return stmt; + } + + [DllImport("sqlite3", EntryPoint = "sqlite3_step", CallingConvention = CallingConvention.Cdecl)] + public static extern Result Step(IntPtr stmt); + + [DllImport("sqlite3", EntryPoint = "sqlite3_reset", CallingConvention = CallingConvention.Cdecl)] + public static extern Result Reset(IntPtr stmt); + + [DllImport("sqlite3", EntryPoint = "sqlite3_finalize", CallingConvention = CallingConvention.Cdecl)] + public static extern Result Finalize(IntPtr stmt); + + [DllImport("sqlite3", EntryPoint = "sqlite3_last_insert_rowid", CallingConvention = CallingConvention.Cdecl)] + public static extern long LastInsertRowid(IntPtr db); + + [DllImport("sqlite3", EntryPoint = "sqlite3_errmsg16", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr Errmsg(IntPtr db); + + public static string GetErrmsg(IntPtr db) + { + return Marshal.PtrToStringUni(Errmsg(db)); + } + + [DllImport("sqlite3", EntryPoint = "sqlite3_bind_parameter_index", CallingConvention = CallingConvention.Cdecl)] + public static extern int BindParameterIndex(IntPtr stmt, [MarshalAs(UnmanagedType.LPStr)] string name); + + [DllImport("sqlite3", EntryPoint = "sqlite3_bind_null", CallingConvention = CallingConvention.Cdecl)] + public static extern int BindNull(IntPtr stmt, int index); + + [DllImport("sqlite3", EntryPoint = "sqlite3_bind_int", CallingConvention = CallingConvention.Cdecl)] + public static extern int BindInt(IntPtr stmt, int index, int val); + + [DllImport("sqlite3", EntryPoint = "sqlite3_bind_int64", CallingConvention = CallingConvention.Cdecl)] + public static extern int BindInt64(IntPtr stmt, int index, long val); + + [DllImport("sqlite3", EntryPoint = "sqlite3_bind_double", CallingConvention = CallingConvention.Cdecl)] + public static extern int BindDouble(IntPtr stmt, int index, double val); + + [DllImport("sqlite3", EntryPoint = "sqlite3_bind_text16", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)] + public static extern int BindText(IntPtr stmt, int index, [MarshalAs(UnmanagedType.LPWStr)] string val, int n, IntPtr free); + + [DllImport("sqlite3", EntryPoint = "sqlite3_bind_blob", CallingConvention = CallingConvention.Cdecl)] + public static extern int BindBlob(IntPtr stmt, int index, byte[] val, int n, IntPtr free); + + [DllImport("sqlite3", EntryPoint = "sqlite3_column_count", CallingConvention = CallingConvention.Cdecl)] + public static extern int ColumnCount(IntPtr stmt); + + [DllImport("sqlite3", EntryPoint = "sqlite3_column_name", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ColumnName(IntPtr stmt, int index); + + [DllImport("sqlite3", EntryPoint = "sqlite3_column_name16", CallingConvention = CallingConvention.Cdecl)] + static extern IntPtr ColumnName16Internal(IntPtr stmt, int index); + public static string ColumnName16(IntPtr stmt, int index) + { + return Marshal.PtrToStringUni(ColumnName16Internal(stmt, index)); + } + + [DllImport("sqlite3", EntryPoint = "sqlite3_column_type", CallingConvention = CallingConvention.Cdecl)] + public static extern ColType ColumnType(IntPtr stmt, int index); + + [DllImport("sqlite3", EntryPoint = "sqlite3_column_int", CallingConvention = CallingConvention.Cdecl)] + public static extern int ColumnInt(IntPtr stmt, int index); + + [DllImport("sqlite3", EntryPoint = "sqlite3_column_int64", CallingConvention = CallingConvention.Cdecl)] + public static extern long ColumnInt64(IntPtr stmt, int index); + + [DllImport("sqlite3", EntryPoint = "sqlite3_column_double", CallingConvention = CallingConvention.Cdecl)] + public static extern double ColumnDouble(IntPtr stmt, int index); + + [DllImport("sqlite3", EntryPoint = "sqlite3_column_text", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ColumnText(IntPtr stmt, int index); + + [DllImport("sqlite3", EntryPoint = "sqlite3_column_text16", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ColumnText16(IntPtr stmt, int index); + + [DllImport("sqlite3", EntryPoint = "sqlite3_column_blob", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ColumnBlob(IntPtr stmt, int index); + + [DllImport("sqlite3", EntryPoint = "sqlite3_column_bytes", CallingConvention = CallingConvention.Cdecl)] + public static extern int ColumnBytes(IntPtr stmt, int index); + + public static string ColumnString(IntPtr stmt, int index) + { + return Marshal.PtrToStringUni(SQLite3.ColumnText16(stmt, index)); + } + + public static byte[] ColumnByteArray(IntPtr stmt, int index) + { + int length = ColumnBytes(stmt, index); + var result = new byte[length]; + if (length > 0) + Marshal.Copy(ColumnBlob(stmt, index), result, 0, length); + return result; + } + + [DllImport("sqlite3", EntryPoint = "sqlite3_extended_errcode", CallingConvention = CallingConvention.Cdecl)] + public static extern ExtendedResult ExtendedErrCode(IntPtr db); + + [DllImport("sqlite3", EntryPoint = "sqlite3_libversion_number", CallingConvention = CallingConvention.Cdecl)] + public static extern int LibVersionNumber(); +#else + public static Result Open(string filename, out Sqlite3DatabaseHandle db) + { + return (Result) Sqlite3.sqlite3_open(filename, out db); + } + + public static Result Open(string filename, out Sqlite3DatabaseHandle db, int flags, IntPtr zVfs) + { +#if USE_WP8_NATIVE_SQLITE + return (Result)Sqlite3.sqlite3_open_v2(filename, out db, flags, ""); +#else + return (Result)Sqlite3.sqlite3_open_v2(filename, out db, flags, null); +#endif + } + + public static Result Close(Sqlite3DatabaseHandle db) + { + return (Result)Sqlite3.sqlite3_close(db); + } + + public static Result BusyTimeout(Sqlite3DatabaseHandle db, int milliseconds) + { + return (Result)Sqlite3.sqlite3_busy_timeout(db, milliseconds); + } + + public static int Changes(Sqlite3DatabaseHandle db) + { + return Sqlite3.sqlite3_changes(db); + } + + public static Sqlite3Statement Prepare2(Sqlite3DatabaseHandle db, string query) + { + Sqlite3Statement stmt = default(Sqlite3Statement); +#if USE_WP8_NATIVE_SQLITE + var r = Sqlite3.sqlite3_prepare_v2(db, query, out stmt); +#else + stmt = new Sqlite3Statement(); + var r = Sqlite3.sqlite3_prepare_v2(db, query, -1, ref stmt, 0); +#endif + if (r != 0) + { + throw SQLiteException.New((Result)r, GetErrmsg(db)); + } + return stmt; + } + + public static Result Step(Sqlite3Statement stmt) + { + return (Result)Sqlite3.sqlite3_step(stmt); + } + + public static Result Reset(Sqlite3Statement stmt) + { + return (Result)Sqlite3.sqlite3_reset(stmt); + } + + public static Result Finalize(Sqlite3Statement stmt) + { + return (Result)Sqlite3.sqlite3_finalize(stmt); + } + + public static long LastInsertRowid(Sqlite3DatabaseHandle db) + { + return Sqlite3.sqlite3_last_insert_rowid(db); + } + + public static string GetErrmsg(Sqlite3DatabaseHandle db) + { + return Sqlite3.sqlite3_errmsg(db); + } + + public static int BindParameterIndex(Sqlite3Statement stmt, string name) + { + return Sqlite3.sqlite3_bind_parameter_index(stmt, name); + } + + public static int BindNull(Sqlite3Statement stmt, int index) + { + return Sqlite3.sqlite3_bind_null(stmt, index); + } + + public static int BindInt(Sqlite3Statement stmt, int index, int val) + { + return Sqlite3.sqlite3_bind_int(stmt, index, val); + } + + public static int BindInt64(Sqlite3Statement stmt, int index, long val) + { + return Sqlite3.sqlite3_bind_int64(stmt, index, val); + } + + public static int BindDouble(Sqlite3Statement stmt, int index, double val) + { + return Sqlite3.sqlite3_bind_double(stmt, index, val); + } + + public static int BindText(Sqlite3Statement stmt, int index, string val, int n, IntPtr free) + { +#if USE_WP8_NATIVE_SQLITE + return Sqlite3.sqlite3_bind_text(stmt, index, val, n); +#else + return Sqlite3.sqlite3_bind_text(stmt, index, val, n, null); +#endif + } + + public static int BindBlob(Sqlite3Statement stmt, int index, byte[] val, int n, IntPtr free) + { +#if USE_WP8_NATIVE_SQLITE + return Sqlite3.sqlite3_bind_blob(stmt, index, val, n); +#else + return Sqlite3.sqlite3_bind_blob(stmt, index, val, n, null); +#endif + } + + public static int ColumnCount(Sqlite3Statement stmt) + { + return Sqlite3.sqlite3_column_count(stmt); + } + + public static string ColumnName(Sqlite3Statement stmt, int index) + { + return Sqlite3.sqlite3_column_name(stmt, index); + } + + public static string ColumnName16(Sqlite3Statement stmt, int index) + { + return Sqlite3.sqlite3_column_name(stmt, index); + } + + public static ColType ColumnType(Sqlite3Statement stmt, int index) + { + return (ColType)Sqlite3.sqlite3_column_type(stmt, index); + } + + public static int ColumnInt(Sqlite3Statement stmt, int index) + { + return Sqlite3.sqlite3_column_int(stmt, index); + } + + public static long ColumnInt64(Sqlite3Statement stmt, int index) + { + return Sqlite3.sqlite3_column_int64(stmt, index); + } + + public static double ColumnDouble(Sqlite3Statement stmt, int index) + { + return Sqlite3.sqlite3_column_double(stmt, index); + } + + public static string ColumnText(Sqlite3Statement stmt, int index) + { + return Sqlite3.sqlite3_column_text(stmt, index); + } + + public static string ColumnText16(Sqlite3Statement stmt, int index) + { + return Sqlite3.sqlite3_column_text(stmt, index); + } + + public static byte[] ColumnBlob(Sqlite3Statement stmt, int index) + { + return Sqlite3.sqlite3_column_blob(stmt, index); + } + + public static int ColumnBytes(Sqlite3Statement stmt, int index) + { + return Sqlite3.sqlite3_column_bytes(stmt, index); + } + + public static string ColumnString(Sqlite3Statement stmt, int index) + { + return Sqlite3.sqlite3_column_text(stmt, index); + } + + public static byte[] ColumnByteArray(Sqlite3Statement stmt, int index) + { + return ColumnBlob(stmt, index); + } + + public static Result EnableLoadExtension(Sqlite3DatabaseHandle db, int onoff) + { + return (Result)Sqlite3.sqlite3_enable_load_extension(db, onoff); + } + + public static ExtendedResult ExtendedErrCode(Sqlite3DatabaseHandle db) + { + return (ExtendedResult)Sqlite3.sqlite3_extended_errcode(db); + } +#endif + + public enum ColType : int + { + Integer = 1, + Float = 2, + Text = 3, + Blob = 4, + Null = 5 + } + } +} diff --git a/Core/mapbox-sdk-cs/Platform/SQLite/SQLite.cs.meta b/Core/mapbox-sdk-cs/Platform/SQLite/SQLite.cs.meta new file mode 100644 index 0000000..040ab20 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/SQLite/SQLite.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: aee17b4969829456097c55d1bc42f57b +timeCreated: 1497883479 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/TileJSON.meta b/Core/mapbox-sdk-cs/Platform/TileJSON.meta new file mode 100644 index 0000000..d4bb777 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/TileJSON.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b68f3c7ef59bf3246a91043a1d382926 +folderAsset: yes +timeCreated: 1515589539 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/TileJSON/TileJSON.cs b/Core/mapbox-sdk-cs/Platform/TileJSON/TileJSON.cs new file mode 100644 index 0000000..0491354 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/TileJSON/TileJSON.cs @@ -0,0 +1,54 @@ +using Mapbox.Json; +using Mapbox.Utils; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Mapbox.Platform.TilesetTileJSON +{ + public class TileJSON + { + + private IFileSource _fileSource; + private int _timeout; + + + public IFileSource FileSource { get { return _fileSource; } } + + + public TileJSON(IFileSource fileSource, int timeout) + { + _fileSource = fileSource; + _timeout = timeout; + } + + + public IAsyncRequest Get(string tilesetName, Action callback) + { + string url = string.Format( + "{0}v4/{1}.json?secure" + , Constants.BaseAPI + , tilesetName + ); + + return _fileSource.Request( + url + , (Response response) => + { + string json = Encoding.UTF8.GetString(response.Data); + TileJSONResponse tileJSONResponse = JsonConvert.DeserializeObject(json); + if (tileJSONResponse != null) + { + tileJSONResponse.Source = tilesetName; + } + callback(tileJSONResponse); + } + , _timeout + ); + } + + + + + } +} diff --git a/Core/mapbox-sdk-cs/Platform/TileJSON/TileJSON.cs.meta b/Core/mapbox-sdk-cs/Platform/TileJSON/TileJSON.cs.meta new file mode 100644 index 0000000..2e38eb6 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/TileJSON/TileJSON.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ab78da4f6b501ed4b8ea92121d3392b8 +timeCreated: 1515589539 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/TileJSON/TileJSONObjectVectorLayer.cs b/Core/mapbox-sdk-cs/Platform/TileJSON/TileJSONObjectVectorLayer.cs new file mode 100644 index 0000000..a9b81f0 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/TileJSON/TileJSONObjectVectorLayer.cs @@ -0,0 +1,32 @@ +namespace Mapbox.Platform.TilesetTileJSON +{ + using Mapbox.Json; + using System.Collections.Generic; + + + + public class TileJSONObjectVectorLayer + { + + [JsonProperty("description")] + public string Description { get; set; } + + + [JsonProperty("fields")] + public Dictionary Fields { get; set; } + + + [JsonProperty("id")] + public string Id { get; set; } + + + [JsonProperty("source")] + public string Source { get; set; } + + + [JsonProperty("source_name")] + public string SourceName { get; set; } + + + } +} diff --git a/Core/mapbox-sdk-cs/Platform/TileJSON/TileJSONObjectVectorLayer.cs.meta b/Core/mapbox-sdk-cs/Platform/TileJSON/TileJSONObjectVectorLayer.cs.meta new file mode 100644 index 0000000..c082159 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/TileJSON/TileJSONObjectVectorLayer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 4d926842f7750b041be895c39e959799 +timeCreated: 1515590225 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Platform/TileJSON/TileJSONReponse.cs b/Core/mapbox-sdk-cs/Platform/TileJSON/TileJSONReponse.cs new file mode 100644 index 0000000..273084a --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/TileJSON/TileJSONReponse.cs @@ -0,0 +1,165 @@ +namespace Mapbox.Platform.TilesetTileJSON +{ + + using Mapbox.Json; + using Mapbox.Utils; + using System; + + public class TileJSONResponse + { + + + [JsonProperty("attribution")] + public string Attribution { get; set; } + + + [JsonProperty("autoscale")] + public bool AutoScale { get; set; } + + + private double[] _bounds; + [JsonProperty("bounds")] + public double[] Bounds + { + get { return _bounds; } + set + { + _bounds = value; + BoundsParsed = new Vector2dBounds( + new Vector2d(Bounds[1], Bounds[0]) + , new Vector2d(Bounds[3], Bounds[2]) + ); + } + } + + + [JsonIgnore] + public Vector2dBounds BoundsParsed { get; private set; } + + + private double[] _center; + [JsonProperty("center")] + public double[] Center + { + get { return _center; } + set + { + _center = value; + CenterParsed = new Vector2d(_center[1], _center[0]); + } + } + + [JsonIgnore] + public Vector2d CenterParsed { get; private set; } + + + private long? _created; + /// Concatenated tilesets don't have a created property + [JsonProperty("created")] + public long? Created + { + get { return _created; } + set + { + _created = value; + if (_created.HasValue) + { + CreatedUtc = UnixTimestampUtils.From(_created.Value); + } + else + { + CreatedUtc = null; + } + } + } + + + /// Concatenated tilesets don't have a created property + [JsonIgnore] + public DateTime? CreatedUtc { get; private set; } + + + [JsonProperty("description")] + public string Description { get; set; } + + + /// Can be empty + [JsonProperty("format")] + public string Format { get; set; } + + + /// Can be empty (for concatenated tilesets) + [JsonProperty("id")] + public string Id { get; set; } + + + [JsonProperty("maxzoom")] + public int MaxZoom { get; set; } + + + [JsonProperty("minzoom")] + public int MinZoom { get; set; } + + + private long? _modified; + /// Unmodified tilesets don't have a modfied property + [JsonProperty("modified")] + public long? Modified + { + get { return _modified; } + set + { + _modified = value; + if (_modified.HasValue) + { + ModifiedUtc = UnixTimestampUtils.From(_modified.Value); + } + else + { + ModifiedUtc = null; + } + } + } + + + /// Unmodified tilesets don't have a modfied property + [JsonIgnore] + public DateTime? ModifiedUtc { get; private set; } + + + [JsonProperty("name")] + public string Name { get; set; } + + + [JsonProperty("private")] + public bool Private { get; set; } + + + [JsonProperty("scheme")] + public string Scheme { get; set; } + + + /// Can be empty + [JsonProperty("source")] + public string Source { get; set; } + + + [JsonProperty("tilejson")] + public string TileJSONVersion { get; set; } + + + [JsonProperty("tiles")] + public string[] Tiles { get; set; } + + + [JsonProperty("vector_layers")] + public TileJSONObjectVectorLayer[] VectorLayers { get; set; } + + + /// Can be empty (for concatenated tilesets) + [JsonProperty("webpage")] + public string WebPage { get; set; } + + + } +} diff --git a/Core/mapbox-sdk-cs/Platform/TileJSON/TileJSONReponse.cs.meta b/Core/mapbox-sdk-cs/Platform/TileJSON/TileJSONReponse.cs.meta new file mode 100644 index 0000000..0ae26f1 --- /dev/null +++ b/Core/mapbox-sdk-cs/Platform/TileJSON/TileJSONReponse.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 8f58425aa7b211946a73691da0414edb +timeCreated: 1515589539 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests.meta b/Core/mapbox-sdk-cs/Tests.meta new file mode 100644 index 0000000..e78310e --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: c35672386d7ec45c8acb13ed4bc5190c +folderAsset: yes +timeCreated: 1498231546 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests.meta b/Core/mapbox-sdk-cs/Tests/UnitTests.meta new file mode 100644 index 0000000..4d48483 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b1c1dc87a227c49bb8efebbb9ad9a41c +folderAsset: yes +timeCreated: 1498231546 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor.meta new file mode 100644 index 0000000..545e77b --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ef29d58528f4f4fd0bfdb0b20e86b3e7 +folderAsset: yes +timeCreated: 1498231546 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_AngleSmoothing.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_AngleSmoothing.cs new file mode 100644 index 0000000..c04b870 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_AngleSmoothing.cs @@ -0,0 +1,132 @@ +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + + using NUnit.Framework; + using Mapbox.Unity.Location; + + + [TestFixture] + internal class AngleSmoothingTest + { + + + [Test] + public void NoOp() + { + //NoOp does nothing. should always return latest value + AngleSmoothingNoOp noop = new AngleSmoothingNoOp(); + string opName = noop.GetType().Name + " "; + noop.Add(23); + Assert.AreEqual(23d, noop.Calculate(), opName + "did modify data"); + noop.Add(29); + Assert.AreEqual(29d, noop.Calculate(), opName + "did modify data"); + noop.Add(178.5); + Assert.AreEqual(178.5d, noop.Calculate(), opName + "did modify data"); + noop.Add(359.99); + Assert.AreEqual(359.99d, noop.Calculate(), opName + "did modify data"); + } + + + [Test] + public void Average() + { + // simple average + AngleSmoothingAverage avg = new AngleSmoothingAverage(); + string opName = avg.GetType().Name + " "; + avg.Add(355); + avg.Add(15); + Assert.AreEqual(5d, avg.Calculate(), opName + "did not properly calculate across 0"); + + avg.Add(335); + Assert.AreEqual(355d, avg.Calculate(), opName + "did not properly calculate back across 0"); + + // add more angles to check if internal buffer rolls over correctly + avg.Add(180); + avg.Add(160); + avg.Add(140); + avg.Add(120); + avg.Add(100); + Assert.AreEqual(140d, avg.Calculate(), opName + "internal default buffer of 5 did not roll over correctly"); + } + + + [Test] + public void LowPass() + { + //simple low pass filter + // parameter 1.0 => no smoothing: despite calucations going on last value should be returned + AngleSmoothingLowPass lp = new AngleSmoothingLowPass(1.0d); + string opName = lp.GetType().Name + " "; + lp.Add(45); + lp.Add(90); + lp.Add(135); + lp.Add(180); + lp.Add(225); + Assert.AreEqual(225d, lp.Calculate(), opName + "smoothed but shouldn't have"); + + lp = new AngleSmoothingLowPass(0.5d); + lp.Add(45); + lp.Add(90); + lp.Add(135); + lp.Add(180); + lp.Add(225); + Assert.AreEqual(193.75d, lp.Calculate(), opName + "did not smooth as expected"); + + // parameter 1.0 => no smoothing: despite calucations going on last value should be returned + lp = new AngleSmoothingLowPass(1d); + lp.Add(355); + lp.Add(355); + lp.Add(5); + lp.Add(5); + lp.Add(5); + Assert.AreEqual(5d, lp.Calculate(), opName + "did not *not* smooth across '0' as expected"); + + lp = new AngleSmoothingLowPass(0.5d); + lp.Add(355); + lp.Add(355); + lp.Add(10); + lp.Add(10); + lp.Add(10); + Assert.AreEqual(8.14d, lp.Calculate(), opName + "did not smooth across '0' as expected"); + lp.Add(320); + Assert.AreEqual(344.02d, lp.Calculate(), opName + "did not smooth back across '0' as expected"); + } + + + [Test] + public void Weighted() + { + // exponential moving average + // parameter 1.0 => no smoothing + AngleSmoothingEMA ema = new AngleSmoothingEMA(); + string opName = ema.GetType().Name + " "; + ema.Add(45); + ema.Add(90); + ema.Add(135); + ema.Add(180); + ema.Add(225); + Assert.AreEqual(165.74d, ema.Calculate(), opName + "didn't smooth as expected"); + + ema = new AngleSmoothingEMA(); + ema.Add(350); + ema.Add(355); + ema.Add(5); + ema.Add(10); + ema.Add(10); + Assert.AreEqual(3.85d, ema.Calculate(), opName + "didn't smooth as expected across 0"); + + ema = new AngleSmoothingEMA(); + ema.Add(20); + ema.Add(15); + ema.Add(350); + ema.Add(345); + ema.Add(330); + Assert.AreEqual(350.43d, ema.Calculate(), opName + "didn't smooth as expected back across 0"); + } + + + + + } +} diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_AngleSmoothing.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_AngleSmoothing.cs.meta new file mode 100644 index 0000000..243684e --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_AngleSmoothing.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 4c71959e4a4a64446a39de632554cf41 +timeCreated: 1529510706 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_BboxToGeoCoordinateBoundsConverter.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_BboxToGeoCoordinateBoundsConverter.cs new file mode 100644 index 0000000..18f67f1 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_BboxToGeoCoordinateBoundsConverter.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + using Mapbox.Json; + using Mapbox.Utils; + using Mapbox.Utils.JsonConverters; + using NUnit.Framework; + + [TestFixture] + internal class BboxToVector2dBoundsConverterTest + { + private string geoCoordinateBoundsStr = "[38.9165,-77.0295,30.2211,-80.5521]"; + + private Vector2dBounds geoCoordinateBoundsObj = new Vector2dBounds( + sw: new Vector2d(y: -77.0295, x: 38.9165), + ne: new Vector2d(y: -80.5521, x: 30.2211)); + + [Test] + public void Deserialize() + { + Vector2dBounds deserializedVector2dBounds = JsonConvert.DeserializeObject(geoCoordinateBoundsStr, JsonConverters.Converters); + Assert.AreEqual(geoCoordinateBoundsObj.ToString(), deserializedVector2dBounds.ToString()); + } + + [Test] + public void Serialize() + { + string serializedVector2dBounds = JsonConvert.SerializeObject(geoCoordinateBoundsObj, JsonConverters.Converters); + Assert.AreEqual(geoCoordinateBoundsStr, serializedVector2dBounds); + } + } +} \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_BboxToGeoCoordinateBoundsConverter.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_BboxToGeoCoordinateBoundsConverter.cs.meta new file mode 100644 index 0000000..599fea4 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_BboxToGeoCoordinateBoundsConverter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 58a06458684f24a7d8758d87456c38ee +timeCreated: 1498231546 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_BearingFilter.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_BearingFilter.cs new file mode 100644 index 0000000..7d85dd5 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_BearingFilter.cs @@ -0,0 +1,63 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + using System; + using Mapbox; + using NUnit.Framework; + using Mapbox.Utils; + + [TestFixture] + internal class BearingFilterTest + { + private BearingFilter _bearingFilter; + + [SetUp] + public void SetUp() + { + _bearingFilter = new BearingFilter(10, 10); + } + + public void BearingTooLarge() + { + _bearingFilter = new BearingFilter(361, 10); + } + + public void BearingTooSmall() + { + _bearingFilter = new BearingFilter(-1, 10); + } + + public void RangeTooLarge() + { + _bearingFilter = new BearingFilter(10, 181); + } + + public void RangeTooSmall() + { + _bearingFilter = new BearingFilter(10, -1); + } + + [Test] + public void InvalidValues() + { + Assert.Throws(BearingTooLarge); + Assert.Throws(BearingTooSmall); + Assert.Throws(RangeTooSmall); + Assert.Throws(RangeTooLarge); + } + + [Test] + public void ToStringTest() + { + Assert.AreEqual(_bearingFilter.ToString(), "10,10"); + + _bearingFilter = new BearingFilter(null, null); + Assert.AreEqual(_bearingFilter.ToString(), string.Empty); + } + } +} \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_BearingFilter.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_BearingFilter.cs.meta new file mode 100644 index 0000000..48fef8e --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_BearingFilter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 92c453cc66e7c404aa6b98cd2488dd54 +timeCreated: 1498231546 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_CanonicalTileId.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_CanonicalTileId.cs new file mode 100644 index 0000000..80e4ff6 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_CanonicalTileId.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + using Mapbox.Map; + using Mapbox.Utils; + using NUnit.Framework; + + [TestFixture] + internal class CanonicalTileIdTest + { + [Test] + public void ToVector2d() + { + var set = TileCover.Get(Vector2dBounds.World(), 5); + + foreach (var tile in set) + { + var reverse = TileCover.CoordinateToTileId(tile.ToVector2d(), 5); + + Assert.AreEqual(tile.Z, reverse.Z); + Assert.AreEqual(tile.X, reverse.X); + Assert.AreEqual(tile.Y, reverse.Y); + } + } + } +} \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_CanonicalTileId.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_CanonicalTileId.cs.meta new file mode 100644 index 0000000..319ea71 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_CanonicalTileId.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f7d7e9f06ea614f1897bff8ed17eeba9 +timeCreated: 1498231547 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Compression.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Compression.cs new file mode 100644 index 0000000..99eed63 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Compression.cs @@ -0,0 +1,159 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +// TODO: figure out how run tests outside of Unity with .NET framework, something like '#if !UNITY' +#if UNITY_5_6_OR_NEWER + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + using System.Text; + using Mapbox.Platform; + using Mapbox.Utils; + using NUnit.Framework; +#if UNITY_5_6_OR_NEWER + using UnityEngine.TestTools; + using System.Collections; + using UnityEngine; +#endif + + [TestFixture] + internal class CompressionTest + { + + + private FileSource _fs; + private int _timeout = 10; + + + [SetUp] + public void SetUp() + { +#if UNITY_5_6_OR_NEWER + _fs = new FileSource(Unity.MapboxAccess.Instance.Configuration.GetMapsSkuToken, Unity.MapboxAccess.Instance.Configuration.AccessToken); + _timeout = Unity.MapboxAccess.Instance.Configuration.DefaultTimeout; +#else + // when run outside of Unity FileSource gets the access token from environment variable 'MAPBOX_ACCESS_TOKEN' + _fs = new FileSource(); +#endif + } + + + [Test] + public void Empty() + { + var buffer = new byte[] { }; + Assert.AreEqual(buffer, Compression.Decompress(buffer)); + } + + [Test] + public void NotCompressed() + { + var buffer = Encoding.ASCII.GetBytes("foobar"); + Assert.AreEqual(buffer, Compression.Decompress(buffer)); + } + +#if UNITY_5_6_OR_NEWER + [UnityTest] + public IEnumerator Corrupt() + { +#else + [Test] + public void Corrupt() { +#endif + var buffer = new byte[] { }; + + // Vector tiles are compressed. + _fs.Request( + "https://api.mapbox.com/v4/mapbox.mapbox-streets-v7/0/0/0.vector.pbf", + (Response res) => + { + if (res.HasError) + { +#if UNITY_5_6_OR_NEWER + Debug.LogError(res.ExceptionsAsString); +#else + System.Diagnostics.Debug.WriteLine(res.ExceptionsAsString); +#endif + } + buffer = res.Data; + }, + _timeout + ); + + +#if UNITY_5_6_OR_NEWER + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } +#else + _fs.WaitForAllRequests(); +#endif + + Assert.Greater(buffer.Length, 30); + + buffer[10] = 0; + buffer[20] = 0; + buffer[30] = 0; + + Assert.AreEqual(buffer, Compression.Decompress(buffer)); + } + + +#if UNITY_5_6_OR_NEWER + [UnityTest] + public IEnumerator Decompress() + { +#else + [Test] + public void Decompress() { +#endif + var buffer = new byte[] { }; + + // Vector tiles are compressed. + _fs.Request( + "https://api.mapbox.com/v4/mapbox.mapbox-streets-v7/0/0/0.vector.pbf", + (Response res) => + { + if (res.HasError) + { +#if UNITY_5_6_OR_NEWER + Debug.LogError(res.ExceptionsAsString); +#else + System.Diagnostics.Debug.WriteLine(res.ExceptionsAsString); +#endif + } + buffer = res.Data; + }, + _timeout + ); + +#if UNITY_5_6_OR_NEWER + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } +#else + _fs.WaitForAllRequests(); +#endif + + // tiles are automatically decompressed during HttpRequest on full .Net framework + // not on .NET Core / UWP / Unity +#if UNITY_EDITOR_OSX && UNITY_IOS + Assert.AreEqual(buffer.Length, Compression.Decompress(buffer).Length); // EditMode on OSX +#elif UNITY_EDITOR && (UNITY_IOS || UNITY_ANDROID) // PlayMode tests in Editor + Debug.Log("EditMode tests in Editor"); + Assert.Less(buffer.Length, Compression.Decompress(buffer).Length); +#elif !UNITY_EDITOR && (UNITY_EDITOR_OSX || UNITY_IOS || UNITY_ANDROID) // PlayMode tests on device + Debug.Log("PlayMode tests on device"); + Assert.AreEqual(buffer.Length, Compression.Decompress(buffer).Length); +#elif NETFX_CORE + Assert.Less(buffer.Length, Compression.Decompress(buffer).Length); +#else + Assert.AreEqual(buffer.Length, Compression.Decompress(buffer).Length); +#endif + } + } +} + + +#endif diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Compression.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Compression.cs.meta new file mode 100644 index 0000000..49eb060 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Compression.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d77460974e8834b2a8f3b1a72c49325b +timeCreated: 1498231547 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_DirectionResource.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_DirectionResource.cs new file mode 100644 index 0000000..0d59635 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_DirectionResource.cs @@ -0,0 +1,104 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + using System; + using Mapbox.Utils; + using NUnit.Framework; + + [TestFixture] + internal class DirectionResourceTest + { + private Vector2d[] _coordinates = { new Vector2d(10, 10), new Vector2d(20, 20) }; + private Directions.RoutingProfile _profile = Directions.RoutingProfile.Driving; + private Directions.DirectionResource _directionResource; + + [SetUp] + public void SetUp() + { + _directionResource = new Directions.DirectionResource(_coordinates, _profile); + } + + public void MismatchedBearings() + { + _directionResource.Bearings = new BearingFilter[] { new BearingFilter(10, 10) }; + } + + public void MismatchedRadiuses() + { + _directionResource.Radiuses = new double[] { 10 }; + } + + public void TooSmallRadius() + { + _directionResource.Radiuses = new double[] { 10, -1 }; + } + + [Test] + public void SetInvalidBearings() + { + Assert.Throws(MismatchedBearings); + } + + [Test] + public void SetInvalidRadiuses_Mismatched() + { + Assert.Throws(MismatchedRadiuses); + } + + [Test] + public void SetInvalidRadiuses_TooSmall() + { + Assert.Throws(TooSmallRadius); + } + + [Test] + public void GetUrl() + { + // With only constructor + Assert.AreEqual("https://api.mapbox.com/directions/v5/mapbox/driving/10.00000,10.00000;20.00000,20.00000.json", _directionResource.GetUrl()); + + // With alternatives + _directionResource.Alternatives = false; + // ToLower is needed to make test pass on OSX + Assert.AreEqual("https://api.mapbox.com/directions/v5/mapbox/driving/10.00000,10.00000;20.00000,20.00000.json?alternatives=false".ToLower(), _directionResource.GetUrl()); + + // With bearings + _directionResource.Bearings = new BearingFilter[] { new BearingFilter(90, 45), new BearingFilter(90, 30) }; + Assert.AreEqual("https://api.mapbox.com/directions/v5/mapbox/driving/10.00000,10.00000;20.00000,20.00000.json?alternatives=false&bearings=90%2C45%3B90%2C30".ToLower(), _directionResource.GetUrl().ToLower()); + + // Bearings are nullable + _directionResource.Bearings = new BearingFilter[] { new BearingFilter(90, 45), new BearingFilter(null, null) }; + Assert.AreEqual("https://api.mapbox.com/directions/v5/mapbox/driving/10.00000,10.00000;20.00000,20.00000.json?alternatives=false&bearings=90%2C45%3B".ToLower(), _directionResource.GetUrl().ToLower()); + + // With continue straight + _directionResource.ContinueStraight = false; + Assert.AreEqual("https://api.mapbox.com/directions/v5/mapbox/driving/10.00000,10.00000;20.00000,20.00000.json?alternatives=false&bearings=90%2C45%3B&continue_straight=false".ToLower(), _directionResource.GetUrl().ToLower()); + + // With overview + _directionResource.Overview = Directions.Overview.Full; + Assert.AreEqual("https://api.mapbox.com/directions/v5/mapbox/driving/10.00000,10.00000;20.00000,20.00000.json?alternatives=false&bearings=90%2C45%3B&continue_straight=false&overview=full".ToLower(), _directionResource.GetUrl().ToLower()); + + // With steps + _directionResource.Radiuses = new double[] { 30, 30 }; + Assert.AreEqual("https://api.mapbox.com/directions/v5/mapbox/driving/10.00000,10.00000;20.00000,20.00000.json?alternatives=false&bearings=90%2C45%3B&continue_straight=false&overview=full&radiuses=30%2C30".ToLower(), _directionResource.GetUrl().ToLower()); + + // With steps + _directionResource.Steps = false; + Assert.AreEqual("https://api.mapbox.com/directions/v5/mapbox/driving/10.00000,10.00000;20.00000,20.00000.json?alternatives=false&bearings=90%2C45%3B&continue_straight=false&overview=full&radiuses=30%2C30&steps=false".ToLower(), _directionResource.GetUrl().ToLower()); + + // Set all to null + _directionResource.Alternatives = null; + _directionResource.Bearings = null; + _directionResource.ContinueStraight = null; + _directionResource.Overview = null; + _directionResource.Radiuses = null; + _directionResource.Steps = null; + Assert.AreEqual("https://api.mapbox.com/directions/v5/mapbox/driving/10.00000,10.00000;20.00000,20.00000.json", _directionResource.GetUrl()); + } + } +} \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_DirectionResource.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_DirectionResource.cs.meta new file mode 100644 index 0000000..a766af7 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_DirectionResource.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 345f6d8ee2d3743779572d1c3701f2fd +timeCreated: 1498231546 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Directions.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Directions.cs new file mode 100644 index 0000000..8657868 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Directions.cs @@ -0,0 +1,63 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + using Mapbox.Directions; + using Mapbox.Json; + using Mapbox.Platform; + using NUnit; + using NUnit.Framework; + using UnityEngine; + + + /// + /// Test that Directions serializes and deserializes responses correctly. + /// + [TestFixture] + internal class DirectionsTest + { + + private string _basicResponse = "{\"routes\":[{\"legs\":[{\"steps\":[],\"summary\":\"\",\"duration\":214.4,\"distance\":1318.2,\"annotation\":null}],\"geometry\":\"_urwFt}qbMuLp_@jWzPoHhRMK\",\"duration\":214.4,\"distance\":1318.2,\"weight\":0.0,\"weight_name\":null}],\"waypoints\":[{\"name\":\"East 13th Street\",\"location\":[-73.988909,40.733122]},{\"name\":\"6th Avenue\",\"location\":[-74.00001,40.733004]}],\"code\":\"Ok\"}"; + private string _responseWithSteps = "{\"routes\":[{\"legs\":[{\"steps\":[{\"intersections\":[{\"out\":0,\"entry\":[true],\"bearings\":[299],\"location\":[-73.988909,40.733122]},{\"out\":3,\"entry\":[true,false,false,true],\"bearings\":[15,120,195,300],\"location\":[-73.989868,40.733528],\"in\":1},{\"out\":3,\"entry\":[false,false,true,true],\"bearings\":[15,120,195,300],\"location\":[-73.990945,40.733978],\"in\":1},{\"out\":3,\"entry\":[true,false,false,true],\"bearings\":[30,120,210,300],\"location\":[-73.992266,40.734532],\"in\":1}],\"geometry\":\"_urwFt}qbMqA~DyAvEmBfG{CpJ\",\"maneuver\":{\"bearing_after\":299,\"type\":\"depart\",\"modifier\":\"left\",\"bearing_before\":0,\"Location\":[40.733122,-73.988909],\"instruction\":\"Head northwest on East 13th Street\"},\"duration\":90.5,\"distance\":502.1,\"name\":\"East 13th Street\",\"mode\":\"driving\"},{\"intersections\":[{\"out\":2,\"entry\":[false,false,true,true],\"bearings\":[30,120,210,300],\"location\":[-73.994118,40.735313],\"in\":1},{\"out\":2,\"entry\":[false,true,true,false],\"bearings\":[30,120,210,300],\"location\":[-73.994585,40.734672],\"in\":0},{\"out\":2,\"entry\":[false,false,true,true],\"bearings\":[30,120,210,300],\"location\":[-73.99505,40.734034],\"in\":0},{\"out\":2,\"entry\":[false,true,true,false],\"bearings\":[30,120,210,300],\"location\":[-73.995489,40.733437],\"in\":0},{\"out\":2,\"entry\":[false,false,true,true],\"bearings\":[30,120,210,300],\"location\":[-73.995914,40.732847],\"in\":0},{\"out\":2,\"entry\":[false,true,true,false],\"bearings\":[30,120,210,300],\"location\":[-73.996351,40.732255],\"in\":0}],\"geometry\":\"ubswFf~rbM~B|A~BzAtBvAtBrAtBvAh@Vd@`@lAx@JH\",\"maneuver\":{\"bearing_after\":209,\"type\":\"turn\",\"modifier\":\"left\",\"bearing_before\":299,\"Location\":[40.735313,-73.994118],\"instruction\":\"Turn left onto 5th Avenue\"},\"duration\":67.8,\"distance\":496.3,\"name\":\"5th Avenue\",\"mode\":\"driving\"},{\"intersections\":[{\"out\":2,\"entry\":[false,true,true],\"bearings\":[30,120,300],\"location\":[-73.996976,40.731414],\"in\":0}],\"geometry\":\"ijrwFbpsbMKPoChHEH\",\"maneuver\":{\"bearing_after\":305,\"type\":\"end of road\",\"modifier\":\"right\",\"bearing_before\":212,\"Location\":[40.731414,-73.996976],\"instruction\":\"Turn right onto Washington Square North\"},\"duration\":21.0,\"distance\":164.2,\"name\":\"Washington Square North\",\"mode\":\"driving\"},{\"intersections\":[{\"out\":3,\"entry\":[false,false,true,true],\"bearings\":[30,120,210,300],\"location\":[-73.998612,40.732215],\"in\":1}],\"geometry\":\"korwFhzsbMmCbH\",\"maneuver\":{\"bearing_after\":303,\"type\":\"new name\",\"modifier\":\"straight\",\"bearing_before\":303,\"Location\":[40.732215,-73.998612],\"instruction\":\"Continue straight onto Waverly Place\"},\"duration\":34.5,\"distance\":146.0,\"name\":\"Waverly Place\",\"mode\":\"driving\"},{\"intersections\":[{\"out\":0,\"entry\":[true,false,false,true],\"bearings\":[30,120,210,300],\"location\":[-74.000066,40.732929],\"in\":1}],\"geometry\":\"ysrwFlctbMMK\",\"maneuver\":{\"bearing_after\":30,\"type\":\"turn\",\"modifier\":\"right\",\"bearing_before\":303,\"Location\":[40.732929,-74.000066],\"instruction\":\"Turn right onto 6th Avenue\"},\"duration\":0.6,\"distance\":9.6,\"name\":\"6th Avenue\",\"mode\":\"driving\"},{\"intersections\":[{\"out\":0,\"entry\":[true],\"bearings\":[210],\"location\":[-74.00001,40.733004],\"in\":0}],\"geometry\":\"gtrwF`ctbM\",\"maneuver\":{\"bearing_after\":0,\"type\":\"arrive\",\"modifier\":null,\"bearing_before\":30,\"Location\":[40.732929,-74.000066],\"instruction\":\"You have arrived at your destination\"},\"duration\":0.0,\"distance\":0.0,\"name\":\"6th Avenue\",\"mode\":\"driving\"}],\"summary\":\"East 13th Street, 5th Avenue\",\"duration\":214.4,\"distance\":1318.2,\"annotation\":null}],\"geometry\":\"_urwFt}qbMuLp_@jWzPoHhRMK\",\"duration\":214.4,\"distance\":1318.2,\"weight\":0.0,\"weight_name\":null}],\"waypoints\":[{\"name\":\"East 13th Street\",\"location\":[-73.988909,40.733122]},{\"name\":\"6th Avenue\",\"location\":[-74.00001,40.733004]}],\"code\":\"Ok\"}"; + private Directions _directions = new Directions(new FileSource(Unity.MapboxAccess.Instance.Configuration.GetMapsSkuToken, Unity.MapboxAccess.Instance.Configuration.AccessToken)); + + + + [Test] + public void SerializesAndDeserializesBasic() + { + // First, deserialize the example response + DirectionsResponse basicResp = _directions.Deserialize(_basicResponse); + + // Then deserialize it back to a string. + string basicReserialized = _directions.Serialize(basicResp); + + // Ensure the two match + Assert.AreEqual(_basicResponse, basicReserialized); + } + + + //TODO: implement a proper Json object comaparer + /// This test will fail, see https://github.com/mapbox/mapbox-sdk-unity/issues/51. + [Test] + public void SerializesAndDeserializesWithSteps() + { + // First, deserialize the example response. + DirectionsResponse withStepsResp = _directions.Deserialize(_responseWithSteps); + + // Then deserialize it back to a string. + string withStepsReserialized = _directions.Serialize(withStepsResp); + + // Ensure the two match. + Assert.AreEqual(_responseWithSteps, withStepsReserialized); + } + + + + } +} diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Directions.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Directions.cs.meta new file mode 100644 index 0000000..d4700be --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Directions.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 255dbd247672f4f0abf600a702d2def7 +timeCreated: 1498231546 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_FileSource.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_FileSource.cs new file mode 100644 index 0000000..269379a --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_FileSource.cs @@ -0,0 +1,250 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +// TODO: figure out how run tests outside of Unity with .NET framework, something like '#if !UNITY' +#if UNITY_5_6_OR_NEWER + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + + using Mapbox.Platform; + using NUnit.Framework; +#if UNITY_5_6_OR_NEWER + using UnityEngine.TestTools; + using System.Collections; +#endif + + + + [TestFixture] + internal class FileSourceTest + { + + private const string _url = "https://api.mapbox.com/geocoding/v5/mapbox.places/helsinki.json"; + private FileSource _fs; + private int _timeout = 10; + + + [SetUp] + public void SetUp() + { +#if UNITY_5_6_OR_NEWER + _fs = new FileSource(Unity.MapboxAccess.Instance.Configuration.GetMapsSkuToken, Unity.MapboxAccess.Instance.Configuration.AccessToken); + _timeout = Unity.MapboxAccess.Instance.Configuration.DefaultTimeout; +#else + // when run outside of Unity FileSource gets the access token from environment variable 'MAPBOX_ACCESS_TOKEN' + _fs = new FileSource(); +#endif + } + + + +#if !UNITY_5_6_OR_NEWER + [Test] + public void AccessTokenSet() + { + Assert.IsNotNull( + Environment.GetEnvironmentVariable("MAPBOX_ACCESS_TOKEN"), + "MAPBOX_ACCESS_TOKEN not set in the environment." + ); + } +#endif + + + +#if UNITY_5_6_OR_NEWER + [UnityTest] + public IEnumerator Request() +#else + [Test] + public void Request() +#endif + { + byte[] data = null; + _fs.Request( + _url, + (Response res) => + { + data = res.Data; + } + , _timeout + ); + +#if UNITY_5_6_OR_NEWER + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } +#else + _fs.WaitForAllRequests(); +#endif + Assert.IsNotNull(data, "No data received from the servers."); + } + + + +#if UNITY_5_6_OR_NEWER + [UnityTest] + public IEnumerator MultipleRequests() +#else + [Test] + public void Request() +#endif + { + int count = 0; + + _fs.Request(_url, (Response res) => ++count, _timeout); + _fs.Request(_url, (Response res) => ++count, _timeout); + _fs.Request(_url, (Response res) => ++count, _timeout); + +#if UNITY_5_6_OR_NEWER + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } +#else + _fs.WaitForAllRequests(); +#endif + + Assert.AreEqual(count, 3, "Should have received 3 replies."); + } + + + +#if UNITY_5_6_OR_NEWER + [UnityTest] +#if UNITY_ANDROID || UNITY_IOS + [Ignore("test ignored: Request.Cancel() does not work on some devices")] +#endif + public IEnumerator RequestCancel() +#else + [Test] + public void RequestCancel() +#endif + { + var request = _fs.Request( + //use "heavy" tile with 182KB that request doesn't finish before it is cancelled + "https://a.tiles.mapbox.com/v4/mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v7/10/545/361.vector.pbf", + (Response res) => + { + // HACK!! THIS IS BAAAD, investigate more! + // on *some* Android devices (eg Samsung S8 not on Pixel 2) and *some* iPhones + // HasError is false as the request finishes successfully before 'Cancel()' kicks in + // couldn't find the reason or a proper fix. + // maybe some OS internal caching? +#if UNITY_ANDROID || UNITY_IOS + UnityEngine.Debug.LogWarning("test 'RequestCancel' not run"); + return; +#endif + + Assert.IsTrue(res.HasError); + +#if UNITY_5_6_OR_NEWER + Assert.IsNotNull(res.Exceptions[0]); + Assert.AreEqual("Request aborted", res.Exceptions[0].Message); +#else + WebException wex = res.Exceptions[0] as WebException; + Assert.IsNotNull(wex); + Assert.AreEqual(wex.Status, WebExceptionStatus.RequestCanceled); +#endif + }, + _timeout + ); + + request.Cancel(); + +#if UNITY_5_6_OR_NEWER + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } +#else + _fs.WaitForAllRequests(); +#endif + } + + + +#if UNITY_5_6_OR_NEWER + [UnityTest] + public IEnumerator RequestDnsError() +#else + [Test] + public void RequestDnsError() +#endif + { + _fs.Request( + "https://dnserror.shouldnotwork", + (Response res) => + { + Assert.IsTrue(res.HasError); + // Attention: when using Fiddler to throttle requests message is "Failed to receive data" + Assert.IsTrue( + res.Exceptions[0].Message.Contains("destination host") + , string.Format("Exception message [{0}] does not contain 'destination host'", res.Exceptions[0].Message) + ); + }, + _timeout + ); + +#if UNITY_5_6_OR_NEWER + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } +#else + _fs.WaitForAllRequests(); +#endif + } + + + +#if UNITY_5_6_OR_NEWER + [UnityTest] + public IEnumerator RequestForbidden() +#else + [Test] + public void RequestForbidden() +#endif + { + // Mapbox servers will return a forbidden when attempting + // to access a page outside the API space with a token + // on the query. Let's hope the behaviour stay like this. + _fs.Request( + "https://mapbox.com/forbidden", + (Response res) => + { + Assert.IsTrue(res.HasError); + Assert.AreEqual(403, res.StatusCode); + }, + _timeout + ); + +#if UNITY_5_6_OR_NEWER + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } +#else + _fs.WaitForAllRequests(); +#endif + } + + + +#if UNITY_5_6_OR_NEWER + [UnityTest] + public IEnumerator WaitWithNoRequests() +#else + [Test] + public void WaitWithNoRequests() +#endif + { + // This should simply not block. +#if UNITY_5_6_OR_NEWER + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } +#else + _fs.WaitForAllRequests(); +#endif + } + + + } +} + +#endif diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_FileSource.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_FileSource.cs.meta new file mode 100644 index 0000000..b5dfbe6 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_FileSource.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ec486731809ff42cf82d08418a7c179a +timeCreated: 1498231547 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_ForwardGeocodeResource.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_ForwardGeocodeResource.cs new file mode 100644 index 0000000..9b21419 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_ForwardGeocodeResource.cs @@ -0,0 +1,150 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + using System; + using Mapbox.Utils; + using NUnit.Framework; + + + [TestFixture] + internal class ForwardGeocodeResourceTest + { + private const string _query = "Minneapolis, MN"; + private Geocoding.ForwardGeocodeResource _forwardGeocodeResource; + + [SetUp] + public void SetUp() + { + _forwardGeocodeResource = new Geocoding.ForwardGeocodeResource(_query); + } + + public void BadType() + { + _forwardGeocodeResource.Types = new string[] { "fake" }; + } + + public void BadTypeWithGoodType() + { + _forwardGeocodeResource.Types = new string[] { "place", "fake" }; + } + + public void BadCountry() + { + _forwardGeocodeResource.Types = new string[] { "zz" }; + } + + public void BadCountryWithGoodType() + { + _forwardGeocodeResource.Types = new string[] { "zz", "ar" }; + } + + [Test] + public void SetInvalidTypes() + { + Assert.Throws(BadType); + Assert.Throws(BadTypeWithGoodType); + } + + [Test] + public void SetInvalidCountries() + { + Assert.Throws(BadCountry); + Assert.Throws(BadCountryWithGoodType); + } + + [Test] + public void GetUrl() + { + // With only constructor + // TODO: find proper fix for encoded url parameters crashing on some iPhones +#if UNITY_IOS + UnityEngine.Debug.LogWarning("ForwardGeocodeResourceTest.GetUrl() TODO: find proper fix for encoded url parameters crashing on some iPhones"); + Assert.AreEqual("https://api.mapbox.com/geocoding/v5/mapbox.places/Minneapolis++MN.json", _forwardGeocodeResource.GetUrl()); +#else + Assert.AreEqual("https://api.mapbox.com/geocoding/v5/mapbox.places/Minneapolis%2C%20MN.json", _forwardGeocodeResource.GetUrl()); +#endif + + + // With autocomplete + _forwardGeocodeResource.Autocomplete = false; +#if UNITY_IOS + Assert.AreEqual("https://api.mapbox.com/geocoding/v5/mapbox.places/Minneapolis++MN.json?autocomplete=false", _forwardGeocodeResource.GetUrl()); +#else + Assert.AreEqual("https://api.mapbox.com/geocoding/v5/mapbox.places/Minneapolis%2C%20MN.json?autocomplete=false", _forwardGeocodeResource.GetUrl()); +#endif + + + // With bbox + _forwardGeocodeResource.Bbox = new Vector2dBounds(new Vector2d(15, 10), new Vector2d(25, 20)); +#if UNITY_IOS + Assert.AreEqual("https://api.mapbox.com/geocoding/v5/mapbox.places/Minneapolis++MN.json?autocomplete=false&bbox=10.00000%2C15.00000%2C20.00000%2C25.00000".ToLower(), _forwardGeocodeResource.GetUrl().ToLower()); +#else + Assert.AreEqual("https://api.mapbox.com/geocoding/v5/mapbox.places/Minneapolis++MN.json?autocomplete=false&bbox=10.00000%2C15.00000%2C20.00000%2C25.00000", _forwardGeocodeResource.GetUrl()); +#endif + + + // With one country + _forwardGeocodeResource.Country = new string[] { "ar" }; +#if UNITY_IOS + Assert.AreEqual("https://api.mapbox.com/geocoding/v5/mapbox.places/Minneapolis++MN.json?autocomplete=false&bbox=10.00000%2C15.00000%2C20.00000%2C25.00000&country=ar".ToLower(), _forwardGeocodeResource.GetUrl().ToLower()); +#else + Assert.AreEqual("https://api.mapbox.com/geocoding/v5/mapbox.places/Minneapolis%2C%20MN.json?autocomplete=false&bbox=10.00000%2C15.00000%2C20.00000%2C25.00000&country=ar", _forwardGeocodeResource.GetUrl()); +#endif + + + // With multiple countries + _forwardGeocodeResource.Country = new string[] { "ar", "fi" }; +#if UNITY_IOS + Assert.AreEqual("https://api.mapbox.com/geocoding/v5/mapbox.places/Minneapolis++MN.json?autocomplete=false&bbox=10.00000%2C15.00000%2C20.00000%2C25.00000&country=ar%2Cfi".ToLower(), _forwardGeocodeResource.GetUrl().ToLower()); +#else + Assert.AreEqual("https://api.mapbox.com/geocoding/v5/mapbox.places/Minneapolis%2C%20MN.json?autocomplete=false&bbox=10.00000%2C15.00000%2C20.00000%2C25.00000&country=ar%2Cfi", _forwardGeocodeResource.GetUrl()); +#endif + + + // With proximity + _forwardGeocodeResource.Proximity = new Vector2d(10, 5); +#if UNITY_IOS + Assert.AreEqual("https://api.mapbox.com/geocoding/v5/mapbox.places/Minneapolis++MN.json?autocomplete=false&bbox=10.00000%2C15.00000%2C20.00000%2C25.00000&country=ar%2Cfi&proximity=5.00000%2C10.00000".ToLower(), _forwardGeocodeResource.GetUrl().ToLower()); +#else + Assert.AreEqual("https://api.mapbox.com/geocoding/v5/mapbox.places/Minneapolis%2C%20MN.json?autocomplete=false&bbox=10.00000%2C15.00000%2C20.00000%2C25.00000&country=ar%2Cfi&proximity=5.00000%2C10.00000", _forwardGeocodeResource.GetUrl()); +#endif + + + // With one types + _forwardGeocodeResource.Types = new string[] { "country" }; +#if UNITY_IOS + Assert.AreEqual("https://api.mapbox.com/geocoding/v5/mapbox.places/Minneapolis++MN.json?autocomplete=false&bbox=10.00000%2C15.00000%2C20.00000%2C25.00000&country=ar%2Cfi&proximity=5.00000%2C10.00000&types=country".ToLower(), _forwardGeocodeResource.GetUrl().ToLower()); +#else + Assert.AreEqual("https://api.mapbox.com/geocoding/v5/mapbox.places/Minneapolis%2C%20MN.json?autocomplete=false&bbox=10.00000%2C15.00000%2C20.00000%2C25.00000&country=ar%2Cfi&proximity=5.00000%2C10.00000&types=country", _forwardGeocodeResource.GetUrl()); +#endif + + + // With multiple types + _forwardGeocodeResource.Types = new string[] { "country", "region" }; +#if UNITY_IOS + Assert.AreEqual("https://api.mapbox.com/geocoding/v5/mapbox.places/Minneapolis++MN.json?autocomplete=false&bbox=10.00000%2C15.00000%2C20.00000%2C25.00000&country=ar%2Cfi&proximity=5.00000%2C10.00000&types=country%2Cregion".ToLower(), _forwardGeocodeResource.GetUrl().ToLower()); +#else + Assert.AreEqual("https://api.mapbox.com/geocoding/v5/mapbox.places/Minneapolis%2C%20MN.json?autocomplete=false&bbox=10.00000%2C15.00000%2C20.00000%2C25.00000&country=ar%2Cfi&proximity=5.00000%2C10.00000&types=country%2Cregion", _forwardGeocodeResource.GetUrl()); +#endif + + // Set all to null + _forwardGeocodeResource.Autocomplete = null; + _forwardGeocodeResource.Bbox = null; + _forwardGeocodeResource.Country = null; + _forwardGeocodeResource.Proximity = null; + _forwardGeocodeResource.Types = null; + +#if UNITY_IOS + Assert.AreEqual("https://api.mapbox.com/geocoding/v5/mapbox.places/Minneapolis++MN.json", _forwardGeocodeResource.GetUrl()); +#else + Assert.AreEqual("https://api.mapbox.com/geocoding/v5/mapbox.places/Minneapolis%2C%20MN.json", _forwardGeocodeResource.GetUrl()); +#endif + } + } +} diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_ForwardGeocodeResource.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_ForwardGeocodeResource.cs.meta new file mode 100644 index 0000000..2a746a2 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_ForwardGeocodeResource.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 91c78df7257b9401c83b93a8c8382016 +timeCreated: 1498231546 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_GeoCoordinate.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_GeoCoordinate.cs new file mode 100644 index 0000000..f1db2f3 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_GeoCoordinate.cs @@ -0,0 +1,41 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + using Mapbox.Utils; + using NUnit.Framework; + + + [TestFixture] + internal class Vector2dTest + { + + [SetUp] + public void SetUp() + { + } + + + [Test] + public void NullIsland() + { + var lngLat = new Vector2d(0, 0); + Assert.AreEqual("0.00000,0.00000", lngLat.ToString()); + } + + + [Test] + public void DC() + { + var lngLat = new Vector2d(38.9165, -77.0295); + Assert.AreEqual("-77.02950,38.91650", lngLat.ToString()); + } + + + } +} diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_GeoCoordinate.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_GeoCoordinate.cs.meta new file mode 100644 index 0000000..8207698 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_GeoCoordinate.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9ce0cc51863054b17aed4f4fdfb8a2d3 +timeCreated: 1498231546 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_GeoCoordinateBounds.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_GeoCoordinateBounds.cs new file mode 100644 index 0000000..8cee40e --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_GeoCoordinateBounds.cs @@ -0,0 +1,127 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + using Mapbox.Utils; + using NUnit.Framework; + + + [TestFixture] + internal class Vector2dBoundsTest + { + [SetUp] + public void SetUp() + { + } + + + [Test] + public void SmallBounds() + { + var a = new Vector2d(0, 0); + var b = new Vector2d(10, 10); + var bounds = new Vector2dBounds(a, b); + Assert.AreEqual("0.00000,0.00000,10.00000,10.00000", bounds.ToString()); + } + + + [Test] + public void Extend() + { + var bounds1 = new Vector2dBounds(new Vector2d(-10, -10), new Vector2d(10, 10)); + var bounds2 = new Vector2dBounds(new Vector2d(-20, -20), new Vector2d(20, 20)); + + bounds1.Extend(bounds2); + + Assert.AreEqual(bounds1.South, bounds2.South); + Assert.AreEqual(bounds1.West, bounds2.West); + Assert.AreEqual(bounds1.North, bounds2.North); + Assert.AreEqual(bounds1.East, bounds2.East); + } + + + [Test] + public void Hull() + { + var bounds1 = new Vector2dBounds(new Vector2d(-10, -10), new Vector2d(10, 10)); + var bounds2 = Vector2dBounds.FromCoordinates(new Vector2d(10, 10), new Vector2d(-10, -10)); + + Assert.AreEqual(bounds1.South, bounds2.South); + Assert.AreEqual(bounds1.West, bounds2.West); + Assert.AreEqual(bounds1.North, bounds2.North); + Assert.AreEqual(bounds1.East, bounds2.East); + } + + + [Test] + public void World() + { + var bounds = Vector2dBounds.World(); + + Assert.AreEqual(bounds.South, -90); + Assert.AreEqual(bounds.West, -180); + Assert.AreEqual(bounds.North, 90); + Assert.AreEqual(bounds.East, 180); + } + + + [Test] + public void CardinalLimits() + { + var bounds = new Vector2dBounds(new Vector2d(10, 20), new Vector2d(30, 40)); + + // SouthWest, first parameter. + Assert.AreEqual(bounds.South, 10); + Assert.AreEqual(bounds.West, 20); + + // NorthEast, second parameter. + Assert.AreEqual(bounds.North, 30); + Assert.AreEqual(bounds.East, 40); + } + + + [Test] + public void IsEmpty() + { + var bounds1 = new Vector2dBounds(new Vector2d(10, 10), new Vector2d(0, 0)); + Assert.IsTrue(bounds1.IsEmpty()); + + var bounds2 = new Vector2dBounds(new Vector2d(0, 0), new Vector2d(0, 0)); + Assert.IsFalse(bounds2.IsEmpty()); + + var bounds3 = new Vector2dBounds(new Vector2d(0, 0), new Vector2d(10, 10)); + Assert.IsFalse(bounds3.IsEmpty()); + } + + + [Test] + public void Center() + { + var bounds1 = new Vector2dBounds(new Vector2d(0, 0), new Vector2d(0, 0)); + Assert.AreEqual(bounds1.Center, new Vector2d(0, 0)); + + bounds1.Center = new Vector2d(10, 10); + Assert.AreEqual(new Vector2dBounds(new Vector2d(10, 10), new Vector2d(10, 10)), bounds1); + + var bounds2 = new Vector2dBounds(new Vector2d(-10, -10), new Vector2d(10, 10)); + Assert.AreEqual(bounds2.Center, new Vector2d(0, 0)); + + bounds2.Center = new Vector2d(10, 10); + Assert.AreEqual(new Vector2dBounds(new Vector2d(0, 0), new Vector2d(20, 20)), bounds2); + + var bounds3 = new Vector2dBounds(new Vector2d(0, 0), new Vector2d(20, 40)); + Assert.AreEqual(bounds3.Center, new Vector2d(10, 20)); + + bounds3.Center = new Vector2d(10, 10); + Assert.AreEqual(new Vector2dBounds(new Vector2d(0, -10), new Vector2d(20, 30)), bounds3); + } + + + + } +} diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_GeoCoordinateBounds.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_GeoCoordinateBounds.cs.meta new file mode 100644 index 0000000..f5238eb --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_GeoCoordinateBounds.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b162f01b49ed74739bf159c9e2f36097 +timeCreated: 1498231547 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Geocoder.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Geocoder.cs new file mode 100644 index 0000000..b867410 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Geocoder.cs @@ -0,0 +1,54 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + using Geocoding; + using Mapbox.Json; + using Mapbox.Platform; + using Mapbox.Unity; + using Mapbox.Utils.JsonConverters; + using NUnit.Framework; + + /// + /// Test that Geocoder serializes and deserializes responses correctly. + /// + [TestFixture] + internal class GeocoderTest + { + private readonly Geocoder _geocoder = new Geocoder(new FileSource(Unity.MapboxAccess.Instance.Configuration.GetMapsSkuToken, Unity.MapboxAccess.Instance.Configuration.AccessToken)); //MapboxAccess.Instance.Geocoder; + private string _forwardResponse = "{\"type\":\"FeatureCollection\",\"query\":[\"minneapolis\"],\"features\":[{\"id\":\"place.12871500125885940\",\"type\":\"Feature\",\"text\":\"Minneapolis\",\"place_name\":\"Minneapolis, Minnesota, United States\",\"relevance\":0.99,\"properties\":{\"wikidata\":\"Q36091\"},\"bbox\":[-93.5226520099878,44.7853029900244,-93.1424209928836,45.2129100099882],\"center\":[-93.2655,44.9773],\"geometry\":{\"type\":\"Point\",\"coordinates\":[-93.2655,44.9773]},\"context\":[{\"id\":\"postcode.11389548391063390\",\"text\":\"55415\"},{\"id\":\"region.12225983719702200\",\"text\":\"Minnesota\",\"short_code\":\"US-MN\",\"wikidata\":\"Q1527\"},{\"id\":\"country.12862386939497690\",\"text\":\"United States\",\"short_code\":\"us\",\"wikidata\":\"Q30\"}]},{\"id\":\"poi.15555644443768740\",\"type\":\"Feature\",\"text\":\"Minneapolis City Hall\",\"place_name\":\"Minneapolis City Hall, Minneapolis, Minnesota 55415, United States\",\"relevance\":0.99,\"properties\":{\"wikidata\":\"Q1384874\",\"landmark\":true,\"tel\":null,\"address\":null,\"category\":\"other\"},\"center\":[-93.265277777778,44.977222222222],\"geometry\":{\"type\":\"Point\",\"coordinates\":[-93.265277777778,44.977222222222]},\"context\":[{\"id\":\"neighborhood.13081559486410050\",\"text\":\"Greater Central\"},{\"id\":\"place.12871500125885940\",\"text\":\"Minneapolis\",\"wikidata\":\"Q36091\"},{\"id\":\"postcode.11389548391063390\",\"text\":\"55415\"},{\"id\":\"region.12225983719702200\",\"text\":\"Minnesota\",\"short_code\":\"US-MN\",\"wikidata\":\"Q1527\"},{\"id\":\"country.12862386939497690\",\"text\":\"United States\",\"short_code\":\"us\",\"wikidata\":\"Q30\"}]},{\"id\":\"poi.6527299549845510\",\"type\":\"Feature\",\"text\":\"Minneapolis Grain Exchange\",\"place_name\":\"Minneapolis Grain Exchange, Minneapolis, Minnesota 55415, United States\",\"relevance\":0.99,\"properties\":{\"wikidata\":\"Q1540984\",\"landmark\":true,\"tel\":null,\"address\":null,\"category\":\"other\"},\"center\":[-93.2636,44.9775],\"geometry\":{\"type\":\"Point\",\"coordinates\":[-93.2636,44.9775]},\"context\":[{\"id\":\"neighborhood.13081559486410050\",\"text\":\"Greater Central\"},{\"id\":\"place.12871500125885940\",\"text\":\"Minneapolis\",\"wikidata\":\"Q36091\"},{\"id\":\"postcode.11389548391063390\",\"text\":\"55415\"},{\"id\":\"region.12225983719702200\",\"text\":\"Minnesota\",\"short_code\":\"US-MN\",\"wikidata\":\"Q1527\"},{\"id\":\"country.12862386939497690\",\"text\":\"United States\",\"short_code\":\"us\",\"wikidata\":\"Q30\"}]},{\"id\":\"poi.12655750184890630\",\"type\":\"Feature\",\"text\":\"Minneapolis Armory\",\"place_name\":\"Minneapolis Armory, Minneapolis, Minnesota 55415, United States\",\"relevance\":0.99,\"properties\":{\"wikidata\":\"Q745327\",\"landmark\":true,\"tel\":null,\"address\":null,\"category\":\"other\"},\"center\":[-93.263278,44.975092],\"geometry\":{\"type\":\"Point\",\"coordinates\":[-93.263278,44.975092]},\"context\":[{\"id\":\"neighborhood.13081559486410050\",\"text\":\"Greater Central\"},{\"id\":\"place.12871500125885940\",\"text\":\"Minneapolis\",\"wikidata\":\"Q36091\"},{\"id\":\"postcode.11389548391063390\",\"text\":\"55415\"},{\"id\":\"region.12225983719702200\",\"text\":\"Minnesota\",\"short_code\":\"US-MN\",\"wikidata\":\"Q1527\"},{\"id\":\"country.12862386939497690\",\"text\":\"United States\",\"short_code\":\"us\",\"wikidata\":\"Q30\"}]},{\"id\":\"poi.4855757554573390\",\"type\":\"Feature\",\"text\":\"Minneapolis Chain of Lakes Park\",\"place_name\":\"Minneapolis Chain of Lakes Park, Minneapolis, Minnesota 55405, United States\",\"relevance\":0.99,\"properties\":{\"wikidata\":null,\"landmark\":true,\"tel\":null,\"address\":null,\"category\":\"park\",\"maki\":\"picnic-site\"},\"bbox\":[-93.330260720104,44.9504758437682,-93.3013567328453,44.969400319872],\"center\":[-93.310259,44.959942],\"geometry\":{\"type\":\"Point\",\"coordinates\":[-93.310259,44.959942]},\"context\":[{\"id\":\"neighborhood.12530456224376080\",\"text\":\"Kenwood\"},{\"id\":\"place.12871500125885940\",\"text\":\"Minneapolis\",\"wikidata\":\"Q36091\"},{\"id\":\"postcode.10829535691218220\",\"text\":\"55405\"},{\"id\":\"region.12225983719702200\",\"text\":\"Minnesota\",\"short_code\":\"US-MN\",\"wikidata\":\"Q1527\"},{\"id\":\"country.12862386939497690\",\"text\":\"United States\",\"short_code\":\"us\",\"wikidata\":\"Q30\"}]}],\"attribution\":\"NOTICE: \u00A9 2016 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service (https://www.mapbox.com/about/maps/). This response and the information it contains may not be retained.\"}"; + private string _reverseResponse = "{\"type\":\"FeatureCollection\",\"query\":[-77.0268808,38.925326999999996],\"features\":[{\"id\":\"address.5375777428110760\",\"type\":\"Feature\",\"text\":\"11th St NW\",\"place_name\":\"2717 11th St NW, Washington, District of Columbia 20001, United States\",\"relevance\":1.0,\"properties\":{},\"center\":[-77.026824,38.925306],\"geometry\":{\"type\":\"Point\",\"coordinates\":[-77.026824,38.925306]},\"address\":\"2717\",\"context\":[{\"id\":\"neighborhood.11736072639395000\",\"text\":\"Pleasant Plains\"},{\"id\":\"place.12334081418246050\",\"text\":\"Washington\",\"wikidata\":\"Q61\"},{\"id\":\"postcode.3526019892841050\",\"text\":\"20001\"},{\"id\":\"region.6884744206035790\",\"text\":\"District of Columbia\",\"short_code\":\"US-DC\",\"wikidata\":\"Q61\"},{\"id\":\"country.12862386939497690\",\"text\":\"United States\",\"wikidata\":\"Q30\",\"short_code\":\"us\"}]},{\"id\":\"neighborhood.11736072639395000\",\"type\":\"Feature\",\"text\":\"Pleasant Plains\",\"place_name\":\"Pleasant Plains, Washington, 20001, District of Columbia, United States\",\"relevance\":1.0,\"properties\":{},\"bbox\":[-77.0367101373528,38.9177500315001,-77.0251464843832,38.9273657639],\"center\":[-77.0303,38.9239],\"geometry\":{\"type\":\"Point\",\"coordinates\":[-77.0303,38.9239]},\"context\":[{\"id\":\"place.12334081418246050\",\"text\":\"Washington\",\"wikidata\":\"Q61\"},{\"id\":\"postcode.3526019892841050\",\"text\":\"20001\"},{\"id\":\"region.6884744206035790\",\"text\":\"District of Columbia\",\"short_code\":\"US-DC\",\"wikidata\":\"Q61\"},{\"id\":\"country.12862386939497690\",\"text\":\"United States\",\"wikidata\":\"Q30\",\"short_code\":\"us\"}]},{\"id\":\"place.12334081418246050\",\"type\":\"Feature\",\"text\":\"Washington\",\"place_name\":\"Washington, District of Columbia, United States\",\"relevance\":1.0,\"properties\":{\"wikidata\":\"Q61\"},\"bbox\":[-77.1197590084041,38.8031129900659,-76.90939299,38.9955480080759],\"center\":[-77.0366,38.895],\"geometry\":{\"type\":\"Point\",\"coordinates\":[-77.0366,38.895]},\"context\":[{\"id\":\"postcode.3526019892841050\",\"text\":\"20001\"},{\"id\":\"region.6884744206035790\",\"text\":\"District of Columbia\",\"short_code\":\"US-DC\",\"wikidata\":\"Q61\"},{\"id\":\"country.12862386939497690\",\"text\":\"United States\",\"wikidata\":\"Q30\",\"short_code\":\"us\"}]},{\"id\":\"postcode.3526019892841050\",\"type\":\"Feature\",\"text\":\"20001\",\"place_name\":\"20001, District of Columbia, United States\",\"relevance\":1.0,\"properties\":{},\"bbox\":[-77.028082,38.890834,-77.007177,38.929058],\"center\":[-77.018017,38.909197],\"geometry\":{\"type\":\"Point\",\"coordinates\":[-77.018017,38.909197]},\"context\":[{\"id\":\"region.6884744206035790\",\"text\":\"District of Columbia\",\"short_code\":\"US-DC\",\"wikidata\":\"Q61\"},{\"id\":\"country.12862386939497690\",\"text\":\"United States\",\"wikidata\":\"Q30\",\"short_code\":\"us\"}]},{\"id\":\"region.6884744206035790\",\"type\":\"Feature\",\"text\":\"District of Columbia\",\"place_name\":\"District of Columbia, United States\",\"relevance\":1.0,\"properties\":{\"short_code\":\"US-DC\",\"wikidata\":\"Q61\"},\"bbox\":[-77.2081379659453,38.7177026348658,-76.909393,38.995548],\"center\":[-76.990661,38.89657],\"geometry\":{\"type\":\"Point\",\"coordinates\":[-76.990661,38.89657]},\"context\":[{\"id\":\"country.12862386939497690\",\"text\":\"United States\",\"wikidata\":\"Q30\",\"short_code\":\"us\"}]},{\"id\":\"country.12862386939497690\",\"type\":\"Feature\",\"text\":\"United States\",\"place_name\":\"United States\",\"relevance\":1.0,\"properties\":{\"wikidata\":\"Q30\",\"short_code\":\"us\"},\"bbox\":[-179.330950579,18.765563302,179.959578044,71.540723637],\"center\":[-97.922211,39.381266],\"geometry\":{\"type\":\"Point\",\"coordinates\":[-97.922211,39.381266]}}],\"attribution\":\"NOTICE: © 2016 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service (https://www.mapbox.com/about/maps/). This response and the information it contains may not be retained.\"}"; + + [Test] + public void SerializesAndDeserializesReverse() + { + // First, deserialize the example response + ReverseGeocodeResponse reverseResp = _geocoder.Deserialize(_reverseResponse); + + // Then deserialize it back to a string. + string reverseReserialized = JsonConvert.SerializeObject(reverseResp, JsonConverters.Converters); + + // Ensure the two match + Assert.AreEqual(_reverseResponse, reverseReserialized); + } + + + [Test] + public void SerializesAndDeserializesForward() + { + // First, deserialize the example response + ForwardGeocodeResponse forwardResp = _geocoder.Deserialize(_forwardResponse); + + // Then deserialize it back to a string. + string forwardReserialized = JsonConvert.SerializeObject(forwardResp, JsonConverters.Converters); + + // Ensure the two match + Assert.AreEqual(_forwardResponse, forwardReserialized); + } + } +} diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Geocoder.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Geocoder.cs.meta new file mode 100644 index 0000000..577d558 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Geocoder.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e32c94248ffc8435ea3385aa22e5b67e +timeCreated: 1498231547 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_LonLatToGeoCoordinateConverter.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_LonLatToGeoCoordinateConverter.cs new file mode 100644 index 0000000..ee7b884 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_LonLatToGeoCoordinateConverter.cs @@ -0,0 +1,44 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + using Mapbox.Json; + using Mapbox.Utils; + using Mapbox.Utils.JsonConverters; + using NUnit.Framework; + + + [TestFixture] + internal class LonLatToVector2dConverterTest + { + + // Mapbox API returns longitude,latitude + private string _lonLatStr = "[-77.0295,38.9165]"; + + // In Unity, x = latitude, y = longitude + private Vector2d _latLonObject = new Vector2d(y: -77.0295, x: 38.9165); + + + [Test] + public void Deserialize() + { + Vector2d deserializedLonLat = JsonConvert.DeserializeObject(_lonLatStr, JsonConverters.Converters); + Assert.AreEqual(_latLonObject.ToString(), deserializedLonLat.ToString()); + } + + + [Test] + public void Serialize() + { + string serializedLonLat = JsonConvert.SerializeObject(_latLonObject, JsonConverters.Converters); + Assert.AreEqual(_lonLatStr, serializedLonLat); + } + + + } +} diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_LonLatToGeoCoordinateConverter.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_LonLatToGeoCoordinateConverter.cs.meta new file mode 100644 index 0000000..06946b1 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_LonLatToGeoCoordinateConverter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 40c0342b3b48a4e0c86d1dab20a71c57 +timeCreated: 1498231546 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Map.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Map.cs new file mode 100644 index 0000000..bac11ef --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Map.cs @@ -0,0 +1,212 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +// TODO: figure out how run tests outside of Unity with .NET framework, something like '#if !UNITY' +#if UNITY_5_6_OR_NEWER + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + using Mapbox.Map; + using Mapbox.Platform; + using Mapbox.Utils; + using NUnit.Framework; +#if UNITY_5_6_OR_NEWER + using System.Collections; + using UnityEngine.TestTools; +#endif + + + [TestFixture] + internal class MapTest + { + + private FileSource _fs; + + + [SetUp] + public void SetUp() + { +#if UNITY_5_6_OR_NEWER + _fs = new FileSource(Unity.MapboxAccess.Instance.Configuration.GetMapsSkuToken, Unity.MapboxAccess.Instance.Configuration.AccessToken); +#else + // when run outside of Unity FileSource gets the access token from environment variable 'MAPBOX_ACCESS_TOKEN' + _fs = new FileSource(); +#endif + } + + + +#if UNITY_5_6_OR_NEWER + [UnityTest] + public IEnumerator World() +#else + [Test] + public void World() +#endif + { + var map = new Map(_fs); + + map.Vector2dBounds = Vector2dBounds.World(); + map.Zoom = 3; + + var mapObserver = new Utils.VectorMapObserver(); + map.Subscribe(mapObserver); + map.Update(); + +#if UNITY_5_6_OR_NEWER + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } +#else + _fs.WaitForAllRequests(); +#endif + + Assert.AreEqual(64, mapObserver.Tiles.Count); + + map.Unsubscribe(mapObserver); + } + + + +#if UNITY_5_6_OR_NEWER + [UnityTest] + public IEnumerator RasterHelsinki() +#else + [Test] + public void RasterHelsinki() +#endif + { + var map = new Map(_fs); + + map.Center = new Vector2d(60.163200, 24.937700); + map.Zoom = 13; + + var mapObserver = new Utils.RasterMapObserver(); + map.Subscribe(mapObserver); + map.Update(); + +#if UNITY_5_6_OR_NEWER + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } +#else + _fs.WaitForAllRequests(); +#endif + + Assert.AreEqual(1, mapObserver.Tiles.Count); + Assert.IsNotNull(mapObserver.Tiles[0]); + + map.Unsubscribe(mapObserver); + } + + + +#if UNITY_5_6_OR_NEWER + [UnityTest] + public IEnumerator ChangeTilesetId() +#else + [Test] + public void ChangeTilesetId() +#endif + { + var map = new Map(_fs); + + var mapObserver = new Utils.ClassicRasterMapObserver(); + map.Subscribe(mapObserver); + + map.Center = new Vector2d(60.163200, 24.937700); + map.Zoom = 13; + map.TilesetId = "invalid"; + map.Update(); + +#if UNITY_5_6_OR_NEWER + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } +#else + _fs.WaitForAllRequests(); +#endif + + Assert.AreEqual(0, mapObserver.Tiles.Count); + + map.TilesetId = "mapbox.terrain-rgb"; + map.Update(); + +#if UNITY_5_6_OR_NEWER + enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } +#else + _fs.WaitForAllRequests(); +#endif + + Assert.AreEqual(1, mapObserver.Tiles.Count); + + map.TilesetId = null; // Use default tileset ID. + map.Update(); + +#if UNITY_5_6_OR_NEWER + enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } +#else + _fs.WaitForAllRequests(); +#endif + + Assert.AreEqual(2, mapObserver.Tiles.Count); + + // Should have fetched tiles from different tileset IDs. + Assert.AreNotEqual(mapObserver.Tiles[0], mapObserver.Tiles[1]); + + map.Unsubscribe(mapObserver); + } + + + + [Test] + public void SetVector2dBoundsZoom() + { + var map1 = new Map(_fs); + var map2 = new Map(_fs); + + map1.Zoom = 3; + map1.Vector2dBounds = Vector2dBounds.World(); + + map2.SetVector2dBoundsZoom(Vector2dBounds.World(), 3); + + Assert.AreEqual(map1.Tiles.Count, map2.Tiles.Count); + } + + + + [Test] + public void TileMax() + { + var map = new Map(_fs); + + map.SetVector2dBoundsZoom(Vector2dBounds.World(), 2); + map.Update(); + Assert.Less(map.Tiles.Count, Map.TileMax); + + // Should stay the same, ignore requests. + map.SetVector2dBoundsZoom(Vector2dBounds.World(), 5); + map.Update(); + Assert.AreEqual(16, map.Tiles.Count); + } + + + + [Test] + public void Zoom() + { + var map = new Map(_fs); + + map.Zoom = 50; + Assert.AreEqual(20, map.Zoom); + + map.Zoom = -50; + Assert.AreEqual(0, map.Zoom); + } + } +} + +#endif diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Map.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Map.cs.meta new file mode 100644 index 0000000..a1d0d54 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Map.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 02c5791defbcf4d1ebf04166ef29344b +timeCreated: 1498231546 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_MapMatcher.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_MapMatcher.cs new file mode 100644 index 0000000..def9f23 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_MapMatcher.cs @@ -0,0 +1,693 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2017 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + + +// TODO: figure out how run tests outside of Unity with .NET framework, something like '#if !UNITY' +#if UNITY_5_6_OR_NEWER + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + + using Mapbox.Platform; + using NUnit.Framework; + using UnityEngine.TestTools; + using System.Collections; + using System.Collections.Generic; + using Mapbox.MapMatching; + using Mapbox.Utils; + + + + [TestFixture] + internal class MapMatcherTest + { + + private const string _url = "https://api.mapbox.com/matching/v5/mapbox/driving/-117.1728265285492,32.71204416018209;-117.17288821935652,32.712258556224;-117.17293113470076,32.712443613445814;-117.17292040586472,32.71256999376694;-117.17298477888109,32.712603845608285;-117.17314302921294,32.71259933203019;-117.17334151268004,32.71254065549407"; + private FileSource _fs; + private int _timeout = 10; + + + [SetUp] + public void SetUp() + { + _fs = new FileSource(Unity.MapboxAccess.Instance.Configuration.GetMapsSkuToken, Unity.MapboxAccess.Instance.Configuration.AccessToken); + _timeout = Unity.MapboxAccess.Instance.Configuration.DefaultTimeout; + } + + + + + [UnityTest] + public IEnumerator AsSimpleAsPossible() + { + + MapMatchingResource resource = new MapMatchingResource(); + resource.Coordinates = new Vector2d[] + { + new Vector2d(32.71204416018209,-117.1728265285492), + new Vector2d(32.712258556224,-117.17288821935652), + new Vector2d(32.712443613445814,-117.17293113470076), + new Vector2d(32.71256999376694,-117.17292040586472), + new Vector2d(32.712603845608285,-117.17298477888109), + new Vector2d(32.71259933203019,-117.17314302921294), + new Vector2d(32.71254065549407,-117.17334151268004), + }; + + MapMatcher mapMatcher = new MapMatcher(_fs, _timeout); + MapMatchingResponse matchingResponse = null; + mapMatcher.Match( + resource, + (MapMatchingResponse response) => + { + matchingResponse = response; + } + ); + + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + + commonBasicResponseAsserts(matchingResponse); + + Assert.AreEqual(7, matchingResponse.Tracepoints.Length, "Wrong number of tracepoints"); + Assert.AreEqual(3, matchingResponse.Tracepoints[3].WaypointIndex, "Wrong WaypointIndex"); + + Assert.AreEqual(1, matchingResponse.Matchings.Length, "Wrong number of matchings"); + Assert.That(matchingResponse.Matchings[0].Weight > 0 && matchingResponse.Matchings[0].Weight < 100, "Wrong Weight: {0}", matchingResponse.Matchings[0].Weight); + Assert.AreEqual("routability", matchingResponse.Matchings[0].WeightName, "Wrong WeightName"); + Assert.AreEqual(6, matchingResponse.Matchings[0].Legs.Count, "Wrong number of legs"); + Assert.AreEqual(8, matchingResponse.Matchings[0].Geometry.Count, "Wrong number of vertices in geometry"); + } + + + [UnityTest] + public IEnumerator Profiles() + { + //walking + IEnumerator enumerator = profile(Profile.MapboxWalking); + MapMatchingResponse matchingResponse = null; + while (enumerator.MoveNext()) + { + matchingResponse = enumerator.Current; + yield return null; + } + + Assert.GreaterOrEqual(matchingResponse.Matchings[0].Duration, 300, "'mapbox/walking' duration [{0}] less than expected", matchingResponse.Matchings[0].Duration); + + //cycling + enumerator = profile(Profile.MapboxCycling); + matchingResponse = null; + while (enumerator.MoveNext()) + { + matchingResponse = enumerator.Current; + yield return null; + } + Assert.GreaterOrEqual(matchingResponse.Matchings[0].Duration, 100, "'mapbox/cycling' duration less than expected"); + + //driving traffic + enumerator = profile(Profile.MapboxDrivingTraffic); + matchingResponse = null; + while (enumerator.MoveNext()) + { + matchingResponse = enumerator.Current; + yield return null; + } + Assert.GreaterOrEqual(matchingResponse.Matchings[0].Duration, 100, "'driving-traffic' duration less than expected"); + + //driving + enumerator = profile(Profile.MapboxDriving); + matchingResponse = null; + while (enumerator.MoveNext()) + { + matchingResponse = enumerator.Current; + yield return null; + } + Assert.GreaterOrEqual(matchingResponse.Matchings[0].Duration, 100, "'driving' duration less than expected"); + } + + + private IEnumerator profile(Profile profile) + { + MapMatchingResource resource = new MapMatchingResource(); + resource.Coordinates = new Vector2d[] + { + new Vector2d(48.27275388447381,16.34687304496765), + new Vector2d(48.271925526874405,16.344040632247925), + new Vector2d(48.27190410365491,16.343783140182495), + new Vector2d(48.27198265541583,16.343053579330444), + new Vector2d(48.27217546377159,16.342334747314453), + new Vector2d(48.27251823238551,16.341615915298462), + new Vector2d(48.27223259203358,16.3416588306427), + new Vector2d(48.27138280254541,16.34069323539734), + new Vector2d(48.27114714413402,16.34015679359436 ) + }; + resource.Profile = profile; + + MapMatcher mapMatcher = new MapMatcher(_fs, _timeout); + MapMatchingResponse matchingResponse = null; + mapMatcher.Match( + resource, + (MapMatchingResponse response) => + { + matchingResponse = response; + } + ); + + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + + commonBasicResponseAsserts(matchingResponse); + + yield return matchingResponse; + } + + + [UnityTest] + public IEnumerator NoSegment() + { + + MapMatchingResource resource = new MapMatchingResource(); + resource.Coordinates = new Vector2d[] + { + new Vector2d(48.28585,16.55267), + new Vector2d(48.28933,16.55211) + }; + + MapMatcher mapMatcher = new MapMatcher(_fs, _timeout); + MapMatchingResponse matchingResponse = null; + mapMatcher.Match( + resource, + (MapMatchingResponse response) => + { + matchingResponse = response; + } + ); + + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + + Assert.IsNotNull(matchingResponse, "Matching response is NULL"); + Assert.IsFalse(matchingResponse.HasRequestError, "Error during web request"); + Assert.AreEqual("NoSegment", matchingResponse.Code, "Matching code != 'NoSegment'"); + Assert.AreEqual("Could not find a matching segment for input coordinates", matchingResponse.Message, "Message not as expected"); + + Assert.IsNull(matchingResponse.Tracepoints, "Tracepoints are not NULL"); + + Assert.IsNotNull(matchingResponse.Matchings, "Matchings are NULL"); + Assert.AreEqual(0, matchingResponse.Matchings.Length, "Wrong number of matchings"); + } + + + + + [UnityTest] + public IEnumerator Radiuses() + { + + MapMatchingResource resource = new MapMatchingResource(); + resource.Coordinates = new Vector2d[] + { + new Vector2d(48.28585,16.55267), + new Vector2d(48.28933,16.55211) + }; + resource.Radiuses = new uint[] { 50, 50 }; + + MapMatcher mapMatcher = new MapMatcher(_fs, _timeout); + MapMatchingResponse matchingResponse = null; + mapMatcher.Match( + resource, + (MapMatchingResponse response) => + { + matchingResponse = response; + } + ); + + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + + commonBasicResponseAsserts(matchingResponse); + + Assert.AreEqual(2, matchingResponse.Tracepoints.Length, "Wrong number of tracepoints"); + Assert.AreEqual(1, matchingResponse.Tracepoints[1].WaypointIndex, "Wrong WaypointIndex"); + + Assert.AreEqual(1, matchingResponse.Matchings.Length, "Wrong number of matchings"); + Assert.GreaterOrEqual(matchingResponse.Matchings[0].Weight, 22.5, "Wrong Weight"); + Assert.AreEqual("routability", matchingResponse.Matchings[0].WeightName, "Wrong WeightName"); + Assert.AreEqual(1, matchingResponse.Matchings[0].Legs.Count, "Wrong number of legs"); + Assert.AreEqual(2, matchingResponse.Matchings[0].Geometry.Count, "Wrong number of vertices in geometry"); + } + + + + [UnityTest] + public IEnumerator AlternativesWithSteps() + { + + MapMatchingResource resource = new MapMatchingResource(); + resource.Coordinates = new Vector2d[] + { + new Vector2d(48.31331,16.49062), + new Vector2d(48.31638,16.49243) + }; + resource.Radiuses = new uint[] { 10, 30 }; + resource.Steps = true; + + MapMatcher mapMatcher = new MapMatcher(_fs, _timeout); + MapMatchingResponse matchingResponse = null; + mapMatcher.Match( + resource, + (MapMatchingResponse response) => + { + matchingResponse = response; + } + ); + + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + + commonBasicResponseAsserts(matchingResponse); + + Assert.AreEqual(2, matchingResponse.Tracepoints.Length, "Wrong number of tracepoints"); + Assert.GreaterOrEqual(2, matchingResponse.Tracepoints[0].AlternativesCount, "Wrong 'AlternativesCount' for Tracepoint[0]"); + Assert.GreaterOrEqual(19, matchingResponse.Tracepoints[1].AlternativesCount, "Wrong 'AlternativesCount' for Tracepoint[1]"); + + Assert.IsNotNull(matchingResponse.Matchings[0].Legs[0].Steps, "Steps are NULL"); + Assert.AreEqual(2, matchingResponse.Matchings[0].Legs[0].Steps.Count, "Wrong number of steps"); + Assert.IsNotNull(matchingResponse.Matchings[0].Legs[0].Steps[0].Intersections, "Intersections are NULL"); + Assert.AreEqual(3, matchingResponse.Matchings[0].Legs[0].Steps[0].Intersections.Count, "Wrong number of intersections"); + } + + + [UnityTest] + public IEnumerator OverviewSimplified() + { + MapMatchingResource resource = new MapMatchingResource(); + resource.Coordinates = new Vector2d[] + { + new Vector2d(48.28514194095631,16.32358074188232), + new Vector2d(48.28528472524657,16.324278116226196), + new Vector2d(48.28502771323672,16.325350999832153), + new Vector2d(48.284999156266906,16.326016187667847), + new Vector2d(48.284870649705155,16.326134204864502), + new Vector2d(48.28467074996644,16.32594108581543), + new Vector2d(48.28467074996644,16.325050592422485), + new Vector2d(48.28459935701301,16.324610710144043) + + }; + resource.Overview = Overview.Simplified; + + MapMatcher mapMatcher = new MapMatcher(_fs, _timeout); + MapMatchingResponse matchingResponse = null; + mapMatcher.Match( + resource, + (MapMatchingResponse response) => + { + matchingResponse = response; + } + ); + + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + + commonBasicResponseAsserts(matchingResponse); + + Assert.GreaterOrEqual(matchingResponse.Matchings[0].Geometry.Count, 14, "Wrong number of vertices in match geometry"); + } + + + [UnityTest] + public IEnumerator OverviewFull() + { + MapMatchingResource resource = new MapMatchingResource(); + resource.Coordinates = new Vector2d[] + { + new Vector2d(48.28514194095631,16.32358074188232), + new Vector2d(48.28528472524657,16.324278116226196), + new Vector2d(48.28502771323672,16.325350999832153), + new Vector2d(48.284999156266906,16.326016187667847), + new Vector2d(48.284870649705155,16.326134204864502), + new Vector2d(48.28467074996644,16.32594108581543), + new Vector2d(48.28467074996644,16.325050592422485), + new Vector2d(48.28459935701301,16.324610710144043) + + }; + resource.Overview = Overview.Full; + + MapMatcher mapMatcher = new MapMatcher(_fs, _timeout); + MapMatchingResponse matchingResponse = null; + mapMatcher.Match( + resource, + (MapMatchingResponse response) => + { + matchingResponse = response; + } + ); + + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + + commonBasicResponseAsserts(matchingResponse); + + Assert.GreaterOrEqual(matchingResponse.Matchings[0].Geometry.Count, 20, "Wrong number of vertices in match geometry"); + } + + + [UnityTest] + public IEnumerator Timestamps() + { + + MapMatchingResource resource = new MapMatchingResource(); + resource.Coordinates = new Vector2d[] + { + new Vector2d(48.1974721043879,16.36202484369278), + new Vector2d(48.197922645046546,16.36285901069641) + }; + resource.Timestamps = new long[] + { + 946684800, + 946684980 + }; + + MapMatcher mapMatcher = new MapMatcher(_fs, _timeout); + MapMatchingResponse matchingResponse = null; + mapMatcher.Match( + resource, + (MapMatchingResponse response) => + { + matchingResponse = response; + } + ); + + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + + commonBasicResponseAsserts(matchingResponse); + } + + + [UnityTest] + public IEnumerator Annotation() + { + + MapMatchingResource resource = new MapMatchingResource(); + resource.Coordinates = new Vector2d[] + { + new Vector2d(48.1974721043879,16.36202484369278), + new Vector2d(48.197922645046546,16.36285901069641) + }; + //need to pass 'Overview.Full' to get 'Congestion' + resource.Overview = Overview.Full; + resource.Annotations = Annotations.Distance | Annotations.Duration | Annotations.Speed | Annotations.Congestion; + + MapMatcher mapMatcher = new MapMatcher(_fs, _timeout); + MapMatchingResponse matchingResponse = null; + mapMatcher.Match( + resource, + (MapMatchingResponse response) => + { + matchingResponse = response; + } + ); + + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + + commonBasicResponseAsserts(matchingResponse); + + Directions.Leg leg = matchingResponse.Matchings[0].Legs[0]; + Assert.IsNotNull(leg.Annotation, "Annotation is NULL"); + Assert.IsNotNull(leg.Annotation.Distance, "Distance is NULL"); + Assert.IsNotNull(leg.Annotation.Duration, "Duration is NULL"); + Assert.IsNotNull(leg.Annotation.Speed, "Speed is NULL"); + Assert.IsNotNull(leg.Annotation.Congestion, "Congestion is NULL"); + + Assert.GreaterOrEqual(leg.Annotation.Distance[1], 42, "Annotation has wrong distnce"); + } + + + [UnityTest] + public IEnumerator Tidy() + { + + MapMatchingResource resource = new MapMatchingResource(); + resource.Coordinates = new Vector2d[] + { + new Vector2d(48.187092481625704,16.312205493450165), + new Vector2d(48.187083540475875,16.312505900859833), + new Vector2d(48.18709426985548,16.312503218650818), + new Vector2d(48.18707281109407,16.312503218650818), + new Vector2d(48.18709605808517,16.312524676322937), + new Vector2d(48.18707817578527,16.312530040740967), + new Vector2d(48.1870656581716,16.312524676322937), + new Vector2d(48.187079964015524,16.312484443187714), + new Vector2d(48.18704598762968,16.312776803970337) + }; + resource.Tidy = true; + + MapMatcher mapMatcher = new MapMatcher(_fs, _timeout); + MapMatchingResponse matchingResponse = null; + mapMatcher.Match( + resource, + (MapMatchingResponse response) => + { + matchingResponse = response; + } + ); + + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + + commonBasicResponseAsserts(matchingResponse); + + Tracepoint[] tps = matchingResponse.Tracepoints; + //tracepoints removed by 'Tidy' are set to 'null' + Assert.IsNotNull(tps, "Tracepoints is NULL"); + Assert.IsNull(tps[6], "Tracepoints is NULL"); + Assert.IsNull(tps[7], "Tracepoints is NULL"); + } + + + + [UnityTest] + public IEnumerator LanguageEnglish() + { + + MapMatchingResource resource = new MapMatchingResource(); + resource.Coordinates = new Vector2d[] + { + new Vector2d(48.1974721043879,16.36202484369278), + new Vector2d(48.197922645046546,16.36285901069641) + }; + //set Steps to true to get turn-by-turn-instructions + resource.Steps = true; + //no language parameter needed: English is default + + MapMatcher mapMatcher = new MapMatcher(_fs, _timeout); + MapMatchingResponse matchingResponse = null; + mapMatcher.Match( + resource, + (MapMatchingResponse response) => + { + matchingResponse = response; + } + ); + + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + + commonBasicResponseAsserts(matchingResponse); + + Directions.Step step0 = matchingResponse.Matchings[0].Legs[0].Steps[0]; + Directions.Step step1 = matchingResponse.Matchings[0].Legs[0].Steps[1]; + Assert.AreEqual("Head northeast on Rechte Wienzeile (B1)", step0.Maneuver.Instruction, "Step[0]:Instruction not as expected"); + Assert.AreEqual("You have arrived at your destination", step1.Maneuver.Instruction, "Step[1]:Instruction not as expected"); + } + + + [UnityTest] + public IEnumerator LanguageGerman() + { + + MapMatchingResource resource = new MapMatchingResource(); + resource.Coordinates = new Vector2d[] + { + new Vector2d(48.1974721043879,16.36202484369278), + new Vector2d(48.197922645046546,16.36285901069641) + }; + //set Steps to true to get turn-by-turn-instructions + resource.Steps = true; + resource.Language = InstructionLanguages.German; + + MapMatcher mapMatcher = new MapMatcher(_fs, _timeout); + MapMatchingResponse matchingResponse = null; + mapMatcher.Match( + resource, + (MapMatchingResponse response) => + { + matchingResponse = response; + } + ); + + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + + commonBasicResponseAsserts(matchingResponse); + + Directions.Step step0 = matchingResponse.Matchings[0].Legs[0].Steps[0]; + Directions.Step step1 = matchingResponse.Matchings[0].Legs[0].Steps[1]; + Assert.AreEqual("Fahren Sie Richtung Nordosten auf Rechte Wienzeile (B1)", step0.Maneuver.Instruction, "Step[0]:Instruction not as expected"); + Assert.AreEqual("Sie haben Ihr Ziel erreicht", step1.Maneuver.Instruction, "Step[1]:Instruction not as expected"); + } + + + + [UnityTest] + public IEnumerator AllParameters() + { + + MapMatchingResource resource = new MapMatchingResource(); + resource.Profile = Profile.MapboxWalking; + resource.Geometries = Geometries.Polyline6; + resource.Coordinates = new Vector2d[] + { + new Vector2d(48.28585,16.55267), + new Vector2d(48.28933,16.55211) + }; + resource.Timestamps = new long[] + { + 946684800, + 946684980 + }; + resource.Radiuses = new uint[] { 50, 50 }; + //set Steps to true to get turn-by-turn-instructions + resource.Steps = true; + //need to pass 'Overview.Full' to get 'Congestion' + resource.Overview = Overview.Full; + resource.Annotations = Annotations.Distance | Annotations.Duration | Annotations.Speed | Annotations.Congestion; + resource.Tidy = true; + resource.Language = InstructionLanguages.German; + + + MapMatcher mapMatcher = new MapMatcher(_fs, _timeout); + MapMatchingResponse matchingResponse = null; + mapMatcher.Match( + resource, + (MapMatchingResponse response) => + { + matchingResponse = response; + } + ); + + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + + commonBasicResponseAsserts(matchingResponse); + + Directions.Leg leg = matchingResponse.Matchings[0].Legs[0]; + Assert.IsNotNull(leg.Annotation, "Annotation is NULL"); + Assert.IsNotNull(leg.Annotation.Distance, "Distance is NULL"); + Assert.IsNotNull(leg.Annotation.Duration, "Duration is NULL"); + Assert.IsNotNull(leg.Annotation.Speed, "Speed is NULL"); + Assert.IsNotNull(leg.Annotation.Congestion, "Congestion is NULL"); + + Directions.Step step1 = matchingResponse.Matchings[0].Legs[0].Steps[1]; + Assert.IsTrue(step1.Maneuver.Instruction.Contains("Sie haben Ihr Ziel erreicht"), "Step[1]:Instruction not as expected"); + + } + + + [UnityTest] + public IEnumerator CoordinatesNull() + { + + MapMatchingResource resource = new MapMatchingResource(); + Assert.Throws( + typeof(System.Exception) + , () => resource.Coordinates = null + , "MapMatchingResource did not throw when setting null coordinates" + ); + + yield return null; + + + MapMatcher mapMatcher = new MapMatcher(_fs, _timeout); + MapMatchingResponse matchingResponse = null; + + Assert.Throws( + typeof(System.Exception) + , () => + { + mapMatcher.Match( + resource, + (MapMatchingResponse response) => + { + matchingResponse = response; + } + ); + } + , "MapMatcher.Match did not throw with null coordinates" + ); + + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + + Assert.IsNull(matchingResponse, "Matching response was expected to be null"); + } + + + + [UnityTest] + public IEnumerator InvalidCoordinate() + { + + MapMatchingResource resource = new MapMatchingResource(); + resource.Coordinates = new Vector2d[] + { + new Vector2d(-117.1728265285492, 32.71204416018209), + new Vector2d(-117.17288821935652,32.712258556224), + }; + + MapMatcher mapMatcher = new MapMatcher(_fs, _timeout); + MapMatchingResponse matchingResponse = null; + mapMatcher.Match( + resource, + (MapMatchingResponse response) => + { + matchingResponse = response; + } + ); + + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + Assert.IsNotNull(matchingResponse, "Matching response is NULL"); + Assert.IsTrue(matchingResponse.HasRequestError, "No web request error"); + Assert.IsTrue(matchingResponse.HasMatchingError, "No matching error"); + Assert.AreEqual("InvalidInput", matchingResponse.Code, "Matching code != 'InvalidInput'"); + Assert.IsNotNull(matchingResponse.Message, "Matching message is NULL"); + Assert.IsNotEmpty(matchingResponse.Message, "Matching message is empty"); + Assert.AreEqual("Coordinate is invalid: 32.71204,-117.17283", matchingResponse.Message, "Matching message not as expected"); + } + + + private void commonBasicResponseAsserts(MapMatchingResponse matchingResponse) + { + Assert.IsNotNull(matchingResponse, "Matching response is NULL"); + Assert.IsFalse(matchingResponse.HasRequestError, "Error during web request"); + Assert.AreEqual("Ok", matchingResponse.Code, "Matching code != 'Ok'"); + Assert.IsFalse(matchingResponse.HasMatchingError, "Macthing error"); + + Assert.IsNotNull(matchingResponse.Tracepoints, "Tracepoints are NULL"); + Assert.GreaterOrEqual(matchingResponse.Tracepoints.Length, 2, "Less than 2 tracepoints"); + + Assert.IsNotNull(matchingResponse.Matchings, "Matchings are NULL"); + Assert.GreaterOrEqual(1, matchingResponse.Matchings.Length, "Less than 1 matchings"); + Assert.IsNotNull(matchingResponse.Matchings[0].Legs, "Legs are NULL"); + Assert.GreaterOrEqual(matchingResponse.Matchings[0].Legs.Count, 1, "1st match has no legs"); + } + } +} + +#endif diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_MapMatcher.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_MapMatcher.cs.meta new file mode 100644 index 0000000..f6600a5 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_MapMatcher.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 59de4f0f699183d4ab19690a6b94c1a0 +timeCreated: 1508247612 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_PolylineToGeoCoordinateListConverter.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_PolylineToGeoCoordinateListConverter.cs new file mode 100644 index 0000000..e1eb306 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_PolylineToGeoCoordinateListConverter.cs @@ -0,0 +1,49 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + using System.Collections.Generic; + using Mapbox.Json; + using Mapbox.Utils; + using Mapbox.Utils.JsonConverters; + using NUnit.Framework; + + + [TestFixture] + internal class PolylineToVector2dListConverterTest + { + + // (38.5, -120.2), (40.7, -120.95), (43.252, -126.453) + private readonly List _polyLineObj = new List() + { + new Vector2d(38.5, -120.2), + new Vector2d(40.7, -120.95), + new Vector2d(43.252, -126.453) + }; + + private string _polyLineString = "\"_p~iF~ps|U_ulLnnqC_mqNvxq`@\""; + + + [Test] + public void Deserialize() + { + List deserializedLine = JsonConvert.DeserializeObject>(_polyLineString, JsonConverters.Converters); + Assert.AreEqual(_polyLineObj, deserializedLine); + } + + + [Test] + public void Serialize() + { + string serializedLine = JsonConvert.SerializeObject(_polyLineObj, JsonConverters.Converters); + Assert.AreEqual(_polyLineString, serializedLine); + } + + + } +} diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_PolylineToGeoCoordinateListConverter.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_PolylineToGeoCoordinateListConverter.cs.meta new file mode 100644 index 0000000..964b718 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_PolylineToGeoCoordinateListConverter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e1b862f6c5e734a409c075ec1bce13e1 +timeCreated: 1498231547 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_PolylineUtils.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_PolylineUtils.cs new file mode 100644 index 0000000..6a45338 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_PolylineUtils.cs @@ -0,0 +1,60 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + using System.Collections.Generic; + using Mapbox.Utils; + using NUnit.Framework; + + + /// Polyline utils test. + [TestFixture] + public class PolylineUtilsTest + { + + + /// + /// Tests the decode. + /// + /// + /// Sample values from https://developers.google.com/maps/documentation/utilities/polylinealgorithm. + /// + [Test] + public void TestDecode() + { + // _p~iF~ps|U_ulLnnqC_mqNvxq`@ + List path = PolylineUtils.Decode( + "_p~iF~ps|U_ulLnnqC_mqNvxq`@"); + + // (38.5, -120.2), (40.7, -120.95), (43.252, -126.453) + Assert.AreEqual(-120.2, path[0].y); + Assert.AreEqual(38.5, path[0].x); + Assert.AreEqual(-120.95, path[1].y); + Assert.AreEqual(40.7, path[1].x); + Assert.AreEqual(-126.453, path[2].y); + Assert.AreEqual(43.252, path[2].x); + } + + + /// Tests the encode. + [Test] + public void TestEncode() + { + // (38.5, -120.2), (40.7, -120.95), (43.252, -126.453) + var path = new List(); + path.Add(new Vector2d(38.5, -120.2)); + path.Add(new Vector2d(40.7, -120.95)); + path.Add(new Vector2d(43.252, -126.453)); + + // _p~iF~ps|U_ulLnnqC_mqNvxq`@ + Assert.AreEqual("_p~iF~ps|U_ulLnnqC_mqNvxq`@", PolylineUtils.Encode(path)); + } + + + } +} diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_PolylineUtils.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_PolylineUtils.cs.meta new file mode 100644 index 0000000..10d47e4 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_PolylineUtils.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: fa0f5d050d73344bf85556235addd1b9 +timeCreated: 1498231547 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_ReverseGeocodeResource.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_ReverseGeocodeResource.cs new file mode 100644 index 0000000..bc7f3f7 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_ReverseGeocodeResource.cs @@ -0,0 +1,70 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + using System; + using Mapbox.Utils; + using NUnit.Framework; + + + [TestFixture] + internal class ReverseGeocodeResourceTest + { + + private const string _baseUrl = "https://api.mapbox.com/geocoding/v5/mapbox.places/"; + private Vector2d _queryLocation = new Vector2d(10, 10); + private string _expectedQueryString = "10.00000,10.00000"; + private Geocoding.ReverseGeocodeResource _reverseGeocodeResource; + + + [SetUp] + public void SetUp() + { + _reverseGeocodeResource = new Geocoding.ReverseGeocodeResource(_queryLocation); + } + + public void BadType() + { + _reverseGeocodeResource.Types = new string[] { "fake" }; + } + + public void BadTypeWithGoodType() + { + _reverseGeocodeResource.Types = new string[] { "place", "fake" }; + } + + [Test] + public void SetInvalidTypes() + { + Assert.Throws(BadType); + Assert.Throws(BadTypeWithGoodType); + } + + [Test] + public void GetUrl() + { + // With only constructor + Assert.AreEqual(_baseUrl + _expectedQueryString + ".json", _reverseGeocodeResource.GetUrl()); + + // With one types + _reverseGeocodeResource.Types = new string[] { "country" }; + Assert.AreEqual(_baseUrl + _expectedQueryString + ".json?types=country", _reverseGeocodeResource.GetUrl()); + + // With multiple types + _reverseGeocodeResource.Types = new string[] { "country", "region" }; + // ToLower is need to make test pass on OSX + Assert.AreEqual((_baseUrl + _expectedQueryString + ".json?types=country%2Cregion").ToLower(), _reverseGeocodeResource.GetUrl().ToLower()); + + // Set all to null + _reverseGeocodeResource.Types = null; + Assert.AreEqual(_baseUrl + _expectedQueryString + ".json", _reverseGeocodeResource.GetUrl()); + } + + + } +} diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_ReverseGeocodeResource.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_ReverseGeocodeResource.cs.meta new file mode 100644 index 0000000..d3a44e5 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_ReverseGeocodeResource.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7f39fa05cece94053b2bf5b0c31eb1da +timeCreated: 1498231546 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_SQLiteCache.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_SQLiteCache.cs new file mode 100644 index 0000000..60e7f5e --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_SQLiteCache.cs @@ -0,0 +1,300 @@ +namespace Mapbox.MapboxSdkCs.UnitTest +{ + using Mapbox.Map; + using Mapbox.Platform.Cache; + using Mapbox.Unity.Utilities; + using Mapbox.Utils; + using NUnit.Framework; + using System; + using System.Collections; + using System.Collections.Generic; + using System.Diagnostics; + using System.Globalization; + using System.IO; + using System.Linq; + using ued = UnityEngine.Debug; + using UnityEngine.TestTools; + + + [TestFixture] + internal class SQLiteCacheTest + { + + + private const string _dbName = "UNITTEST.db"; + // tileset names + private const string TS_NO_OVERWRITE = "NoOverwrite"; + private const string TS_FORCE_OVERWRITE = "ForceOverwrite"; + private const string TS_CONCURRENT1 = "concurrent1"; + private const string TS_CONCURRENT2 = "concurrent2"; + private const string TS_CONCURRENT3 = "concurrent3"; + private const string TS_CONCURRENT4 = "concurrent4"; + private const string TS_PRUNE = "concurrent4"; + private const string TS_REINIT = "reinit"; + private string[] _allTilesetNames; + private SQLiteCache _cache; + private string _className; + private HashSet _tileIds; + // be careful when setting the 'maxTileCount' parameter. when setting too low unwanted pruning might happen. + private uint _maxCacheTileCount = 6000; + + + [OneTimeSetUp] + public void Init() + { + _className = this.GetType().Name; + + Runnable.EnableRunnableInEditor(); + + _allTilesetNames = new string[] { + TS_NO_OVERWRITE + , TS_FORCE_OVERWRITE + , TS_CONCURRENT1 + , TS_CONCURRENT2 + , TS_CONCURRENT3 + , TS_CONCURRENT4 + , TS_PRUNE + , TS_REINIT + }; + + Vector2d southWest = new Vector2d(48.2174, 16.3662); + Vector2d northEast = new Vector2d(48.2310, 16.3877); + Vector2dBounds bounds = new Vector2dBounds(southWest, northEast); + _tileIds = TileCover.Get(bounds, 19); + + + // delete cache from previous runs + string dbFullPath = SQLiteCache.GetFullDbPath(_dbName); + if (File.Exists(dbFullPath)) { File.Delete(dbFullPath); } + + _cache = new SQLiteCache(_maxCacheTileCount, _dbName); + } + + + [OneTimeTearDown] + public void Cleanup() + { + if (null != _cache) + { + _cache.Dispose(); + _cache = null; + } + } + + + [Test, Order(1)] + public void InsertSameTileNoOverwrite() + { + string methodName = _className + "." + new StackFrame().GetMethod().Name; + List elapsed = simpleInsert(TS_NO_OVERWRITE, false); + logTime(methodName, elapsed); + cacheItemAsserts(TS_NO_OVERWRITE, new CanonicalTileId(0, 0, 0)); + Assert.AreEqual(1, _cache.TileCount(TS_NO_OVERWRITE), "tileset {0}: unexpected number of tiles", TS_NO_OVERWRITE); + } + + + [Test, Order(2)] + public void InsertSameTileForceOverwrite() + { + string methodName = _className + "." + new StackFrame().GetMethod().Name; + List elapsed = simpleInsert(TS_FORCE_OVERWRITE, true); + logTime(methodName, elapsed); + cacheItemAsserts(TS_FORCE_OVERWRITE, new CanonicalTileId(0, 0, 0)); + Assert.AreEqual(1, _cache.TileCount(TS_FORCE_OVERWRITE), "tileset {0}: unexpected number of tiles", TS_FORCE_OVERWRITE); + } + + + [UnityTest, Order(3)] + public IEnumerator ConcurrentTilesetInsert() + { + + ued.LogFormat("about to insert {0} tiles for each tileset", _tileIds.Count); + + int rIdCr1 = Runnable.Run(InsertCoroutine(TS_CONCURRENT1, false, _tileIds)); + int rIdCr2 = Runnable.Run(InsertCoroutine(TS_CONCURRENT2, false, _tileIds)); + int rIdCr3 = Runnable.Run(InsertCoroutine(TS_CONCURRENT3, false, _tileIds)); + int rIdCr4 = Runnable.Run(InsertCoroutine(TS_CONCURRENT4, false, _tileIds)); + + while (Runnable.IsRunning(rIdCr1) || Runnable.IsRunning(rIdCr2) || Runnable.IsRunning(rIdCr3) || Runnable.IsRunning(rIdCr4)) + { + yield return null; + } + + } + + + [Test, Order(4)] + public void VerifyTilesFromConcurrentInsert() + { + ued.Log("verifying concurrently inserted tiles ..."); + + string[] tilesetNames = new string[] { TS_CONCURRENT1, TS_CONCURRENT2, TS_CONCURRENT3, TS_CONCURRENT4 }; + + foreach (string tilesetName in tilesetNames) + { + Assert.AreEqual(_tileIds.Count, _cache.TileCount(tilesetName), "tileset '{0}' does not contain expected number of tiles", tilesetName); + } + + foreach (string tilesetName in tilesetNames) + { + foreach (CanonicalTileId tileId in _tileIds) + { + cacheItemAsserts(tilesetName, tileId); + } + } + + ued.Log("all tiles in cache!"); + } + + + [Test, Order(5)] + public void Prune() + { + string methodName = _className + "." + new StackFrame().GetMethod().Name; + HashSet tileIds = new HashSet(); + + int tiles2Insert = (int)_maxCacheTileCount + (int)_cache.PruneCacheDelta + 1; + ued.Log(string.Format("about to insert {0} tiles", tiles2Insert)); + for (int x = 0; x < tiles2Insert; x++) + { + tileIds.Add(new CanonicalTileId(x, 131205, 18)); + } + + List elapsed = simpleInsert(TS_PRUNE, false, tileIds); + logTime(methodName, elapsed); + Assert.AreEqual(_maxCacheTileCount, _cache.TileCount(TS_PRUNE), _cache.PruneCacheDelta, "tileset [{0}]: pruning did not work as expected", TS_PRUNE); + } + + + [Test, Order(6)] + public void Clear() + { + // We still should have tiles in the cache + long tileCnt = getAllTilesCount(); + + // beware 'Assert.Greater' has parameters flipped compared to 'Assert.AreEqual' + Assert.GreaterOrEqual(tileCnt, _cache.MaxCacheSize, "number of tiles lower than expected"); + + _cache.Clear(); + // have to Reinit after Clear() + _cache.ReInit(); + + tileCnt = getAllTilesCount(); + + Assert.AreEqual(0, tileCnt, "'Clear()' did not work as expected"); + } + + + [Test, Order(7)] + public void ReInit() + { + // after previous 'Clear' there shouldn't be any tiles in cache + long tileCnt = getAllTilesCount(); + Assert.AreEqual(0, tileCnt, "'Clear()' did not work as expected"); + // insert one tile + simpleInsert(TS_REINIT, false, itemCount: 1); + tileCnt = getAllTilesCount(); + Assert.AreEqual(1, tileCnt, "one tile was not inserted"); + + _cache.ReInit(); + + Assert.AreEqual(1, tileCnt, "tile was lost during 'ReInit()'"); + } + + + #region helper methods + + + private long getAllTilesCount() + { + long tileCnt = 0; + foreach (string tilesetName in _allTilesetNames) + { + tileCnt += _cache.TileCount(tilesetName); + } + return tileCnt; + } + + + private void cacheItemAsserts(string tilesetName, CanonicalTileId tileId) + { + CacheItem ci = _cache.Get(tilesetName, tileId); + Assert.NotNull(ci, "tileset '{0}': {1} not found in cache", tilesetName, tileId); + Assert.NotNull(ci.Data, "tileset '{0}': {1} tile data is null", tilesetName, tileId); + Assert.NotZero(ci.Data.Length, "tileset '{0}': {1} data length is 0", tilesetName, tileId); + } + + + private IEnumerator InsertCoroutine(string tileSetName, bool forceInsert, HashSet tileIds = null) + { + ued.Log(string.Format("coroutine [{0}] started", tileSetName)); + yield return null; + + List elapsed = simpleInsert(tileSetName, forceInsert, tileIds); + + ued.Log(string.Format("coroutine [{0}] finished", tileSetName)); + logTime(tileSetName, elapsed); + } + + + private List simpleInsert(string tileSetName, bool forceInsert, HashSet tileIds = null, int itemCount = 1000) + { + if (null != tileIds) { itemCount = tileIds.Count; } + + List elapsed = new List(); + Stopwatch sw = new Stopwatch(); + + for (int i = 0; i < itemCount; i++) + { + CanonicalTileId tileId = null != tileIds ? tileIds.ElementAt(i) : new CanonicalTileId(0, 0, 0); + DateTime now = DateTime.UtcNow; + CacheItem cacheItem = new CacheItem() + { + AddedToCacheTicksUtc = now.Ticks, + // simulate 100KB data + Data = Enumerable.Repeat((byte)0x58, 100 * 1024).ToArray(), + ETag = "etag", + LastModified = now + }; + + sw.Start(); + _cache.Add(tileSetName, tileId, cacheItem, forceInsert); + sw.Stop(); + elapsed.Add(sw.ElapsedMilliseconds); + sw.Reset(); + } + + return elapsed; + } + + + + private void logTime(string label, List elapsed) + { + double overall = elapsed.Sum() / 1000.0; + double min = elapsed.Min() / 1000.0; + double max = elapsed.Max() / 1000.0; + double avg = elapsed.Average() / 1000.0; + + double sum = elapsed.Sum(d => Math.Pow(d - avg, 2)); + double stdDev = (Math.Sqrt((sum) / (elapsed.Count - 1))) / 1000.0; + + ued.Log(string.Format( + CultureInfo.InvariantCulture + , "[{0}] {1} items, overall time:{2,6:0.000}s avg:{3,6:0.000}s min:{4,6:0.000}s max:{5,6:0.000}s stdDev:{6,6:0.000}s" + , label + , elapsed.Count + , overall + , avg + , min + , max + , stdDev + )); + } + + + #endregion + + + } +} diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_SQLiteCache.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_SQLiteCache.cs.meta new file mode 100644 index 0000000..b40a774 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_SQLiteCache.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: e9829dc6854b57c4daa504cf64758026 +timeCreated: 1528105352 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Tile.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Tile.cs new file mode 100644 index 0000000..5c16410 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Tile.cs @@ -0,0 +1,108 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + + +// TODO: figure out how run tests outside of Unity with .NET framework, something like '#if !UNITY' +#if UNITY_5_6_OR_NEWER + + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + + using Mapbox.Map; + using Mapbox.Platform; + using NUnit.Framework; +#if UNITY_5_6_OR_NEWER + using System.Collections; + using UnityEngine.TestTools; +#endif + + + [TestFixture] + internal class TileTest + { + + + private FileSource _fs; + + + [SetUp] + public void SetUp() + { +#if UNITY_5_6_OR_NEWER + _fs = new FileSource(Unity.MapboxAccess.Instance.Configuration.GetMapsSkuToken, Unity.MapboxAccess.Instance.Configuration.AccessToken); +#else + // when run outside of Unity FileSource gets the access token from environment variable 'MAPBOX_ACCESS_TOKEN' + _fs = new FileSource(); +#endif + } + + + +#if UNITY_5_6_OR_NEWER + [UnityTest] + public IEnumerator TileLoading() +#else + [Test] + public void TileLoading() +#endif + { + byte[] data; + + var parameters = new Tile.Parameters(); + parameters.Fs = _fs; + parameters.Id = new CanonicalTileId(1, 1, 1); + + var tile = new RawPngRasterTile(); + tile.Initialize(parameters, () => { data = tile.Data; }); + +#if UNITY_5_6_OR_NEWER + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } +#else + _fs.WaitForAllRequests(); +#endif + + Assert.Greater(tile.Data.Length, 1000); + } + + + +#if UNITY_5_6_OR_NEWER + [UnityTest] + public IEnumerator States() +#else + [Test] + public void States() +#endif + { + var parameters = new Tile.Parameters(); + parameters.Fs = _fs; + parameters.Id = new CanonicalTileId(1, 1, 1); + + var tile = new RawPngRasterTile(); + Assert.AreEqual(Tile.State.New, tile.CurrentState); + + tile.Initialize(parameters, () => { }); + Assert.AreEqual(Tile.State.Loading, tile.CurrentState); + +#if UNITY_5_6_OR_NEWER + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } +#else + _fs.WaitForAllRequests(); +#endif + + Assert.AreEqual(Tile.State.Loaded, tile.CurrentState); + + tile.Cancel(); + Assert.AreEqual(Tile.State.Canceled, tile.CurrentState); + } + } +} + +#endif diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Tile.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Tile.cs.meta new file mode 100644 index 0000000..04a3180 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Tile.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 458f515b81c004c5982c33a6fb6f99ed +timeCreated: 1498231546 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_TileCover.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_TileCover.cs new file mode 100644 index 0000000..84de2cc --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_TileCover.cs @@ -0,0 +1,63 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + using System; + using System.Collections.Generic; + using Mapbox.Map; + using Mapbox.Utils; + using NUnit.Framework; + + + [TestFixture] + internal class TileCoverTest + { + + + [Test] + public void World() + { + // Zoom > 8 will generate so many tiles that we + // might run out of memory. + for (int zoom = 0; zoom < 8; ++zoom) + { + var tiles = TileCover.Get(Vector2dBounds.World(), zoom); + Assert.AreEqual(Math.Pow(4, zoom), tiles.Count); + } + } + + + [Test] + public void Helsinki() + { + // Assertion results verified on Mapbox GL Native. + var sw = new Vector2d(60.163200, 24.937700); + var ne = new Vector2d(60.163300, 24.937800); + + var set1 = TileCover.Get(new Vector2dBounds(sw, ne), 13); + Assert.AreEqual(1, set1.Count); + + var list1 = new List(set1); + Assert.AreEqual("13/4663/2371", list1[0].ToString()); + + var set2 = TileCover.Get(new Vector2dBounds(sw, ne), 6); + Assert.AreEqual(1, set2.Count); + + var list2 = new List(set2); + Assert.AreEqual("6/36/18", list2[0].ToString()); + + var set3 = TileCover.Get(new Vector2dBounds(sw, ne), 0); + Assert.AreEqual(1, set3.Count); + + var list3 = new List(set3); + Assert.AreEqual("0/0/0", list3[0].ToString()); + } + + + } +} diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_TileCover.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_TileCover.cs.meta new file mode 100644 index 0000000..8dff9a5 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_TileCover.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5990cb1e4cf9440e1ab76a610a3364fc +timeCreated: 1498231546 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_TileJSON.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_TileJSON.cs new file mode 100644 index 0000000..1eac85c --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_TileJSON.cs @@ -0,0 +1,225 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +// TODO: figure out how run tests outside of Unity with .NET framework, something like '#if !UNITY' +#if UNITY_5_6_OR_NEWER + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + + using Mapbox.Platform; + using NUnit.Framework; + using UnityEngine.TestTools; + using System.Collections; + using Mapbox.Platform.TilesetTileJSON; + + + [TestFixture] + internal class TileJSONTest + { + + + + [UnityTest] + public IEnumerator MapboxStreets() + { + string id = "mapbox.mapbox-streets-v7"; + int minZoom = 0; + int maxZoom = 16; + + TileJSONResponse response = null; + + Unity.MapboxAccess.Instance.TileJSON.Get( + id + , (TileJSONResponse tjr) => + { + response = tjr; + } + ); + + + IEnumerator enumerator = ((FileSource)Unity.MapboxAccess.Instance.TileJSON.FileSource).WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + + testsCommonToVectorAndRasterTilesets(response, id, minZoom, maxZoom); + testsForVectorTilesets(response); + } + + + [UnityTest] + public IEnumerator ConcatenatedVectorTilesets() + { + string id = "mapbox.mapbox-traffic-v1,mapbox.mapbox-streets-v7"; + int minZoom = 0; + int maxZoom = 16; + + TileJSONResponse response = null; + + Unity.MapboxAccess.Instance.TileJSON.Get( + id + , (TileJSONResponse tjr) => + { + response = tjr; + } + ); + + + IEnumerator enumerator = ((FileSource)Unity.MapboxAccess.Instance.TileJSON.FileSource).WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + + testsCommonToVectorAndRasterTilesets( + response + , id + , minZoom + , maxZoom + , boundsSouth: -90 + , boundsNorth: 90 + ); + testsForVectorTilesets(response); + } + + + [UnityTest] + public IEnumerator MapboxSatellite() + { + string id = "mapbox.satellite"; + int minZoom = 0; + int maxZoom = 22; + + TileJSONResponse response = null; + + Unity.MapboxAccess.Instance.TileJSON.Get( + id + , (TileJSONResponse tjr) => + { + response = tjr; + } + ); + + + IEnumerator enumerator = ((FileSource)Unity.MapboxAccess.Instance.TileJSON.FileSource).WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + + testsCommonToVectorAndRasterTilesets(response, id, minZoom, maxZoom, boundsSouth: -85, boundsNorth: 85); + } + + + [UnityTest] + public IEnumerator MapboxEmerald() + { + string id = "mapbox.emerald"; + int minZoom = 0; + int maxZoom = 22; + + TileJSONResponse response = null; + + Unity.MapboxAccess.Instance.TileJSON.Get( + id + , (TileJSONResponse tjr) => + { + response = tjr; + } + ); + + + IEnumerator enumerator = ((FileSource)Unity.MapboxAccess.Instance.TileJSON.FileSource).WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } + + testsCommonToVectorAndRasterTilesets(response, id, minZoom, maxZoom); + + Assert.IsNotEmpty(response.Source, "'Source' not set properly"); + } + + + + private void testsForVectorTilesets(TileJSONResponse response) + { + Assert.IsNotNull(response.VectorLayers, "'VectorLayers' not set properly"); + Assert.GreaterOrEqual(response.VectorLayers.Length, 1, "Not enough 'VectorLayers'"); + + TileJSONObjectVectorLayer vl1 = response.VectorLayers[0]; + Assert.IsNotNull(vl1.Fields, "VectorLayer fields not parsed properly"); + Assert.GreaterOrEqual(vl1.Fields.Count, 1, "Not enough vector layer fields"); + Assert.IsNotEmpty(vl1.Id, "'Id' of vector layer not parsed properly"); + Assert.IsNotEmpty(vl1.Source, "'Source' of vector layer not parsed properly"); + Assert.IsNotEmpty(vl1.SourceName, "'SourceName' of vector layer not parsed properly"); + } + + + private void testsCommonToVectorAndRasterTilesets( + TileJSONResponse response + , string id + , int minZoom + , int maxZoom + , double boundsWest = -180 + , double boundsSouth = -85.0511 + , double boundsEast = 180 + , double boundsNorth = 85.0511 + ) + { + Assert.IsNotNull(response, "Parsing error or no data received from the servers."); + + Assert.IsNotEmpty(response.Attribution, "Attribution not set."); + + Assert.AreEqual(boundsWest, response.BoundsParsed.West, "Bounds.West does not match"); + Assert.AreEqual(boundsSouth, response.BoundsParsed.South, 0.003, "Bounds.South does not match"); + Assert.AreEqual(boundsEast, response.BoundsParsed.East, "Bounds.East does not match"); + Assert.AreEqual(boundsNorth, response.BoundsParsed.North, 0.003, "Bounds.North does not match"); + + // this does not work as some tilesets report whole world bounds despite covering a small area only + // revisit some time in the future + //Assert.AreEqual(response.BoundsParsed.Center.x, response.CenterParsed.x, 0.003, "Center.x does not match"); + //Assert.AreEqual(response.BoundsParsed.Center.y, response.CenterParsed.y, "Center.y does not match"); + + //concatenated tilesets don't have created property + if (response.Created.HasValue) + { + Assert.Greater(response.Created.Value, 0, "'Created' not set"); + Assert.IsNotNull(response.CreatedUtc, "'CreatedUtc' not set properly'"); + } + + // mapbox.satellite doesn't set 'format': bug?? + // revisit in the future + //Assert.IsNotEmpty(response.Format, "'Format' is empty"); + + // concatenated tilesets don't report 'id' + if (!id.Contains(",")) + { + Assert.IsNotEmpty(response.Id, "'Id' is empty"); + Assert.AreEqual(id, response.Id, "'Id' not set properly"); + } + Assert.AreEqual(minZoom, response.MinZoom, "'MinZoom' not set properly"); + Assert.AreEqual(maxZoom, response.MaxZoom, "'MaxZoom' not set properly"); + + //Unmodified tilesets don't have a modified property + if (response.Modified.HasValue) + { + Assert.Greater(response.Modified.Value, 0, "'Modified not set'"); + Assert.IsTrue(response.ModifiedUtc.HasValue, "'Modified not properly parsed'"); + } + + Assert.IsNotEmpty(response.Name, "'Name' not set properly"); + Assert.IsFalse(response.Private, "'Private' not set properly"); + Assert.AreEqual("xyz", response.Scheme, "'Scheme' not set properly"); + Assert.IsNotEmpty(response.TileJSONVersion, "'TileJSONVersion not set properly"); + + Assert.IsNotNull(response.Tiles, "'Tiles' not set properly"); + Assert.GreaterOrEqual(response.Tiles.Length, 1, "Not enough 'Tiles'"); + + // concatenated tilesets don't report 'webpage' + if (!id.Contains(",")) + { + Assert.IsNotEmpty(response.WebPage, "'WebPage' not set properly"); + } + } + + + + } +} + +#endif diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_TileJSON.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_TileJSON.cs.meta new file mode 100644 index 0000000..f0f82cc --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_TileJSON.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 609e55c6e2c34624eb02d61d96cb34f0 +timeCreated: 1515592137 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_TileResource.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_TileResource.cs new file mode 100644 index 0000000..c386685 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_TileResource.cs @@ -0,0 +1,78 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +// TODO: figure out how run tests outside of Unity with .NET framework, something like '#if !UNITY' +#if UNITY_5_6_OR_NEWER + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + using Mapbox.Map; + using Mapbox.Utils; + using NUnit.Framework; + + [TestFixture] + public class TileResourceTest + { + + private string _api; + private CanonicalTileId _tileId; + + + [SetUp] + public void SetUp() + { + _api = Constants.BaseAPI; + _tileId = new CanonicalTileId(0, 0, 0); + } + + + [Test] + public void GetUrlRaster() + { + var res1 = TileResource.MakeRaster(_tileId, null); + Assert.AreEqual(_api + "styles/v1/mapbox/satellite-v9/tiles/0/0/0", res1.GetUrl().Split("?".ToCharArray())[0]); + + var res2 = TileResource.MakeRaster(_tileId, "mapbox://styles/mapbox/basic-v9"); + Assert.AreEqual(_api + "styles/v1/mapbox/basic-v9/tiles/0/0/0", res2.GetUrl().Split("?".ToCharArray())[0]); + + var res3 = TileResource.MakeRaster(_tileId, "https://api.mapbox.com/styles/v1/penny/penny-map/tiles"); + Assert.AreEqual(_api + "styles/v1/penny/penny-map/tiles/0/0/0", res3.GetUrl().Split("?".ToCharArray())[0]); + } + + + [Test] + public void GetUrlClassicRaster() + { + var res1 = TileResource.MakeClassicRaster(_tileId, null); + Assert.AreEqual(_api + "v4/mapbox.satellite/0/0/0.png", res1.GetUrl().Split("?".ToCharArray())[0]); + + var res2 = TileResource.MakeClassicRaster(_tileId, "foobar"); + Assert.AreEqual(_api + "v4/foobar/0/0/0.png", res2.GetUrl().Split("?".ToCharArray())[0]); + + var res3 = TileResource.MakeClassicRaster(_tileId, "test"); + Assert.AreEqual(_api + "v4/test/0/0/0.png", res3.GetUrl().Split("?".ToCharArray())[0]); + } + + [Test] + public void GetUrlVector() + { + var res1 = TileResource.MakeVector(_tileId, null); + Assert.AreEqual(_api + "v4/mapbox.mapbox-streets-v7/0/0/0.vector.pbf", res1.GetUrl().Split("?".ToCharArray())[0]); + + var res2 = TileResource.MakeVector(_tileId, "foobar"); + Assert.AreEqual(_api + "v4/foobar/0/0/0.vector.pbf", res2.GetUrl().Split("?".ToCharArray())[0]); + + var res3 = TileResource.MakeVector(_tileId, "test"); + Assert.AreEqual(_api + "v4/test/0/0/0.vector.pbf", res3.GetUrl().Split("?".ToCharArray())[0]); + } + + + + } +} + +#endif diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_TileResource.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_TileResource.cs.meta new file mode 100644 index 0000000..3041526 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_TileResource.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a7052b373a72748da8c09b8288e433fc +timeCreated: 1498231547 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Token.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Token.cs new file mode 100644 index 0000000..3588791 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Token.cs @@ -0,0 +1,109 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2017 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +using System; + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + + using Mapbox.Tokens; + using Mapbox.Unity; + using NUnit.Framework; + using System.Collections; + using UnityEngine.TestTools; + + + [TestFixture] + internal class TokenTest + { + + + private MapboxTokenApi _tokenApi; + private string _configAccessToken; + private Func _configSkuToken; + + [SetUp] + public void SetUp() + { + _tokenApi = new MapboxTokenApi(); + _configAccessToken = MapboxAccess.Instance.Configuration.AccessToken; + _configSkuToken = MapboxAccess.Instance.Configuration.GetMapsSkuToken; + } + + + [UnityTest] + public IEnumerator RetrieveConfigToken() + { + + MapboxToken token = null; + + _tokenApi.Retrieve( + _configSkuToken, + _configAccessToken, + (MapboxToken tok) => + { + token = tok; + } + ); + + while (null == token) { yield return null; } + + Assert.IsNull(token.ErrorMessage); + Assert.IsFalse(token.HasError); + Assert.AreEqual(MapboxTokenStatus.TokenValid, token.Status, "Config token is not valid"); + } + + + [UnityTest] + public IEnumerator TokenMalformed() + { + + MapboxToken token = null; + + _tokenApi.Retrieve( + _configSkuToken, + "yada.yada", + (MapboxToken tok) => + { + token = tok; + } + ); + + while (null == token) { yield return null; } + + Assert.IsNull(token.ErrorMessage); + Assert.IsFalse(token.HasError); + Assert.AreEqual(MapboxTokenStatus.TokenMalformed, token.Status, "token is malformed"); + } + + + [UnityTest] + public IEnumerator TokenInvalid() + { + + MapboxToken token = null; + + _tokenApi.Retrieve( + _configSkuToken, + "pk.12345678901234567890123456789012345.0123456789012345678901", + (MapboxToken tok) => + { + token = tok; + } + ); + + while (null == token) { yield return null; } + + Assert.IsNull(token.ErrorMessage); + Assert.IsFalse(token.HasError); + Assert.AreEqual(MapboxTokenStatus.TokenInvalid, token.Status, "token is invalid"); + + } + + + } +} \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Token.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Token.cs.meta new file mode 100644 index 0000000..8883b8c --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Token.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 067fbf2b171d0d24fb888953affd5740 +timeCreated: 1512087400 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Utils.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Utils.cs new file mode 100644 index 0000000..31daea8 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Utils.cs @@ -0,0 +1,82 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + using System.Collections.Generic; + using Mapbox.Map; + + + internal static class Utils + { + internal class VectorMapObserver : Mapbox.Utils.IObserver + { + private List tiles = new List(); + + public List Tiles + { + get + { + return tiles; + } + } + + public void OnNext(VectorTile tile) + { + if (tile.CurrentState == Tile.State.Loaded) + { + tiles.Add(tile); + } + } + } + + internal class RasterMapObserver : Mapbox.Utils.IObserver + { + private List tiles = new List(); + + public List Tiles + { + get + { + return tiles; + } + } + + public void OnNext(RasterTile tile) + { + if (tile.CurrentState == Tile.State.Loaded && !tile.HasError) + { + tiles.Add(tile.Data); + } + } + } + + internal class ClassicRasterMapObserver : Mapbox.Utils.IObserver + { + private List tiles = new List(); + + public List Tiles + { + get + { + return tiles; + } + } + + public void OnNext(ClassicRasterTile tile) + { + if (tile.CurrentState == Tile.State.Loaded && !tile.HasError) + { + tiles.Add(tile.Data); + } + } + } + + + + } +} diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Utils.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Utils.cs.meta new file mode 100644 index 0000000..f65b619 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_Utils.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e6a3a4a684cc64e609e83b2b547a9e82 +timeCreated: 1498231547 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_VectorTile.cs b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_VectorTile.cs new file mode 100644 index 0000000..9f541b9 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_VectorTile.cs @@ -0,0 +1,138 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +// TODO: figure out how run tests outside of Unity with .NET framework, something like '#if !UNITY' +#if UNITY_5_6_OR_NEWER + + +namespace Mapbox.MapboxSdkCs.UnitTest +{ + + using System.Linq; + using Mapbox.Map; + using Mapbox.Platform; + using Mapbox.Utils; + using NUnit.Framework; +#if UNITY_5_6_OR_NEWER + using UnityEngine.TestTools; + using System.Collections; +#endif + + + [TestFixture] + internal class VectorTileTest + { + + + private FileSource _fs; + + + [SetUp] + public void SetUp() + { +#if UNITY_5_6_OR_NEWER + _fs = new FileSource(Unity.MapboxAccess.Instance.Configuration.GetMapsSkuToken, Unity.MapboxAccess.Instance.Configuration.AccessToken); +#else + // when run outside of Unity FileSource gets the access token from environment variable 'MAPBOX_ACCESS_TOKEN' + _fs = new FileSource(); +#endif + } + + + +#if UNITY_5_6_OR_NEWER + [UnityTest] + public IEnumerator ParseSuccess() +#else + [Test] + public void ParseSuccess() +#endif + { + var map = new Map(_fs); + + var mapObserver = new Utils.VectorMapObserver(); + map.Subscribe(mapObserver); + + // Helsinki city center. + map.Center = new Vector2d(60.163200, 24.937700); + + for (int zoom = 15; zoom > 0; zoom--) + { + map.Zoom = zoom; + map.Update(); +#if UNITY_5_6_OR_NEWER + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } +#else + _fs.WaitForAllRequests(); +#endif + } + + // We must have all the tiles for Helsinki from 0-15. + Assert.AreEqual(15, mapObserver.Tiles.Count); + + foreach (var tile in mapObserver.Tiles) + { + Assert.Greater(tile.LayerNames().Count, 0, "Tile contains at least one layer"); + Mapbox.VectorTile.VectorTileLayer layer = tile.GetLayer("water"); + Assert.NotNull(layer, "Tile contains 'water' layer. Layers: {0}", string.Join(",", tile.LayerNames().ToArray())); + Assert.Greater(layer.FeatureCount(), 0, "Water layer has features"); + Mapbox.VectorTile.VectorTileFeature feature = layer.GetFeature(0); + Assert.Greater(feature.Geometry().Count, 0, "Feature has geometry"); + Assert.Greater(tile.GeoJson.Length, 1000); + } + + map.Unsubscribe(mapObserver); + } + + + +#if UNITY_5_6_OR_NEWER + [UnityTest] + public IEnumerator SeveralTiles() +#else + [Test] + public void ParseSuccess +#endif + { + var map = new Map(_fs); + + var mapObserver = new Utils.VectorMapObserver(); + map.Subscribe(mapObserver); + + map.Vector2dBounds = Vector2dBounds.World(); + map.Zoom = 3; // 64 tiles. + map.Update(); + +#if UNITY_5_6_OR_NEWER + IEnumerator enumerator = _fs.WaitForAllRequests(); + while (enumerator.MoveNext()) { yield return null; } +#else + _fs.WaitForAllRequests(); +#endif + + Assert.AreEqual(64, mapObserver.Tiles.Count); + + foreach (var tile in mapObserver.Tiles) + { + if (!tile.HasError) + { + Assert.Greater(tile.GeoJson.Length, 41); + } + else + { + Assert.GreaterOrEqual(tile.Exceptions.Count, 1, "not set enough exceptions set on 'Tile'"); + } + } + + map.Unsubscribe(mapObserver); + } + + + } +} + +#endif diff --git a/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_VectorTile.cs.meta b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_VectorTile.cs.meta new file mode 100644 index 0000000..26de420 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tests/UnitTests/Editor/MapboxUnitTests_VectorTile.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1b9319977dcf54a1d9f78833a2490004 +timeCreated: 1498231546 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tokens.meta b/Core/mapbox-sdk-cs/Tokens.meta new file mode 100644 index 0000000..d05a456 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tokens.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d8b4380d992e2d14e8b200746856fbf0 +folderAsset: yes +timeCreated: 1512083717 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tokens/MapboxToken.cs b/Core/mapbox-sdk-cs/Tokens/MapboxToken.cs new file mode 100644 index 0000000..8c3475f --- /dev/null +++ b/Core/mapbox-sdk-cs/Tokens/MapboxToken.cs @@ -0,0 +1,142 @@ + +namespace Mapbox.Tokens +{ + + using Mapbox.Json; + using System; + using System.Text; + + + /// + /// Mapbox Token: https://www.mapbox.com/api-documentation/accounts/#retrieve-a-token + /// + public class MapboxToken + { + + /// String representation of the token' status + [JsonProperty("code")] + public string Code; + + + /// Token metadata + [JsonProperty("token")] + public TokenMetadata TokenMetadata; + + + /// Parsed token status from 'code' + [JsonIgnore] + public MapboxTokenStatus Status = MapboxTokenStatus.StatusNotYetSet; + + + /// True if there was an error during requesting or parsing the token + [JsonIgnore] + public bool HasError; + + + /// Error message if the token could not be requested or parsed + [JsonIgnore] + public string ErrorMessage; + + + public static MapboxToken FromResponseData(byte[] data) + { + + if (null == data || data.Length < 1) + { + return new MapboxToken() + { + HasError = true, + ErrorMessage = "No data received from token endpoint." + }; + } + + + string jsonTxt = Encoding.UTF8.GetString(data); + + MapboxToken token = new MapboxToken(); + try + { + token = JsonConvert.DeserializeObject(jsonTxt); + + MapboxTokenStatus status = (MapboxTokenStatus)Enum.Parse(typeof(MapboxTokenStatus), token.Code); + if (!Enum.IsDefined(typeof(MapboxTokenStatus), status)) + { + throw new Exception(string.Format("could not convert token.code '{0}' to MapboxTokenStatus", token.Code)); + } + + token.Status = status; + } + catch (Exception ex) + { + token.HasError = true; + token.ErrorMessage = ex.Message; + } + + return token; + } + } + + + + + + /// + /// Every token has a metadata object that contains information about the capabilities of the token. + /// https://www.mapbox.com/api-documentation/accounts/#token-metadata-object + /// + public class TokenMetadata + { + + /// the identifier for the token + [JsonProperty("id")] + public string ID; + + + /// the type of token + [JsonProperty("usage")] + public string Usage; + + + /// if the token is a default token + [JsonProperty("default")] + public bool Default; + + + /// + [JsonProperty("user")] + public string User; + + + /// + [JsonProperty("authorization")] + public string Authorization; + + + /// date and time the token was created + [JsonProperty("created")] + public string Created; + + + /// date and time the token was last modified + [JsonProperty("modified")] + public string Modified; + + + /// array of scopes granted to the token + [JsonProperty("scopes")] + public string[] Scopes; + + + /// the client for the token, always 'api' + [JsonProperty("client")] + public string Client; + + + /// the token itself + [JsonProperty("token")] + public string Token; + } + + + +} diff --git a/Core/mapbox-sdk-cs/Tokens/MapboxToken.cs.meta b/Core/mapbox-sdk-cs/Tokens/MapboxToken.cs.meta new file mode 100644 index 0000000..9e36560 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tokens/MapboxToken.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6ac4a9ce5130afa49a675b6b40b746f3 +timeCreated: 1512084369 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Tokens/MapboxTokenApi.cs b/Core/mapbox-sdk-cs/Tokens/MapboxTokenApi.cs new file mode 100644 index 0000000..c50a508 --- /dev/null +++ b/Core/mapbox-sdk-cs/Tokens/MapboxTokenApi.cs @@ -0,0 +1,80 @@ + + +using Mapbox.Unity; + +namespace Mapbox.Tokens +{ + + + using Mapbox.Platform; + using System; + using System.ComponentModel; + using Mapbox.VectorTile.Geometry; + + public enum MapboxTokenStatus + { + /// The token is valid and active + [Description("The token is valid and active")] + TokenValid, + /// the token can not be parsed + [Description("the token can not be parsed")] + TokenMalformed, + /// the signature for the token does not validate + [Description("the signature for the token does not validate")] + TokenInvalid, + /// the token was temporary and expired + [Description("the token was temporary and expired")] + TokenExpired, + /// the token's authorization has been revoked + [Description("the token's authorization has been revoked")] + TokenRevoked, + /// inital value + StatusNotYetSet + } + + + /// + /// Wrapper class to retrieve details about a token + /// + public class MapboxTokenApi + { + + public MapboxTokenApi() { } + + + // use internal FileSource without(!) passing access token from config into constructor + // otherwise access token would be appended to url twice + // https://www.mapbox.com/api-documentation/accounts/#retrieve-a-token + // if we should ever implement other API methods: creating, deleting, updating ... tokens + // we will need another FileSource with the token from the config + private FileSource _fs; + + + public void Retrieve(Func skuToken, string accessToken, Action callback) + { + if (_fs == null) + { + _fs = new FileSource(skuToken); + } + + _fs.Request( + Utils.Constants.BaseAPI + "tokens/v2?access_token=" + accessToken, + (Response response) => + { + if (response.HasError) + { + callback(new MapboxToken() + { + HasError = true, + ErrorMessage = response.ExceptionsAsString + }); + return; + + } + callback(MapboxToken.FromResponseData(response.Data)); + } + ); + } + + } +} diff --git a/Core/mapbox-sdk-cs/Tokens/MapboxTokenApi.cs.meta b/Core/mapbox-sdk-cs/Tokens/MapboxTokenApi.cs.meta new file mode 100644 index 0000000..8e925ef --- /dev/null +++ b/Core/mapbox-sdk-cs/Tokens/MapboxTokenApi.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 048525bbaeb7aaa41b37e458c98090ee +timeCreated: 1512083739 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils.meta b/Core/mapbox-sdk-cs/Utils.meta new file mode 100644 index 0000000..1fe7622 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ec7827c37b22345e6ac27185e2f3aa06 +folderAsset: yes +timeCreated: 1491243031 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils/BearingFilter.cs b/Core/mapbox-sdk-cs/Utils/BearingFilter.cs new file mode 100644 index 0000000..c96d026 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/BearingFilter.cs @@ -0,0 +1,59 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Utils +{ + using System; + + /// + /// Represents a bearing filter, composed of a bearing in decimal angular degrees, with a +/- range + /// also in angular degrees. + /// + public struct BearingFilter + { + /// A decimal degree between 0 and 360. + public double? Bearing; + + /// + /// A decimal degree between 0 and 180. Represents the range + /// beyond bearing in both directions. + /// + public double? Range; + + /// Initializes a new instance of the struct. + /// A decimal degree between 0 and 360, or null. + /// A decimal degree between 0 and 180, or null. + public BearingFilter(double? bearing, double? range) + { + if (bearing != null && (bearing > 360 || bearing < 0)) + { + throw new Exception("Bearing must be greater than 0 and less than 360."); + } + + if (bearing != null && (range > 180 || range < 0)) + { + throw new Exception("Range must be greater than 0 and less than 180."); + } + + this.Bearing = bearing; + this.Range = range; + } + + /// Converts bearing to a URL snippet. + /// Returns a string for use in a Mapbox query URL. + public override string ToString() + { + if (this.Bearing != null && this.Range != null) + { + return this.Bearing.ToString() + "," + this.Range.ToString(); + } + else + { + return string.Empty; + } + } + } +} diff --git a/Core/mapbox-sdk-cs/Utils/BearingFilter.cs.meta b/Core/mapbox-sdk-cs/Utils/BearingFilter.cs.meta new file mode 100644 index 0000000..db7fc36 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/BearingFilter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 62331eb3e8b654367ab8e0339c5d8905 +timeCreated: 1493218361 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils/CircularBuffer.cs b/Core/mapbox-sdk-cs/Utils/CircularBuffer.cs new file mode 100644 index 0000000..90916b0 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/CircularBuffer.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; + +namespace Mapbox.Utils +{ + + + public interface ICircularBuffer + { + int Count { get; } + void Add(T item); + T this[int index] { get; } + } + + + + /// + /// http://geekswithblogs.net/blackrob/archive/2014/09/01/circular-buffer-in-c.aspx + /// https://social.msdn.microsoft.com/Forums/vstudio/en-US/416a2175-b05d-43b1-b99a-a01c56550dbe/circular-buffer-in-net?forum=netfxbcl + /// https://en.wikipedia.org/wiki/Circular_buffer + /// + /// + public class CircularBuffer : ICircularBuffer, IEnumerable + + { + private T[] _buffer; + private int _head; + private int _tail; + + + public CircularBuffer(int capacity) + { + if (capacity < 0) { throw new ArgumentOutOfRangeException("capacity", "must be positive"); } + _buffer = new T[capacity]; + _head = 0; + } + + + public int Count { get; private set; } + + + public void Add(T item) + { + _head = (_head + 1) % _buffer.Length; + _buffer[_head] = item; + if (Count == _buffer.Length) + { + _tail = (_tail + 1) % _buffer.Length; + } + else + { + ++Count; + } + } + + + /// + /// ATTENTION!!! order is flipped like in rolling window + /// [0] is newest value + /// + /// + /// + public T this[int index] + { + get + { + if (index < 0 || index >= _buffer.Length) { throw new ArgumentOutOfRangeException("index: " + index.ToString()); } + + return _buffer[mod((_head - index), _buffer.Length)]; + } + } + + + private int mod(int x, int m) // x mod m works for both positive and negative x (unlike x % m). + { + return (x % m + m) % m; + } + + public IEnumerator GetEnumerator() + { + if (Count == 0 || _buffer.Length == 0) + { + yield break; + } + + for (var i = 0; i < Count; ++i) { yield return this[i]; } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + + public IEnumerable GetEnumerable() + { + IEnumerator enumerator = GetEnumerator(); + while (enumerator.MoveNext()) + { + yield return enumerator.Current; + } + } + + + } +} diff --git a/Core/mapbox-sdk-cs/Utils/CircularBuffer.cs.meta b/Core/mapbox-sdk-cs/Utils/CircularBuffer.cs.meta new file mode 100644 index 0000000..7d3518b --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/CircularBuffer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: bfee2b258d221f741a76c90caaa027db +timeCreated: 1524828267 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils/Compression.cs b/Core/mapbox-sdk-cs/Utils/Compression.cs new file mode 100644 index 0000000..71f52d1 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/Compression.cs @@ -0,0 +1,102 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Utils +{ + + using System.IO; + using Mapbox.IO.Compression; + + + /// Collection of constants used across the project. + public static class Compression + { + /// + /// Decompress the specified buffer previously compressed using GZip. + /// + /// + /// The GZip'ed buffer. + /// + /// + /// Returns the uncompressed buffer or the buffer in case decompression + /// is not possible. + /// + public static byte[] Decompress(byte[] buffer) + { + // Test for magic bits. + if (buffer.Length < 2 || buffer[0] != 0x1f || buffer[1] != 0x8b) + { + return buffer; + } + + using (GZipStream stream = new GZipStream(new MemoryStream(buffer), CompressionMode.Decompress)) + { + const int Size = 4096; // Pagesize. + byte[] buf = new byte[Size]; + + using (MemoryStream memory = new MemoryStream()) + { + int count = 0; + + do + { + try + { + count = stream.Read(buf, 0, Size); + } + catch + { + // For now we return the uncompressed buffer + // on error. Assumes the magic check passed + // by luck. + return buffer; + } + + if (count > 0) + { + memory.Write(buf, 0, count); + } + } + while (count > 0); + + buffer = memory.ToArray(); + } + } + + return buffer; + } + + + public static byte[] Compress(byte[] raw, CompressionLevel compressionLevel) + { + using (MemoryStream memory = new MemoryStream()) + { + using (GZipStream gzip = new GZipStream(memory, compressionLevel)) + { + gzip.Write(raw, 0, raw.Length); + } + return memory.ToArray(); + } + } + + public static byte[] CompressModeCompress(byte[] raw) + { + using (MemoryStream memory = new MemoryStream()) + { + using (GZipStream gzip = new GZipStream(memory, CompressionMode.Compress, true)) + { + gzip.Write(raw, 0, raw.Length); + } + return memory.ToArray(); + } + } + + + + + + } +} \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/Utils/Compression.cs.meta b/Core/mapbox-sdk-cs/Utils/Compression.cs.meta new file mode 100644 index 0000000..14d9513 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/Compression.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d9e429703576740d18a04c9209e91364 +timeCreated: 1491243035 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils/Constants.cs b/Core/mapbox-sdk-cs/Utils/Constants.cs new file mode 100644 index 0000000..3d771d0 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/Constants.cs @@ -0,0 +1,30 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Utils +{ + /// Collection of constants used across the project. + public static class Constants + { + /// Base URL for all the Mapbox APIs. + public const string BaseAPI = "https://api.mapbox.com/"; + + public const string EventsAPI = "https://events.mapbox.com/"; + + /// Mercator projection max latitude limit. + public const double LatitudeMax = 85.0511; + + /// Mercator projection max longitude limit. + public const double LongitudeMax = 180; + + /// Mercator projection max meters + public const double WebMercMax = 20037508.342789244; + + /// Epsilon to comapre floating point numbers + public const float EpsilonFloatingPoint = 1E-05f; + + } +} \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/Utils/Constants.cs.meta b/Core/mapbox-sdk-cs/Utils/Constants.cs.meta new file mode 100644 index 0000000..171e636 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/Constants.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8ca3d2784c960430588fbe21ea681744 +timeCreated: 1491243034 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils/GeoCoordinateBounds.cs b/Core/mapbox-sdk-cs/Utils/GeoCoordinateBounds.cs new file mode 100644 index 0000000..efcd770 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/GeoCoordinateBounds.cs @@ -0,0 +1,173 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Utils +{ + /// Represents a bounding box derived from a southwest corner and a northeast corner. + public struct Vector2dBounds + { + /// Southwest corner of bounding box. + public Vector2d SouthWest; + + /// Northeast corner of bounding box. + public Vector2d NorthEast; + + /// Initializes a new instance of the struct. + /// Geographic coordinate representing southwest corner of bounding box. + /// Geographic coordinate representing northeast corner of bounding box. + public Vector2dBounds(Vector2d sw, Vector2d ne) + { + this.SouthWest = sw; + this.NorthEast = ne; + } + + /// Gets the south latitude. + /// The south latitude. + public double South { + get { + return this.SouthWest.x; + } + } + + /// Gets the west longitude. + /// The west longitude. + public double West { + get { + return this.SouthWest.y; + } + } + + /// Gets the north latitude. + /// The north latitude. + public double North { + get { + return this.NorthEast.x; + } + } + + /// Gets the east longitude. + /// The east longitude. + public double East { + get { + return this.NorthEast.y; + } + } + + /// + /// Gets or sets the central coordinate of the bounding box. When + /// setting a new center, the bounding box will retain its original size. + /// + /// The central coordinate. + public Vector2d Center { + get { + var lat = (this.SouthWest.x + this.NorthEast.x) / 2; + var lng = (this.SouthWest.y + this.NorthEast.y) / 2; + + return new Vector2d(lat, lng); + } + + set { + var lat = (this.NorthEast.x - this.SouthWest.x) / 2; + this.SouthWest.x = value.x - lat; + this.NorthEast.x = value.x + lat; + + var lng = (this.NorthEast.y - this.SouthWest.y) / 2; + this.SouthWest.y = value.y - lng; + this.NorthEast.y = value.y + lng; + } + } + + /// + /// Creates a bound from two arbitrary points. Contrary to the constructor, + /// this method always creates a non-empty box. + /// + /// The first point. + /// The second point. + /// The convex hull. + public static Vector2dBounds FromCoordinates(Vector2d a, Vector2d b) + { + var bounds = new Vector2dBounds(a, a); + bounds.Extend(b); + + return bounds; + } + + /// A bounding box containing the world. + /// The world bounding box. + public static Vector2dBounds World() + { + var sw = new Vector2d(-90, -180); + var ne = new Vector2d(90, 180); + + return new Vector2dBounds(sw, ne); + } + + /// Extend the bounding box to contain the point. + /// A geographic coordinate. + public void Extend(Vector2d point) + { + if (point.x < this.SouthWest.x) + { + this.SouthWest.x = point.x; + } + + if (point.x > this.NorthEast.x) + { + this.NorthEast.x = point.x; + } + + if (point.y < this.SouthWest.y) + { + this.SouthWest.y = point.y; + } + + if (point.y > this.NorthEast.y) + { + this.NorthEast.y = point.y; + } + } + + /// Extend the bounding box to contain the bounding box. + /// A bounding box. + public void Extend(Vector2dBounds bounds) + { + this.Extend(bounds.SouthWest); + this.Extend(bounds.NorthEast); + } + + /// Whenever the geographic bounding box is empty. + /// true, if empty, false otherwise. + public bool IsEmpty() + { + return this.SouthWest.x > this.NorthEast.x || + this.SouthWest.y > this.NorthEast.y; + } + + /// + /// Converts to an array of doubles. + /// + /// An array of coordinates. + public double[] ToArray() + { + double[] array = + { + this.SouthWest.x, + this.SouthWest.y, + this.NorthEast.x, + this.NorthEast.y + }; + + return array; + } + + /// Converts the Bbox to a URL snippet. + /// Returns a string for use in a Mapbox query URL. + public override string ToString() + { + return string.Format("{0},{1}", this.SouthWest.ToString(), this.NorthEast.ToString()); + } + } +} diff --git a/Core/mapbox-sdk-cs/Utils/GeoCoordinateBounds.cs.meta b/Core/mapbox-sdk-cs/Utils/GeoCoordinateBounds.cs.meta new file mode 100644 index 0000000..d7c837e --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/GeoCoordinateBounds.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8e1bb77e9b97c4e3e942735be5df9370 +timeCreated: 1493833265 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils/IObservable.cs b/Core/mapbox-sdk-cs/Utils/IObservable.cs new file mode 100644 index 0000000..0725808 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/IObservable.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Utils +{ + /// + /// An observable interface, similar to .NET 4.0 own IObservable. + /// + /// + /// The data being observed. + /// + public interface IObservable + { + /// Add an to the observer list. + /// The object subscribing to events. + void Subscribe(Mapbox.Utils.IObserver observer); + + /// Remove an to the observer list. + /// The object unsubscribing to events. + void Unsubscribe(Mapbox.Utils.IObserver observer); + } +} \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/Utils/IObservable.cs.meta b/Core/mapbox-sdk-cs/Utils/IObservable.cs.meta new file mode 100644 index 0000000..e4b20c8 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/IObservable.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9a29c46baf3924f1b9d848459974aedb +timeCreated: 1491243034 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils/IObserver.cs b/Core/mapbox-sdk-cs/Utils/IObserver.cs new file mode 100644 index 0000000..ed6e3e3 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/IObserver.cs @@ -0,0 +1,21 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Utils +{ + /// + /// An observer interface, similar to .NET 4.0 own IObserver. + /// + /// + /// The data being observed. + /// + public interface IObserver + { + /// The has updated the data. + /// The data that has changed. + void OnNext(T next); + } +} \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/Utils/IObserver.cs.meta b/Core/mapbox-sdk-cs/Utils/IObserver.cs.meta new file mode 100644 index 0000000..72416c9 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/IObserver.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3c13777d23b1144809002930214eed99 +timeCreated: 1491243034 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils/JsonConverters.meta b/Core/mapbox-sdk-cs/Utils/JsonConverters.meta new file mode 100644 index 0000000..24828dd --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/JsonConverters.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: bbed14c6a96bc4fba8b89885ba5f1724 +folderAsset: yes +timeCreated: 1491243031 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils/JsonConverters/BboxToGeoCoordinateBoundsConverter.cs b/Core/mapbox-sdk-cs/Utils/JsonConverters/BboxToGeoCoordinateBoundsConverter.cs new file mode 100644 index 0000000..ed0ad72 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/JsonConverters/BboxToGeoCoordinateBoundsConverter.cs @@ -0,0 +1,80 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Utils.JsonConverters +{ + using System; + using Mapbox.Json; + using Mapbox.Json.Converters; + using Mapbox.Json.Linq; + + /// + /// Bbox to geo coordinate bounds converter. + /// + public class BboxToVector2dBoundsConverter : CustomCreationConverter + { + /// + /// Gets a value indicating whether this can write. + /// + /// true if can write; otherwise, false. + public override bool CanWrite { + get { return true; } + } + + /// + /// Create the specified objectType. + /// + /// Object type. + /// A . + public override Vector2dBounds Create(Type objectType) + { + throw new NotImplementedException(); + } + + /// + /// Create the specified objectType and jArray. + /// + /// Object type. + /// J array. + /// A . + public Vector2dBounds Create(Type objectType, JArray val) + { + return new Vector2dBounds( + new Vector2d((double)val[0], (double)val[1]), + new Vector2d((double)val[2], (double)val[3])); + } + + /// + /// Reads the json. + /// + /// The serialized object. + /// A reader. + /// Object type. + /// Existing value. + /// A . + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + JArray bbox = JArray.Load(reader); + + return Create(objectType, bbox); + } + + /// + /// Writes the JSON as an array. + /// + /// A . + /// The value to serialize. + /// A . + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + var val = (Vector2dBounds)value; + + // TODO: This is not working correctly, and setting "bbox: [0,0,0,0]" to Vector2d properties for some reason. + System.Diagnostics.Debug.WriteLine(val); + serializer.Serialize(writer, val.ToArray()); + } + } +} diff --git a/Core/mapbox-sdk-cs/Utils/JsonConverters/BboxToGeoCoordinateBoundsConverter.cs.meta b/Core/mapbox-sdk-cs/Utils/JsonConverters/BboxToGeoCoordinateBoundsConverter.cs.meta new file mode 100644 index 0000000..44d8170 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/JsonConverters/BboxToGeoCoordinateBoundsConverter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 382bc19f5f34f4f14985294dbd8d4f73 +timeCreated: 1493218361 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils/JsonConverters/JsonConverters.cs b/Core/mapbox-sdk-cs/Utils/JsonConverters/JsonConverters.cs new file mode 100644 index 0000000..3e8fe55 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/JsonConverters/JsonConverters.cs @@ -0,0 +1,36 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Utils.JsonConverters +{ + using Mapbox.Json; + + /// + /// Custom json converters. + /// + public static class JsonConverters + { + /// + /// Array of converters. + /// + private static JsonConverter[] converters = + { + new LonLatToVector2dConverter(), + new BboxToVector2dBoundsConverter(), + new PolylineToVector2dListConverter() + }; + + /// + /// Gets the converters. + /// + /// The converters. + public static JsonConverter[] Converters { + get { + return converters; + } + } + } +} diff --git a/Core/mapbox-sdk-cs/Utils/JsonConverters/JsonConverters.cs.meta b/Core/mapbox-sdk-cs/Utils/JsonConverters/JsonConverters.cs.meta new file mode 100644 index 0000000..bf37eb8 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/JsonConverters/JsonConverters.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f95c54018d5ac404bbe0b84d5dc3ab9a +timeCreated: 1493218361 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils/JsonConverters/LonLatToGeoCoordinateConverter.cs b/Core/mapbox-sdk-cs/Utils/JsonConverters/LonLatToGeoCoordinateConverter.cs new file mode 100644 index 0000000..72fc61c --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/JsonConverters/LonLatToGeoCoordinateConverter.cs @@ -0,0 +1,83 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Utils.JsonConverters +{ + using System; + using Mapbox.Json; + using Mapbox.Json.Converters; + using Mapbox.Json.Linq; + + /// + /// Bbox to geo coordinate bounds converter. + /// + public class LonLatToVector2dConverter : CustomCreationConverter + { + /// + /// Gets a value indicating whether this can write. + /// + /// true if can write; otherwise, false. + public override bool CanWrite { + get { return true; } + } + + /// + /// Create the specified objectType. + /// + /// Object type. + /// A . + public override Vector2d Create(Type objectType) + { + throw new NotImplementedException(); + } + + /// + /// Create the specified objectType and jArray. + /// + /// Object type. + /// Jarray representing a two length array of coordinates. + /// A . + public Vector2d Create(Type objectType, JArray val) + { + // Assumes long,lat order (like in geojson) + return new Vector2d(y: (double)val[0], x: (double)val[1]); + } + + /// + /// Writes the json. + /// + /// A . + /// The value to serialize. + /// A . + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + var val = (Vector2d)value; + + Array valAsArray = val.ToArray(); + + // By default, Vector2d outputs an array with [lat, lon] order, but we want the reverse. + Array.Reverse(valAsArray); + + serializer.Serialize(writer, valAsArray); + } + + /// + /// Reads the json. + /// + /// The serialized object. + /// A reader. + /// Object type. + /// Existing value. + /// A . + /// An object. + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + JArray coordinates = JArray.Load(reader); + + return Create(objectType, coordinates); + } + } +} diff --git a/Core/mapbox-sdk-cs/Utils/JsonConverters/LonLatToGeoCoordinateConverter.cs.meta b/Core/mapbox-sdk-cs/Utils/JsonConverters/LonLatToGeoCoordinateConverter.cs.meta new file mode 100644 index 0000000..9f08efe --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/JsonConverters/LonLatToGeoCoordinateConverter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4974791f7db3740088cca9acd2104670 +timeCreated: 1493218361 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils/JsonConverters/PolylineToGeoCoordinateListConverter.cs b/Core/mapbox-sdk-cs/Utils/JsonConverters/PolylineToGeoCoordinateListConverter.cs new file mode 100644 index 0000000..48e3e2a --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/JsonConverters/PolylineToGeoCoordinateListConverter.cs @@ -0,0 +1,78 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Utils.JsonConverters +{ + using System; + using System.Collections.Generic; + using Mapbox.Json; + using Mapbox.Json.Converters; + using Mapbox.Json.Linq; + + /// + /// Bbox to geo coordinate bounds converter. + /// + public class PolylineToVector2dListConverter : CustomCreationConverter> + { + /// + /// Gets a value indicating whether this can write. + /// + /// true if can write; otherwise, false. + public override bool CanWrite { + get { return true; } + } + + /// + /// Create the specified objectType. + /// + /// Object type. + /// A List of . + public override List Create(Type objectType) + { + throw new NotImplementedException(); + } + + /// + /// Create the specified objectType and jArray. + /// + /// Object type. + /// String representation of a polyLine. + /// A List of . + public List Create(Type objectType, string polyLine) + { + return PolylineUtils.Decode(polyLine); + } + + /// + /// Writes the JSON as an encoded polyline. + /// + /// A . + /// The original value. + /// A . + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + var val = (List)value; + + serializer.Serialize(writer, PolylineUtils.Encode(val)); + } + + /// + /// Reads the json. Must be a linestring. + /// + /// The serialized object. + /// A Reader. + /// Object type. + /// Existing value. + /// A . + /// An object. + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + JToken polyLine = JToken.Load(reader); + + return Create(objectType, (string)polyLine); + } + } +} diff --git a/Core/mapbox-sdk-cs/Utils/JsonConverters/PolylineToGeoCoordinateListConverter.cs.meta b/Core/mapbox-sdk-cs/Utils/JsonConverters/PolylineToGeoCoordinateListConverter.cs.meta new file mode 100644 index 0000000..8ccdd1a --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/JsonConverters/PolylineToGeoCoordinateListConverter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 37d418b3df007437d873ac93f792c69b +timeCreated: 1493218361 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils/PolylineUtils.cs b/Core/mapbox-sdk-cs/Utils/PolylineUtils.cs new file mode 100644 index 0000000..96ceff2 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/PolylineUtils.cs @@ -0,0 +1,119 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Utils +{ + using System; + using System.Collections.Generic; + using System.Text; + + /// + /// A set of Polyline utils. + /// + public static class PolylineUtils + { + /// Decodes an encoded path string into a sequence of Positions. + /// + /// Adapted from + /// + /// A string representing a path. + /// Level of precision. OSRMv4 uses 6, OSRMv5 and Google use 5. + /// List of making up the line. + public static List Decode(string encodedPath, int precision = 5) + { + int len = encodedPath.Length; + + double factor = Math.Pow(10, precision); + + // For speed we preallocate to an upper bound on the final length, then + // truncate the array before returning. + var path = new List(); + int index = 0; + int lat = 0; + int lng = 0; + + while (index < len) + { + int result = 1; + int shift = 0; + int b; + do + { + b = encodedPath[index++] - 63 - 1; + result += b << shift; + shift += 5; + } + while (b >= 0x1f); + lat += (result & 1) != 0 ? ~(result >> 1) : (result >> 1); + + result = 1; + shift = 0; + do + { + b = encodedPath[index++] - 63 - 1; + result += b << shift; + shift += 5; + } + while (b >= 0x1f); + lng += (result & 1) != 0 ? ~(result >> 1) : (result >> 1); + + path.Add(new Vector2d(y: lng / factor, x: lat / factor)); + } + + return path; + } + + /// + /// Encodes a sequence of Positions into an encoded path string. + /// + /// + /// Adapted from + /// + /// List of making up the line. + /// Level of precision. OSRMv4 uses 6, OSRMv5 and Google use 5.. + /// A string representing a polyLine. + public static string Encode(List path, int precision = 5) + { + long lastLat = 0; + long lastLng = 0; + + var result = new StringBuilder(); + + double factor = Math.Pow(10, precision); + + foreach (Vector2d point in path) + { + var lat = (long)Math.Round(point.x * factor); + var lng = (long)Math.Round(point.y * factor); + + Encode(lat - lastLat, result); + Encode(lng - lastLng, result); + + lastLat = lat; + lastLng = lng; + } + + return result.ToString(); + } + + /// + /// Encode the latitude or longitude. + /// + /// The value to encode. + /// String representation of latitude or longitude. + private static void Encode(long variable, StringBuilder result) + { + variable = variable < 0 ? ~(variable << 1) : variable << 1; + while (variable >= 0x20) + { + result.Append((char)((int)((0x20 | (variable & 0x1f)) + 63))); + variable >>= 5; + } + + result.Append((char)((int)(variable + 63))); + } + } +} diff --git a/Core/mapbox-sdk-cs/Utils/PolylineUtils.cs.meta b/Core/mapbox-sdk-cs/Utils/PolylineUtils.cs.meta new file mode 100644 index 0000000..8428c8a --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/PolylineUtils.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3b86e6a08ea6e41c3bd214de1a0b1fa2 +timeCreated: 1493218361 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils/UnixTimestampUtils.cs b/Core/mapbox-sdk-cs/Utils/UnixTimestampUtils.cs new file mode 100644 index 0000000..711641c --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/UnixTimestampUtils.cs @@ -0,0 +1,65 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace Mapbox.Utils +{ + using System; + using System.Collections.Generic; + using System.Text; + + + /// + /// A set of Unix Timestamp utils. + /// + public static class UnixTimestampUtils + { + + // http://gigi.nullneuron.net/gigilabs/converting-tofrom-unix-timestamp-in-c/ + + /// + /// Convert from DateTime to Unix timestamp + /// + /// + /// + public static double To(DateTime date) + { + return date.Subtract(new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds; + } + + + /// + /// Convert from Unitx timestamp to DateTime. Uses TimeSpan.FromSeconds to caluclate offset since epoch 0 + /// + /// + /// + public static DateTime From(double timestamp) + { + return new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).Add(TimeSpan.FromSeconds(timestamp)); + } + + /// + /// Convert from Unitx timestamp to DateTime. Uses TimeSpan.FromSeconds to caluclate offset since epoch 0 + /// + /// + /// + public static DateTime FromMilliseconds(double timestamp) + { + return new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).Add(TimeSpan.FromMilliseconds(timestamp)); + } + + /// + /// Convert from Unitx timestamp to DateTime. Uses TimeSpan.FromTicks to caluclate offset since epoch 0 + /// + /// + /// + public static DateTime From(long timestamp) + { + return new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).Add(TimeSpan.FromTicks(timestamp)); + } + + + } +} diff --git a/Core/mapbox-sdk-cs/Utils/UnixTimestampUtils.cs.meta b/Core/mapbox-sdk-cs/Utils/UnixTimestampUtils.cs.meta new file mode 100644 index 0000000..96720f4 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/UnixTimestampUtils.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f2a29c583ae184002b8d46a92024562d +timeCreated: 1494952071 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils/Vector2d.meta b/Core/mapbox-sdk-cs/Utils/Vector2d.meta new file mode 100644 index 0000000..4414b69 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/Vector2d.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f1d1e64226b2747fea7e72a83de288ba +folderAsset: yes +timeCreated: 1491243031 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils/Vector2d/Mathd.cs b/Core/mapbox-sdk-cs/Utils/Vector2d/Mathd.cs new file mode 100644 index 0000000..047fd54 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/Vector2d/Mathd.cs @@ -0,0 +1,352 @@ +namespace Mapbox.Utils +{ + using System; + using System.Runtime.CompilerServices; + + public struct Mathd { + public const double PI = 3.141593d; + public const double Infinity = double.PositiveInfinity; + public const double NegativeInfinity = double.NegativeInfinity; + public const double Deg2Rad = 0.01745329d; + public const double Rad2Deg = 57.29578d; + public const double Epsilon = 1.401298E-45d; + + public static double Sin(double d) { + return Math.Sin(d); + } + + public static double Cos(double d) { + return Math.Cos(d); + } + + public static double Tan(double d) { + return Math.Tan(d); + } + + public static double Asin(double d) { + return Math.Asin(d); + } + + public static double Acos(double d) { + return Math.Acos(d); + } + + public static double Atan(double d) { + return Math.Atan(d); + } + + public static double Atan2(double y, double x) { + return Math.Atan2(y, x); + } + + public static double Sqrt(double d) { + return Math.Sqrt(d); + } + + public static double Abs(double d) { + return Math.Abs(d); + } + + public static int Abs(int value) { + return Math.Abs(value); + } + + public static double Min(double a, double b) { + if (a < b) + return a; + else + return b; + } + + public static double Min(params double[] values) { + int length = values.Length; + if (length == 0) + return 0.0d; + double num = values[0]; + for (int index = 1; index < length; ++index) { + if (values[index] < num) + num = values[index]; + } + return num; + } + + public static int Min(int a, int b) { + if (a < b) + return a; + else + return b; + } + + public static int Min(params int[] values) { + int length = values.Length; + if (length == 0) + return 0; + int num = values[0]; + for (int index = 1; index < length; ++index) { + if (values[index] < num) + num = values[index]; + } + return num; + } + + public static double Max(double a, double b) { + if (a > b) + return a; + else + return b; + } + + public static double Max(params double[] values) { + int length = values.Length; + if (length == 0) + return 0d; + double num = values[0]; + for (int index = 1; index < length; ++index) { + if ((double)values[index] > (double)num) + num = values[index]; + } + return num; + } + + public static int Max(int a, int b) { + if (a > b) + return a; + else + return b; + } + + public static int Max(params int[] values) { + int length = values.Length; + if (length == 0) + return 0; + int num = values[0]; + for (int index = 1; index < length; ++index) { + if (values[index] > num) + num = values[index]; + } + return num; + } + + public static double Pow(double d, double p) { + return Math.Pow(d, p); + } + + public static double Exp(double power) { + return Math.Exp(power); + } + + public static double Log(double d, double p) { + return Math.Log(d, p); + } + + public static double Log(double d) { + return Math.Log(d); + } + + public static double Log10(double d) { + return Math.Log10(d); + } + + public static double Ceil(double d) { + return Math.Ceiling(d); + } + + public static double Floor(double d) { + return Math.Floor(d); + } + + public static double Round(double d) { + return Math.Round(d); + } + + public static int CeilToInt(double d) { + return (int)Math.Ceiling(d); + } + + public static int FloorToInt(double d) { + return (int)Math.Floor(d); + } + + public static int RoundToInt(double d) { + return (int)Math.Round(d); + } + + public static double Sign(double d) { + return d >= 0.0 ? 1d : -1d; + } + + public static double Clamp(double value, double min, double max) { + if (value < min) + value = min; + else if (value > max) + value = max; + return value; + } + + public static int Clamp(int value, int min, int max) { + if (value < min) + value = min; + else if (value > max) + value = max; + return value; + } + + public static double Clamp01(double value) { + if (value < 0.0) + return 0.0d; + if (value > 1.0) + return 1d; + else + return value; + } + + public static double Lerp(double from, double to, double t) { + return from + (to - from) * Mathd.Clamp01(t); + } + + public static double LerpAngle(double a, double b, double t) { + double num = Mathd.Repeat(b - a, 360d); + if (num > 180.0d) + num -= 360d; + return a + num * Mathd.Clamp01(t); + } + + public static double MoveTowards(double current, double target, double maxDelta) { + if (Mathd.Abs(target - current) <= maxDelta) + return target; + else + return current + Mathd.Sign(target - current) * maxDelta; + } + + public static double MoveTowardsAngle(double current, double target, double maxDelta) { + target = current + Mathd.DeltaAngle(current, target); + return Mathd.MoveTowards(current, target, maxDelta); + } + + public static double SmoothStep(double from, double to, double t) { + t = Mathd.Clamp01(t); + t = (-2.0 * t * t * t + 3.0 * t * t); + return to * t + from * (1.0 - t); + } + + public static double Gamma(double value, double absmax, double gamma) { + bool flag = false; + if (value < 0.0) + flag = true; + double num1 = Mathd.Abs(value); + if (num1 > absmax) { + if (flag) + return -num1; + else + return num1; + } else { + double num2 = Mathd.Pow(num1 / absmax, gamma) * absmax; + if (flag) + return -num2; + else + return num2; + } + } + + public static bool Approximately(double a, double b) { + return Mathd.Abs(b - a) < Mathd.Max(1E-06d * Mathd.Max(Mathd.Abs(a), Mathd.Abs(b)), 1.121039E-44d); + } + + public static double SmoothDamp(double current, double target, ref double currentVelocity, double smoothTime, double maxSpeed, double deltaTime) { + smoothTime = Mathd.Max(0.0001d, smoothTime); + double num1 = 2d / smoothTime; + double num2 = num1 * deltaTime; + double num3 = (1.0d / (1.0d + num2 + 0.479999989271164d * num2 * num2 + 0.234999999403954d * num2 * num2 * num2)); + double num4 = current - target; + double num5 = target; + double max = maxSpeed * smoothTime; + double num6 = Mathd.Clamp(num4, -max, max); + target = current - num6; + double num7 = (currentVelocity + num1 * num6) * deltaTime; + currentVelocity = (currentVelocity - num1 * num7) * num3; + double num8 = target + (num6 + num7) * num3; + if (num5 - current > 0.0 == num8 > num5) { + num8 = num5; + currentVelocity = (num8 - num5) / deltaTime; + } + return num8; + } + + public static double SmoothDampAngle(double current, double target, ref double currentVelocity, double smoothTime, double maxSpeed, double deltaTime) { + target = current + Mathd.DeltaAngle(current, target); + return Mathd.SmoothDamp(current, target, ref currentVelocity, smoothTime, maxSpeed, deltaTime); + } + + public static double Repeat(double t, double length) { + return t - Mathd.Floor(t / length) * length; + } + + public static double PingPong(double t, double length) { + t = Mathd.Repeat(t, length * 2d); + return length - Mathd.Abs(t - length); + } + + public static double InverseLerp(double from, double to, double value) { + if (from < to) { + if (value < from) + return 0d; + if (value > to) + return 1d; + value -= from; + value /= to - from; + return value; + } else { + if (from <= to) + return 0d; + if (value < to) + return 1d; + if (value > from) + return 0d; + else + return (1.0d - (value - to) / (from - to)); + } + } + + public static double DeltaAngle(double current, double target) { + double num = Mathd.Repeat(target - current, 360d); + if (num > 180.0d) + num -= 360d; + return num; + } + + internal static bool LineIntersection(Vector2d p1, Vector2d p2, Vector2d p3, Vector2d p4, ref Vector2d result) { + double num1 = p2.x - p1.x; + double num2 = p2.y - p1.y; + double num3 = p4.x - p3.x; + double num4 = p4.y - p3.y; + double num5 = num1 * num4 - num2 * num3; + if (num5 == 0.0d) + return false; + double num6 = p3.x - p1.x; + double num7 = p3.y - p1.y; + double num8 = (num6 * num4 - num7 * num3) / num5; + result = new Vector2d(p1.x + num8 * num1, p1.y + num8 * num2); + return true; + } + + internal static bool LineSegmentIntersection(Vector2d p1, Vector2d p2, Vector2d p3, Vector2d p4, ref Vector2d result) { + double num1 = p2.x - p1.x; + double num2 = p2.y - p1.y; + double num3 = p4.x - p3.x; + double num4 = p4.y - p3.y; + double num5 = (num1 * num4 - num2 * num3); + if (num5 == 0.0d) + return false; + double num6 = p3.x - p1.x; + double num7 = p3.y - p1.y; + double num8 = (num6 * num4 - num7 * num3) / num5; + if (num8 < 0.0d || num8 > 1.0d) + return false; + double num9 = (num6 * num2 - num7 * num1) / num5; + if (num9 < 0.0d || num9 > 1.0d) + return false; + result = new Vector2d(p1.x + num8 * num1, p1.y + num8 * num2); + return true; + } + } +} diff --git a/Core/mapbox-sdk-cs/Utils/Vector2d/Mathd.cs.meta b/Core/mapbox-sdk-cs/Utils/Vector2d/Mathd.cs.meta new file mode 100644 index 0000000..2ec3fd2 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/Vector2d/Mathd.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 52ad69ec3e74044aeb3f5ae61b5069f3 +timeCreated: 1493218361 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils/Vector2d/RectD.cs b/Core/mapbox-sdk-cs/Utils/Vector2d/RectD.cs new file mode 100644 index 0000000..c3d4dae --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/Vector2d/RectD.cs @@ -0,0 +1,25 @@ +namespace Mapbox.Utils +{ + public struct RectD + { + public Vector2d Min { get; private set; } + public Vector2d Max { get; private set; } + //size is absolute width&height so Min+size != max + public Vector2d Size { get; private set; } + public Vector2d Center { get; private set; } + + public RectD(Vector2d min, Vector2d size) + { + Min = min; + Max = min + size; + Center = new Vector2d(Min.x + size.x / 2, Min.y + size.y / 2); + Size = new Vector2d(Mathd.Abs(size.x), Mathd.Abs(size.y)); + } + + public bool Contains(Vector2d point) + { + bool flag = Size.x < 0.0 && point.x <= Min.x && point.x > (Min.x + Size.x) || Size.x >= 0.0 && point.x >= Min.x && point.x < (Min.x + Size.x); + return flag && (Size.y < 0.0 && point.y <= Min.y && point.y > (Min.y + Size.y) || Size.y >= 0.0 && point.y >= Min.y && point.y < (Min.y + Size.y)); + } + } +} \ No newline at end of file diff --git a/Core/mapbox-sdk-cs/Utils/Vector2d/RectD.cs.meta b/Core/mapbox-sdk-cs/Utils/Vector2d/RectD.cs.meta new file mode 100644 index 0000000..8660a91 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/Vector2d/RectD.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f922c015d33a448f4b51ecc8e0153dd8 +timeCreated: 1493218361 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/mapbox-sdk-cs/Utils/Vector2d/Vector2d.cs b/Core/mapbox-sdk-cs/Utils/Vector2d/Vector2d.cs new file mode 100644 index 0000000..25eb2ad --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/Vector2d/Vector2d.cs @@ -0,0 +1,268 @@ +namespace Mapbox.Utils +{ + using Mapbox.Json; + using System; + using System.Globalization; + + [Serializable] + public struct Vector2d + { + public const double kEpsilon = 1E-05d; + public double x; + public double y; + + public double this[int index] + { + get + { + switch (index) + { + case 0: + return this.x; + case 1: + return this.y; + default: + throw new IndexOutOfRangeException("Invalid Vector2d index!"); + } + } + set + { + switch (index) + { + case 0: + this.x = value; + break; + case 1: + this.y = value; + break; + default: + throw new IndexOutOfRangeException("Invalid Vector2d index!"); + } + } + } + + [JsonIgnore] + public Vector2d normalized + { + get + { + Vector2d vector2d = new Vector2d(this.x, this.y); + vector2d.Normalize(); + return vector2d; + } + } + + [JsonIgnore] + public double magnitude + { + get + { + return Mathd.Sqrt(this.x * this.x + this.y * this.y); + } + } + + [JsonIgnore] + public double sqrMagnitude + { + get + { + return this.x * this.x + this.y * this.y; + } + } + + public static Vector2d zero + { + get + { + return new Vector2d(0.0d, 0.0d); + } + } + + public static Vector2d one + { + get + { + return new Vector2d(1d, 1d); + } + } + + public static Vector2d up + { + get + { + return new Vector2d(0.0d, 1d); + } + } + + public static Vector2d right + { + get + { + return new Vector2d(1d, 0.0d); + } + } + + public Vector2d(double x, double y) + { + this.x = x; + this.y = y; + } + + public static Vector2d operator +(Vector2d a, Vector2d b) + { + return new Vector2d(a.x + b.x, a.y + b.y); + } + + public static Vector2d operator -(Vector2d a, Vector2d b) + { + return new Vector2d(a.x - b.x, a.y - b.y); + } + + public static Vector2d operator -(Vector2d a) + { + return new Vector2d(-a.x, -a.y); + } + + public static Vector2d operator *(Vector2d a, double d) + { + return new Vector2d(a.x * d, a.y * d); + } + + public static Vector2d operator *(float d, Vector2d a) + { + return new Vector2d(a.x * d, a.y * d); + } + + public static Vector2d operator /(Vector2d a, double d) + { + return new Vector2d(a.x / d, a.y / d); + } + + public static bool operator ==(Vector2d lhs, Vector2d rhs) + { + return Vector2d.SqrMagnitude(lhs - rhs) < 0.0 / 1.0; + } + + public static bool operator !=(Vector2d lhs, Vector2d rhs) + { + return (double)Vector2d.SqrMagnitude(lhs - rhs) >= 0.0 / 1.0; + } + + public void Set(double new_x, double new_y) + { + this.x = new_x; + this.y = new_y; + } + + public static Vector2d Lerp(Vector2d from, Vector2d to, double t) + { + t = Mathd.Clamp01(t); + return new Vector2d(from.x + (to.x - from.x) * t, from.y + (to.y - from.y) * t); + } + + public static Vector2d MoveTowards(Vector2d current, Vector2d target, double maxDistanceDelta) + { + Vector2d vector2 = target - current; + double magnitude = vector2.magnitude; + if (magnitude <= maxDistanceDelta || magnitude == 0.0d) + return target; + else + return current + vector2 / magnitude * maxDistanceDelta; + } + + public static Vector2d Scale(Vector2d a, Vector2d b) + { + return new Vector2d(a.x * b.x, a.y * b.y); + } + + public void Scale(Vector2d scale) + { + this.x *= scale.x; + this.y *= scale.y; + } + + public void Normalize() + { + double magnitude = this.magnitude; + if (magnitude > 9.99999974737875E-06) + this = this / magnitude; + else + this = Vector2d.zero; + } + + public override string ToString() + { + return string.Format(NumberFormatInfo.InvariantInfo, "{0:F5},{1:F5}", this.y, this.x); + } + + public override int GetHashCode() + { + return this.x.GetHashCode() ^ this.y.GetHashCode() << 2; + } + + public override bool Equals(object other) + { + if (!(other is Vector2d)) + return false; + Vector2d vector2d = (Vector2d)other; + if (this.x.Equals(vector2d.x)) + return this.y.Equals(vector2d.y); + else + return false; + } + + public static double Dot(Vector2d lhs, Vector2d rhs) + { + return lhs.x * rhs.x + lhs.y * rhs.y; + } + + public static double Angle(Vector2d from, Vector2d to) + { + return Mathd.Acos(Mathd.Clamp(Vector2d.Dot(from.normalized, to.normalized), -1d, 1d)) * 57.29578d; + } + + public static double Distance(Vector2d a, Vector2d b) + { + return (a - b).magnitude; + } + + public static Vector2d ClampMagnitude(Vector2d vector, double maxLength) + { + if (vector.sqrMagnitude > maxLength * maxLength) + return vector.normalized * maxLength; + else + return vector; + } + + public static double SqrMagnitude(Vector2d a) + { + return (a.x * a.x + a.y * a.y); + } + + public double SqrMagnitude() + { + return (this.x * this.x + this.y * this.y); + } + + public static Vector2d Min(Vector2d lhs, Vector2d rhs) + { + return new Vector2d(Mathd.Min(lhs.x, rhs.x), Mathd.Min(lhs.y, rhs.y)); + } + + public static Vector2d Max(Vector2d lhs, Vector2d rhs) + { + return new Vector2d(Mathd.Max(lhs.x, rhs.x), Mathd.Max(lhs.y, rhs.y)); + } + + public double[] ToArray() + { + double[] array = + { + this.x, + this.y + }; + + return array; + } + } +} diff --git a/Core/mapbox-sdk-cs/Utils/Vector2d/Vector2d.cs.meta b/Core/mapbox-sdk-cs/Utils/Vector2d/Vector2d.cs.meta new file mode 100644 index 0000000..d4b6c60 --- /dev/null +++ b/Core/mapbox-sdk-cs/Utils/Vector2d/Vector2d.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 65e0c0d8a33eb4adea4665f24e55962a +timeCreated: 1493833265 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/probe-extractor-cs.meta b/Core/probe-extractor-cs.meta new file mode 100644 index 0000000..97c2f4d --- /dev/null +++ b/Core/probe-extractor-cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: d5e1c6b7d1367a6499dae6c38bf2a085 +folderAsset: yes +timeCreated: 1510755854 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/probe-extractor-cs/Probe.cs b/Core/probe-extractor-cs/Probe.cs new file mode 100644 index 0000000..6328a5a --- /dev/null +++ b/Core/probe-extractor-cs/Probe.cs @@ -0,0 +1,52 @@ + +namespace Mapbox.ProbeExtractorCs +{ + + using Mapbox.Unity.Location; + + + /// + /// Represents a point of a GPS trace + /// + public struct TracePoint + { + public long Timestamp; + public double Latitude; + public double Longitude; + public double Bearing; + public float? Elevation; + /// Horizontal dilution of precision + public float? HDop; + /// Vertical dilution of precision + public float? VDop; + + public static TracePoint FromLocation(Location location) + { + return new TracePoint() + { + Timestamp = (long)location.Timestamp, + Latitude = location.LatitudeLongitude.x, + Longitude = location.LatitudeLongitude.y, + Bearing = location.UserHeading, + HDop = location.Accuracy + }; + } + } + + + /// + /// Represents a probe extracted by ProbeExtractor + /// + public struct Probe + { + public double Latitude; + public double Longitude; + public long StartTime; + public long Duration; + public double Speed; + public double Bearing; + public double Distance; + public bool IsGood; + } + +} \ No newline at end of file diff --git a/Core/probe-extractor-cs/Probe.cs.meta b/Core/probe-extractor-cs/Probe.cs.meta new file mode 100644 index 0000000..de9fb2c --- /dev/null +++ b/Core/probe-extractor-cs/Probe.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 1ee37be5546122440bc3a9abd7318aea +timeCreated: 1510828497 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/probe-extractor-cs/ProbeExtractor.cs b/Core/probe-extractor-cs/ProbeExtractor.cs new file mode 100644 index 0000000..9c3ac62 --- /dev/null +++ b/Core/probe-extractor-cs/ProbeExtractor.cs @@ -0,0 +1,354 @@ +namespace Mapbox.ProbeExtractorCs +{ + + + using Mapbox.CheapRulerCs; + using System; + using System.Collections.Generic; + + + public class ProbeExtractorOptions + { + /// Seconds + public double MinTimeBetweenProbes = 0; + /// Do not include probes when the distance is X times bigger than the previous one + public double MaxDistanceRatioJump = double.MaxValue; + /// Do not include probes when the duration is X times bigger than the previous one + public double MaxDurationRatioJump = double.MaxValue; + /// Meters per second per second + public double MaxAcceleration = double.MaxValue; + /// Meters per second per second + public double MaxDeceleration = double.MaxValue; + /// Minimum probes extracted data should contain + public int MinProbes = 2; + /// Also return probes deemed not good + public bool OutputBadProbes = false; + } + + + /// + /// This module allows to pass a list of trace points and extract its probes and their properties. + /// It can also act as a filter for those probes. + /// + public class ProbeExtractor + { + + private CheapRuler _ruler; + private ProbeExtractorOptions _options; + + + /// + /// + /// + /// A CheapRuler instance, expected in kilometers. + /// + public ProbeExtractor(CheapRuler ruler, ProbeExtractorOptions options) + { + _ruler = ruler; + _options = options; + } + + + /// + /// Extract probes according to ProbeExtractorOptions. + /// + /// List of trace points + /// List of probes. Empty list if no trace point matched the options. + public List ExtractProbes(List trace) + { + int tracePntCnt = trace.Count; + long[] durations = new long[tracePntCnt - 1]; + double[] distances = new double[tracePntCnt - 1]; + double[] speeds = new double[tracePntCnt - 1]; + double[] bearings = new double[tracePntCnt - 1]; + + for (int i = 1; i < tracePntCnt; i++) + { + TracePoint current = trace[i]; + TracePoint previous = trace[i - 1]; + int insertIdx = i - 1; + + durations[insertIdx] = (current.Timestamp - previous.Timestamp) / 1000; //seconds + + double[] currLocation = new double[] { current.Longitude, current.Latitude }; + double[] prevLocation = new double[] { previous.Longitude, previous.Latitude }; + distances[insertIdx] = _ruler.Distance(currLocation, prevLocation); + speeds[insertIdx] = distances[insertIdx] / durations[insertIdx] * 3600; //kph + + double bearing = _ruler.Bearing(prevLocation, currLocation); + bearings[insertIdx] = bearing < 0 ? 360 + bearing : bearing; + } + + List probes = new List(); + + // 1st pass: iterate trace points and determine if they are good + // bail early if !_options.OutputBadProbes + bool negativeDuration = false; + for (int i = 1; i < speeds.Length; i++) + { + //assume tracpoint is good + bool isGood = true; + if (negativeDuration) + { + // if trace already has a negative duration, then all probes are bad + isGood = false; + } + else if (durations[i] < 0) + { + // if a trace has negative duration, the trace is likely noisy + // bail, if we don't want bad probes + if (!_options.OutputBadProbes) { return new List(); } + + negativeDuration = true; + isGood = false; + } + else if (durations[i] < _options.MinTimeBetweenProbes) + { + // if shorter than the minTimeBetweenProbes, filter. + isGood = false; + } + else if (durations[i] > _options.MaxDurationRatioJump * durations[i - 1]) + { + // if not a gradual decrease in sampling frequency, it's most likely a signal jump + isGood = false; + } + else if (speeds[i] - speeds[i - 1] > _options.MaxAcceleration * durations[i]) + { + // if accelerating faster than maxAcceleration, it's most likely a glitch + isGood = false; + } + else if (speeds[i - 1] - speeds[i] > _options.MaxDeceleration * durations[i]) + { + // if decelerating faster than maxDeceleration, it's most likely a glitch + isGood = false; + } + else + { + bool isForwardDirection = compareBearing(bearings[i - 1], bearings[i], 89, false); + if (!isForwardDirection) + { + isGood = false; + } + } + + if (isGood || _options.OutputBadProbes) + { + double[] coords = pointAtDistanceAndBearing( + trace[i - 1] + , distances[i] / 2 + , bearings[i] + ); + + probes.Add(new Probe() + { + Latitude = coords[1], + Longitude = coords[0], + StartTime = trace[i].Timestamp, + Duration = durations[i], + Distance = distances[i], + Speed = speeds[i], + Bearing = bearings[i], + IsGood = isGood + }); + } + } + + // if too few good probes, drop entire trace + if (!_options.OutputBadProbes && probes.Count < _options.MinProbes) + { + return new List(); + } + + // MinProbes can be 0, return + if (probes.Count == 0 && _options.MinProbes == 0) + { + return new List(); + } + + + // 2nd pass + + // require at least two probes + if (probes.Count > 1) + { + // check first probe in a trace against the average of first two good probes + var avgSpeed = (probes[0].Speed + probes[1].Speed) / 2; + var avgDistance = (probes[0].Distance + probes[1].Distance) / 2; + var avgDuration = (probes[0].Duration + probes[1].Duration) / 2; + var avgBearing = averageAngle(probes[0].Bearing, probes[1].Bearing); + + bool good = true; + + if (negativeDuration) + { + if (!_options.OutputBadProbes) + { + return new List(); + } + + negativeDuration = true; + good = false; + + // if a trace has negative duration, the trace is likely noisy + } + else if (durations[0] < 0) + { + good = false; + } + else if (durations[0] < _options.MinTimeBetweenProbes) + { + // if shorter than the minTimeBetweenProbes, filter. + good = false; + } + else if (distances[0] > _options.MaxDistanceRatioJump * avgDistance) + { + // if not a gradual increase in distance, it's most likely a signal jump + good = false; + } + else if (durations[0] > _options.MaxDurationRatioJump * avgDuration) + { + // if not a gradual decrease in sampling frequency, it's most likely a signal jump + good = false; + } + else if (avgSpeed - speeds[0] > _options.MaxAcceleration * durations[0]) + { + // if accelerating faster than maxAcceleration, it's most likely a glitch + good = false; + } + else if (speeds[0] - avgSpeed > _options.MaxDeceleration * durations[0]) + { + // if decelerating faster than maxDeceleration, it's most likely a glitch + good = false; + } + else + { + // if in reverse direction, it's most likely signal jump + bool isForwardDirection = compareBearing(bearings[0], avgBearing, 89, false); + if (!isForwardDirection) + { + good = false; + } + } + + if (good || _options.OutputBadProbes) + { + + double[] coords = pointAtDistanceAndBearing( + trace[0] + , distances[0] + , bearings[0] + ); + + probes.Insert( + 0, + new Probe() + { + Latitude = coords[1], + Longitude = coords[0], + StartTime = trace[0].Timestamp, + Duration = durations[0], + Distance = distances[0], + Speed = speeds[0], + Bearing = bearings[0], + IsGood = good + } + ); + } + } + + return probes; + } + + + /// + /// Computes the average of two angles. + /// + /// First angle. + /// Second angle + /// Angle midway between a and b. + private double averageAngle(double a, double b) + { + var anorm = normalizeAngle(a); + var bnorm = normalizeAngle(b); + + var minAngle = Math.Min(anorm, bnorm); + var maxAngle = Math.Max(anorm, bnorm); + + var dist1 = Math.Abs(a - b); + var dist2 = (minAngle + (360 - maxAngle)); + + if (dist1 <= dist2) { return normalizeAngle(minAngle + dist1 / 2); } + else + { + return normalizeAngle(maxAngle + dist2 / 2); + } + } + + + /// + /// Map angle to positive modulo 360 space. + /// + /// An angle in degrees + /// Equivalent angle in [0-360] space. + private double normalizeAngle(double angle) + { + return (angle < 0) ? (angle % 360) + 360 : (angle % 360); + } + + + /// + /// Compare bearing `baseBearing` to `bearing`, to determine if they are close enough to each other to be considered matching. + /// + /// Base bearing + /// Number of degrees difference that is allowed between the bearings. + /// + /// allows bearings that are 180 degrees +/- `range` to be considered matching + /// + private bool compareBearing(double baseBearing, double bearing, double range, bool allowReverse) + { + + // map base and bearing into positive modulo 360 space + var normalizedBase = normalizeAngle(baseBearing); + var normalizedBearing = normalizeAngle(bearing); + + var min = normalizeAngle(normalizedBase - range); + var max = normalizeAngle(normalizedBase + range); + + if (min < max) + { + if (min <= normalizedBearing && normalizedBearing <= max) + { + return true; + } + } + else if (min <= normalizedBearing || normalizedBearing <= max) + { + return true; + } + + if (allowReverse) + { + return compareBearing(normalizedBase + 180, bearing, range, false); + } + + return false; + } + + + + /// + /// Creates coordinate in between two trace points to smooth line + /// + /// double array containing lng/lat + private double[] pointAtDistanceAndBearing(TracePoint tracePoint, double distance, double bearing) + { + return _ruler.Destination( + new double[] { tracePoint.Longitude, tracePoint.Latitude } + , distance + , bearing + ); + + } + + } +} \ No newline at end of file diff --git a/Core/probe-extractor-cs/ProbeExtractor.cs.meta b/Core/probe-extractor-cs/ProbeExtractor.cs.meta new file mode 100644 index 0000000..968a60f --- /dev/null +++ b/Core/probe-extractor-cs/ProbeExtractor.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: c5372119c5f67a74b940346a8aff4fc6 +timeCreated: 1510757089 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/probe-extractor-cs/Tests.meta b/Core/probe-extractor-cs/Tests.meta new file mode 100644 index 0000000..c90b26d --- /dev/null +++ b/Core/probe-extractor-cs/Tests.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: da2de0b67d574e64481954f696b7b58f +folderAsset: yes +timeCreated: 1511187101 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/probe-extractor-cs/Tests/Editor.meta b/Core/probe-extractor-cs/Tests/Editor.meta new file mode 100644 index 0000000..4a211cc --- /dev/null +++ b/Core/probe-extractor-cs/Tests/Editor.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c0c613d8a2e6422439f0ee0a0e418427 +folderAsset: yes +timeCreated: 1511187112 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/probe-extractor-cs/Tests/Editor/MapboxUnitTests_ProbeExtractorCs.cs b/Core/probe-extractor-cs/Tests/Editor/MapboxUnitTests_ProbeExtractorCs.cs new file mode 100644 index 0000000..61f4311 --- /dev/null +++ b/Core/probe-extractor-cs/Tests/Editor/MapboxUnitTests_ProbeExtractorCs.cs @@ -0,0 +1,222 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) 2016 Mapbox. All rights reserved. +// +//----------------------------------------------------------------------- + +// TODO: figure out how run tests outside of Unity with .NET framework, something like '#if !UNITY' + +namespace Mapbox.ProbeExtractorCs.UnitTest +{ + + + using Mapbox.Platform; + using NUnit.Framework; + using System.Collections.Generic; + using System.Globalization; + using System.IO; + using System.Text; + using System; + using System.Linq; + using UnityEngine; + using Mapbox.CheapRulerCs; + + [TestFixture] + internal class ProbeExtractorCsTest + { + + private List _trace; + private List _footTrace; + private List _probes; + + [SetUp] + public void SetUp() + { + _trace = loadTraceFixture("ProbeExtractorCs_fixture_trace"); + _footTrace = loadTraceFixture("ProbeExtractorCs_fixture_trace-foot"); + _probes = loadProbeFixture("ProbeExtractorCs_fixture_probes"); + } + + + + [Test, Order(1)] + public void FixturesLoaded() + { + Assert.AreEqual(14, _trace.Count); + Assert.AreEqual(12, _probes.Count); + } + + + [Test] + public void ExtractProbes() + { + CheapRuler ruler = CheapRuler.FromTile(49, 7); + + ProbeExtractorOptions options = new ProbeExtractorOptions() + { + MinTimeBetweenProbes = 1, // seconds + MaxDistanceRatioJump = 3, // do not include probes when the distance is 3 times bigger than the previous one + MaxDurationRatioJump = 3, // do not include probes when the duration is 3 times bigger than the previous one + MaxAcceleration = 15, // meters per second per second + MaxDeceleration = 18 // meters per second per second + }; + + ProbeExtractor extractor = new ProbeExtractor(ruler, options); + List extractedProbes = extractor.ExtractProbes(_trace); + + Assert.AreEqual(12, extractedProbes.Count, "12 probes were expected to be extracted"); + + for (int i = 0; i < extractedProbes.Count; i++) + { + Probe fp = _probes[i]; // fixture probe + Probe ep = extractedProbes[i]; // extracted probe + + Assert.AreEqual(fp.Longitude, ep.Longitude, 0.001, "probe[" + i.ToString() + "]: longitude doesn't match"); + Assert.AreEqual(fp.Latitude, ep.Latitude, 0.001, "probe[" + i.ToString() + "]: latitude doesn't match"); + Assert.AreEqual(fp.StartTime, ep.StartTime, "probe[" + i.ToString() + "]: start time doesn't match"); + Assert.AreEqual(fp.Duration, ep.Duration, "probe[" + i.ToString() + "]: duration doesn't match"); + Assert.AreEqual(fp.Speed, ep.Speed, 0.001, "probe[" + i.ToString() + "]: speed doesn't match"); + Assert.AreEqual(fp.Bearing, ep.Bearing, 0.001, "probe[" + i.ToString() + "]: bearing doesn't match"); + Assert.AreEqual(fp.Distance, ep.Distance, 0.001, "probe[" + i.ToString() + "]: distance doesn't match"); + Assert.AreEqual(fp.IsGood, ep.IsGood, "probe[" + i.ToString() + "]: longitude doesn't match"); + } + + + options.MinTimeBetweenProbes = 2; + extractor = new ProbeExtractor(ruler, options); + extractedProbes = extractor.ExtractProbes(_trace); + + Assert.AreEqual(5, extractedProbes.Count, "5 probes were expected to be extracted"); + + + options.OutputBadProbes = true; + extractor = new ProbeExtractor(ruler, options); + extractedProbes = extractor.ExtractProbes(_trace); + + Assert.AreEqual(13, extractedProbes.Count, "13 probes were expected to be extracted"); + } + + + [Test] + public void ExtractFootTrace() + { + CheapRuler ruler = new CheapRuler(_footTrace[0].Latitude); + ProbeExtractorOptions options = new ProbeExtractorOptions(); + + ProbeExtractor extractor = new ProbeExtractor(ruler, options); + List extractedProbes = extractor.ExtractProbes(_footTrace); + + Assert.AreEqual(40, extractedProbes.Count); + } + + + private List loadTraceFixture(string fixtureName) + { + TextAsset fixtureAsset = Resources.Load(fixtureName); + List trace = new List(); + using (StringReader sr = new StringReader(fixtureAsset.text)) + { + // skip header + sr.ReadLine(); + string line; + while (null != (line = sr.ReadLine())) + { + string[] tokens = line.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); + if (tokens.Length != 4) + { + Debug.LogWarning("trace.csv has wrong number of columns"); + continue; + } + + double lng; + double lat; + double bearing; + long timestamp; + + if (!double.TryParse(tokens[0], NumberStyles.Any, CultureInfo.InvariantCulture, out lng)) { Debug.LogWarning("could not parse longitude"); continue; } + if (!double.TryParse(tokens[1], NumberStyles.Any, CultureInfo.InvariantCulture, out lat)) { Debug.LogWarning("could not parse latitude"); continue; } + if (!double.TryParse(tokens[2], NumberStyles.Any, CultureInfo.InvariantCulture, out bearing)) { Debug.LogWarning("could not parse bearing"); continue; } + if (!long.TryParse(tokens[3], NumberStyles.Any, CultureInfo.InvariantCulture, out timestamp)) { Debug.LogWarning("could not parse timestamp"); continue; } + + trace.Add(new TracePoint() + { + Longitude = lng, + Latitude = lat, + Bearing = bearing, + Timestamp = timestamp + }); + } + } + return trace; + } + + + private List loadProbeFixture(string fixtureName) + { + TextAsset fixtureAsset = Resources.Load(fixtureName); + List probes = new List(); + using (StringReader sr = new StringReader(fixtureAsset.text)) + { + // skip header + sr.ReadLine(); + string line; + while (null != (line = sr.ReadLine())) + { + string[] tokens = line.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); + if (tokens.Length != 8) + { + Debug.LogWarning("probes.csv has wrong number of columns"); + continue; + } + + double lng; + double lat; + long startTime; + long duration; + double speed; + double bearing; + double distance; + bool isGood; + + if (!double.TryParse(tokens[0], NumberStyles.Any, CultureInfo.InvariantCulture, out lng)) { Debug.LogWarning("could not parse longitude"); continue; } + if (!double.TryParse(tokens[1], NumberStyles.Any, CultureInfo.InvariantCulture, out lat)) { Debug.LogWarning("could not parse latitude"); continue; } + if (!long.TryParse(tokens[2], NumberStyles.Any, CultureInfo.InvariantCulture, out startTime)) { Debug.LogWarning("could not parse timestamp"); continue; } + if (!long.TryParse(tokens[3], NumberStyles.Any, CultureInfo.InvariantCulture, out duration)) { Debug.LogWarning("could not parse duration"); continue; } + if (!double.TryParse(tokens[4], NumberStyles.Any, CultureInfo.InvariantCulture, out speed)) { Debug.LogWarning("could not parse speed"); continue; } + if (!double.TryParse(tokens[5], NumberStyles.Any, CultureInfo.InvariantCulture, out bearing)) { Debug.LogWarning("could not parse bearing"); continue; } + if (!double.TryParse(tokens[6], NumberStyles.Any, CultureInfo.InvariantCulture, out distance)) { Debug.LogWarning("could not parse distance"); continue; } + if (!bool.TryParse(tokens[7], out isGood)) { Debug.LogWarning("could not parse good"); continue; } + + probes.Add(new Probe() + { + Longitude = lng, + Latitude = lat, + StartTime = startTime, + Duration = duration, + Speed = speed, + Bearing = bearing, + Distance = distance, + IsGood = isGood + }); + } + } + return probes; + } + + + // quick hack for visualizing output of ProbeExtractor on http://geojson.io + private string probesToGeojson(List probes) + { + StringBuilder sb = new StringBuilder(); + + // line + sb.Append("{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"LineString\",\"coordinates\":["); + sb.Append(string.Join(",", probes.Select(p => string.Format(CultureInfo.InvariantCulture, "[{0},{1}]", p.Longitude, p.Latitude)).ToArray())); + sb.Append("]}}"); + + sb.Append("]}"); + return sb.ToString(); + } + + } +} diff --git a/Core/probe-extractor-cs/Tests/Editor/MapboxUnitTests_ProbeExtractorCs.cs.meta b/Core/probe-extractor-cs/Tests/Editor/MapboxUnitTests_ProbeExtractorCs.cs.meta new file mode 100644 index 0000000..9aeb2d4 --- /dev/null +++ b/Core/probe-extractor-cs/Tests/Editor/MapboxUnitTests_ProbeExtractorCs.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 6c911a8f62439664b8f8743ebfa8700a +timeCreated: 1511187181 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/DragableDirectionWaypoint.cs b/DragableDirectionWaypoint.cs new file mode 100644 index 0000000..bc6dbf1 --- /dev/null +++ b/DragableDirectionWaypoint.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Mapbox.Examples +{ + public class DragableDirectionWaypoint : MonoBehaviour + { + public Action MouseDown = () => { }; + public Action MouseDraging = () => { }; + public Action MouseDrop = () => { }; + + public Transform MoveTarget; + private Vector3 screenPoint; + private Vector3 offset; + private Plane _yPlane; + + public void Start() + { + _yPlane = new Plane(Vector3.up, Vector3.zero); + } + + void OnMouseDrag() + { + MouseDraging(); + Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); + float enter = 0.0f; + if (_yPlane.Raycast(ray, out enter)) + { + MoveTarget.position = ray.GetPoint(enter); + } + } + + private void OnMouseDown() + { + MouseDown(); + } + + private void OnMouseUp() + { + MouseDrop(); + } + } +} diff --git a/DragableDirectionWaypoint.cs.meta b/DragableDirectionWaypoint.cs.meta new file mode 100644 index 0000000..28b98e3 --- /dev/null +++ b/DragableDirectionWaypoint.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 9c39c383c96521a4083f7339972619c7 +timeCreated: 1528989212 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fonts.meta b/Fonts.meta new file mode 100644 index 0000000..b847d1e --- /dev/null +++ b/Fonts.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3d729f28e8e9e4c73874798680125792 +folderAsset: yes +timeCreated: 1480366434 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fonts/OpenSans-Bold.ttf b/Fonts/OpenSans-Bold.ttf new file mode 100644 index 0000000..fd79d43 Binary files /dev/null and b/Fonts/OpenSans-Bold.ttf differ diff --git a/Fonts/OpenSans-Bold.ttf.meta b/Fonts/OpenSans-Bold.ttf.meta new file mode 100644 index 0000000..5b87645 --- /dev/null +++ b/Fonts/OpenSans-Bold.ttf.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: 7dfc2e1472ac84e1bb749a8a9f934483 +TrueTypeFontImporter: + serializedVersion: 2 + fontSize: 5 + forceTextureCase: -2 + characterSpacing: 1 + characterPadding: 0 + includeFontData: 1 + use2xBehaviour: 0 + fontNames: [] + customCharacters: + fontRenderingMode: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fonts/OpenSans-Regular.ttf b/Fonts/OpenSans-Regular.ttf new file mode 100644 index 0000000..db43334 Binary files /dev/null and b/Fonts/OpenSans-Regular.ttf differ diff --git a/Fonts/OpenSans-Regular.ttf.meta b/Fonts/OpenSans-Regular.ttf.meta new file mode 100644 index 0000000..d73c768 --- /dev/null +++ b/Fonts/OpenSans-Regular.ttf.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: bd1ea67ca2b5742d1a24fcbdc17c55e1 +TrueTypeFontImporter: + serializedVersion: 2 + fontSize: 5 + forceTextureCase: -2 + characterSpacing: 1 + characterPadding: 0 + includeFontData: 1 + use2xBehaviour: 0 + fontNames: [] + customCharacters: + fontRenderingMode: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fonts/OpenSans-Semibold.ttf b/Fonts/OpenSans-Semibold.ttf new file mode 100644 index 0000000..1a7679e Binary files /dev/null and b/Fonts/OpenSans-Semibold.ttf differ diff --git a/Fonts/OpenSans-Semibold.ttf.meta b/Fonts/OpenSans-Semibold.ttf.meta new file mode 100644 index 0000000..4194125 --- /dev/null +++ b/Fonts/OpenSans-Semibold.ttf.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: 218956a5c2a6e42d6a60afccf80b002b +TrueTypeFontImporter: + serializedVersion: 2 + fontSize: 5 + forceTextureCase: -2 + characterSpacing: 1 + characterPadding: 0 + includeFontData: 1 + use2xBehaviour: 0 + fontNames: [] + customCharacters: + fontRenderingMode: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Fonts/OpenSansLic.txt b/Fonts/OpenSansLic.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/Fonts/OpenSansLic.txt @@ -0,0 +1,202 @@ + + 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. diff --git a/Fonts/OpenSansLic.txt.meta b/Fonts/OpenSansLic.txt.meta new file mode 100644 index 0000000..b48dfd7 --- /dev/null +++ b/Fonts/OpenSansLic.txt.meta @@ -0,0 +1,6 @@ +fileFormatVersion: 2 +guid: 7d1743538c61d42559fdf1e11d5bad17 +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Materials.meta b/Materials.meta new file mode 100644 index 0000000..fd56322 --- /dev/null +++ b/Materials.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b7649b69d4931a741ad3dcc8d326087b +folderAsset: yes +timeCreated: 1505418320 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Materials/LoadingMaterial.mat b/Materials/LoadingMaterial.mat new file mode 100644 index 0000000..dbe4b18 --- /dev/null +++ b/Materials/LoadingMaterial.mat @@ -0,0 +1,37 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: LoadingMaterial + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: e2896a92727704803a9c422b043eae89, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + - _InvFade: 1 + m_Colors: + - _Color: {r: 0, g: 0.91724133, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} + - _TintColor: {r: 0, g: 0.7931032, b: 1, a: 1} diff --git a/Materials/LoadingMaterial.mat.meta b/Materials/LoadingMaterial.mat.meta new file mode 100644 index 0000000..2b55853 --- /dev/null +++ b/Materials/LoadingMaterial.mat.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: e486fb1a0b4233944af95fee011a22e0 +timeCreated: 1505418341 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Materials/MaskTest.mat b/Materials/MaskTest.mat new file mode 100644 index 0000000..c0fb3d8 --- /dev/null +++ b/Materials/MaskTest.mat @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: MaskTest + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Materials/MaskTest.mat.meta b/Materials/MaskTest.mat.meta new file mode 100644 index 0000000..f2bce1a --- /dev/null +++ b/Materials/MaskTest.mat.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: af23ad1f77579405eb8e5010eab51186 +timeCreated: 1518216790 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Materials/frameTest.mat b/Materials/frameTest.mat new file mode 100644 index 0000000..bde6612 --- /dev/null +++ b/Materials/frameTest.mat @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: frameTest + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Materials/frameTest.mat.meta b/Materials/frameTest.mat.meta new file mode 100644 index 0000000..1dfee4a --- /dev/null +++ b/Materials/frameTest.mat.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8b1bace0619934bbd966f8b67360472c +timeCreated: 1518735418 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Prefabs.meta b/Prefabs.meta new file mode 100644 index 0000000..a0ddb12 --- /dev/null +++ b/Prefabs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0db425f244af04bc9a710f6886a34403 +folderAsset: yes +timeCreated: 1480368170 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Prefabs/Attribution.prefab b/Prefabs/Attribution.prefab new file mode 100644 index 0000000..d378bf3 --- /dev/null +++ b/Prefabs/Attribution.prefab @@ -0,0 +1,2976 @@ +%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: 1000012270391302} + m_IsPrefabParent: 1 +--- !u!1 &1000010054780072 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000011786869730} + - component: {fileID: 222000013861620362} + - component: {fileID: 114000013954146960} + m_Layer: 5 + m_Name: GeneralPopup + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1000010251623658 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000013849289752} + - component: {fileID: 222000013216232360} + - component: {fileID: 114000013974789120} + - component: {fileID: 114000010956861998} + m_Layer: 5 + m_Name: MapboxLogo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010261933500 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000011052731304} + - component: {fileID: 222000012542523728} + - component: {fileID: 114000014293323536} + - component: {fileID: 114000010413256100} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1000010322957038 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000010832569436} + - component: {fileID: 222000012838451916} + - component: {fileID: 114000011669420336} + m_Layer: 5 + m_Name: Border + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010469169742 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012452801200} + - component: {fileID: 222000012598981250} + - component: {fileID: 114000012514615580} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010595931910 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000011871004796} + - component: {fileID: 222000010898632596} + - component: {fileID: 114000010200746752} + m_Layer: 5 + m_Name: Border + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010654442462 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000010289174704} + - component: {fileID: 222000013765660792} + - component: {fileID: 114000011291760786} + m_Layer: 5 + m_Name: Detail + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010903190438 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012954539924} + - component: {fileID: 222000013821890836} + - component: {fileID: 114000013194257072} + - component: {fileID: 114000012991362564} + - component: {fileID: 114000011502999528} + m_Layer: 5 + m_Name: OpenStreetMap + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011102880912 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012863316938} + - component: {fileID: 222000012073267988} + - component: {fileID: 114000011099255292} + m_Layer: 5 + m_Name: Border + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011170295744 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000011881113432} + - component: {fileID: 114000013425509446} + m_Layer: 5 + m_Name: Buttons + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011206144066 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012853769856} + - component: {fileID: 222000014189796102} + - component: {fileID: 114000010891849290} + m_Layer: 5 + m_Name: Border + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011230084972 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000011665632892} + - component: {fileID: 222000010152334938} + - component: {fileID: 114000013305285980} + m_Layer: 5 + m_Name: Border + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011293578650 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000011436070778} + - component: {fileID: 222000011956438890} + - component: {fileID: 114000014032524088} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011707437516 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000011240730510} + m_Layer: 5 + m_Name: TextHolder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011782995990 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000011463966310} + - component: {fileID: 222000013959506544} + - component: {fileID: 114000012327158974} + - component: {fileID: 114000013366972262} + - component: {fileID: 114000013102648220} + m_Layer: 5 + m_Name: ImproveThisMap + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011939526250 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000010449021188} + - component: {fileID: 222000012689643076} + - component: {fileID: 114000010853554134} + - component: {fileID: 114000010592763224} + - component: {fileID: 114000012459593998} + m_Layer: 5 + m_Name: MoreInfo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011994908926 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000010973732652} + - component: {fileID: 222000011304938888} + - component: {fileID: 114000011915122438} + m_Layer: 5 + m_Name: MakeMapboxMapsBetter + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012270391302 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000013044306136} + - component: {fileID: 223000013144521578} + - component: {fileID: 114000013038469802} + - component: {fileID: 114000011445104640} + m_Layer: 5 + m_Name: Attribution + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012472160484 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012669324860} + - component: {fileID: 222000014189569612} + - component: {fileID: 114000012113965706} + - component: {fileID: 114000012931723954} + - component: {fileID: 114000013215882760} + m_Layer: 5 + m_Name: Mapbox + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012558740832 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012654707720} + - component: {fileID: 222000013053592878} + - component: {fileID: 114000013496265404} + - component: {fileID: 114000013548531306} + m_Layer: 5 + m_Name: MapboxTelemetry + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012678072350 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012680463924} + - component: {fileID: 114000010010780026} + m_Layer: 5 + m_Name: PoweredByMapbox + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012814445858 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000014186409798} + - component: {fileID: 222000012683884346} + - component: {fileID: 114000012237847192} + - component: {fileID: 114000011143267216} + - component: {fileID: 114000011949223418} + m_Layer: 5 + m_Name: DigitalGlobe + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012855620454 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012464907794} + - component: {fileID: 222000011382682882} + - component: {fileID: 114000010656795658} + m_Layer: 5 + m_Name: Border + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012879106734 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000010031077894} + - component: {fileID: 222000010158576028} + - component: {fileID: 114000010223518896} + - component: {fileID: 114000010598074150} + - component: {fileID: 114000011838890462} + m_Layer: 5 + m_Name: Disgaree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013082094982 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012998554140} + - component: {fileID: 222000010225006892} + - component: {fileID: 114000011266373950} + - component: {fileID: 114000013798014308} + m_Layer: 5 + m_Name: Close + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013106954598 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000011642918620} + - component: {fileID: 114000011250703824} + m_Layer: 5 + m_Name: Buttons + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013265815560 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000010592324750} + - component: {fileID: 222000012668071652} + - component: {fileID: 114000012880934706} + m_Layer: 5 + m_Name: TelemetryPopup + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1000013302142452 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000011244315594} + - component: {fileID: 222000013925482918} + - component: {fileID: 114000012882014622} + m_Layer: 5 + m_Name: Border + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013605029738 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000013466125426} + m_Layer: 5 + m_Name: ImageHolder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013752281266 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000010729241092} + - component: {fileID: 222000010271277808} + - component: {fileID: 114000012806416914} + m_Layer: 5 + m_Name: PopupButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013825489580 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000010415967706} + - component: {fileID: 222000012252638138} + - component: {fileID: 114000012653900312} + - component: {fileID: 114000011412483932} + - component: {fileID: 114000012507710678} + m_Layer: 5 + m_Name: Agree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000014061529118 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000010566913724} + - component: {fileID: 114000012627991630} + - component: {fileID: 114000012965303632} + m_Layer: 5 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000014070005868 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012294732398} + - component: {fileID: 222000012914824310} + - component: {fileID: 114000013336503972} + m_Layer: 5 + m_Name: Border + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &114000010010780026 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012678072350} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -405508275, guid: f5f67c52d1564df4a8936ccd202a3bd8, 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: 6 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 +--- !u!114 &114000010200746752 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010595931910} + 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.18382353, g: 0.18382353, b: 0.18382353, a: 0.347} + 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: 21300000, guid: 184ca10c8fb4d4c4b988276fd798c9dc, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000010223518896 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012879106734} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25882354, g: 0.39215687, b: 0.9843137, 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: bd1ea67ca2b5742d1a24fcbdc17c55e1, type: 3} + m_FontSize: 16 + 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: Disagree +--- !u!114 &114000010413256100 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010261933500} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, 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: 0 + 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: 114000014293323536} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1000010054780072} + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 1000013265815560} + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 1000010261933500} + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000010592763224 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011939526250} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, 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: 114000010853554134} + 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 &114000010598074150 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012879106734} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, 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: 114000010223518896} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1000013265815560} + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 1000010261933500} + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000010656795658 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012855620454} + 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.18382353, g: 0.18382353, b: 0.18382353, a: 0.347} + 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: 21300000, guid: 184ca10c8fb4d4c4b988276fd798c9dc, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000010853554134 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011939526250} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25882354, g: 0.39215687, b: 0.9843137, 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: bd1ea67ca2b5742d1a24fcbdc17c55e1, type: 3} + m_FontSize: 16 + 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: More Info +--- !u!114 &114000010891849290 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011206144066} + 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.18382353, g: 0.18382353, b: 0.18382353, a: 0.347} + 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: 21300000, guid: 184ca10c8fb4d4c4b988276fd798c9dc, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000010956861998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010251623658} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, 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: 114000012806416914} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1000010054780072} + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 + - m_Target: {fileID: 1000010261933500} + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000011099255292 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011102880912} + 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.18382353, g: 0.18382353, b: 0.18382353, a: 0.347} + 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: 21300000, guid: 184ca10c8fb4d4c4b988276fd798c9dc, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000011143267216 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012814445858} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, 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: 114000012237847192} + 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 &114000011250703824 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013106954598} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1297475563, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 180 + m_Bottom: 30 + m_ChildAlignment: 4 + m_Spacing: 6 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 +--- !u!114 &114000011266373950 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013082094982} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25882354, g: 0.39215687, b: 0.9843137, 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: bd1ea67ca2b5742d1a24fcbdc17c55e1, type: 3} + m_FontSize: 16 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: CLOSE +--- !u!114 &114000011291760786 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010654442462} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, 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: bd1ea67ca2b5742d1a24fcbdc17c55e1, type: 3} + 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: You are helping to make OpenStreetMap and Mapbox maps better by contributing + anonymous usage data. +--- !u!114 &114000011412483932 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013825489580} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, 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: 114000012653900312} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1000013265815560} + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 1000010261933500} + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000011445104640 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012270391302} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &114000011502999528 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010903190438} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7d2bfe282373c4419b3edefc8dd20f68, type: 3} + m_Name: + m_EditorClassIdentifier: + _url: http://www.openstreetmap.org/copyright +--- !u!114 &114000011669420336 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010322957038} + 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.18382353, g: 0.18382353, b: 0.18382353, a: 0.347} + 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: 21300000, guid: 184ca10c8fb4d4c4b988276fd798c9dc, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000011838890462 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012879106734} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 859a38e5f727a4ea7ad0839a89bcd655, type: 3} + m_Name: + m_EditorClassIdentifier: + _booleanValue: 0 +--- !u!114 &114000011915122438 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011994908926} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, 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: bd1ea67ca2b5742d1a24fcbdc17c55e1, type: 3} + m_FontSize: 20 + m_FontStyle: 1 + m_BestFit: 1 + m_MinSize: 20 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Make Mapbox Maps Better +--- !u!114 &114000011949223418 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012814445858} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7d2bfe282373c4419b3edefc8dd20f68, type: 3} + m_Name: + m_EditorClassIdentifier: + _url: https://www.digitalglobe.com/about/our-company +--- !u!114 &114000012113965706 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012472160484} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25882354, g: 0.39215687, b: 0.9843137, 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: bd1ea67ca2b5742d1a24fcbdc17c55e1, type: 3} + m_FontSize: 16 + 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: "\xA9 Mapbox" +--- !u!114 &114000012237847192 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012814445858} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25882354, g: 0.39215687, b: 0.9843137, 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: bd1ea67ca2b5742d1a24fcbdc17c55e1, type: 3} + m_FontSize: 16 + 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: "\xA9 DigitalGlobe" +--- !u!114 &114000012327158974 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011782995990} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25882354, g: 0.39215687, b: 0.9843137, 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: bd1ea67ca2b5742d1a24fcbdc17c55e1, type: 3} + m_FontSize: 16 + 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: Improve This Map +--- !u!114 &114000012459593998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011939526250} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7d2bfe282373c4419b3edefc8dd20f68, type: 3} + m_Name: + m_EditorClassIdentifier: + _url: https://www.mapbox.com/telemetry/ +--- !u!114 &114000012507710678 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013825489580} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 859a38e5f727a4ea7ad0839a89bcd655, type: 3} + m_Name: + m_EditorClassIdentifier: + _booleanValue: 1 +--- !u!114 &114000012514615580 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010469169742} + 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.25882354, g: 0.39215687, b: 0.9843137, 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_Sprite: {fileID: 21300000, guid: fa730453dea644416a34148b2e436e78, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000012627991630 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014061529118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 5 +--- !u!114 &114000012653900312 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013825489580} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25882354, g: 0.39215687, b: 0.9843137, 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: bd1ea67ca2b5742d1a24fcbdc17c55e1, type: 3} + m_FontSize: 16 + 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: Agree +--- !u!114 &114000012806416914 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013752281266} + 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: 1, g: 1, b: 1, a: 0.6} + 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: 21300000, guid: 82852ff66538d44ccb63c5afc39708a5, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000012880934706 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013265815560} + 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: 1, g: 1, b: 1, a: 0.847} + 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: 21300000, guid: ae30072a59a25814e8cfe4b1f70242ed, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000012882014622 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013302142452} + 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.18382353, g: 0.18382353, b: 0.18382353, a: 0.347} + 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: 21300000, guid: 184ca10c8fb4d4c4b988276fd798c9dc, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000012931723954 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012472160484} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, 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: 114000012113965706} + 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 &114000012965303632 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014061529118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &114000012991362564 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010903190438} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, 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: 114000013194257072} + 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 &114000013038469802 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012270391302} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 960, y: 680} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &114000013102648220 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011782995990} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7d2bfe282373c4419b3edefc8dd20f68, type: 3} + m_Name: + m_EditorClassIdentifier: + _url: https://www.mapbox.com/feedback/ +--- !u!114 &114000013194257072 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010903190438} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25882354, g: 0.39215687, b: 0.9843137, 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: bd1ea67ca2b5742d1a24fcbdc17c55e1, type: 3} + m_FontSize: 16 + 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: "\xA9 OpenStreetMap" +--- !u!114 &114000013215882760 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012472160484} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7d2bfe282373c4419b3edefc8dd20f68, type: 3} + m_Name: + m_EditorClassIdentifier: + _url: https://www.mapbox.com/about/maps +--- !u!114 &114000013305285980 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011230084972} + 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.18382353, g: 0.18382353, b: 0.18382353, a: 0.347} + 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: 21300000, guid: 184ca10c8fb4d4c4b988276fd798c9dc, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000013336503972 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014070005868} + 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.18382353, g: 0.18382353, b: 0.18382353, a: 0.347} + 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: 21300000, guid: 184ca10c8fb4d4c4b988276fd798c9dc, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000013366972262 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011782995990} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, 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: 114000012327158974} + 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 &114000013425509446 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011170295744} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1297475563, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 70 + m_Bottom: 50 + m_ChildAlignment: 4 + m_Spacing: 6 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 +--- !u!114 &114000013496265404 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012558740832} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25882354, g: 0.39215687, b: 0.9843137, 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: bd1ea67ca2b5742d1a24fcbdc17c55e1, type: 3} + m_FontSize: 16 + 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: Mapbox Telemetry +--- !u!114 &114000013548531306 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012558740832} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, 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: 114000013496265404} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1000013265815560} + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 + - m_Target: {fileID: 1000010054780072} + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000013798014308 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013082094982} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, 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: 114000011266373950} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1000010054780072} + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 1000010261933500} + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000013954146960 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010054780072} + 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: 1, g: 1, b: 1, a: 0.847} + 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: 21300000, guid: ae30072a59a25814e8cfe4b1f70242ed, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000013974789120 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010251623658} + 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: 1, g: 1, b: 1, a: 0.6} + 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: 21300000, guid: 066eb96836b694d168eff135bd2aeaca, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000014032524088 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011293578650} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, 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: bd1ea67ca2b5742d1a24fcbdc17c55e1, type: 3} + m_FontSize: 30 + m_FontStyle: 1 + m_BestFit: 1 + m_MinSize: 16 + m_MaxSize: 30 + m_Alignment: 5 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Powered by +--- !u!114 &114000014293323536 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010261933500} + 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.616} + 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 +--- !u!222 &222000010152334938 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011230084972} +--- !u!222 &222000010158576028 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012879106734} +--- !u!222 &222000010225006892 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013082094982} +--- !u!222 &222000010271277808 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013752281266} +--- !u!222 &222000010898632596 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010595931910} +--- !u!222 &222000011304938888 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011994908926} +--- !u!222 &222000011382682882 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012855620454} +--- !u!222 &222000011956438890 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011293578650} +--- !u!222 &222000012073267988 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011102880912} +--- !u!222 &222000012252638138 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013825489580} +--- !u!222 &222000012542523728 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010261933500} +--- !u!222 &222000012598981250 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010469169742} +--- !u!222 &222000012668071652 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013265815560} +--- !u!222 &222000012683884346 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012814445858} +--- !u!222 &222000012689643076 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011939526250} +--- !u!222 &222000012838451916 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010322957038} +--- !u!222 &222000012914824310 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014070005868} +--- !u!222 &222000013053592878 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012558740832} +--- !u!222 &222000013216232360 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010251623658} +--- !u!222 &222000013765660792 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010654442462} +--- !u!222 &222000013821890836 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010903190438} +--- !u!222 &222000013861620362 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010054780072} +--- !u!222 &222000013925482918 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013302142452} +--- !u!222 &222000013959506544 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011782995990} +--- !u!222 &222000014189569612 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012472160484} +--- !u!222 &222000014189796102 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011206144066} +--- !u!223 &223000013144521578 +Canvas: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012270391302} + 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: 100 + m_TargetDisplay: 0 +--- !u!224 &224000010031077894 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012879106734} + 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: 224000012853769856} + m_Father: {fileID: 224000011642918620} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 111, y: -265} + m_SizeDelta: {x: 222, y: 52.666664} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000010289174704 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010654442462} + 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: 224000010973732652} + 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: -30} + m_SizeDelta: {x: 0, y: 100} + m_Pivot: {x: 0.5, y: 1} +--- !u!224 &224000010415967706 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013825489580} + 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: 224000012464907794} + m_Father: {fileID: 224000011642918620} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 111, y: -323.66666} + m_SizeDelta: {x: 222, y: 52.666664} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000010449021188 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011939526250} + 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: 224000010832569436} + m_Father: {fileID: 224000011642918620} + 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: 111, y: -206.33333} + m_SizeDelta: {x: 222, y: 52.666664} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000010566913724 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014061529118} + 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: 224000013044306136} + m_RootOrder: 4 + 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: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000010592324750 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013265815560} + 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: 224000010973732652} + - {fileID: 224000011642918620} + m_Father: {fileID: 224000013044306136} + m_RootOrder: 3 + 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: 342, y: 380} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000010729241092 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013752281266} + 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: 224000013849289752} + m_RootOrder: 0 + 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: 32, y: 0} + m_SizeDelta: {x: 30, y: 30} + m_Pivot: {x: 1, y: 0.5} +--- !u!224 &224000010832569436 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010322957038} + 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: 224000010449021188} + 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 &224000010973732652 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011994908926} + 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: 224000010289174704} + m_Father: {fileID: 224000010592324750} + 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: -20} + m_SizeDelta: {x: -40, y: 30} + m_Pivot: {x: 0.5, y: 1} +--- !u!224 &224000011052731304 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010261933500} + 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: 224000013044306136} + 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: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000011240730510 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011707437516} + 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: 224000011436070778} + m_Father: {fileID: 224000012680463924} + 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: 148, y: -20} + m_SizeDelta: {x: 148, y: 40} + m_Pivot: {x: 1, y: 0.5} +--- !u!224 &224000011244315594 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013302142452} + 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: 224000012669324860} + 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 &224000011436070778 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011293578650} + 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: 224000011240730510} + 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: 1, y: 0.5} +--- !u!224 &224000011463966310 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011782995990} + 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: 224000011871004796} + m_Father: {fileID: 224000011881113432} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 111, y: -253.20004} + m_SizeDelta: {x: 222, y: 47.20001} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000011642918620 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013106954598} + 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: 224000010449021188} + - {fileID: 224000010031077894} + - {fileID: 224000010415967706} + m_Father: {fileID: 224000010592324750} + 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: -120, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000011665632892 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011230084972} + 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: 224000014186409798} + 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 &224000011786869730 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010054780072} + 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: 224000012680463924} + - {fileID: 224000011881113432} + - {fileID: 224000012998554140} + m_Father: {fileID: 224000013044306136} + m_RootOrder: 2 + 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: 342, y: 380} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000011871004796 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010595931910} + 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: 224000011463966310} + 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 &224000011881113432 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011170295744} + 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: 224000012669324860} + - {fileID: 224000012954539924} + - {fileID: 224000014186409798} + - {fileID: 224000011463966310} + - {fileID: 224000012654707720} + m_Father: {fileID: 224000011786869730} + 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: -120, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012294732398 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014070005868} + 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: 224000012654707720} + 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 &224000012452801200 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010469169742} + 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: 224000013466125426} + 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: -3} + m_SizeDelta: {x: 0, y: -6} + m_Pivot: {x: 0, y: 0.5} +--- !u!224 &224000012464907794 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012855620454} + 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: 224000010415967706} + 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 &224000012654707720 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012558740832} + 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: 224000012294732398} + m_Father: {fileID: 224000011881113432} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 111, y: -306.40005} + m_SizeDelta: {x: 222, y: 47.20001} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012669324860 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012472160484} + 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: 224000011244315594} + m_Father: {fileID: 224000011881113432} + 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: 111, y: -93.600006} + m_SizeDelta: {x: 222, y: 47.20001} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012680463924 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012678072350} + 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: 224000011240730510} + - {fileID: 224000013466125426} + m_Father: {fileID: 224000011786869730} + 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: -10} + m_SizeDelta: {x: -40, y: 40} + m_Pivot: {x: 0.5, y: 1} +--- !u!224 &224000012853769856 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011206144066} + 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: 224000010031077894} + 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 &224000012863316938 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011102880912} + 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: 224000012954539924} + 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 &224000012954539924 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010903190438} + 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: 224000012863316938} + m_Father: {fileID: 224000011881113432} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 111, y: -146.80002} + m_SizeDelta: {x: 222, y: 47.20001} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012998554140 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013082094982} + 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: 224000011786869730} + 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: 0} + m_SizeDelta: {x: -40, y: 50} + m_Pivot: {x: 0.5, y: 0} +--- !u!224 &224000013044306136 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012270391302} + 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: + - {fileID: 224000013849289752} + - {fileID: 224000011052731304} + - {fileID: 224000011786869730} + - {fileID: 224000010592324750} + - {fileID: 224000010566913724} + 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!224 &224000013466125426 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013605029738} + 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: 224000012452801200} + m_Father: {fileID: 224000012680463924} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 154, y: -20} + m_SizeDelta: {x: 148, y: 40} + m_Pivot: {x: 0, y: 0.5} +--- !u!224 &224000013849289752 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010251623658} + 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: 224000010729241092} + m_Father: {fileID: 224000013044306136} + 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: 20, y: 20} + m_SizeDelta: {x: 127, y: 32} + m_Pivot: {x: 0, y: 0} +--- !u!224 &224000014186409798 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012814445858} + 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: 224000011665632892} + m_Father: {fileID: 224000011881113432} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 111, y: -200.00003} + m_SizeDelta: {x: 222, y: 47.20001} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/Prefabs/Attribution.prefab.meta b/Prefabs/Attribution.prefab.meta new file mode 100644 index 0000000..dffbf6a --- /dev/null +++ b/Prefabs/Attribution.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3adcee2515f8c49f4a7afb3bacf2c56e +timeCreated: 1495664292 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Prefabs/CitySimulatorMap.prefab b/Prefabs/CitySimulatorMap.prefab new file mode 100644 index 0000000..6499384 --- /dev/null +++ b/Prefabs/CitySimulatorMap.prefab @@ -0,0 +1,290 @@ +%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: 1290224484336908} + m_IsPrefabParent: 1 +--- !u!1 &1290224484336908 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4187505068457818} + - component: {fileID: 114196496685157712} + m_Layer: 0 + m_Name: CitySimulatorMap + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4187505068457818 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1290224484336908} + 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 &114196496685157712 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1290224484336908} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cd961b1c9541a4cee99686069ecce852, type: 3} + m_Name: + m_EditorClassIdentifier: + _options: + locationOptions: + latitudeLongitude: 37.784179, -122.401583 + zoom: 16 + extentOptions: + extentType: 1 + defaultExtents: + cameraBoundsOptions: + camera: {fileID: 0} + visibleBuffer: 0 + disposeBuffer: 0 + rangeAroundCenterOptions: + west: 1 + north: 1 + east: 1 + south: 1 + rangeAroundTransformOptions: + targetTransform: {fileID: 0} + visibleBuffer: 0 + disposeBuffer: 0 + placementOptions: + placementType: 1 + snapMapToZero: 1 + scalingOptions: + scalingType: 1 + unityTileSize: 100 + loadingTexture: {fileID: 2800000, guid: e2896a92727704803a9c422b043eae89, type: 3} + tileMaterial: {fileID: 2100000, guid: b9f23e9bce724fa4daac57ecded470b8, type: 2} + _initializeOnStart: 1 + _imagery: + _layerProperty: + sourceType: 0 + sourceOptions: + isActive: 1 + layerSource: + Name: Streets + Id: mapbox://styles/mapbox/streets-v10 + Modified: + UserName: + rasterOptions: + useRetina: 0 + useCompression: 0 + useMipMap: 0 + _terrain: + _layerProperty: + sourceType: 0 + sourceOptions: + isActive: 1 + layerSource: + Name: + Id: mapbox.terrain-rgb + Modified: + UserName: + elevationLayerType: 1 + requiredOptions: + exaggerationFactor: 1 + colliderOptions: + addCollider: 0 + modificationOptions: + sampleCount: 10 + useRelativeHeight: 0 + earthRadius: 1000 + unityLayerOptions: + addToLayer: 0 + layerId: 0 + sideWallOptions: + isActive: 0 + wallHeight: 10 + wallMaterial: {fileID: 0} + _vectorData: + _layerProperty: + tileJsonData: + tileJSONLoaded: 0 + LayerDisplayNames: + - admin + - aeroway + - airport_label + - barrier_line + - building + - country_label + - housenum_label + - landuse + - landuse_overlay + - marine_label + - motorway_junction + - mountain_peak_label + - place_label + - poi_label + - rail_station_label + - road + - road_label + - state_label + - water + - water_label + - waterway + - waterway_label + _sourceType: 0 + sourceOptions: + isActive: 1 + layerSource: + Name: Mapbox Terrain + Id: mapbox.3d-buildings,mapbox.mapbox-streets-v7 + Modified: + UserName: + useOptimizedStyle: 0 + optimizedStyle: + Name: + Id: + Modified: + UserName: + performanceOptions: + isEnabled: 1 + entityPerCoroutine: 20 + vectorSubLayers: + - coreOptions: + sourceId: mapbox.3d-buildings,mapbox.mapbox-streets-v7 + isActive: 1 + sublayerName: ExtrudedBuildings + geometryType: 2 + layerName: building + snapToTerrain: 1 + combineMeshes: 0 + lineGeometryOptions: + Width: 1 + filterOptions: + _selectedLayerName: building + filters: [] + combinerType: 0 + extrusionOptions: + _selectedLayerName: building + extrusionType: 1 + extrusionGeometryType: 0 + propertyName: height + propertyDescription: Number. Height of building or part of building. + minimumHeight: 0 + maximumHeight: 0 + extrusionScaleFactor: 1 + colliderOptions: + colliderType: 0 + materialOptions: + style: 4 + texturingType: 3 + materials: + - Materials: + - {fileID: 2100000, guid: d4d7464e3429a44e090f55a4ac17f110, type: 2} + - Materials: + - {fileID: 2100000, guid: 55cc6edead802446b9106b2998406844, type: 2} + atlasInfo: {fileID: 11400000, guid: 414754d7155df47beb52ca117a774f21, type: 2} + lightStyleOpacity: 1 + darkStyleOpacity: 1 + colorStyleColor: {r: 1, g: 1, b: 1, a: 1} + samplePalettes: 0 + colorPalette: {fileID: 11400000, guid: ef118b5e263da4b1fa4327ca1d3e0c7b, + type: 2} + customStyleOptions: + texturingType: 3 + materials: + - Materials: + - {fileID: 2100000, guid: a1aa333e18c0640d7b428eecff9c4af7, type: 2} + - Materials: + - {fileID: 2100000, guid: c0653693b48614a139a124871d499679, type: 2} + atlasInfo: {fileID: 11400000, guid: 414754d7155df47beb52ca117a774f21, + type: 2} + colorPalette: {fileID: 11400000, guid: 57bdfa37edf7a4f7f999d19443497554, + type: 2} + performanceOptions: + isEnabled: 1 + entityPerCoroutine: 20 + honorBuildingIdSetting: 1 + buildingsWithUniqueIds: 1 + moveFeaturePositionTo: 0 + MeshModifiers: [] + GoModifiers: [] + presetFeatureType: 0 + _maskValue: 0 + selectedTypes: + - coreOptions: + sourceId: + isActive: 1 + sublayerName: Roads + geometryType: 1 + layerName: road + snapToTerrain: 1 + combineMeshes: 0 + lineGeometryOptions: + Width: 1 + filterOptions: + _selectedLayerName: road + filters: [] + combinerType: 0 + extrusionOptions: + _selectedLayerName: road + extrusionType: 5 + extrusionGeometryType: 0 + propertyName: height + propertyDescription: + minimumHeight: 0 + maximumHeight: 2 + extrusionScaleFactor: 1 + colliderOptions: + colliderType: 0 + materialOptions: + style: 3 + texturingType: 0 + materials: + - Materials: + - {fileID: 2100000, guid: 8e8afdee0a225a84282f04f2fb89b8b6, type: 2} + - Materials: + - {fileID: 2100000, guid: b00db1eb69ea64eb4adb30b2c0fb01cb, type: 2} + atlasInfo: {fileID: 0} + lightStyleOpacity: 1 + darkStyleOpacity: 1 + colorStyleColor: {r: 1, g: 1, b: 1, a: 1} + samplePalettes: 0 + colorPalette: {fileID: 0} + customStyleOptions: + texturingType: 0 + materials: + - Materials: + - {fileID: 2100000, guid: 5ac0ac96d738c0845b30185d2838f299, type: 2} + - Materials: + - {fileID: 2100000, guid: b00db1eb69ea64eb4adb30b2c0fb01cb, type: 2} + atlasInfo: {fileID: 0} + colorPalette: {fileID: 0} + performanceOptions: + isEnabled: 1 + entityPerCoroutine: 20 + honorBuildingIdSetting: 0 + buildingsWithUniqueIds: 0 + moveFeaturePositionTo: 0 + MeshModifiers: [] + GoModifiers: [] + presetFeatureType: 1 + _maskValue: 0 + selectedTypes: + locationPrefabList: [] + _tileProvider: {fileID: 0} diff --git a/Prefabs/CitySimulatorMap.prefab.meta b/Prefabs/CitySimulatorMap.prefab.meta new file mode 100644 index 0000000..d7d16fa --- /dev/null +++ b/Prefabs/CitySimulatorMap.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 5bb46bae81bf04608ac699be504c5e66 +timeCreated: 1520990077 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Prefabs/IconicBuildingMap.prefab b/Prefabs/IconicBuildingMap.prefab new file mode 100644 index 0000000..5917450 --- /dev/null +++ b/Prefabs/IconicBuildingMap.prefab @@ -0,0 +1,291 @@ +%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: 1416190854468854} + m_IsPrefabParent: 1 +--- !u!1 &1416190854468854 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4732696979201430} + - component: {fileID: 114585160210174956} + m_Layer: 0 + m_Name: IconicBuildingMap + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4732696979201430 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1416190854468854} + 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 &114585160210174956 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1416190854468854} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cd961b1c9541a4cee99686069ecce852, type: 3} + m_Name: + m_EditorClassIdentifier: + _options: + locationOptions: + latitudeLongitude: 37.79514, -122.402756 + zoom: 16 + extentOptions: + extentType: 1 + defaultExtents: + cameraBoundsOptions: + camera: {fileID: 0} + visibleBuffer: 0 + disposeBuffer: 0 + rangeAroundCenterOptions: + west: 1 + north: 1 + east: 1 + south: 1 + rangeAroundTransformOptions: + targetTransform: {fileID: 0} + visibleBuffer: 0 + disposeBuffer: 0 + placementOptions: + placementType: 1 + snapMapToZero: 1 + scalingOptions: + scalingType: 1 + unityTileSize: 100 + loadingTexture: {fileID: 2800000, guid: e2896a92727704803a9c422b043eae89, type: 3} + tileMaterial: {fileID: 2100000, guid: b9f23e9bce724fa4daac57ecded470b8, type: 2} + _initializeOnStart: 1 + _imagery: + _layerProperty: + sourceType: 0 + sourceOptions: + isActive: 1 + layerSource: + Name: Streets + Id: mapbox://styles/mapbox/streets-v10 + Modified: + UserName: + rasterOptions: + useRetina: 0 + useCompression: 0 + useMipMap: 0 + _terrain: + _layerProperty: + sourceType: 0 + sourceOptions: + isActive: 1 + layerSource: + Name: + Id: mapbox.terrain-rgb + Modified: + UserName: + elevationLayerType: 1 + requiredOptions: + exaggerationFactor: 1 + colliderOptions: + addCollider: 0 + modificationOptions: + sampleCount: 10 + useRelativeHeight: 0 + earthRadius: 1000 + unityLayerOptions: + addToLayer: 0 + layerId: 0 + sideWallOptions: + isActive: 0 + wallHeight: 10 + wallMaterial: {fileID: 0} + _vectorData: + _layerProperty: + tileJsonData: + tileJSONLoaded: 0 + LayerDisplayNames: + - admin + - aeroway + - airport_label + - barrier_line + - building + - country_label + - housenum_label + - landuse + - landuse_overlay + - marine_label + - motorway_junction + - mountain_peak_label + - place_label + - poi_label + - rail_station_label + - road + - road_label + - state_label + - water + - water_label + - waterway + - waterway_label + _sourceType: 0 + sourceOptions: + isActive: 1 + layerSource: + Name: Mapbox Terrain + Id: mapbox.3d-buildings,mapbox.mapbox-streets-v7 + Modified: + UserName: + useOptimizedStyle: 0 + optimizedStyle: + Name: + Id: + Modified: + UserName: + performanceOptions: + isEnabled: 1 + entityPerCoroutine: 20 + vectorSubLayers: + - coreOptions: + sourceId: mapbox.3d-buildings,mapbox.mapbox-streets-v7 + isActive: 1 + sublayerName: ExtrudedBuildings + geometryType: 2 + layerName: building + snapToTerrain: 1 + combineMeshes: 0 + lineGeometryOptions: + Width: 1 + filterOptions: + _selectedLayerName: building + filters: [] + combinerType: 0 + extrusionOptions: + _selectedLayerName: building + extrusionType: 3 + extrusionGeometryType: 0 + propertyName: height + propertyDescription: Number. Height of building or part of building. + minimumHeight: 0 + maximumHeight: 0 + extrusionScaleFactor: 1 + colliderOptions: + colliderType: 0 + materialOptions: + style: 4 + texturingType: 3 + materials: + - Materials: + - {fileID: 2100000, guid: a1aa333e18c0640d7b428eecff9c4af7, type: 2} + - Materials: + - {fileID: 2100000, guid: c0653693b48614a139a124871d499679, type: 2} + atlasInfo: {fileID: 11400000, guid: 414754d7155df47beb52ca117a774f21, type: 2} + lightStyleOpacity: 1 + darkStyleOpacity: 1 + colorStyleColor: {r: 1, g: 1, b: 1, a: 1} + samplePalettes: 0 + colorPalette: {fileID: 11400000, guid: 57bdfa37edf7a4f7f999d19443497554, + type: 2} + customStyleOptions: + texturingType: 3 + materials: + - Materials: + - {fileID: 2100000, guid: a1aa333e18c0640d7b428eecff9c4af7, type: 2} + - Materials: + - {fileID: 2100000, guid: c0653693b48614a139a124871d499679, type: 2} + atlasInfo: {fileID: 11400000, guid: 414754d7155df47beb52ca117a774f21, + type: 2} + colorPalette: {fileID: 11400000, guid: 57bdfa37edf7a4f7f999d19443497554, + type: 2} + performanceOptions: + isEnabled: 1 + entityPerCoroutine: 20 + honorBuildingIdSetting: 1 + buildingsWithUniqueIds: 1 + moveFeaturePositionTo: 0 + MeshModifiers: [] + GoModifiers: + - {fileID: 11400000, guid: 9cc65532303e9448e8ecbe284fc7f035, type: 2} + presetFeatureType: 0 + _maskValue: 0 + selectedTypes: + - coreOptions: + sourceId: + isActive: 1 + sublayerName: Roads + geometryType: 1 + layerName: road + snapToTerrain: 1 + combineMeshes: 0 + lineGeometryOptions: + Width: 1 + filterOptions: + _selectedLayerName: road + filters: [] + combinerType: 0 + extrusionOptions: + _selectedLayerName: road + extrusionType: 5 + extrusionGeometryType: 0 + propertyName: height + propertyDescription: + minimumHeight: 0 + maximumHeight: 2 + extrusionScaleFactor: 1 + colliderOptions: + colliderType: 0 + materialOptions: + style: 3 + texturingType: 0 + materials: + - Materials: + - {fileID: 2100000, guid: 8e8afdee0a225a84282f04f2fb89b8b6, type: 2} + - Materials: + - {fileID: 2100000, guid: b00db1eb69ea64eb4adb30b2c0fb01cb, type: 2} + atlasInfo: {fileID: 0} + lightStyleOpacity: 1 + darkStyleOpacity: 1 + colorStyleColor: {r: 1, g: 1, b: 1, a: 1} + samplePalettes: 0 + colorPalette: {fileID: 0} + customStyleOptions: + texturingType: 0 + materials: + - Materials: + - {fileID: 2100000, guid: 8e8afdee0a225a84282f04f2fb89b8b6, type: 2} + - Materials: + - {fileID: 2100000, guid: b00db1eb69ea64eb4adb30b2c0fb01cb, type: 2} + atlasInfo: {fileID: 0} + colorPalette: {fileID: 0} + performanceOptions: + isEnabled: 1 + entityPerCoroutine: 20 + honorBuildingIdSetting: 0 + buildingsWithUniqueIds: 0 + moveFeaturePositionTo: 0 + MeshModifiers: [] + GoModifiers: [] + presetFeatureType: 1 + _maskValue: 0 + selectedTypes: + locationPrefabList: [] + _tileProvider: {fileID: 0} diff --git a/Prefabs/IconicBuildingMap.prefab.meta b/Prefabs/IconicBuildingMap.prefab.meta new file mode 100644 index 0000000..32ffb1c --- /dev/null +++ b/Prefabs/IconicBuildingMap.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 4cd0111f17b6043cf817880e3fd57cd1 +timeCreated: 1534522836 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Prefabs/LocationBasedGame.prefab b/Prefabs/LocationBasedGame.prefab new file mode 100644 index 0000000..89bd1ec --- /dev/null +++ b/Prefabs/LocationBasedGame.prefab @@ -0,0 +1,979 @@ +%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: 1317352403415316} + m_IsPrefabParent: 1 +--- !u!1 &1065618987163410 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4961856903295740} + - component: {fileID: 114140835023345716} + - component: {fileID: 114668955501623132} + m_Layer: 0 + m_Name: PlayerTarget + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1080079784494230 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4246599577666654} + - component: {fileID: 114061638112787974} + m_Layer: 0 + m_Name: OrientationSmoothingAverage + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1094528686802348 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4310658642812482} + - component: {fileID: 114105500206378512} + - component: {fileID: 114086566548189782} + m_Layer: 0 + m_Name: Map + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1150654482131460 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4799350488123096} + - component: {fileID: 114005716392592828} + m_Layer: 0 + m_Name: HeadingSmoothingLowPass + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1317352403415316 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4886150424162858} + m_Layer: 0 + m_Name: LocationBasedGame + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1491795049829526 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4730853386710314} + - component: {fileID: 114352101756843672} + m_Layer: 0 + m_Name: AndroidDeviceLocationProvider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1495889947503892 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4542949352487020} + - component: {fileID: 33635898767261260} + - component: {fileID: 65999262174974900} + - component: {fileID: 23386010693667174} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1514120829208204 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4684202510553644} + - component: {fileID: 114275890671072080} + m_Layer: 0 + m_Name: EditorLocationProviderLocationLog + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1593389716135088 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4743977495129256} + - component: {fileID: 114330636339840990} + m_Layer: 0 + m_Name: OrientationSmoothingNoOperation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1625832438174652 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4168681940542294} + - component: {fileID: 33348043099498896} + - component: {fileID: 135296336305408694} + - component: {fileID: 23748609930179622} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1638059881744458 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129673418936512} + - component: {fileID: 114658503893516242} + m_Layer: 0 + m_Name: EditorLocationArrayProvider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1794436748899412 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4661063812952726} + - component: {fileID: 114884900018957070} + m_Layer: 0 + m_Name: HeadingSmoothingNoOperation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1890051226035590 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4857128744900630} + - component: {fileID: 114811608996724456} + m_Layer: 0 + m_Name: DefaultDeviceLocationProvider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1914554019858210 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4556514920020454} + - component: {fileID: 114467468983267246} + m_Layer: 0 + m_Name: LocationProvider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1955583132415804 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4086284340975594} + - component: {fileID: 114693865358142148} + m_Layer: 0 + m_Name: HeadingSmoothingAverage + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1973830715875770 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4586255385020768} + - component: {fileID: 114338581737783854} + m_Layer: 0 + m_Name: OrientationSmoothingLowPass + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1996530296785342 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4109422646323390} + - component: {fileID: 114011132729224596} + m_Layer: 0 + m_Name: TransformLocationProvider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &4086284340975594 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1955583132415804} + 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: 4857128744900630} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4109422646323390 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1996530296785342} + 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: 4556514920020454} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4129673418936512 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1638059881744458} + 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: 4556514920020454} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4168681940542294 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1625832438174652} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 4.14, z: 0} + m_LocalScale: {x: 2, y: 2, z: 2} + m_Children: [] + m_Father: {fileID: 4961856903295740} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4246599577666654 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1080079784494230} + 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: 4857128744900630} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4310658642812482 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1094528686802348} + 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: 4886150424162858} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4542949352487020 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1495889947503892} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 1.5, z: 0} + m_LocalScale: {x: 1, y: 3, z: 1} + m_Children: [] + m_Father: {fileID: 4961856903295740} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4556514920020454 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1914554019858210} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -18.677399, y: 12.257265, z: 21.646572} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4857128744900630} + - {fileID: 4129673418936512} + - {fileID: 4109422646323390} + - {fileID: 4730853386710314} + - {fileID: 4684202510553644} + m_Father: {fileID: 4886150424162858} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4586255385020768 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1973830715875770} + 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: 4857128744900630} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4661063812952726 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1794436748899412} + 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: 4857128744900630} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4684202510553644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1514120829208204} + 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: 4556514920020454} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4730853386710314 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1491795049829526} + 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: 4556514920020454} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4743977495129256 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1593389716135088} + 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: 4857128744900630} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4799350488123096 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1150654482131460} + 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: 4857128744900630} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4857128744900630 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1890051226035590} + 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: 4661063812952726} + - {fileID: 4086284340975594} + - {fileID: 4799350488123096} + - {fileID: 4743977495129256} + - {fileID: 4246599577666654} + - {fileID: 4586255385020768} + m_Father: {fileID: 4556514920020454} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4886150424162858 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1317352403415316} + 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: 4310658642812482} + - {fileID: 4961856903295740} + - {fileID: 4556514920020454} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4961856903295740 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1065618987163410} + 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: 4542949352487020} + - {fileID: 4168681940542294} + m_Father: {fileID: 4886150424162858} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23386010693667174 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1495889947503892} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: caa6c6f6f7879034992a27a6bc3794fd, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23748609930179622 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1625832438174652} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: caa6c6f6f7879034992a27a6bc3794fd, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33348043099498896 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1625832438174652} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &33635898767261260 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1495889947503892} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!65 &65999262174974900 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1495889947503892} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &114005716392592828 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1150654482131460} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5bc20e719eeb82d448d4698d29d526c0, type: 3} + m_Name: + m_EditorClassIdentifier: + _measurements: 2 + _smoothingFactor: 0.009999999776482582 +--- !u!114 &114011132729224596 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1996530296785342} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a034c4eeb3293418aab101c1895844a4, type: 3} + m_Name: + m_EditorClassIdentifier: + _accuracy: 0 + _autoFireEvent: 0 + _updateInterval: 0 + _sendEvent: 0 + _targetTransform: {fileID: 0} +--- !u!114 &114061638112787974 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1080079784494230} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6843ccbf70c208645a89b4c8c37a4ecf, type: 3} + m_Name: + m_EditorClassIdentifier: + _measurements: 10 +--- !u!114 &114086566548189782 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1094528686802348} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 96f0fa82f89d64bb9a6524c72d538179, type: 3} + m_Name: + m_EditorClassIdentifier: + _map: {fileID: 114105500206378512} +--- !u!114 &114105500206378512 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1094528686802348} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cd961b1c9541a4cee99686069ecce852, type: 3} + m_Name: + m_EditorClassIdentifier: + _initializeOnStart: 0 + _options: + locationOptions: + latitudeLongitude: 37.784179, -122.401583 + zoom: 16 + extentOptions: + extentType: 2 + cameraBoundsOptions: + camera: {fileID: 0} + visibleBuffer: 0 + disposeBuffer: 0 + rangeAroundCenterOptions: + west: 1 + north: 1 + east: 1 + south: 1 + rangeAroundTransformOptions: + targetTransform: {fileID: 4961856903295740} + visibleBuffer: 3 + disposeBuffer: 3 + placementOptions: + placementType: 1 + snapMapToZero: 0 + scalingOptions: + scalingType: 1 + unityTileSize: 100 + loadingTexture: {fileID: 2800000, guid: e2896a92727704803a9c422b043eae89, type: 3} + tileMaterial: {fileID: 0} + _imagery: + _layerProperty: + sourceType: 0 + sourceOptions: + isActive: 1 + layerSource: + Name: Streets + Id: mapbox://styles/mapbox/streets-v10 + Modified: + UserName: + rasterOptions: + useRetina: 0 + useCompression: 0 + useMipMap: 0 + _terrain: + _layerProperty: + sourceType: 0 + sourceOptions: + isActive: 1 + layerSource: + Name: + Id: mapbox.terrain-rgb + Modified: + UserName: + elevationLayerType: 0 + requiredOptions: + addCollider: 0 + exaggerationFactor: 1 + modificationOptions: + sampleCount: 10 + useRelativeHeight: 1 + earthRadius: 1000 + unityLayerOptions: + addToLayer: 0 + layerId: 0 + sideWallOptions: + isActive: 0 + wallHeight: 10 + wallMaterial: {fileID: 0} + _vectorData: + _layerProperty: + tileJsonData: + tileJSONLoaded: 0 + LayerDisplayNames: + - admin + - aeroway + - airport_label + - barrier_line + - building + - contour + - country_label + - hillshade + - housenum_label + - landcover + - landuse + - landuse_overlay + - marine_label + - motorway_junction + - mountain_peak_label + - place_label + - poi_label + - rail_station_label + - road + - road_label + - state_label + - traffic + - water + - water_label + - waterway + - waterway_label + _sourceType: 3 + sourceOptions: + isActive: 0 + layerSource: + Name: Mapbox Terrain + Id: mapbox.3d-buildings,mapbox.mapbox-streets-v7,mapbox.mapbox-traffic-v1,mapbox.mapbox-terrain-v2 + Modified: + UserName: + useOptimizedStyle: 0 + optimizedStyle: + Name: + Id: + Modified: + UserName: + performanceOptions: + isEnabled: 1 + entityPerCoroutine: 20 + vectorSubLayers: [] + locationPrefabList: [] + _tileProvider: {fileID: 0} +--- !u!114 &114140835023345716 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1065618987163410} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7760043eea2cd452ba7117f2c97e0038, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &114275890671072080 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1514120829208204} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c34c76d6349bc9844998f48d16f0d3bb, type: 3} + m_Name: + m_EditorClassIdentifier: + _accuracy: 1 + _autoFireEvent: 1 + _updateInterval: 0.1 + _sendEvent: 0 + _locationLogFile: {fileID: 4900000, guid: 5e6bb7224cef35c4788a4817b1c9778d, type: 3} +--- !u!114 &114330636339840990 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1593389716135088} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1ea49ff9cb53e9b44b5fa981d0009588, type: 3} + m_Name: + m_EditorClassIdentifier: + _measurements: 5 +--- !u!114 &114338581737783854 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1973830715875770} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5bc20e719eeb82d448d4698d29d526c0, type: 3} + m_Name: + m_EditorClassIdentifier: + _measurements: 7 + _smoothingFactor: 0.5 +--- !u!114 &114352101756843672 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1491795049829526} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d3d557417079b1446999d2d86ff71dfb, type: 3} + m_Name: + m_EditorClassIdentifier: + _updateDistanceInMeters: 0.5 + _updateTimeInMilliSeconds: 500 +--- !u!114 &114467468983267246 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1914554019858210} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b55f37f9a6f7e44f7bb35e6bc3863847, type: 3} + m_Name: + m_EditorClassIdentifier: + mapManager: {fileID: 114105500206378512} + _deviceLocationProviderUnity: {fileID: 114811608996724456} + _deviceLocationProviderAndroid: {fileID: 114352101756843672} + _editorLocationProvider: {fileID: 114275890671072080} + _transformLocationProvider: {fileID: 114011132729224596} + _dontDestroyOnLoad: 0 +--- !u!114 &114658503893516242 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1638059881744458} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6b5c815d91f9d4c3690891f3ed4c3162, type: 3} + m_Name: + m_EditorClassIdentifier: + _accuracy: 5 + _autoFireEvent: 1 + _updateInterval: 1 + _sendEvent: 0 + _latitudeLongitude: + - 48.859489, 2.32000 + - 48.859489, 2.32015 + - 48.859489, 2.32030 + - 48.859489, 2.32045 + - 48.859489, 2.32060 + _heading: 112 +--- !u!114 &114668955501623132 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1065618987163410} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 061d2afb48ace4fd19611279b6cf732f, type: 3} + m_Name: + m_EditorClassIdentifier: + _useDeviceOrientation: 0 + _subtractUserHeading: 0 + _rotationFollowFactor: 2 + _rotateZ: 0 + _useNegativeAngle: 0 + _useTransformLocationProvider: 0 +--- !u!114 &114693865358142148 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1955583132415804} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6843ccbf70c208645a89b4c8c37a4ecf, type: 3} + m_Name: + m_EditorClassIdentifier: + _measurements: 5 +--- !u!114 &114811608996724456 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1890051226035590} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0a38712e93231418a84665190b8473d0, type: 3} + m_Name: + m_EditorClassIdentifier: + _desiredAccuracyInMeters: 1 + _updateDistanceInMeters: 0.5 + _updateTimeInMilliSeconds: 500 + _userHeadingSmoothing: {fileID: 114005716392592828} + _deviceOrientationSmoothing: {fileID: 114338581737783854} + _editorDebuggingOnly: + _mockUnityInputLocation: 1 + _locationLogFile: {fileID: 4900000, guid: 5e6bb7224cef35c4788a4817b1c9778d, type: 3} +--- !u!114 &114884900018957070 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1794436748899412} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1ea49ff9cb53e9b44b5fa981d0009588, type: 3} + m_Name: + m_EditorClassIdentifier: + _measurements: 5 +--- !u!135 &135296336305408694 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1625832438174652} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} diff --git a/Prefabs/LocationBasedGame.prefab.meta b/Prefabs/LocationBasedGame.prefab.meta new file mode 100644 index 0000000..f512e74 --- /dev/null +++ b/Prefabs/LocationBasedGame.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 35ce2bb4caba9434db5e656796b632b1 +timeCreated: 1528956514 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Prefabs/LocationProviderFactory.prefab b/Prefabs/LocationProviderFactory.prefab new file mode 100644 index 0000000..7d60a48 --- /dev/null +++ b/Prefabs/LocationProviderFactory.prefab @@ -0,0 +1,549 @@ +%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: 1605400046471130} + m_IsPrefabParent: 1 +--- !u!1 &1072194836493600 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4547357477629274} + - component: {fileID: 114665743543917518} + m_Layer: 0 + m_Name: OrientationSmoothingLowPass + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1126074346445138 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4571334280868920} + - component: {fileID: 114189903949029994} + m_Layer: 0 + m_Name: EditorLocationArrayProvider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1138706396882392 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4040343670449964} + - component: {fileID: 114050834106129140} + m_Layer: 0 + m_Name: OrientationSmoothingNoOperation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1334597763213690 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4831568114114072} + - component: {fileID: 114346689834948578} + m_Layer: 0 + m_Name: EditorLocationProviderLocationLog + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1359982225887012 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4976591158707796} + - component: {fileID: 114889913300336898} + m_Layer: 0 + m_Name: HeadingSmoothingLowPass + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1461356201740360 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4657526369587342} + - component: {fileID: 114585386640868846} + m_Layer: 0 + m_Name: OrientationSmoothingAverage + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1547503680519440 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4327817087063852} + - component: {fileID: 114545591127719896} + m_Layer: 0 + m_Name: HeadingSmoothingNoOperation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1547511233063230 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4298281135474838} + - component: {fileID: 114511931985414354} + m_Layer: 0 + m_Name: DefaultDeviceLocationProvider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1560769821367572 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4384223496714738} + - component: {fileID: 114312242556060558} + m_Layer: 0 + m_Name: AndroidDeviceLocationProvider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1605400046471130 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4806497037511362} + - component: {fileID: 114834956557871126} + m_Layer: 0 + m_Name: LocationProviderFactory + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1769576109208534 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4197629483137308} + - component: {fileID: 114061583707577078} + m_Layer: 0 + m_Name: TransformLocationProvider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1882429956169314 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4698310142003876} + - component: {fileID: 114924954806116516} + m_Layer: 0 + m_Name: HeadingSmoothingAverage + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4040343670449964 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138706396882392} + 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: 4298281135474838} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4197629483137308 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1769576109208534} + 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: 4806497037511362} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4298281135474838 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1547511233063230} + 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: 4327817087063852} + - {fileID: 4698310142003876} + - {fileID: 4976591158707796} + - {fileID: 4040343670449964} + - {fileID: 4657526369587342} + - {fileID: 4547357477629274} + m_Father: {fileID: 4806497037511362} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4327817087063852 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1547503680519440} + 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: 4298281135474838} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4384223496714738 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1560769821367572} + 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: 4806497037511362} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4547357477629274 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1072194836493600} + 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: 4298281135474838} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4571334280868920 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1126074346445138} + 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: 4806497037511362} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4657526369587342 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1461356201740360} + 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: 4298281135474838} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4698310142003876 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1882429956169314} + 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: 4298281135474838} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4806497037511362 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1605400046471130} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -18.677399, y: 12.257265, z: 21.646572} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4298281135474838} + - {fileID: 4571334280868920} + - {fileID: 4197629483137308} + - {fileID: 4384223496714738} + - {fileID: 4831568114114072} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4831568114114072 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1334597763213690} + 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: 4806497037511362} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4976591158707796 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1359982225887012} + 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: 4298281135474838} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &114050834106129140 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138706396882392} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1ea49ff9cb53e9b44b5fa981d0009588, type: 3} + m_Name: + m_EditorClassIdentifier: + _measurements: 5 +--- !u!114 &114061583707577078 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1769576109208534} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a034c4eeb3293418aab101c1895844a4, type: 3} + m_Name: + m_EditorClassIdentifier: + _accuracy: 0 + _autoFireEvent: 0 + _updateInterval: 0 + _sendEvent: 0 + _targetTransform: {fileID: 0} +--- !u!114 &114189903949029994 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1126074346445138} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6b5c815d91f9d4c3690891f3ed4c3162, type: 3} + m_Name: + m_EditorClassIdentifier: + _accuracy: 5 + _autoFireEvent: 1 + _updateInterval: 1 + _sendEvent: 0 + _latitudeLongitude: + - 48.859489, 2.32000 + - 48.859489, 2.32015 + - 48.859489, 2.32030 + - 48.859489, 2.32045 + - 48.859489, 2.32060 + _heading: 112 +--- !u!114 &114312242556060558 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1560769821367572} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d3d557417079b1446999d2d86ff71dfb, type: 3} + m_Name: + m_EditorClassIdentifier: + _updateDistanceInMeters: 0.5 + _updateTimeInMilliSeconds: 500 +--- !u!114 &114346689834948578 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1334597763213690} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: beed7ad1e12d3434a943d5fb6807cb6d, type: 3} + m_Name: + m_EditorClassIdentifier: + _accuracy: 0 + _autoFireEvent: 1 + _updateInterval: 500 + _sendEvent: 0 + _locationLogFile: {fileID: 4900000, guid: 5e6bb7224cef35c4788a4817b1c9778d, type: 3} +--- !u!114 &114511931985414354 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1547511233063230} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0a38712e93231418a84665190b8473d0, type: 3} + m_Name: + m_EditorClassIdentifier: + _desiredAccuracyInMeters: 1 + _updateDistanceInMeters: 0.5 + _updateTimeInMilliSeconds: 500 + _userHeadingSmoothing: {fileID: 114889913300336898} + _deviceOrientationSmoothing: {fileID: 114665743543917518} + _editorDebuggingOnly: + _mockUnityInputLocation: 1 + _locationLogFile: {fileID: 4900000, guid: 5e6bb7224cef35c4788a4817b1c9778d, type: 3} +--- !u!114 &114545591127719896 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1547503680519440} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1ea49ff9cb53e9b44b5fa981d0009588, type: 3} + m_Name: + m_EditorClassIdentifier: + _measurements: 5 +--- !u!114 &114585386640868846 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1461356201740360} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6843ccbf70c208645a89b4c8c37a4ecf, type: 3} + m_Name: + m_EditorClassIdentifier: + _measurements: 10 +--- !u!114 &114665743543917518 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1072194836493600} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5bc20e719eeb82d448d4698d29d526c0, type: 3} + m_Name: + m_EditorClassIdentifier: + _measurements: 7 + _smoothingFactor: 0.5 +--- !u!114 &114834956557871126 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1605400046471130} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b55f37f9a6f7e44f7bb35e6bc3863847, type: 3} + m_Name: + m_EditorClassIdentifier: + mapManager: {fileID: 0} + _deviceLocationProviderUnity: {fileID: 114511931985414354} + _deviceLocationProviderAndroid: {fileID: 114312242556060558} + _editorLocationProvider: {fileID: 114346689834948578} + _transformLocationProvider: {fileID: 114061583707577078} + _dontDestroyOnLoad: 0 +--- !u!114 &114889913300336898 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1359982225887012} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5bc20e719eeb82d448d4698d29d526c0, type: 3} + m_Name: + m_EditorClassIdentifier: + _measurements: 2 + _smoothingFactor: 0.009999999776482582 +--- !u!114 &114924954806116516 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1882429956169314} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6843ccbf70c208645a89b4c8c37a4ecf, type: 3} + m_Name: + m_EditorClassIdentifier: + _measurements: 5 diff --git a/Prefabs/LocationProviderFactory.prefab.meta b/Prefabs/LocationProviderFactory.prefab.meta new file mode 100644 index 0000000..ac81e00 --- /dev/null +++ b/Prefabs/LocationProviderFactory.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: fa49ad38da3e540fca722d2ca9e1d026 +timeCreated: 1528956679 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Prefabs/Map.prefab b/Prefabs/Map.prefab new file mode 100644 index 0000000..a32e09b --- /dev/null +++ b/Prefabs/Map.prefab @@ -0,0 +1,147 @@ +%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: 1257486800756004} + m_IsPrefabParent: 1 +--- !u!1 &1257486800756004 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4867834046800562} + - component: {fileID: 114478715909612932} + m_Layer: 0 + m_Name: Map + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4867834046800562 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1257486800756004} + 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 &114478715909612932 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1257486800756004} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cd961b1c9541a4cee99686069ecce852, type: 3} + m_Name: + m_EditorClassIdentifier: + _options: + locationOptions: + latitudeLongitude: 37.784179, -122.401583 + zoom: 15 + extentOptions: + extentType: 1 + defaultExtents: + cameraBoundsOptions: + camera: {fileID: 0} + visibleBuffer: 0 + disposeBuffer: 0 + rangeAroundCenterOptions: + west: 1 + north: 1 + east: 1 + south: 1 + rangeAroundTransformOptions: + targetTransform: {fileID: 0} + visibleBuffer: 0 + disposeBuffer: 0 + placementOptions: + placementType: 1 + snapMapToZero: 0 + scalingOptions: + scalingType: 1 + unityTileSize: 100 + loadingTexture: {fileID: 2800000, guid: e2896a92727704803a9c422b043eae89, type: 3} + tileMaterial: {fileID: 2100000, guid: b9f23e9bce724fa4daac57ecded470b8, type: 2} + _initializeOnStart: 1 + _imagery: + _layerProperty: + sourceType: 0 + sourceOptions: + isActive: 1 + layerSource: + Name: Streets + Id: mapbox://styles/mapbox/streets-v10 + Modified: + UserName: + rasterOptions: + useRetina: 1 + useCompression: 0 + useMipMap: 1 + _terrain: + _layerProperty: + sourceType: 0 + sourceOptions: + isActive: 1 + layerSource: + Name: + Id: mapbox.terrain-rgb + Modified: + UserName: + elevationLayerType: 0 + requiredOptions: + exaggerationFactor: 1 + colliderOptions: + addCollider: 0 + modificationOptions: + sampleCount: 10 + useRelativeHeight: 1 + earthRadius: 1000 + unityLayerOptions: + addToLayer: 0 + layerId: 0 + sideWallOptions: + isActive: 0 + wallHeight: 10 + wallMaterial: {fileID: 0} + _vectorData: + _layerProperty: + tileJsonData: + tileJSONLoaded: 0 + LayerDisplayNames: [] + _sourceType: 3 + sourceOptions: + isActive: 0 + layerSource: + Name: Mapbox Terrain + Id: mapbox.3d-buildings,mapbox.mapbox-streets-v7 + Modified: + UserName: + useOptimizedStyle: 0 + optimizedStyle: + Name: + Id: + Modified: + UserName: + performanceOptions: + isEnabled: 1 + entityPerCoroutine: 20 + vectorSubLayers: [] + locationPrefabList: [] + _tileProvider: {fileID: 0} diff --git a/Prefabs/Map.prefab.meta b/Prefabs/Map.prefab.meta new file mode 100644 index 0000000..e96951e --- /dev/null +++ b/Prefabs/Map.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: e6b749c6d877f4c19a5a5c3c0783d53b +timeCreated: 1520535134 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Prefabs/Player.prefab b/Prefabs/Player.prefab new file mode 100644 index 0000000..aa06594 --- /dev/null +++ b/Prefabs/Player.prefab @@ -0,0 +1,238 @@ +%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: 1111785780636424} + m_IsPrefabParent: 1 +--- !u!1 &1111785780636424 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4895895357916372} + - component: {fileID: 114150699017918456} + - component: {fileID: 114909627013365610} + m_Layer: 0 + m_Name: Player + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1138502710912304 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4614660974660258} + - component: {fileID: 33915310404607778} + - component: {fileID: 135225253641546306} + - component: {fileID: 23237265919546434} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1534900271134446 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4384392236184240} + - component: {fileID: 33393011270884676} + - component: {fileID: 65522443254307020} + - component: {fileID: 23696350353452674} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4384392236184240 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1534900271134446} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 1.5, z: 0} + m_LocalScale: {x: 1, y: 3, z: 1} + m_Children: [] + m_Father: {fileID: 4895895357916372} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4614660974660258 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138502710912304} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 4.14, z: 0} + m_LocalScale: {x: 2, y: 2, z: 2} + m_Children: [] + m_Father: {fileID: 4895895357916372} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4895895357916372 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1111785780636424} + 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: 4384392236184240} + - {fileID: 4614660974660258} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23237265919546434 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138502710912304} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: caa6c6f6f7879034992a27a6bc3794fd, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23696350353452674 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1534900271134446} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: caa6c6f6f7879034992a27a6bc3794fd, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33393011270884676 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1534900271134446} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &33915310404607778 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138502710912304} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!65 &65522443254307020 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1534900271134446} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &114150699017918456 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1111785780636424} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7760043eea2cd452ba7117f2c97e0038, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &114909627013365610 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1111785780636424} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 061d2afb48ace4fd19611279b6cf732f, type: 3} + m_Name: + m_EditorClassIdentifier: + _rotationFollowFactor: 2 + _rotateZ: 0 + _useTransformLocationProvider: 0 +--- !u!135 &135225253641546306 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138502710912304} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} diff --git a/Prefabs/Player.prefab.meta b/Prefabs/Player.prefab.meta new file mode 100644 index 0000000..f0d62fa --- /dev/null +++ b/Prefabs/Player.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 18593aeac18474b49bebac9e072ef2ab +timeCreated: 1511288923 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..77a1996 --- /dev/null +++ b/README.txt @@ -0,0 +1,23 @@ +Thank you for downloading the Mapbox Unity SDK (for Unity 2017.4.2+)! + + +Getting started: https://www.mapbox.com/unity-sdk/overview/#getting-started + +Tutorials: https://www.mapbox.com/unity-sdk/tutorials/ + +Known Issues: https://www.mapbox.com/mapbox-unity-sdk/docs/02-known-issues.html + +API: https://www.mapbox.com/mapbox-unity-sdk/api/ + + + +Current version: 2.0.1, as of December 21st, 2018 + +Changelog: https://www.mapbox.com/mapbox-unity-sdk/docs/05-changelog.html + +IMPORTANT: +If you intend to deploy for Android, please set your minimum version to 15 in PlayerSettings. +For iOS, please set your minimum version to 8. + +If you have any other issues or feedback, please contact us at https://www.mapbox.com/contact/ +or check our public repository: https://github.com/mapbox/mapbox-unity-sdk/issues. diff --git a/README.txt.meta b/README.txt.meta new file mode 100644 index 0000000..4fa58b4 --- /dev/null +++ b/README.txt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0ae487f330dd3406f827bfa400c2d056 +timeCreated: 1480534669 +licenseType: Free +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources.meta b/Resources.meta new file mode 100644 index 0000000..67fa5db --- /dev/null +++ b/Resources.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 5a5e985e7333443019481a23949c6167 +folderAsset: yes +timeCreated: 1512679461 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures.meta b/Resources/HeroStructures.meta new file mode 100644 index 0000000..727dd46 --- /dev/null +++ b/Resources/HeroStructures.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9178b7d22c68b40698f6671a9b515cd6 +folderAsset: yes +timeCreated: 1530553239 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Materials.meta b/Resources/HeroStructures/Materials.meta new file mode 100644 index 0000000..0312042 --- /dev/null +++ b/Resources/HeroStructures/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: ae743a21163124bab8f611a46caf78da +folderAsset: yes +timeCreated: 1530553530 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Materials/HeroStructureDefault.mat b/Resources/HeroStructures/Materials/HeroStructureDefault.mat new file mode 100644 index 0000000..b02ffb8 --- /dev/null +++ b/Resources/HeroStructures/Materials/HeroStructureDefault.mat @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: HeroStructureDefault + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.225 + - _GlossyReflections: 1 + - _Metallic: 0.094 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.9117647, g: 0.9117647, b: 0.9117647, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Resources/HeroStructures/Materials/HeroStructureDefault.mat.meta b/Resources/HeroStructures/Materials/HeroStructureDefault.mat.meta new file mode 100644 index 0000000..e827f87 --- /dev/null +++ b/Resources/HeroStructures/Materials/HeroStructureDefault.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 3db77ee4b81b0439eb9843d7706d832d +timeCreated: 1532463884 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Materials/StatueOfLibertyBase.mat b/Resources/HeroStructures/Materials/StatueOfLibertyBase.mat new file mode 100644 index 0000000..531efe6 --- /dev/null +++ b/Resources/HeroStructures/Materials/StatueOfLibertyBase.mat @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: StatueOfLibertyBase + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.85882354, g: 0.75686276, b: 0.6784314, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Resources/HeroStructures/Materials/StatueOfLibertyBase.mat.meta b/Resources/HeroStructures/Materials/StatueOfLibertyBase.mat.meta new file mode 100644 index 0000000..09d7430 --- /dev/null +++ b/Resources/HeroStructures/Materials/StatueOfLibertyBase.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 07e8a1a7dedf44e8180a04f153bb8f93 +timeCreated: 1532463884 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Materials/StatueOfLibertyBody.mat b/Resources/HeroStructures/Materials/StatueOfLibertyBody.mat new file mode 100644 index 0000000..a4e5588 --- /dev/null +++ b/Resources/HeroStructures/Materials/StatueOfLibertyBody.mat @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: StatueOfLibertyBody + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.49019608, g: 0.87058824, b: 0.8392157, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Resources/HeroStructures/Materials/StatueOfLibertyBody.mat.meta b/Resources/HeroStructures/Materials/StatueOfLibertyBody.mat.meta new file mode 100644 index 0000000..922a5b0 --- /dev/null +++ b/Resources/HeroStructures/Materials/StatueOfLibertyBody.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b06e58202ed324d33ad23577d5f69e5d +timeCreated: 1532463884 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Meshes.meta b/Resources/HeroStructures/Meshes.meta new file mode 100644 index 0000000..ef85047 --- /dev/null +++ b/Resources/HeroStructures/Meshes.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 1d96b7bd1cf684b818a131d85cc919ac +folderAsset: yes +timeCreated: 1530553522 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Meshes/ChryslerBuilding.fbx b/Resources/HeroStructures/Meshes/ChryslerBuilding.fbx new file mode 100644 index 0000000..51af285 Binary files /dev/null and b/Resources/HeroStructures/Meshes/ChryslerBuilding.fbx differ diff --git a/Resources/HeroStructures/Meshes/ChryslerBuilding.fbx.meta b/Resources/HeroStructures/Meshes/ChryslerBuilding.fbx.meta new file mode 100644 index 0000000..f1f1bc3 --- /dev/null +++ b/Resources/HeroStructures/Meshes/ChryslerBuilding.fbx.meta @@ -0,0 +1,96 @@ +fileFormatVersion: 2 +guid: 9ef00dc880db74fa2a52720b0b7b3c13 +timeCreated: 1533836370 +licenseType: Pro +ModelImporter: + serializedVersion: 22 + fileIDToRecycleName: + 100000: ChryslerBuilding + 100002: //RootNode + 400000: ChryslerBuilding + 400002: //RootNode + 2100000: lambert1 + 2300000: ChryslerBuilding + 3300000: ChryslerBuilding + 4300000: ChryslerBuilding + 9500000: //RootNode + externalObjects: {} + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 0.01 + meshCompression: 0 + addColliders: 0 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + serializedVersion: 2 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + rootMotionBoneName: + rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 2 + humanoidOversampling: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Meshes/CoitTower.fbx b/Resources/HeroStructures/Meshes/CoitTower.fbx new file mode 100644 index 0000000..bf60467 Binary files /dev/null and b/Resources/HeroStructures/Meshes/CoitTower.fbx differ diff --git a/Resources/HeroStructures/Meshes/CoitTower.fbx.meta b/Resources/HeroStructures/Meshes/CoitTower.fbx.meta new file mode 100644 index 0000000..d39d906 --- /dev/null +++ b/Resources/HeroStructures/Meshes/CoitTower.fbx.meta @@ -0,0 +1,94 @@ +fileFormatVersion: 2 +guid: 3b08328d5fd4f45b38052b68b9e3b74e +timeCreated: 1533836370 +licenseType: Pro +ModelImporter: + serializedVersion: 22 + fileIDToRecycleName: + 100000: //RootNode + 400000: //RootNode + 2100000: lambert1 + 2300000: //RootNode + 3300000: //RootNode + 4300000: CoitTower + 9500000: //RootNode + externalObjects: {} + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 0.01 + meshCompression: 0 + addColliders: 0 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + serializedVersion: 2 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + rootMotionBoneName: + rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 2 + humanoidOversampling: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Meshes/EmpireStateBuilding.fbx b/Resources/HeroStructures/Meshes/EmpireStateBuilding.fbx new file mode 100644 index 0000000..5a4c930 Binary files /dev/null and b/Resources/HeroStructures/Meshes/EmpireStateBuilding.fbx differ diff --git a/Resources/HeroStructures/Meshes/EmpireStateBuilding.fbx.meta b/Resources/HeroStructures/Meshes/EmpireStateBuilding.fbx.meta new file mode 100644 index 0000000..c1cfc2a --- /dev/null +++ b/Resources/HeroStructures/Meshes/EmpireStateBuilding.fbx.meta @@ -0,0 +1,94 @@ +fileFormatVersion: 2 +guid: 5a2fea3a89fae4f97b0661209286d9b9 +timeCreated: 1533836370 +licenseType: Pro +ModelImporter: + serializedVersion: 22 + fileIDToRecycleName: + 100000: //RootNode + 400000: //RootNode + 2100000: lambert1 + 2300000: //RootNode + 3300000: //RootNode + 4300000: Empire_State_Building1 + 9500000: //RootNode + externalObjects: {} + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 0.01 + meshCompression: 0 + addColliders: 0 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + serializedVersion: 2 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + rootMotionBoneName: + rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 2 + humanoidOversampling: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Meshes/OneWorldTradeCenter.fbx b/Resources/HeroStructures/Meshes/OneWorldTradeCenter.fbx new file mode 100644 index 0000000..3c8edc6 Binary files /dev/null and b/Resources/HeroStructures/Meshes/OneWorldTradeCenter.fbx differ diff --git a/Resources/HeroStructures/Meshes/OneWorldTradeCenter.fbx.meta b/Resources/HeroStructures/Meshes/OneWorldTradeCenter.fbx.meta new file mode 100644 index 0000000..60870c3 --- /dev/null +++ b/Resources/HeroStructures/Meshes/OneWorldTradeCenter.fbx.meta @@ -0,0 +1,94 @@ +fileFormatVersion: 2 +guid: 891973e6c0cc14d778d0090973a4ac11 +timeCreated: 1533836370 +licenseType: Pro +ModelImporter: + serializedVersion: 22 + fileIDToRecycleName: + 100000: //RootNode + 400000: //RootNode + 2100000: lambert1 + 2300000: //RootNode + 3300000: //RootNode + 4300000: OneWorldTradeCenter + 9500000: //RootNode + externalObjects: {} + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 0.01 + meshCompression: 0 + addColliders: 0 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + serializedVersion: 2 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + rootMotionBoneName: + rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 2 + humanoidOversampling: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Meshes/SalesForceTower.fbx b/Resources/HeroStructures/Meshes/SalesForceTower.fbx new file mode 100644 index 0000000..c67c4e0 Binary files /dev/null and b/Resources/HeroStructures/Meshes/SalesForceTower.fbx differ diff --git a/Resources/HeroStructures/Meshes/SalesForceTower.fbx.meta b/Resources/HeroStructures/Meshes/SalesForceTower.fbx.meta new file mode 100644 index 0000000..b3c37db --- /dev/null +++ b/Resources/HeroStructures/Meshes/SalesForceTower.fbx.meta @@ -0,0 +1,94 @@ +fileFormatVersion: 2 +guid: 2fb8615dbc67e43d081d04d16aa37949 +timeCreated: 1533836370 +licenseType: Pro +ModelImporter: + serializedVersion: 22 + fileIDToRecycleName: + 100000: //RootNode + 400000: //RootNode + 2100000: lambert1 + 2300000: //RootNode + 3300000: //RootNode + 4300000: SalesForceTower + 9500000: //RootNode + externalObjects: {} + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 0.01 + meshCompression: 0 + addColliders: 0 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + serializedVersion: 2 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + rootMotionBoneName: + rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 2 + humanoidOversampling: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Meshes/StatueofLiberty.fbx b/Resources/HeroStructures/Meshes/StatueofLiberty.fbx new file mode 100644 index 0000000..f862318 Binary files /dev/null and b/Resources/HeroStructures/Meshes/StatueofLiberty.fbx differ diff --git a/Resources/HeroStructures/Meshes/StatueofLiberty.fbx.meta b/Resources/HeroStructures/Meshes/StatueofLiberty.fbx.meta new file mode 100644 index 0000000..f4c82b4 --- /dev/null +++ b/Resources/HeroStructures/Meshes/StatueofLiberty.fbx.meta @@ -0,0 +1,95 @@ +fileFormatVersion: 2 +guid: 76087a3bd0f174964bbe71a0a9c5386d +timeCreated: 1533836370 +licenseType: Pro +ModelImporter: + serializedVersion: 22 + fileIDToRecycleName: + 100000: //RootNode + 400000: //RootNode + 2100000: Base + 2100002: Statue + 2300000: //RootNode + 3300000: //RootNode + 4300000: polySurface5 + 9500000: //RootNode + externalObjects: {} + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 0.01 + meshCompression: 0 + addColliders: 0 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + serializedVersion: 2 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + rootMotionBoneName: + rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 2 + humanoidOversampling: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Meshes/TransamericaPyramid.fbx b/Resources/HeroStructures/Meshes/TransamericaPyramid.fbx new file mode 100644 index 0000000..59d8886 Binary files /dev/null and b/Resources/HeroStructures/Meshes/TransamericaPyramid.fbx differ diff --git a/Resources/HeroStructures/Meshes/TransamericaPyramid.fbx.meta b/Resources/HeroStructures/Meshes/TransamericaPyramid.fbx.meta new file mode 100644 index 0000000..d66e422 --- /dev/null +++ b/Resources/HeroStructures/Meshes/TransamericaPyramid.fbx.meta @@ -0,0 +1,94 @@ +fileFormatVersion: 2 +guid: 7484dc0391f0f4984979c271ba6db225 +timeCreated: 1533836370 +licenseType: Pro +ModelImporter: + serializedVersion: 22 + fileIDToRecycleName: + 100000: //RootNode + 400000: //RootNode + 2100000: lambert1 + 2300000: //RootNode + 3300000: //RootNode + 4300000: TransamericaPyramid + 9500000: //RootNode + externalObjects: {} + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 0.01 + meshCompression: 0 + addColliders: 0 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + serializedVersion: 2 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + rootMotionBoneName: + rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 2 + humanoidOversampling: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Modifiers.meta b/Resources/HeroStructures/Modifiers.meta new file mode 100644 index 0000000..9bcbe01 --- /dev/null +++ b/Resources/HeroStructures/Modifiers.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: af13ce38a0c2e411b970988ff7f3ce19 +folderAsset: yes +timeCreated: 1532023164 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Modifiers/ReplaceGlobalHeroStructuresModifier.asset b/Resources/HeroStructures/Modifiers/ReplaceGlobalHeroStructuresModifier.asset new file mode 100644 index 0000000..f134324 --- /dev/null +++ b/Resources/HeroStructures/Modifiers/ReplaceGlobalHeroStructuresModifier.asset @@ -0,0 +1,87 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 13ade7ea2a146442b9575619cf724737, type: 3} + m_Name: ReplaceGlobalHeroStructuresModifier + m_EditorClassIdentifier: + Active: 1 + features: + - Name: TransamericaPyramid + active: 1 + prefab: {fileID: 1149413301708452, guid: 6310371eff51a7344b94c2d1bd6659ee, type: 2} + scaleDownWithWorld: 1 + _prefabLocations: + - 37.795135, -122.402748 + _explicitlyBlockedFeatureIds: + - 1366159871 + - 4513368931 + - 4513368981 + - 4513368951 + - Name: CoitTower + active: 1 + prefab: {fileID: 1557681104471738, guid: 2cb306508c053344ea5fbc519cdcff79, type: 2} + scaleDownWithWorld: 1 + _prefabLocations: + - 37.8024, -122.405833 + _explicitlyBlockedFeatureIds: [] + - Name: SalesForceTower + active: 1 + prefab: {fileID: 1410376122861786, guid: 8c4fae6310db68849ad95d5e92cd30fe, type: 2} + scaleDownWithWorld: 1 + _prefabLocations: + - 37.7898526,-122.3972425 + _explicitlyBlockedFeatureIds: + - 4319721861 + - Name: EmpireStateBuilding + active: 1 + prefab: {fileID: 1158024974015050, guid: f845fd35405547d4ca0a433a01c502c4, type: 2} + scaleDownWithWorld: 1 + _prefabLocations: + - 40.748333333333, -73.985277777778 + _explicitlyBlockedFeatureIds: + - 20989694 + - 2659326181 + - 1374251251 + - 1374251271 + - 1374251281 + - 1374251291 + - 1374251421 + - 1374251331 + - 1374251441 + - 346338541 + - 1374251311 + - Name: ChryslerBuilding + active: 1 + prefab: {fileID: 1858286666362292, guid: aedce91c327268742b81a28f40485857, type: 2} + scaleDownWithWorld: 1 + _prefabLocations: + - 40.751622, -73.975333 + _explicitlyBlockedFeatureIds: [] + - Name: OneWorldTradeCenter + active: 1 + prefab: {fileID: 1969484294415250, guid: 23006cc4ad4e90e47a00d5e992fa9c9e, type: 2} + scaleDownWithWorld: 1 + _prefabLocations: + - 40.713, -74.0135 + _explicitlyBlockedFeatureIds: + - 2410292511 + - 2410292491 + - 2410292501 + - 2410292521 + - 1472299781 + - 2410292531 + - 2410292481 + - Name: StatueofLiberty + active: 1 + prefab: {fileID: 1512981436160018, guid: 810c08d90875e4d2cab1a96f8a2edba4, type: 2} + scaleDownWithWorld: 1 + _prefabLocations: + - 40.6892, -74.0445 + _explicitlyBlockedFeatureIds: [] diff --git a/Resources/HeroStructures/Modifiers/ReplaceGlobalHeroStructuresModifier.asset.meta b/Resources/HeroStructures/Modifiers/ReplaceGlobalHeroStructuresModifier.asset.meta new file mode 100644 index 0000000..0e4238c --- /dev/null +++ b/Resources/HeroStructures/Modifiers/ReplaceGlobalHeroStructuresModifier.asset.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9cc65532303e9448e8ecbe284fc7f035 +timeCreated: 1530571520 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Prefabs.meta b/Resources/HeroStructures/Prefabs.meta new file mode 100644 index 0000000..2a91261 --- /dev/null +++ b/Resources/HeroStructures/Prefabs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 08406fe564d624dd69736f93927fe214 +folderAsset: yes +timeCreated: 1531262326 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Prefabs/ChryslerBuilding.prefab b/Resources/HeroStructures/Prefabs/ChryslerBuilding.prefab new file mode 100644 index 0000000..1aaa882 --- /dev/null +++ b/Resources/HeroStructures/Prefabs/ChryslerBuilding.prefab @@ -0,0 +1,84 @@ +%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: 1858286666362292} + m_IsPrefabParent: 1 +--- !u!1 &1858286666362292 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4566927207667822} + - component: {fileID: 33006862733243482} + - component: {fileID: 23603956348938526} + m_Layer: 0 + m_Name: ChryslerBuilding + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4566927207667822 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1858286666362292} + 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!23 &23603956348938526 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1858286666362292} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 3db77ee4b81b0439eb9843d7706d832d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33006862733243482 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1858286666362292} + m_Mesh: {fileID: 4300000, guid: 9ef00dc880db74fa2a52720b0b7b3c13, type: 3} diff --git a/Resources/HeroStructures/Prefabs/ChryslerBuilding.prefab.meta b/Resources/HeroStructures/Prefabs/ChryslerBuilding.prefab.meta new file mode 100644 index 0000000..e97394f --- /dev/null +++ b/Resources/HeroStructures/Prefabs/ChryslerBuilding.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: aedce91c327268742b81a28f40485857 +timeCreated: 1531516298 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Prefabs/CoitTower.prefab b/Resources/HeroStructures/Prefabs/CoitTower.prefab new file mode 100644 index 0000000..08519ce --- /dev/null +++ b/Resources/HeroStructures/Prefabs/CoitTower.prefab @@ -0,0 +1,84 @@ +%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: 1557681104471738} + m_IsPrefabParent: 1 +--- !u!1 &1557681104471738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4344938401925126} + - component: {fileID: 33074883412325742} + - component: {fileID: 23057148553458214} + m_Layer: 0 + m_Name: CoitTower + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4344938401925126 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1557681104471738} + 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!23 &23057148553458214 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1557681104471738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 3db77ee4b81b0439eb9843d7706d832d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33074883412325742 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1557681104471738} + m_Mesh: {fileID: 4300000, guid: 3b08328d5fd4f45b38052b68b9e3b74e, type: 3} diff --git a/Resources/HeroStructures/Prefabs/CoitTower.prefab.meta b/Resources/HeroStructures/Prefabs/CoitTower.prefab.meta new file mode 100644 index 0000000..5a2929d --- /dev/null +++ b/Resources/HeroStructures/Prefabs/CoitTower.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 2cb306508c053344ea5fbc519cdcff79 +timeCreated: 1533837084 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Prefabs/EmpireStateBuilding.prefab b/Resources/HeroStructures/Prefabs/EmpireStateBuilding.prefab new file mode 100644 index 0000000..bdf4bf9 --- /dev/null +++ b/Resources/HeroStructures/Prefabs/EmpireStateBuilding.prefab @@ -0,0 +1,84 @@ +%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: 1158024974015050} + m_IsPrefabParent: 1 +--- !u!1 &1158024974015050 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4729132199128288} + - component: {fileID: 33080274549203546} + - component: {fileID: 23730308311450780} + m_Layer: 0 + m_Name: EmpireStateBuilding + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4729132199128288 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1158024974015050} + 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!23 &23730308311450780 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1158024974015050} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 3db77ee4b81b0439eb9843d7706d832d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33080274549203546 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1158024974015050} + m_Mesh: {fileID: 4300000, guid: 5a2fea3a89fae4f97b0661209286d9b9, type: 3} diff --git a/Resources/HeroStructures/Prefabs/EmpireStateBuilding.prefab.meta b/Resources/HeroStructures/Prefabs/EmpireStateBuilding.prefab.meta new file mode 100644 index 0000000..a67ba38 --- /dev/null +++ b/Resources/HeroStructures/Prefabs/EmpireStateBuilding.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f845fd35405547d4ca0a433a01c502c4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Prefabs/OneWorldTradeCenter.prefab b/Resources/HeroStructures/Prefabs/OneWorldTradeCenter.prefab new file mode 100644 index 0000000..06d5574 --- /dev/null +++ b/Resources/HeroStructures/Prefabs/OneWorldTradeCenter.prefab @@ -0,0 +1,84 @@ +%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: 1969484294415250} + m_IsPrefabParent: 1 +--- !u!1 &1969484294415250 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4722413474237250} + - component: {fileID: 33903844087798318} + - component: {fileID: 23122515962132876} + m_Layer: 0 + m_Name: OneWorldTradeCenter + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4722413474237250 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1969484294415250} + 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!23 &23122515962132876 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1969484294415250} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 3db77ee4b81b0439eb9843d7706d832d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33903844087798318 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1969484294415250} + m_Mesh: {fileID: 4300000, guid: 891973e6c0cc14d778d0090973a4ac11, type: 3} diff --git a/Resources/HeroStructures/Prefabs/OneWorldTradeCenter.prefab.meta b/Resources/HeroStructures/Prefabs/OneWorldTradeCenter.prefab.meta new file mode 100644 index 0000000..84fd144 --- /dev/null +++ b/Resources/HeroStructures/Prefabs/OneWorldTradeCenter.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 23006cc4ad4e90e47a00d5e992fa9c9e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Prefabs/SalesForceTower.prefab b/Resources/HeroStructures/Prefabs/SalesForceTower.prefab new file mode 100644 index 0000000..d92cccf --- /dev/null +++ b/Resources/HeroStructures/Prefabs/SalesForceTower.prefab @@ -0,0 +1,84 @@ +%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: 1410376122861786} + m_IsPrefabParent: 1 +--- !u!1 &1410376122861786 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4398265057899486} + - component: {fileID: 33621496149832244} + - component: {fileID: 23170822393837704} + m_Layer: 0 + m_Name: SalesForceTower + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4398265057899486 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1410376122861786} + 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!23 &23170822393837704 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1410376122861786} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 3db77ee4b81b0439eb9843d7706d832d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33621496149832244 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1410376122861786} + m_Mesh: {fileID: 4300000, guid: 2fb8615dbc67e43d081d04d16aa37949, type: 3} diff --git a/Resources/HeroStructures/Prefabs/SalesForceTower.prefab.meta b/Resources/HeroStructures/Prefabs/SalesForceTower.prefab.meta new file mode 100644 index 0000000..4c5311c --- /dev/null +++ b/Resources/HeroStructures/Prefabs/SalesForceTower.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 8c4fae6310db68849ad95d5e92cd30fe +timeCreated: 1533837091 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Prefabs/StatueofLiberty.prefab b/Resources/HeroStructures/Prefabs/StatueofLiberty.prefab new file mode 100644 index 0000000..35f8ad1 --- /dev/null +++ b/Resources/HeroStructures/Prefabs/StatueofLiberty.prefab @@ -0,0 +1,103 @@ +%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: 1512981436160018} + m_IsPrefabParent: 1 +--- !u!1 &1512981436160018 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4735128613251444} + - component: {fileID: 33104524246768286} + - component: {fileID: 23030472429036658} + - component: {fileID: 95731898682986650} + m_Layer: 0 + m_Name: StatueofLiberty + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4735128613251444 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1512981436160018} + 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!23 &23030472429036658 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1512981436160018} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 07e8a1a7dedf44e8180a04f153bb8f93, type: 2} + - {fileID: 2100000, guid: b06e58202ed324d33ad23577d5f69e5d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33104524246768286 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1512981436160018} + m_Mesh: {fileID: 4300000, guid: 76087a3bd0f174964bbe71a0a9c5386d, type: 3} +--- !u!95 &95731898682986650 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1512981436160018} + m_Enabled: 1 + m_Avatar: {fileID: 9000000, guid: 76087a3bd0f174964bbe71a0a9c5386d, type: 3} + m_Controller: {fileID: 0} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 diff --git a/Resources/HeroStructures/Prefabs/StatueofLiberty.prefab.meta b/Resources/HeroStructures/Prefabs/StatueofLiberty.prefab.meta new file mode 100644 index 0000000..7cdd1e9 --- /dev/null +++ b/Resources/HeroStructures/Prefabs/StatueofLiberty.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 810c08d90875e4d2cab1a96f8a2edba4 +timeCreated: 1533840962 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/HeroStructures/Prefabs/TransamericaPyramid.prefab b/Resources/HeroStructures/Prefabs/TransamericaPyramid.prefab new file mode 100644 index 0000000..0b3ddf6 --- /dev/null +++ b/Resources/HeroStructures/Prefabs/TransamericaPyramid.prefab @@ -0,0 +1,84 @@ +%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: 1149413301708452} + m_IsPrefabParent: 1 +--- !u!1 &1149413301708452 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4122525094766956} + - component: {fileID: 33699940909911056} + - component: {fileID: 23004653334368634} + m_Layer: 0 + m_Name: TransamericaPyramid + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4122525094766956 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1149413301708452} + 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!23 &23004653334368634 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1149413301708452} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 3db77ee4b81b0439eb9843d7706d832d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33699940909911056 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1149413301708452} + m_Mesh: {fileID: 4300000, guid: 7484dc0391f0f4984979c271ba6db225, type: 3} diff --git a/Resources/HeroStructures/Prefabs/TransamericaPyramid.prefab.meta b/Resources/HeroStructures/Prefabs/TransamericaPyramid.prefab.meta new file mode 100644 index 0000000..8f23d9f --- /dev/null +++ b/Resources/HeroStructures/Prefabs/TransamericaPyramid.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 6310371eff51a7344b94c2d1bd6659ee +timeCreated: 1533837088 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/Mapbox.meta b/Resources/Mapbox.meta new file mode 100644 index 0000000..d7d2c1a --- /dev/null +++ b/Resources/Mapbox.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6c37bc97c80774f8aa0cb426d0f87ab5 +folderAsset: yes +timeCreated: 1512672366 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/Mapbox/PrefabList.asset b/Resources/Mapbox/PrefabList.asset new file mode 100644 index 0000000..e1dae39 --- /dev/null +++ b/Resources/Mapbox/PrefabList.asset @@ -0,0 +1,108 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c331d4375e95e4050aadbf5ed3492bba, type: 3} + m_Name: PrefabList + m_EditorClassIdentifier: + SceneList: + - {fileID: 114897919769560758} + - {fileID: 114727026839306020} + - {fileID: 114308819730444958} + - {fileID: 114247311498626294} +--- !u!114 &114128613080724838 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: ManualWorldSynchronization + m_EditorClassIdentifier: + Name: ManualWorldSynchronization + ScenePath: Assets/MapboxAR/Examples/Scenes/ManualWorldSynchronization.unity + Image: {fileID: 2800000, guid: ef67c027bc2d14df2b999b22b8ca13cb, type: 3} + Text: {fileID: 0} +--- !u!114 &114247311498626294 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: AutomaticWorldSynchronization + m_EditorClassIdentifier: + Name: WorldScaleAR + ScenePath: Assets/MapboxAR/Examples/Scenes/WorldScaleAR.unity + Image: {fileID: 2800000, guid: 544693615a8f3459c94a0a5a8930a702, type: 3} + Text: {fileID: 0} +--- !u!114 &114308819730444958 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: ARTabletopScene + m_EditorClassIdentifier: + Name: TabletopAR + ScenePath: Assets/MapboxAR/Examples/Scenes/TabletopAR.unity + Image: {fileID: 2800000, guid: e96036a81f146439cb33587e192539c7, type: 3} + Text: {fileID: 0} +--- !u!114 &114700025974298426 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: LocationBasedGame + m_EditorClassIdentifier: + Name: Location-based Game + ScenePath: Assets/Mapbox/Examples/0_PrefabScenes/Location-basedGame.unity + Image: {fileID: 2800000, guid: b9da555a2df00402d86244517dae835a, type: 3} + Text: {fileID: 0} +--- !u!114 &114727026839306020 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: CitySimulator + m_EditorClassIdentifier: + Name: City Simulator + ScenePath: Assets/Mapbox/Examples/0_PrefabScenes/CitySimulator.unity + Image: {fileID: 2800000, guid: 53e90d032a2624ab1801469b8ce804e4, type: 3} + Text: {fileID: 0} +--- !u!114 &114897919769560758 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: Location-basedGame + m_EditorClassIdentifier: + Name: Location-based Game + ScenePath: Assets/Mapbox/Examples/0_PrefabScenes/Location-basedGame.unity + Image: {fileID: 2800000, guid: b9da555a2df00402d86244517dae835a, type: 3} + Text: {fileID: 0} diff --git a/Resources/Mapbox/PrefabList.asset.meta b/Resources/Mapbox/PrefabList.asset.meta new file mode 100644 index 0000000..4e9dbe9 --- /dev/null +++ b/Resources/Mapbox/PrefabList.asset.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 8d2ff5cb743b345f4a7ff8b3cdc69f27 +timeCreated: 1521183682 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/Mapbox/PrefabScreens.meta b/Resources/Mapbox/PrefabScreens.meta new file mode 100644 index 0000000..9778a31 --- /dev/null +++ b/Resources/Mapbox/PrefabScreens.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a56e2b9138ca147588d8b25dd640a830 +folderAsset: yes +timeCreated: 1521145003 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/Mapbox/PrefabScreens/CitySimulator.gif b/Resources/Mapbox/PrefabScreens/CitySimulator.gif new file mode 100644 index 0000000..be34291 Binary files /dev/null and b/Resources/Mapbox/PrefabScreens/CitySimulator.gif differ diff --git a/Resources/Mapbox/PrefabScreens/CitySimulator.gif.meta b/Resources/Mapbox/PrefabScreens/CitySimulator.gif.meta new file mode 100644 index 0000000..76ec1bc --- /dev/null +++ b/Resources/Mapbox/PrefabScreens/CitySimulator.gif.meta @@ -0,0 +1,145 @@ +fileFormatVersion: 2 +guid: 53e90d032a2624ab1801469b8ce804e4 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + 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: 8 + 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: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + 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: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/Mapbox/PrefabScreens/Location-basedGame.gif b/Resources/Mapbox/PrefabScreens/Location-basedGame.gif new file mode 100644 index 0000000..40c421f Binary files /dev/null and b/Resources/Mapbox/PrefabScreens/Location-basedGame.gif differ diff --git a/Resources/Mapbox/PrefabScreens/Location-basedGame.gif.meta b/Resources/Mapbox/PrefabScreens/Location-basedGame.gif.meta new file mode 100644 index 0000000..447ad29 --- /dev/null +++ b/Resources/Mapbox/PrefabScreens/Location-basedGame.gif.meta @@ -0,0 +1,145 @@ +fileFormatVersion: 2 +guid: b9da555a2df00402d86244517dae835a +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + 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: 8 + 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: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + 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: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/Mapbox/PrefabScreens/TabletopAR.gif b/Resources/Mapbox/PrefabScreens/TabletopAR.gif new file mode 100644 index 0000000..445e736 Binary files /dev/null and b/Resources/Mapbox/PrefabScreens/TabletopAR.gif differ diff --git a/Resources/Mapbox/PrefabScreens/TabletopAR.gif.meta b/Resources/Mapbox/PrefabScreens/TabletopAR.gif.meta new file mode 100644 index 0000000..6e9528f --- /dev/null +++ b/Resources/Mapbox/PrefabScreens/TabletopAR.gif.meta @@ -0,0 +1,145 @@ +fileFormatVersion: 2 +guid: e96036a81f146439cb33587e192539c7 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + 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: 8 + 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: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + 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: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/Mapbox/PrefabScreens/WorldScaleAR.gif b/Resources/Mapbox/PrefabScreens/WorldScaleAR.gif new file mode 100644 index 0000000..8744eb2 Binary files /dev/null and b/Resources/Mapbox/PrefabScreens/WorldScaleAR.gif differ diff --git a/Resources/Mapbox/PrefabScreens/WorldScaleAR.gif.meta b/Resources/Mapbox/PrefabScreens/WorldScaleAR.gif.meta new file mode 100644 index 0000000..abb13fb --- /dev/null +++ b/Resources/Mapbox/PrefabScreens/WorldScaleAR.gif.meta @@ -0,0 +1,145 @@ +fileFormatVersion: 2 +guid: 544693615a8f3459c94a0a5a8930a702 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + 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: 8 + 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: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + 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: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/Mapbox/PrefabScreens/placeholder.png b/Resources/Mapbox/PrefabScreens/placeholder.png new file mode 100644 index 0000000..e585a7a Binary files /dev/null and b/Resources/Mapbox/PrefabScreens/placeholder.png differ diff --git a/Resources/Mapbox/PrefabScreens/placeholder.png.meta b/Resources/Mapbox/PrefabScreens/placeholder.png.meta new file mode 100644 index 0000000..cefedcd --- /dev/null +++ b/Resources/Mapbox/PrefabScreens/placeholder.png.meta @@ -0,0 +1,117 @@ +fileFormatVersion: 2 +guid: ef67c027bc2d14df2b999b22b8ca13cb +timeCreated: 1521143578 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - buildTarget: Standalone + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - buildTarget: iPhone + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - buildTarget: Android + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - buildTarget: WebGL + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/Mapbox/ScenesList.asset b/Resources/Mapbox/ScenesList.asset new file mode 100644 index 0000000..e7901b5 --- /dev/null +++ b/Resources/Mapbox/ScenesList.asset @@ -0,0 +1,334 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c331d4375e95e4050aadbf5ed3492bba, type: 3} + m_Name: ScenesList + m_EditorClassIdentifier: + SceneList: + - {fileID: 114778326577532556} + - {fileID: 0} + - {fileID: 114867299411580208} + - {fileID: 114677639717397690} + - {fileID: 114502121280561658} + - {fileID: 114578278320698056} + - {fileID: 114771648504718328} + - {fileID: 114276195077856018} + - {fileID: 114065962956837788} + - {fileID: 114604153191931578} + - {fileID: 114601058624558330} + - {fileID: 114515002572569922} + - {fileID: 114605066102793998} + - {fileID: 114832298713168932} + - {fileID: 114562083331774168} + - {fileID: 114481292457269868} + - {fileID: 114261525222947302} + - {fileID: 114873904952696824} + - {fileID: 114095059372530020} + - {fileID: 114545493278003882} +--- !u!114 &114065962956837788 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: Directions + m_EditorClassIdentifier: + Name: Directions + ScenePath: Assets/Mapbox/Examples/5_Playground/Scenes/Directions.unity + Image: {fileID: 0} + Text: {fileID: 0} +--- !u!114 &114095059372530020 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: WorldScaleAR-ManualAlignment + m_EditorClassIdentifier: + Name: WorldScaleAR-ManualAlignment + ScenePath: Assets/MapboxAR/Examples/Scenes/WorldScaleAR-ManualAlignment.unity + Image: {fileID: 0} + Text: {fileID: 0} +--- !u!114 &114261525222947302 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: VoxelMap + m_EditorClassIdentifier: + Name: VoxelMap + ScenePath: Assets/Mapbox/Examples/8_VoxelMap/VoxelMap.unity + Image: {fileID: 2800000, guid: 805ed9e7e2bcd4071bd22b135125a912, type: 3} + Text: {fileID: 0} +--- !u!114 &114276195077856018 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: ReplaceFeatures + m_EditorClassIdentifier: + Name: ReplaceFeatures + ScenePath: Assets/Mapbox/Examples/4_ReplaceFeatures/ReplaceFeatures.unity + Image: {fileID: 2800000, guid: 81e4425f6c22e497d9f87b864accb082, type: 3} + Text: {fileID: 0} +--- !u!114 &114481292457269868 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: Globe + m_EditorClassIdentifier: + Name: Globe + ScenePath: Assets/Mapbox/Examples/7_Globe/Globe.unity + Image: {fileID: 2800000, guid: 31ea88f94a559415194f73d9ae78c4bb, type: 3} + Text: {fileID: 0} +--- !u!114 &114502121280561658 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: TrafficAndDirections + m_EditorClassIdentifier: + Name: TrafficAndDirections + ScenePath: Assets/Mapbox/Examples/1_DataExplorer/TrafficAndDirections.unity + Image: {fileID: 2800000, guid: 9f8dc63149c4c452fb12fa47be6bb6c9, type: 3} + Text: {fileID: 0} +--- !u!114 &114515002572569922 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: RasterTile + m_EditorClassIdentifier: + Name: RasterTile + ScenePath: Assets/Mapbox/Examples/5_Playground/Scenes/RasterTile.unity + Image: {fileID: 0} + Text: {fileID: 0} +--- !u!114 &114545493278003882 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: WorldScaleAR + m_EditorClassIdentifier: + Name: WorldScaleAR + ScenePath: Assets/MapboxAR/Examples/Scenes/WorldScaleAR.unity + Image: {fileID: 0} + Text: {fileID: 0} +--- !u!114 &114556980017213984 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: Location-basedGame + m_EditorClassIdentifier: + Name: Location-basedGame + ScenePath: Assets/Mapbox/Examples/0_PrefabScenes/Location-basedGame.unity + Image: {fileID: 2800000, guid: b9da555a2df00402d86244517dae835a, type: 3} + Text: {fileID: 0} +--- !u!114 &114562083331774168 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: ZoomableMap + m_EditorClassIdentifier: + Name: ZoomableMap + ScenePath: Assets/Mapbox/Examples/6_ZoomableMap/ZoomableMap.unity + Image: {fileID: 2800000, guid: f1321adbaa6e24299bb58ab33ad3adf9, type: 3} + Text: {fileID: 0} +--- !u!114 &114578278320698056 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: AstronautGame + m_EditorClassIdentifier: + Name: AstronautGame + ScenePath: Assets/Mapbox/Examples/2_AstronautGame/AstronautGame.unity + Image: {fileID: 2800000, guid: 260f5f572e80f479bbfb37b17a01ae03, type: 3} + Text: {fileID: 0} +--- !u!114 &114601058624558330 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: LocationProvider + m_EditorClassIdentifier: + Name: LocationProvider + ScenePath: Assets/Mapbox/Examples/5_Playground/Scenes/LocationProvider.unity + Image: {fileID: 0} + Text: {fileID: 0} +--- !u!114 &114604153191931578 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: ForwardGeocoder + m_EditorClassIdentifier: + Name: ForwardGeocoder + ScenePath: Assets/Mapbox/Examples/5_Playground/Scenes/ForwardGeocoder.unity + Image: {fileID: 0} + Text: {fileID: 0} +--- !u!114 &114605066102793998 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: ReverseGeocoder + m_EditorClassIdentifier: + Name: ReverseGeocoder + ScenePath: Assets/Mapbox/Examples/5_Playground/Scenes/ReverseGeocoder.unity + Image: {fileID: 0} + Text: {fileID: 0} +--- !u!114 &114677639717397690 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: InteractiveStyledVectorMap + m_EditorClassIdentifier: + Name: InteractiveStyledVectorMap + ScenePath: Assets/Mapbox/Examples/1_DataExplorer/InteractiveStyledVectorMap.unity + Image: {fileID: 0} + Text: {fileID: 0} +--- !u!114 &114771648504718328 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: POIPlacement + m_EditorClassIdentifier: + Name: POIPlacement + ScenePath: Assets/Mapbox/Examples/3_POIPlacement/POIPlacement.unity + Image: {fileID: 2800000, guid: c2103bdd982e845a0a07bc8ee6649a17, type: 3} + Text: {fileID: 0} +--- !u!114 &114778326577532556 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: CitySimulator + m_EditorClassIdentifier: + Name: CitySimulator + ScenePath: Assets/Mapbox/Examples/0_PrefabScenes/CitySimulator.unity + Image: {fileID: 0} + Text: {fileID: 0} +--- !u!114 &114832298713168932 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: VectorTile + m_EditorClassIdentifier: + Name: VectorTile + ScenePath: Assets/Mapbox/Examples/5_Playground/Scenes/VectorTile.unity + Image: {fileID: 0} + Text: {fileID: 0} +--- !u!114 &114867299411580208 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: DataExplorer + m_EditorClassIdentifier: + Name: DataExplorer + ScenePath: Assets/Mapbox/Examples/1_DataExplorer/DataExplorer.unity + Image: {fileID: 2800000, guid: 1b7a3200c45d3425bbf8e891123932d8, type: 3} + Text: {fileID: 0} +--- !u!114 &114873904952696824 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d9ef4c9a5f1410ea3cf247b3917654, type: 3} + m_Name: TabletopAR + m_EditorClassIdentifier: + Name: TabletopAR + ScenePath: Assets/MapboxAR/Examples/Scenes/TabletopAR.unity + Image: {fileID: 0} + Text: {fileID: 0} diff --git a/Resources/Mapbox/ScenesList.asset.meta b/Resources/Mapbox/ScenesList.asset.meta new file mode 100644 index 0000000..185d04c --- /dev/null +++ b/Resources/Mapbox/ScenesList.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5424214e66dd94ac79007c7c31989849 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxPin.prefab b/Resources/MapboxPin.prefab new file mode 100644 index 0000000..1218344 --- /dev/null +++ b/Resources/MapboxPin.prefab @@ -0,0 +1,212 @@ +%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: 1064074361305596} + m_IsPrefabParent: 1 +--- !u!1 &1064074361305596 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4975462510289000} + m_Layer: 0 + m_Name: MapboxPin + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1406253380433950 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4433321769519016} + - component: {fileID: 33789390629346910} + - component: {fileID: 136328829604160218} + - component: {fileID: 23951160422349436} + m_Layer: 0 + m_Name: Cylinder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1696503624169290 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4729070745943542} + - component: {fileID: 33050419455833054} + - component: {fileID: 135736392568148992} + - component: {fileID: 23926995882122000} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4433321769519016 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1406253380433950} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 1.01, z: 0} + m_LocalScale: {x: 2, y: 2, z: 2} + m_Children: [] + m_Father: {fileID: 4975462510289000} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4729070745943542 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1696503624169290} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 4, z: 0} + m_LocalScale: {x: 4, y: 4, z: 4} + m_Children: [] + m_Father: {fileID: 4975462510289000} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4975462510289000 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1064074361305596} + 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: 4729070745943542} + - {fileID: 4433321769519016} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23926995882122000 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1696503624169290} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 1f9f9c322fb5f4efeb40ada4f2f0c854, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23951160422349436 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1406253380433950} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 1f9f9c322fb5f4efeb40ada4f2f0c854, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33050419455833054 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1696503624169290} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &33789390629346910 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1406253380433950} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!135 &135736392568148992 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1696503624169290} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!136 &136328829604160218 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1406253380433950} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} diff --git a/Resources/MapboxPin.prefab.meta b/Resources/MapboxPin.prefab.meta new file mode 100644 index 0000000..6258e89 --- /dev/null +++ b/Resources/MapboxPin.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 748e2c1db1257594bb438fbb7bd185f0 +timeCreated: 1538143890 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles.meta b/Resources/MapboxStyles.meta new file mode 100644 index 0000000..48508ed --- /dev/null +++ b/Resources/MapboxStyles.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a5b6f0096f22b4cdb826cdc4a583aa40 +folderAsset: yes +timeCreated: 1520623954 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/DefaultStyleAssets.meta b/Resources/MapboxStyles/DefaultStyleAssets.meta new file mode 100644 index 0000000..361ae62 --- /dev/null +++ b/Resources/MapboxStyles/DefaultStyleAssets.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: d90a3ccee913b4a34859e3651cbdc26a +folderAsset: yes +timeCreated: 1524243556 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/DefaultStyleAssets/Atlas.meta b/Resources/MapboxStyles/DefaultStyleAssets/Atlas.meta new file mode 100644 index 0000000..46a13ab --- /dev/null +++ b/Resources/MapboxStyles/DefaultStyleAssets/Atlas.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 05547ab88e9284d98804718999dc129d +folderAsset: yes +timeCreated: 1524504493 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/DefaultStyleAssets/Atlas/DefaultAtlasInfo.asset b/Resources/MapboxStyles/DefaultStyleAssets/Atlas/DefaultAtlasInfo.asset new file mode 100644 index 0000000..35669f4 --- /dev/null +++ b/Resources/MapboxStyles/DefaultStyleAssets/Atlas/DefaultAtlasInfo.asset @@ -0,0 +1,320 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 48879146f3ce9fb4abc113a9a2bb8e0a, type: 3} + m_Name: DefaultAtlasInfo + m_EditorClassIdentifier: + Textures: + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 3 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0.25 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 4 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 5 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0.75 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 6 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 4 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0.25 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 2 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 1 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0.75 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 11 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0.5 + width: 0.25 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 1 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 48 + FirstFloorHeight: 16 + TopFloorHeight: 16 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0.25 + y: 0.5 + width: 0.25 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 2 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 48 + FirstFloorHeight: 16 + TopFloorHeight: 16 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0.5 + width: 0.25 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 3 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 48 + FirstFloorHeight: 16 + TopFloorHeight: 16 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0.75 + y: 0.5 + width: 0.25 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 4 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 48 + FirstFloorHeight: 16 + TopFloorHeight: 16 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + Roofs: + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0.5 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0.5 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + AtlasEntityType: 0 diff --git a/Resources/MapboxStyles/DefaultStyleAssets/Atlas/DefaultAtlasInfo.asset.meta b/Resources/MapboxStyles/DefaultStyleAssets/Atlas/DefaultAtlasInfo.asset.meta new file mode 100644 index 0000000..c3b7325 --- /dev/null +++ b/Resources/MapboxStyles/DefaultStyleAssets/Atlas/DefaultAtlasInfo.asset.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 414754d7155df47beb52ca117a774f21 +timeCreated: 1515083851 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/DefaultStyleAssets/Materials.meta b/Resources/MapboxStyles/DefaultStyleAssets/Materials.meta new file mode 100644 index 0000000..2866dc4 --- /dev/null +++ b/Resources/MapboxStyles/DefaultStyleAssets/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: ace8a1e70c1984f91ac902b84df653aa +folderAsset: yes +timeCreated: 1524504545 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/DefaultStyleAssets/Materials/DefaultPerRendererMaterial.mat b/Resources/MapboxStyles/DefaultStyleAssets/Materials/DefaultPerRendererMaterial.mat new file mode 100644 index 0000000..04ab47f --- /dev/null +++ b/Resources/MapboxStyles/DefaultStyleAssets/Materials/DefaultPerRendererMaterial.mat @@ -0,0 +1,92 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: DefaultPerRendererMaterial + m_Shader: {fileID: 4800000, guid: 02ca05f28416c4bbab659e473fa74ec6, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex1: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex2: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _Emission: 0.1 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor1: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor2: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Resources/MapboxStyles/DefaultStyleAssets/Materials/DefaultPerRendererMaterial.mat.meta b/Resources/MapboxStyles/DefaultStyleAssets/Materials/DefaultPerRendererMaterial.mat.meta new file mode 100644 index 0000000..becd03c --- /dev/null +++ b/Resources/MapboxStyles/DefaultStyleAssets/Materials/DefaultPerRendererMaterial.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: babb58a68f0154cc28f9140a42b4f5c3 +timeCreated: 1527011731 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/DefaultStyleAssets/Materials/DefaultSideMaterial.mat b/Resources/MapboxStyles/DefaultStyleAssets/Materials/DefaultSideMaterial.mat new file mode 100644 index 0000000..b055320 --- /dev/null +++ b/Resources/MapboxStyles/DefaultStyleAssets/Materials/DefaultSideMaterial.mat @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: DefaultSideMaterial + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d22116fee9b9b486f847633108f0fc42, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Resources/MapboxStyles/DefaultStyleAssets/Materials/DefaultSideMaterial.mat.meta b/Resources/MapboxStyles/DefaultStyleAssets/Materials/DefaultSideMaterial.mat.meta new file mode 100644 index 0000000..9b3adf7 --- /dev/null +++ b/Resources/MapboxStyles/DefaultStyleAssets/Materials/DefaultSideMaterial.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c0653693b48614a139a124871d499679 +timeCreated: 1524504520 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/DefaultStyleAssets/Materials/DefaultTopMaterial.mat b/Resources/MapboxStyles/DefaultStyleAssets/Materials/DefaultTopMaterial.mat new file mode 100644 index 0000000..f31d735 --- /dev/null +++ b/Resources/MapboxStyles/DefaultStyleAssets/Materials/DefaultTopMaterial.mat @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: DefaultTopMaterial + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: cbadf2ff391df40bbb762a1009a9a243, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Resources/MapboxStyles/DefaultStyleAssets/Materials/DefaultTopMaterial.mat.meta b/Resources/MapboxStyles/DefaultStyleAssets/Materials/DefaultTopMaterial.mat.meta new file mode 100644 index 0000000..3bba2e6 --- /dev/null +++ b/Resources/MapboxStyles/DefaultStyleAssets/Materials/DefaultTopMaterial.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a1aa333e18c0640d7b428eecff9c4af7 +timeCreated: 1524504507 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/DefaultStyleAssets/Palettes.meta b/Resources/MapboxStyles/DefaultStyleAssets/Palettes.meta new file mode 100644 index 0000000..44a74f3 --- /dev/null +++ b/Resources/MapboxStyles/DefaultStyleAssets/Palettes.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: bf42686f8a8f346bdb651c756df746ea +folderAsset: yes +timeCreated: 1524504575 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/DefaultStyleAssets/Palettes/DefaultPalette.asset b/Resources/MapboxStyles/DefaultStyleAssets/Palettes/DefaultPalette.asset new file mode 100644 index 0000000..fd34f80 --- /dev/null +++ b/Resources/MapboxStyles/DefaultStyleAssets/Palettes/DefaultPalette.asset @@ -0,0 +1,25 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 324a61621a4444024b4a9423715bd22b, type: 3} + m_Name: DefaultPalette + m_EditorClassIdentifier: + m_numColors: 3 + m_keyColor: {r: 1, g: 1, b: 1, a: 1} + m_colors: [] + m_hueRange: 0 + m_saturationRange: 0 + m_valueRange: 0 + m_setBaseColor_Override: 0 + m_setDetailColor1_Override: 0 + m_setDetailColor2_Override: 0 + m_baseColor_Override: {r: 1, g: 1, b: 1, a: 1} + m_detailColor1_Override: {r: 1, g: 1, b: 1, a: 1} + m_detailColor2_Override: {r: 1, g: 1, b: 1, a: 1} diff --git a/Resources/MapboxStyles/DefaultStyleAssets/Palettes/DefaultPalette.asset.meta b/Resources/MapboxStyles/DefaultStyleAssets/Palettes/DefaultPalette.asset.meta new file mode 100644 index 0000000..e8c7ef9 --- /dev/null +++ b/Resources/MapboxStyles/DefaultStyleAssets/Palettes/DefaultPalette.asset.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 57bdfa37edf7a4f7f999d19443497554 +timeCreated: 1524504588 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/DefaultStyleAssets/Textures.meta b/Resources/MapboxStyles/DefaultStyleAssets/Textures.meta new file mode 100644 index 0000000..4a063e7 --- /dev/null +++ b/Resources/MapboxStyles/DefaultStyleAssets/Textures.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 31022fd2d5b8b4a0d93345aeec1c4e50 +folderAsset: yes +timeCreated: 1524504554 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/DefaultStyleAssets/Textures/DefaultSideTexture.png b/Resources/MapboxStyles/DefaultStyleAssets/Textures/DefaultSideTexture.png new file mode 100644 index 0000000..998c64d Binary files /dev/null and b/Resources/MapboxStyles/DefaultStyleAssets/Textures/DefaultSideTexture.png differ diff --git a/Resources/MapboxStyles/DefaultStyleAssets/Textures/DefaultSideTexture.png.meta b/Resources/MapboxStyles/DefaultStyleAssets/Textures/DefaultSideTexture.png.meta new file mode 100644 index 0000000..f6eef15 --- /dev/null +++ b/Resources/MapboxStyles/DefaultStyleAssets/Textures/DefaultSideTexture.png.meta @@ -0,0 +1,108 @@ +fileFormatVersion: 2 +guid: d22116fee9b9b486f847633108f0fc42 +timeCreated: 1548701735 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/DefaultStyleAssets/Textures/DefaultTopTexture.png b/Resources/MapboxStyles/DefaultStyleAssets/Textures/DefaultTopTexture.png new file mode 100644 index 0000000..bac1671 Binary files /dev/null and b/Resources/MapboxStyles/DefaultStyleAssets/Textures/DefaultTopTexture.png differ diff --git a/Resources/MapboxStyles/DefaultStyleAssets/Textures/DefaultTopTexture.png.meta b/Resources/MapboxStyles/DefaultStyleAssets/Textures/DefaultTopTexture.png.meta new file mode 100644 index 0000000..f464746 --- /dev/null +++ b/Resources/MapboxStyles/DefaultStyleAssets/Textures/DefaultTopTexture.png.meta @@ -0,0 +1,108 @@ +fileFormatVersion: 2 +guid: cbadf2ff391df40bbb762a1009a9a243 +timeCreated: 1548701735 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Materials.meta b/Resources/MapboxStyles/Materials.meta new file mode 100644 index 0000000..0af2598 --- /dev/null +++ b/Resources/MapboxStyles/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 041012e11f3cb4f4e83a5c06b5c4243d +folderAsset: yes +timeCreated: 1527182001 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Materials/MapboxStylesFacades.mat b/Resources/MapboxStyles/Materials/MapboxStylesFacades.mat new file mode 100644 index 0000000..e71100a --- /dev/null +++ b/Resources/MapboxStyles/Materials/MapboxStylesFacades.mat @@ -0,0 +1,92 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: MapboxStylesFacades + m_Shader: {fileID: 4800000, guid: a58a57c7d09bd4d5a9dd79ebd542fea4, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseTex: + m_Texture: {fileID: 2800000, guid: 4d520150ef3724e4bb52237605c761df, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex1: + m_Texture: {fileID: 2800000, guid: 36bfefc139bfa434daf90848bb333e1d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex2: + m_Texture: {fileID: 2800000, guid: aaebc04bedf1444bebad66d5386b3744, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _Emission: 0.1 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 0.28676468, g: 0.28676468, b: 0.28676468, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor1: {r: 0.5147059, g: 0.5147059, b: 0.5147059, a: 1} + - _DetailColor2: {r: 0.7647059, g: 0.7647059, b: 0.7647059, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Resources/MapboxStyles/Materials/MapboxStylesFacades.mat.meta b/Resources/MapboxStyles/Materials/MapboxStylesFacades.mat.meta new file mode 100644 index 0000000..cfbd6c0 --- /dev/null +++ b/Resources/MapboxStyles/Materials/MapboxStylesFacades.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 402dd72669f434508aa3ebc1a1491897 +timeCreated: 1527182014 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Materials/MapboxStylesFacadesPerRenderer.mat b/Resources/MapboxStyles/Materials/MapboxStylesFacadesPerRenderer.mat new file mode 100644 index 0000000..49d248a --- /dev/null +++ b/Resources/MapboxStyles/Materials/MapboxStylesFacadesPerRenderer.mat @@ -0,0 +1,92 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: MapboxStylesFacadesPerRenderer + m_Shader: {fileID: 4800000, guid: 02ca05f28416c4bbab659e473fa74ec6, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseTex: + m_Texture: {fileID: 2800000, guid: 4d520150ef3724e4bb52237605c761df, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex1: + m_Texture: {fileID: 2800000, guid: 36bfefc139bfa434daf90848bb333e1d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex2: + m_Texture: {fileID: 2800000, guid: aaebc04bedf1444bebad66d5386b3744, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _Emission: 0.1 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor1: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor2: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Resources/MapboxStyles/Materials/MapboxStylesFacadesPerRenderer.mat.meta b/Resources/MapboxStyles/Materials/MapboxStylesFacadesPerRenderer.mat.meta new file mode 100644 index 0000000..5b1545d --- /dev/null +++ b/Resources/MapboxStyles/Materials/MapboxStylesFacadesPerRenderer.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: e094fd573e6524af3a68b053b7de22c8 +timeCreated: 1527182014 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Materials/MapboxStylesRoofs.mat b/Resources/MapboxStyles/Materials/MapboxStylesRoofs.mat new file mode 100644 index 0000000..7c41e09 --- /dev/null +++ b/Resources/MapboxStyles/Materials/MapboxStylesRoofs.mat @@ -0,0 +1,92 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: MapboxStylesRoofs + m_Shader: {fileID: 4800000, guid: a58a57c7d09bd4d5a9dd79ebd542fea4, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseTex: + m_Texture: {fileID: 2800000, guid: 89d3c1f500b7e4b8bba0ce9b760e9134, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex1: + m_Texture: {fileID: 2800000, guid: a7ad6933f58d64d56a4879cc266290b3, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex2: + m_Texture: {fileID: 2800000, guid: abf274fea99064d7f9087e58ccaf6d27, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _Emission: 0.1 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 0.28676468, g: 0.28676468, b: 0.28676468, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor1: {r: 0.5147059, g: 0.5147059, b: 0.5147059, a: 1} + - _DetailColor2: {r: 0.7647059, g: 0.7647059, b: 0.7647059, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Resources/MapboxStyles/Materials/MapboxStylesRoofs.mat.meta b/Resources/MapboxStyles/Materials/MapboxStylesRoofs.mat.meta new file mode 100644 index 0000000..a28fc9b --- /dev/null +++ b/Resources/MapboxStyles/Materials/MapboxStylesRoofs.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 7b8186f8ab7c84eaaa1f9890eb440693 +timeCreated: 1527182014 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Materials/MapboxStylesRoofsPerRenderer.mat b/Resources/MapboxStyles/Materials/MapboxStylesRoofsPerRenderer.mat new file mode 100644 index 0000000..d30f0ae --- /dev/null +++ b/Resources/MapboxStyles/Materials/MapboxStylesRoofsPerRenderer.mat @@ -0,0 +1,92 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: MapboxStylesRoofsPerRenderer + m_Shader: {fileID: 4800000, guid: 02ca05f28416c4bbab659e473fa74ec6, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseTex: + m_Texture: {fileID: 2800000, guid: 89d3c1f500b7e4b8bba0ce9b760e9134, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex1: + m_Texture: {fileID: 2800000, guid: a7ad6933f58d64d56a4879cc266290b3, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex2: + m_Texture: {fileID: 2800000, guid: abf274fea99064d7f9087e58ccaf6d27, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _Emission: 0.1 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor1: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor2: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Resources/MapboxStyles/Materials/MapboxStylesRoofsPerRenderer.mat.meta b/Resources/MapboxStyles/Materials/MapboxStylesRoofsPerRenderer.mat.meta new file mode 100644 index 0000000..f8a2a5b --- /dev/null +++ b/Resources/MapboxStyles/Materials/MapboxStylesRoofsPerRenderer.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 97a65133a2ed4494bb233afaa06385bd +timeCreated: 1527182014 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles.meta b/Resources/MapboxStyles/Styles.meta new file mode 100644 index 0000000..96dd101 --- /dev/null +++ b/Resources/MapboxStyles/Styles.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 568d0dea9fa974961b4baaa83a571258 +folderAsset: yes +timeCreated: 1524244146 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles.meta new file mode 100644 index 0000000..227b65b --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 7241f5e399a064a5fb9b8bc54e740622 +folderAsset: yes +timeCreated: 1524690481 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color.meta new file mode 100644 index 0000000..a638e5a --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 0cf8ce9db9a06419cac5718e3b06f3f8 +folderAsset: yes +timeCreated: 1525729182 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets.meta new file mode 100644 index 0000000..9dc94e7 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: e3a40f1d9963a4afca03fa1f602cc37f +folderAsset: yes +timeCreated: 1524673128 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Atlas.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Atlas.meta new file mode 100644 index 0000000..b89f72b --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Atlas.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 2c2fc3b9e69b14a32b531bb67914a878 +folderAsset: yes +timeCreated: 1524502554 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Atlas/ColorAtlasInfo.asset b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Atlas/ColorAtlasInfo.asset new file mode 100644 index 0000000..1143137 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Atlas/ColorAtlasInfo.asset @@ -0,0 +1,320 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 48879146f3ce9fb4abc113a9a2bb8e0a, type: 3} + m_Name: ColorAtlasInfo + m_EditorClassIdentifier: + Textures: + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 3 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0.175 + topOfMidUv: 0.175 + topOfBottomUv: 0.1 + midUvHeight: 0.074999996 + WallToFloorRatio: 0.29999998 + - TextureRect: + serializedVersion: 2 + x: 0.25 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 4 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0.175 + topOfMidUv: 0.175 + topOfBottomUv: 0.1 + midUvHeight: 0.074999996 + WallToFloorRatio: 0.29999998 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 5 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0.175 + topOfMidUv: 0.175 + topOfBottomUv: 0.1 + midUvHeight: 0.074999996 + WallToFloorRatio: 0.29999998 + - TextureRect: + serializedVersion: 2 + x: 0.75 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 6 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0.175 + topOfMidUv: 0.175 + topOfBottomUv: 0.1 + midUvHeight: 0.074999996 + WallToFloorRatio: 0.29999998 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 4 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0.425 + topOfMidUv: 0.425 + topOfBottomUv: 0.35 + midUvHeight: 0.074999996 + WallToFloorRatio: 0.29999998 + - TextureRect: + serializedVersion: 2 + x: 0.25 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 2 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0.425 + topOfMidUv: 0.425 + topOfBottomUv: 0.35 + midUvHeight: 0.074999996 + WallToFloorRatio: 0.29999998 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 1 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0.425 + topOfMidUv: 0.425 + topOfBottomUv: 0.35 + midUvHeight: 0.074999996 + WallToFloorRatio: 0.29999998 + - TextureRect: + serializedVersion: 2 + x: 0.75 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 11 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0.425 + topOfMidUv: 0.425 + topOfBottomUv: 0.35 + midUvHeight: 0.074999996 + WallToFloorRatio: 0.29999998 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0.5 + width: 0.5 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 1 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 24 + FirstFloorHeight: 8 + TopFloorHeight: 8 + bottomOfTopUv: 0.9 + topOfMidUv: 0.9 + topOfBottomUv: 0.6 + midUvHeight: 0.3 + WallToFloorRatio: 0.6 + - TextureRect: + serializedVersion: 2 + x: 0.25 + y: 0.5 + width: 0.25 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 2 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 48 + FirstFloorHeight: 16 + TopFloorHeight: 16 + bottomOfTopUv: 0.9 + topOfMidUv: 0.9 + topOfBottomUv: 0.6 + midUvHeight: 0.3 + WallToFloorRatio: 1.2 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0.5 + width: 0.25 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 3 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 48 + FirstFloorHeight: 16 + TopFloorHeight: 16 + bottomOfTopUv: 0.9 + topOfMidUv: 0.9 + topOfBottomUv: 0.6 + midUvHeight: 0.3 + WallToFloorRatio: 1.2 + - TextureRect: + serializedVersion: 2 + x: 0.75 + y: 0.5 + width: 0.25 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 4 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 48 + FirstFloorHeight: 16 + TopFloorHeight: 16 + bottomOfTopUv: 0.9 + topOfMidUv: 0.9 + topOfBottomUv: 0.6 + midUvHeight: 0.3 + WallToFloorRatio: 1.2 + Roofs: + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0.5 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0.5 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + AtlasEntityType: 0 diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Atlas/ColorAtlasInfo.asset.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Atlas/ColorAtlasInfo.asset.meta new file mode 100644 index 0000000..56d5c2c --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Atlas/ColorAtlasInfo.asset.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 05066a15aa3b24c6493cc83636625fe3 +timeCreated: 1515083851 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Materials.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Materials.meta new file mode 100644 index 0000000..df2c8c1 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 4e5007f04d3bc45a9a593ff4076b9dff +folderAsset: yes +timeCreated: 1524502483 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Materials/ColorSideMaterial.mat b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Materials/ColorSideMaterial.mat new file mode 100644 index 0000000..178929a --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Materials/ColorSideMaterial.mat @@ -0,0 +1,103 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: ColorSideMaterial + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseTex: + m_Texture: {fileID: 2800000, guid: 4d520150ef3724e4bb52237605c761df, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex: + m_Texture: {fileID: 2800000, guid: 36bfefc139bfa434daf90848bb333e1d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex1: + m_Texture: {fileID: 2800000, guid: 36bfefc139bfa434daf90848bb333e1d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex2: + m_Texture: {fileID: 2800000, guid: aaebc04bedf1444bebad66d5386b3744, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _WindowTex: + m_Texture: {fileID: 2800000, guid: aaebc04bedf1444bebad66d5386b3744, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _Emission: 0.75 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor: {r: 0, g: 0.751724, b: 1, a: 1} + - _DetailColor1: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor2: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _WindowColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Materials/ColorSideMaterial.mat.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Materials/ColorSideMaterial.mat.meta new file mode 100644 index 0000000..759f947 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Materials/ColorSideMaterial.mat.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b45d1a21770e64c52a90af3260e1f91e +timeCreated: 1520454477 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Materials/ColorTopMaterial.mat b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Materials/ColorTopMaterial.mat new file mode 100644 index 0000000..352c50a --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Materials/ColorTopMaterial.mat @@ -0,0 +1,103 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: ColorTopMaterial + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseTex: + m_Texture: {fileID: 2800000, guid: 89d3c1f500b7e4b8bba0ce9b760e9134, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex: + m_Texture: {fileID: 2800000, guid: a88424a1da5f049169a689bf6ba4e638, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex1: + m_Texture: {fileID: 2800000, guid: a7ad6933f58d64d56a4879cc266290b3, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex2: + m_Texture: {fileID: 2800000, guid: abf274fea99064d7f9087e58ccaf6d27, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _WindowTex: + m_Texture: {fileID: 2800000, guid: a88424a1da5f049169a689bf6ba4e638, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _Emission: 0.1 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor: {r: 1, g: 0.99264705, b: 1, a: 1} + - _DetailColor1: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor2: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _WindowColor: {r: 0.23529412, g: 0.41911763, b: 1, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Materials/ColorTopMaterial.mat.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Materials/ColorTopMaterial.mat.meta new file mode 100644 index 0000000..3bdf727 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/Assets/Materials/ColorTopMaterial.mat.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: efa673a70e78040569fec7b08ba99cfa +timeCreated: 1520454477 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/ColorIcon.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/ColorIcon.png new file mode 100644 index 0000000..f499f48 Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/ColorIcon.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/ColorIcon.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/ColorIcon.png.meta new file mode 100644 index 0000000..df34fcd --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Color/ColorIcon.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: f3c3cfc0277d942eb89bfb56525e6c85 +timeCreated: 1534196301 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark.meta new file mode 100644 index 0000000..f277841 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 979f508a7dc824a57bf76a9d0b81330f +folderAsset: yes +timeCreated: 1525729182 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets.meta new file mode 100644 index 0000000..9df0f03 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: de8a1d9f6101f44529f0f7e08bfc8cf7 +folderAsset: yes +timeCreated: 1524673128 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Atlas.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Atlas.meta new file mode 100644 index 0000000..4978750 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Atlas.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 1e200e749ca644415aeef1e0c8fe963b +folderAsset: yes +timeCreated: 1524502554 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Atlas/DarkAtlasInfo.asset b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Atlas/DarkAtlasInfo.asset new file mode 100644 index 0000000..c4901b4 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Atlas/DarkAtlasInfo.asset @@ -0,0 +1,86 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 48879146f3ce9fb4abc113a9a2bb8e0a, type: 3} + m_Name: DarkAtlasInfo + m_EditorClassIdentifier: + Textures: + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 1 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 30 + FloorHeight: 18 + FirstFloorHeight: 6 + TopFloorHeight: 6 + Roofs: + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0.5 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0.5 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + AtlasEntityType: 0 diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Atlas/DarkAtlasInfo.asset.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Atlas/DarkAtlasInfo.asset.meta new file mode 100644 index 0000000..062315a --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Atlas/DarkAtlasInfo.asset.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 59ca6a03aa1ab4d5797fc37bc0f37797 +timeCreated: 1515083851 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Materials.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Materials.meta new file mode 100644 index 0000000..08abec1 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 5c84d35c417e140258f724c4556cff3c +folderAsset: yes +timeCreated: 1524502483 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Materials/DarkSideMaterial.mat b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Materials/DarkSideMaterial.mat new file mode 100644 index 0000000..75df0ba --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Materials/DarkSideMaterial.mat @@ -0,0 +1,103 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: DarkSideMaterial + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseTex: + m_Texture: {fileID: 2800000, guid: 4d520150ef3724e4bb52237605c761df, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex: + m_Texture: {fileID: 2800000, guid: 36bfefc139bfa434daf90848bb333e1d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex1: + m_Texture: {fileID: 2800000, guid: 36bfefc139bfa434daf90848bb333e1d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex2: + m_Texture: {fileID: 2800000, guid: aaebc04bedf1444bebad66d5386b3744, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _WindowTex: + m_Texture: {fileID: 2800000, guid: aaebc04bedf1444bebad66d5386b3744, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _Emission: 0.75 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 0.25, g: 0.25, b: 0.25, a: 1} + - _DetailColor: {r: 0, g: 0.751724, b: 1, a: 1} + - _DetailColor1: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor2: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _WindowColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Materials/DarkSideMaterial.mat.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Materials/DarkSideMaterial.mat.meta new file mode 100644 index 0000000..6b927dd --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Materials/DarkSideMaterial.mat.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 5cb4277d0de1443ce84170893d05adca +timeCreated: 1520454477 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Materials/DarkTopMaterial.mat b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Materials/DarkTopMaterial.mat new file mode 100644 index 0000000..575b0c3 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Materials/DarkTopMaterial.mat @@ -0,0 +1,103 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: DarkTopMaterial + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseTex: + m_Texture: {fileID: 2800000, guid: 89d3c1f500b7e4b8bba0ce9b760e9134, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex: + m_Texture: {fileID: 2800000, guid: a88424a1da5f049169a689bf6ba4e638, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex1: + m_Texture: {fileID: 2800000, guid: a7ad6933f58d64d56a4879cc266290b3, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex2: + m_Texture: {fileID: 2800000, guid: abf274fea99064d7f9087e58ccaf6d27, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _WindowTex: + m_Texture: {fileID: 2800000, guid: a88424a1da5f049169a689bf6ba4e638, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _Emission: 0.1 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 0.25, g: 0.25, b: 0.25, a: 1} + - _DetailColor: {r: 1, g: 0.99264705, b: 1, a: 1} + - _DetailColor1: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor2: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _WindowColor: {r: 0.23529412, g: 0.41911763, b: 1, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Materials/DarkTopMaterial.mat.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Materials/DarkTopMaterial.mat.meta new file mode 100644 index 0000000..152e681 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/Assets/Materials/DarkTopMaterial.mat.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1c7d76a44fa2d4908bf4ee096556a5db +timeCreated: 1520454477 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/DarkIcon.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/DarkIcon.png new file mode 100644 index 0000000..a1e805b Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/DarkIcon.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/DarkIcon.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/DarkIcon.png.meta new file mode 100644 index 0000000..ec1c724 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Dark/DarkIcon.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 8000e1968557249138e2cc002b9c082f +timeCreated: 1534196301 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy.meta new file mode 100644 index 0000000..440273a --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 5e23a332724014d2c9c637a78cad8cb6 +folderAsset: yes +timeCreated: 1524075919 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets.meta new file mode 100644 index 0000000..26e0c12 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 94f396a4e39be4445bd593c3c2892fbf +folderAsset: yes +timeCreated: 1524673128 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Atlas.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Atlas.meta new file mode 100644 index 0000000..d4c9c9e --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Atlas.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9db5db299e4da48688f54c671bd508db +folderAsset: yes +timeCreated: 1524502876 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Atlas/FantasyAtlasInfo.asset b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Atlas/FantasyAtlasInfo.asset new file mode 100644 index 0000000..62bec04 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Atlas/FantasyAtlasInfo.asset @@ -0,0 +1,155 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 48879146f3ce9fb4abc113a9a2bb8e0a, type: 3} + m_Name: FantasyAtlasInfo + m_EditorClassIdentifier: + Textures: + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 3 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.25 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 4 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 5 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.75 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 6 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 4 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.25 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 2 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 1 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.75 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 11 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + Roofs: + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0.5 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0.5 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Atlas/FantasyAtlasInfo.asset.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Atlas/FantasyAtlasInfo.asset.meta new file mode 100644 index 0000000..9b00cac --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Atlas/FantasyAtlasInfo.asset.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 4793568a8fb3c40a0ab74f5419319b48 +timeCreated: 1525818671 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Materials.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Materials.meta new file mode 100644 index 0000000..9cac51d --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 3d041e98647384eaf92cc34f92a9b9fc +folderAsset: yes +timeCreated: 1524502856 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Materials/FantasySideMaterial.mat b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Materials/FantasySideMaterial.mat new file mode 100644 index 0000000..e84fee0 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Materials/FantasySideMaterial.mat @@ -0,0 +1,80 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: FantasySideMaterial + m_Shader: {fileID: 47, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _METALLICGLOSSMAP _NORMALMAP _SPECGLOSSMAP + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 2800000, guid: cc9fc53d1707044a89869011758a4ace, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 4a6fbea75bd8b4efd965f0e8562736f7, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: c0c54855db6f343369c7b95ea83766e0, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 2800000, guid: 387ea64048d8f4163b4f7f54e4cd5b3e, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Materials/FantasySideMaterial.mat.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Materials/FantasySideMaterial.mat.meta new file mode 100644 index 0000000..fc9c6e2 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Materials/FantasySideMaterial.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 7420a65a71a3f48a083a5e43216a8a6e +timeCreated: 1523481632 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Materials/FantasyTopMaterial.mat b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Materials/FantasyTopMaterial.mat new file mode 100644 index 0000000..4637501 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Materials/FantasyTopMaterial.mat @@ -0,0 +1,80 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: FantasyTopMaterial + m_Shader: {fileID: 47, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _METALLICGLOSSMAP _NORMALMAP _SPECGLOSSMAP + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 2800000, guid: cc9fc53d1707044a89869011758a4ace, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 4a6fbea75bd8b4efd965f0e8562736f7, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: c0c54855db6f343369c7b95ea83766e0, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 2800000, guid: 387ea64048d8f4163b4f7f54e4cd5b3e, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Materials/FantasyTopMaterial.mat.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Materials/FantasyTopMaterial.mat.meta new file mode 100644 index 0000000..a063ed9 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Materials/FantasyTopMaterial.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 2cc3bc1f1604c4145aebb2232440059b +timeCreated: 1523481632 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures.meta new file mode 100644 index 0000000..0898683 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: dcaab30292cce476197b688f231dd19d +folderAsset: yes +timeCreated: 1524502864 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyAlbedo.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyAlbedo.png new file mode 100644 index 0000000..7f28d2e Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyAlbedo.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyAlbedo.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyAlbedo.png.meta new file mode 100644 index 0000000..da6b5a9 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyAlbedo.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 4a6fbea75bd8b4efd965f0e8562736f7 +timeCreated: 1548702110 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyMetallic.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyMetallic.png new file mode 100644 index 0000000..3f99a2e Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyMetallic.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyMetallic.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyMetallic.png.meta new file mode 100644 index 0000000..eb89e93 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyMetallic.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: c0c54855db6f343369c7b95ea83766e0 +timeCreated: 1548702111 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyNormal.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyNormal.png new file mode 100644 index 0000000..3af374a Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyNormal.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyNormal.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyNormal.png.meta new file mode 100644 index 0000000..31374cf --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyNormal.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: cc9fc53d1707044a89869011758a4ace +timeCreated: 1548702112 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 1 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyRoughness.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyRoughness.png new file mode 100644 index 0000000..bbaf997 Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyRoughness.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyRoughness.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyRoughness.png.meta new file mode 100644 index 0000000..b471c01 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasyRoughness.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 387ea64048d8f4163b4f7f54e4cd5b3e +timeCreated: 1548702109 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasySideAlbedo.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasySideAlbedo.png new file mode 100644 index 0000000..dec1ccd Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasySideAlbedo.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasySideAlbedo.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasySideAlbedo.png.meta new file mode 100644 index 0000000..453a432 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/Assets/Textures/FantasySideAlbedo.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 992dea7ebd0a54a45899a2e3dba54fa6 +timeCreated: 1548702111 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/FantasyIcon.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/FantasyIcon.png new file mode 100644 index 0000000..7403fbe Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/FantasyIcon.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/FantasyIcon.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/FantasyIcon.png.meta new file mode 100644 index 0000000..3293d6c --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Fantasy/FantasyIcon.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: e05ca07235f774564ac030037ceadf8c +timeCreated: 1534196301 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light.meta new file mode 100644 index 0000000..0b92041 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 3ca2306bb5abf45a5a7658b0a34a4f23 +folderAsset: yes +timeCreated: 1525729182 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets.meta new file mode 100644 index 0000000..35b99fc --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 4c1d2a7e681424689a0b8b7ee56a214a +folderAsset: yes +timeCreated: 1524673128 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Atlas.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Atlas.meta new file mode 100644 index 0000000..9f814d4 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Atlas.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 7afea0e425ae943f681258a33a848e8b +folderAsset: yes +timeCreated: 1524502554 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Atlas/LightAtlasInfo.asset b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Atlas/LightAtlasInfo.asset new file mode 100644 index 0000000..1cf85a4 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Atlas/LightAtlasInfo.asset @@ -0,0 +1,239 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 48879146f3ce9fb4abc113a9a2bb8e0a, type: 3} + m_Name: LightAtlasInfo + m_EditorClassIdentifier: + Textures: + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 3 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.25 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 4 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 5 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.75 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 6 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 4 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.25 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 2 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 1 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.75 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 11 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0.5 + width: 0.5 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 1 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 50 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.25 + y: 0.5 + width: 0.25 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 2 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 50 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0.5 + width: 0.25 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 3 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 50 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.75 + y: 0.5 + width: 0.25 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 4 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 50 + FirstFloorHeight: 12 + TopFloorHeight: 12 + Roofs: + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0.5 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0.5 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Atlas/LightAtlasInfo.asset.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Atlas/LightAtlasInfo.asset.meta new file mode 100644 index 0000000..cb073b2 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Atlas/LightAtlasInfo.asset.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 817b646f06c8845628ba7acf4819a67d +timeCreated: 1515083851 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Materials.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Materials.meta new file mode 100644 index 0000000..895c1be --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9728fd5c889f64b3198102e28e9c5d83 +folderAsset: yes +timeCreated: 1524502483 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Materials/LightSideMaterial.mat b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Materials/LightSideMaterial.mat new file mode 100644 index 0000000..a76dee7 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Materials/LightSideMaterial.mat @@ -0,0 +1,103 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: LightSideMaterial + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseTex: + m_Texture: {fileID: 2800000, guid: 4d520150ef3724e4bb52237605c761df, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex: + m_Texture: {fileID: 2800000, guid: 36bfefc139bfa434daf90848bb333e1d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex1: + m_Texture: {fileID: 2800000, guid: 36bfefc139bfa434daf90848bb333e1d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex2: + m_Texture: {fileID: 2800000, guid: aaebc04bedf1444bebad66d5386b3744, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _WindowTex: + m_Texture: {fileID: 2800000, guid: aaebc04bedf1444bebad66d5386b3744, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _Emission: 0.75 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 0.78676474, g: 0.78676474, b: 0.78676474, a: 1} + - _DetailColor: {r: 0, g: 0.751724, b: 1, a: 1} + - _DetailColor1: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor2: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _WindowColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Materials/LightSideMaterial.mat.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Materials/LightSideMaterial.mat.meta new file mode 100644 index 0000000..52773db --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Materials/LightSideMaterial.mat.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b0c7fbba2306f4732b02134faa797327 +timeCreated: 1520454477 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Materials/LightTopMaterial.mat b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Materials/LightTopMaterial.mat new file mode 100644 index 0000000..5595a2c --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Materials/LightTopMaterial.mat @@ -0,0 +1,103 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: LightTopMaterial + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHABLEND_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseTex: + m_Texture: {fileID: 2800000, guid: 89d3c1f500b7e4b8bba0ce9b760e9134, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex: + m_Texture: {fileID: 2800000, guid: a88424a1da5f049169a689bf6ba4e638, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex1: + m_Texture: {fileID: 2800000, guid: a7ad6933f58d64d56a4879cc266290b3, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex2: + m_Texture: {fileID: 2800000, guid: abf274fea99064d7f9087e58ccaf6d27, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _WindowTex: + m_Texture: {fileID: 2800000, guid: a88424a1da5f049169a689bf6ba4e638, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _Emission: 0.1 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 2 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 5 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 0.78676474, g: 0.78676474, b: 0.78676474, a: 1} + - _DetailColor: {r: 1, g: 0.99264705, b: 1, a: 1} + - _DetailColor1: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor2: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _WindowColor: {r: 0.23529412, g: 0.41911763, b: 1, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Materials/LightTopMaterial.mat.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Materials/LightTopMaterial.mat.meta new file mode 100644 index 0000000..349a0e6 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/Assets/Materials/LightTopMaterial.mat.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ce046f747f2e84761ab461cb5f85fcbd +timeCreated: 1520454477 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/LightIcon.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/LightIcon.png new file mode 100644 index 0000000..3254307 Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/LightIcon.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/LightIcon.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/LightIcon.png.meta new file mode 100644 index 0000000..82d3a70 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Light/LightIcon.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: a6abe9dc5451a4d4683e41afd413a0d5 +timeCreated: 1534196301 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic.meta new file mode 100644 index 0000000..d4d63e4 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 1d39b68bd0fcc41e88196412d22a683f +folderAsset: yes +timeCreated: 1524075909 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets.meta new file mode 100644 index 0000000..e2c62ab --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: bdbdb0d8875404b278dd343cf3b95064 +folderAsset: yes +timeCreated: 1524673128 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Atlas.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Atlas.meta new file mode 100644 index 0000000..5bd1ffc --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Atlas.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: baf18efdb9c1e4533b37895d97c04abc +folderAsset: yes +timeCreated: 1524502876 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Atlas/RealisticAtlasInfo.asset b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Atlas/RealisticAtlasInfo.asset new file mode 100644 index 0000000..2c23bcc --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Atlas/RealisticAtlasInfo.asset @@ -0,0 +1,320 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 48879146f3ce9fb4abc113a9a2bb8e0a, type: 3} + m_Name: RealisticAtlasInfo + m_EditorClassIdentifier: + Textures: + - TextureRect: + serializedVersion: 2 + x: 0.25 + y: 0.5 + width: 0.25 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 2 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 48 + FirstFloorHeight: 16 + TopFloorHeight: 16 + bottomOfTopUv: 0.9 + topOfMidUv: 0.9 + topOfBottomUv: 0.6 + midUvHeight: 0.3 + WallToFloorRatio: 1.2 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 3 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0.425 + topOfMidUv: 0.425 + topOfBottomUv: 0.35 + midUvHeight: 0.074999996 + WallToFloorRatio: 0.29999998 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 4 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0.425 + topOfMidUv: 0.425 + topOfBottomUv: 0.35 + midUvHeight: 0.074999996 + WallToFloorRatio: 0.29999998 + - TextureRect: + serializedVersion: 2 + x: 0.75 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 11 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0.425 + topOfMidUv: 0.425 + topOfBottomUv: 0.35 + midUvHeight: 0.074999996 + WallToFloorRatio: 0.29999998 + - TextureRect: + serializedVersion: 2 + x: 0.25 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 2 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0.425 + topOfMidUv: 0.425 + topOfBottomUv: 0.35 + midUvHeight: 0.074999996 + WallToFloorRatio: 0.29999998 + - TextureRect: + serializedVersion: 2 + x: 0.25 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 2 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0.175 + topOfMidUv: 0.175 + topOfBottomUv: 0.1 + midUvHeight: 0.074999996 + WallToFloorRatio: 0.29999998 + - TextureRect: + serializedVersion: 2 + x: 0.75 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 6 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0.175 + topOfMidUv: 0.175 + topOfBottomUv: 0.1 + midUvHeight: 0.074999996 + WallToFloorRatio: 0.29999998 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 3 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 30 + FloorHeight: 8.999999 + FirstFloorHeight: 12 + TopFloorHeight: 9 + bottomOfTopUv: 0.175 + topOfMidUv: 0.175 + topOfBottomUv: 0.1 + midUvHeight: 0.074999996 + WallToFloorRatio: 0.29999998 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 3 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 11.999999 + FirstFloorHeight: 16 + TopFloorHeight: 12 + bottomOfTopUv: 0.175 + topOfMidUv: 0.175 + topOfBottomUv: 0.1 + midUvHeight: 0.074999996 + WallToFloorRatio: 0.29999998 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0.5 + width: 0.25 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 3 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 48 + FirstFloorHeight: 16 + TopFloorHeight: 16 + bottomOfTopUv: 0.9 + topOfMidUv: 0.9 + topOfBottomUv: 0.6 + midUvHeight: 0.3 + WallToFloorRatio: 1.2 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0.5 + width: 0.25 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 3 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 48 + FirstFloorHeight: 16 + TopFloorHeight: 16 + bottomOfTopUv: 0.9 + topOfMidUv: 0.9 + topOfBottomUv: 0.6 + midUvHeight: 0.3 + WallToFloorRatio: 1.2 + - TextureRect: + serializedVersion: 2 + x: 0.75 + y: 0.5 + width: 0.25 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 4 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 48 + FirstFloorHeight: 16 + TopFloorHeight: 16 + bottomOfTopUv: 0.9 + topOfMidUv: 0.9 + topOfBottomUv: 0.6 + midUvHeight: 0.3 + WallToFloorRatio: 1.2 + Roofs: + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0.5 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0.5 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + bottomOfTopUv: 0 + topOfMidUv: 0 + topOfBottomUv: 0 + midUvHeight: 0 + WallToFloorRatio: 0 + AtlasEntityType: 0 diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Atlas/RealisticAtlasInfo.asset.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Atlas/RealisticAtlasInfo.asset.meta new file mode 100644 index 0000000..1cfd802 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Atlas/RealisticAtlasInfo.asset.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c422f39ca8fe566479230c87805b3301 +timeCreated: 1527158143 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Materials.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Materials.meta new file mode 100644 index 0000000..127b2ab --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 17022f11f743746409ecc2920ba138af +folderAsset: yes +timeCreated: 1524502856 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Materials/RealisticSideMaterial.mat b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Materials/RealisticSideMaterial.mat new file mode 100644 index 0000000..085ad04 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Materials/RealisticSideMaterial.mat @@ -0,0 +1,80 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: RealisticSideMaterial + m_Shader: {fileID: 47, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _METALLICGLOSSMAP _NORMALMAP _SPECGLOSSMAP + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 2800000, guid: 639754785a99045debbad4593b7c92e9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 0bcf5c7180b764937aa4cd980bd44e8b, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: c3370fc9cdec647fcb05b4bcfb13aa37, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: feda69b01240b4568a23a5a754012e5a, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 2800000, guid: b4566aacde9a0463a89407bec92aa87c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Materials/RealisticSideMaterial.mat.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Materials/RealisticSideMaterial.mat.meta new file mode 100644 index 0000000..d9b48ca --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Materials/RealisticSideMaterial.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9f4e4d809e3e14cc08a842dc23ff86ed +timeCreated: 1523481632 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Materials/RealisticTopMaterial.mat b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Materials/RealisticTopMaterial.mat new file mode 100644 index 0000000..84a1a56 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Materials/RealisticTopMaterial.mat @@ -0,0 +1,80 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: RealisticTopMaterial + m_Shader: {fileID: 47, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _NORMALMAP + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 2800000, guid: f99015b7b1a6f497bab611412ee65c90, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 581505b85254d4d29b170800875ef29a, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 2800000, guid: 0bc8bd5e5fc49497fad146b25f52e005, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Materials/RealisticTopMaterial.mat.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Materials/RealisticTopMaterial.mat.meta new file mode 100644 index 0000000..e2ff3b7 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Materials/RealisticTopMaterial.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: e510beb4b52b54f9eace1c065a96dd24 +timeCreated: 1523481632 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures.meta new file mode 100644 index 0000000..65fe43f --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: d238bfe6909294cbfbd4158ecf549a1a +folderAsset: yes +timeCreated: 1524502864 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideAO.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideAO.png new file mode 100644 index 0000000..cbed3b5 Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideAO.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideAO.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideAO.png.meta new file mode 100644 index 0000000..bc1a86d --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideAO.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: feda69b01240b4568a23a5a754012e5a +timeCreated: 1548702202 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideAlbedo.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideAlbedo.png new file mode 100644 index 0000000..668c01f Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideAlbedo.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideAlbedo.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideAlbedo.png.meta new file mode 100644 index 0000000..fea1124 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideAlbedo.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 0bcf5c7180b764937aa4cd980bd44e8b +timeCreated: 1548702196 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideMetallic.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideMetallic.png new file mode 100644 index 0000000..df4f61a Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideMetallic.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideMetallic.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideMetallic.png.meta new file mode 100644 index 0000000..9fa61dd --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideMetallic.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: c3370fc9cdec647fcb05b4bcfb13aa37 +timeCreated: 1548702199 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideNormal.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideNormal.png new file mode 100644 index 0000000..6d6a2ab Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideNormal.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideNormal.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideNormal.png.meta new file mode 100644 index 0000000..b7d6da1 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideNormal.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 639754785a99045debbad4593b7c92e9 +timeCreated: 1548702199 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 1 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideRoughness.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideRoughness.png new file mode 100644 index 0000000..e851360 Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideRoughness.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideRoughness.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideRoughness.png.meta new file mode 100644 index 0000000..e24819b --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticSideRoughness.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: b4566aacde9a0463a89407bec92aa87c +timeCreated: 1548702199 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticTopAO.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticTopAO.png new file mode 100644 index 0000000..99a79bd Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticTopAO.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticTopAO.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticTopAO.png.meta new file mode 100644 index 0000000..ff60765 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticTopAO.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 0bc8bd5e5fc49497fad146b25f52e005 +timeCreated: 1548702196 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticTopAlbedo.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticTopAlbedo.png new file mode 100644 index 0000000..767e7ef Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticTopAlbedo.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticTopAlbedo.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticTopAlbedo.png.meta new file mode 100644 index 0000000..368c936 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticTopAlbedo.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 581505b85254d4d29b170800875ef29a +timeCreated: 1548702198 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticTopNormal.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticTopNormal.png new file mode 100644 index 0000000..a61fb8e Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticTopNormal.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticTopNormal.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticTopNormal.png.meta new file mode 100644 index 0000000..01590ef --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/Assets/Textures/RealisticTopNormal.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: f99015b7b1a6f497bab611412ee65c90 +timeCreated: 1548702201 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 1 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/RealisticIcon.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/RealisticIcon.png new file mode 100644 index 0000000..c2a65dd Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/RealisticIcon.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/RealisticIcon.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/RealisticIcon.png.meta new file mode 100644 index 0000000..b737a35 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Realistic/RealisticIcon.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 8d7b18fbb73ab4574887f2502c6b332d +timeCreated: 1534196334 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite.meta new file mode 100644 index 0000000..b9f5798 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 8773d242ae6264de6b2d9dde90edfc84 +folderAsset: yes +timeCreated: 1525729182 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/Assets.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/Assets.meta new file mode 100644 index 0000000..f88b5ab --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/Assets.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 6ad17a97f632a40fba47671b05212900 +folderAsset: yes +timeCreated: 1524673128 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/Assets/Materials.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/Assets/Materials.meta new file mode 100644 index 0000000..ec23d6e --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/Assets/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c93c2d52130b8459bafe6d51c50d4ce6 +folderAsset: yes +timeCreated: 1524502483 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/Assets/Materials/SatelliteSideMaterial.mat b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/Assets/Materials/SatelliteSideMaterial.mat new file mode 100644 index 0000000..bfc1338 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/Assets/Materials/SatelliteSideMaterial.mat @@ -0,0 +1,102 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: SatelliteSideMaterial + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseTex: + m_Texture: {fileID: 2800000, guid: 4d520150ef3724e4bb52237605c761df, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex: + m_Texture: {fileID: 2800000, guid: 36bfefc139bfa434daf90848bb333e1d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex1: + m_Texture: {fileID: 2800000, guid: 36bfefc139bfa434daf90848bb333e1d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex2: + m_Texture: {fileID: 2800000, guid: aaebc04bedf1444bebad66d5386b3744, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _WindowTex: + m_Texture: {fileID: 2800000, guid: aaebc04bedf1444bebad66d5386b3744, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _Emission: 0.75 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor: {r: 0, g: 0.751724, b: 1, a: 1} + - _DetailColor1: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor2: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _WindowColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/Assets/Materials/SatelliteSideMaterial.mat.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/Assets/Materials/SatelliteSideMaterial.mat.meta new file mode 100644 index 0000000..8746c55 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/Assets/Materials/SatelliteSideMaterial.mat.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ace449cc706bd49b7a69aa1cf216554b +timeCreated: 1520454477 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/Assets/Materials/SatelliteTopMaterial.mat b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/Assets/Materials/SatelliteTopMaterial.mat new file mode 100644 index 0000000..f9437c9 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/Assets/Materials/SatelliteTopMaterial.mat @@ -0,0 +1,102 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: SatelliteTopMaterial + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseTex: + m_Texture: {fileID: 2800000, guid: 89d3c1f500b7e4b8bba0ce9b760e9134, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex: + m_Texture: {fileID: 2800000, guid: a88424a1da5f049169a689bf6ba4e638, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex1: + m_Texture: {fileID: 2800000, guid: a7ad6933f58d64d56a4879cc266290b3, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex2: + m_Texture: {fileID: 2800000, guid: abf274fea99064d7f9087e58ccaf6d27, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _WindowTex: + m_Texture: {fileID: 2800000, guid: a88424a1da5f049169a689bf6ba4e638, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _Emission: 0.1 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor: {r: 1, g: 0.99264705, b: 1, a: 1} + - _DetailColor1: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor2: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _WindowColor: {r: 0.23529412, g: 0.41911763, b: 1, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/Assets/Materials/SatelliteTopMaterial.mat.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/Assets/Materials/SatelliteTopMaterial.mat.meta new file mode 100644 index 0000000..fe9fb27 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/Assets/Materials/SatelliteTopMaterial.mat.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 37ef2b0c2d42647a79863b9c9661beeb +timeCreated: 1520454477 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/SatelliteIcon.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/SatelliteIcon.png new file mode 100644 index 0000000..2e7816c Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/SatelliteIcon.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/SatelliteIcon.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/SatelliteIcon.png.meta new file mode 100644 index 0000000..41b3098 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Satellite/SatelliteIcon.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: ad764ebd3ff314d70b7e1caac328efd6 +timeCreated: 1534196301 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple.meta new file mode 100644 index 0000000..bb008ca --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 61aefc08b5ccc4377ae9b402d4aced81 +folderAsset: yes +timeCreated: 1525729182 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets.meta new file mode 100644 index 0000000..3e47848 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b559719ab140941b0804edd9cd5150f2 +folderAsset: yes +timeCreated: 1524673128 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Atlas.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Atlas.meta new file mode 100644 index 0000000..896988b --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Atlas.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 85506310233344ca692aaa8aa0ded9b3 +folderAsset: yes +timeCreated: 1524502554 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Atlas/SimpleAtlasInfo.asset b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Atlas/SimpleAtlasInfo.asset new file mode 100644 index 0000000..0a30d55 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Atlas/SimpleAtlasInfo.asset @@ -0,0 +1,239 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 48879146f3ce9fb4abc113a9a2bb8e0a, type: 3} + m_Name: SimpleAtlasInfo + m_EditorClassIdentifier: + Textures: + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 3 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.25 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 4 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 5 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.75 + y: 0 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 6 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 4 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.25 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 2 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 1 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.75 + y: 0.25 + width: 0.25 + height: 0.25 + MidFloorCount: 1 + ColumnCount: 11 + TopSectionRatio: 0.3 + BottomSectionRatio: 0.4 + PreferredEdgeSectionLength: 40 + FloorHeight: 10 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0.5 + width: 0.5 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 1 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 50 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.25 + y: 0.5 + width: 0.25 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 2 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 50 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0.5 + width: 0.25 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 3 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 50 + FirstFloorHeight: 12 + TopFloorHeight: 12 + - TextureRect: + serializedVersion: 2 + x: 0.75 + y: 0.5 + width: 0.25 + height: 0.5 + MidFloorCount: 4 + ColumnCount: 4 + TopSectionRatio: 0.2 + BottomSectionRatio: 0.2 + PreferredEdgeSectionLength: 40 + FloorHeight: 50 + FirstFloorHeight: 12 + TopFloorHeight: 12 + Roofs: + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + - TextureRect: + serializedVersion: 2 + x: 0 + y: 0.5 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 + - TextureRect: + serializedVersion: 2 + x: 0.5 + y: 0.5 + width: 0.5 + height: 0.5 + MidFloorCount: 0 + ColumnCount: 0 + TopSectionRatio: 0 + BottomSectionRatio: 0 + PreferredEdgeSectionLength: 0 + FloorHeight: 0 + FirstFloorHeight: 0 + TopFloorHeight: 0 diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Atlas/SimpleAtlasInfo.asset.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Atlas/SimpleAtlasInfo.asset.meta new file mode 100644 index 0000000..98f20ea --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Atlas/SimpleAtlasInfo.asset.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 4df87964fe5004278acef942d9a878d4 +timeCreated: 1515083851 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Materials.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Materials.meta new file mode 100644 index 0000000..832dbad --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: fbf857b3329304fdeb9c0c0ef551ad0e +folderAsset: yes +timeCreated: 1524502483 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Materials/SimpleSideMaterial.mat b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Materials/SimpleSideMaterial.mat new file mode 100644 index 0000000..7f91d27 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Materials/SimpleSideMaterial.mat @@ -0,0 +1,102 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: SimpleSideMaterial + m_Shader: {fileID: 4800000, guid: 02ca05f28416c4bbab659e473fa74ec6, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseTex: + m_Texture: {fileID: 2800000, guid: 4d520150ef3724e4bb52237605c761df, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex: + m_Texture: {fileID: 2800000, guid: 36bfefc139bfa434daf90848bb333e1d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex1: + m_Texture: {fileID: 2800000, guid: 36bfefc139bfa434daf90848bb333e1d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex2: + m_Texture: {fileID: 2800000, guid: aaebc04bedf1444bebad66d5386b3744, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _WindowTex: + m_Texture: {fileID: 2800000, guid: aaebc04bedf1444bebad66d5386b3744, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _Emission: 0.5 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor: {r: 0, g: 0.751724, b: 1, a: 1} + - _DetailColor1: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor2: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _WindowColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Materials/SimpleSideMaterial.mat.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Materials/SimpleSideMaterial.mat.meta new file mode 100644 index 0000000..58033e2 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Materials/SimpleSideMaterial.mat.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 55cc6edead802446b9106b2998406844 +timeCreated: 1520454477 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Materials/SimpleTopMaterial.mat b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Materials/SimpleTopMaterial.mat new file mode 100644 index 0000000..42b7a46 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Materials/SimpleTopMaterial.mat @@ -0,0 +1,102 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: SimpleTopMaterial + m_Shader: {fileID: 4800000, guid: 02ca05f28416c4bbab659e473fa74ec6, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseTex: + m_Texture: {fileID: 2800000, guid: 89d3c1f500b7e4b8bba0ce9b760e9134, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex: + m_Texture: {fileID: 2800000, guid: a88424a1da5f049169a689bf6ba4e638, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex1: + m_Texture: {fileID: 2800000, guid: a7ad6933f58d64d56a4879cc266290b3, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailTex2: + m_Texture: {fileID: 2800000, guid: abf274fea99064d7f9087e58ccaf6d27, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _WindowTex: + m_Texture: {fileID: 2800000, guid: a88424a1da5f049169a689bf6ba4e638, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _Emission: 0.1 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor: {r: 1, g: 0.99264705, b: 1, a: 1} + - _DetailColor1: {r: 1, g: 1, b: 1, a: 1} + - _DetailColor2: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _WindowColor: {r: 0.23529412, g: 0.41911763, b: 1, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Materials/SimpleTopMaterial.mat.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Materials/SimpleTopMaterial.mat.meta new file mode 100644 index 0000000..f0fc158 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Materials/SimpleTopMaterial.mat.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d4d7464e3429a44e090f55a4ac17f110 +timeCreated: 1520454477 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes.meta new file mode 100644 index 0000000..5fbf88a --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9a885e2bd58ba447d8b6058ec9503125 +folderAsset: yes +timeCreated: 1524502575 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/City.asset b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/City.asset new file mode 100644 index 0000000..41ea7e6 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/City.asset @@ -0,0 +1,34 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 324a61621a4444024b4a9423715bd22b, type: 3} + m_Name: City + m_EditorClassIdentifier: + m_numColors: 9 + m_keyColor: {r: 0.8161765, g: 0.69962716, b: 0.5521194, a: 1} + m_colors: + - {r: 0.6328619, g: 0.49346206, b: 0.44425955, a: 1} + - {r: 0.6985294, g: 0.6954592, b: 0.64716697, a: 1} + - {r: 0.93227565, g: 0.9338235, b: 0.9269572, a: 1} + - {r: 0.8897059, g: 0.70093226, b: 0.50373054, a: 1} + - {r: 0.5068123, g: 0.56482077, b: 0.63235295, a: 1} + - {r: 0.58965516, g: 0.50580156, b: 0.48993406, a: 1} + - {r: 0.866, g: 0.628776, b: 0.527394, a: 1} + - {r: 0.9191176, g: 0.8699924, b: 0.7096129, a: 1} + - {r: 0.593929, g: 0.53991795, b: 0.46728235, a: 1} + m_hueRange: 0.118 + m_saturationRange: 0.144 + m_valueRange: 0.569 + m_setBaseColor_Override: 0 + m_setDetailColor1_Override: 0 + m_setDetailColor2_Override: 1 + m_baseColor_Override: {r: 1, g: 1, b: 1, a: 1} + m_detailColor1_Override: {r: 1, g: 1, b: 1, a: 1} + m_detailColor2_Override: {r: 0.934, g: 0.9042066, b: 0.8996618, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/City.asset.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/City.asset.meta new file mode 100644 index 0000000..03893db --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/City.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: e1b79d6caac0144adada0c548ef06705 +timeCreated: 1520536530 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Cool.asset b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Cool.asset new file mode 100644 index 0000000..e277d64 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Cool.asset @@ -0,0 +1,30 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 324a61621a4444024b4a9423715bd22b, type: 3} + m_Name: Cool + m_EditorClassIdentifier: + m_numColors: 5 + m_keyColor: {r: 0.10294118, g: 0, b: 0.75735295, a: 1} + m_colors: + - {r: 0.10185269, g: 0.76076436, b: 0.8814387, a: 1} + - {r: 0.02051252, g: 0.35250887, b: 0.60667163, a: 1} + - {r: 0.5853085, g: 0.11520802, b: 0.8157118, a: 1} + - {r: 0.08519433, g: 0.16219918, b: 0.55013573, a: 1} + - {r: 0.11049541, g: 0.36344543, b: 0.6154569, a: 1} + m_hueRange: 0.21 + m_saturationRange: 0.203 + m_valueRange: 0.292 + m_setBaseColor_Override: 0 + m_setDetailColor1_Override: 0 + m_setDetailColor2_Override: 0 + m_baseColor_Override: {r: 1, g: 1, b: 1, a: 1} + m_detailColor1_Override: {r: 1, g: 1, b: 1, a: 1} + m_detailColor2_Override: {r: 1, g: 1, b: 1, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Cool.asset.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Cool.asset.meta new file mode 100644 index 0000000..5082498 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Cool.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2ca96a0df5f70411e848710682ec847b +timeCreated: 1520470810 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Rainbow.asset b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Rainbow.asset new file mode 100644 index 0000000..f1d8dce --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Rainbow.asset @@ -0,0 +1,33 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 324a61621a4444024b4a9423715bd22b, type: 3} + m_Name: Rainbow + m_EditorClassIdentifier: + m_numColors: 8 + m_keyColor: {r: 0.5808824, g: 1, b: 0.92958826, a: 1} + m_colors: + - {r: 0.80840087, g: 1, b: 0.5808824, a: 1} + - {r: 0.5808824, g: 0.9856317, b: 1, a: 1} + - {r: 0.66944236, g: 1, b: 0.5808824, a: 1} + - {r: 0.9281918, g: 0.5808824, b: 1, a: 1} + - {r: 1, g: 0.7957347, b: 0.5808824, a: 1} + - {r: 1, g: 0.5808824, b: 0.6061475, a: 1} + - {r: 0.5808824, g: 1, b: 0.65120786, a: 1} + - {r: 0.77373224, g: 0.5808824, b: 1, a: 1} + m_hueRange: 0.537 + m_saturationRange: 0 + m_valueRange: 0 + m_setBaseColor_Override: 0 + m_setDetailColor1_Override: 0 + m_setDetailColor2_Override: 0 + m_baseColor_Override: {r: 1, g: 1, b: 1, a: 1} + m_detailColor1_Override: {r: 1, g: 1, b: 1, a: 1} + m_detailColor2_Override: {r: 1, g: 1, b: 1, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Rainbow.asset.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Rainbow.asset.meta new file mode 100644 index 0000000..422767d --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Rainbow.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3da751952f9a14bbdb3da2db7a7a675a +timeCreated: 1520538484 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Urban.asset b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Urban.asset new file mode 100644 index 0000000..4d4819b --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Urban.asset @@ -0,0 +1,30 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 324a61621a4444024b4a9423715bd22b, type: 3} + m_Name: Urban + m_EditorClassIdentifier: + m_numColors: 5 + m_keyColor: {r: 0.424252, g: 0.51017004, b: 0.578, a: 1} + m_colors: + - {r: 0.4879521, g: 0.619151, b: 0.6111964, a: 1} + - {r: 0.4851196, g: 0.50504345, b: 0.50226355, a: 1} + - {r: 0.816, g: 0.8017941, b: 0.774, a: 1} + - {r: 0.17766227, g: 0.23063363, b: 0.26551723, a: 1} + - {r: 0.597, g: 0.5079504, b: 0.33372298, a: 1} + m_hueRange: 0.144 + m_saturationRange: 0.305 + m_valueRange: 0.253 + m_setBaseColor_Override: 0 + m_setDetailColor1_Override: 0 + m_setDetailColor2_Override: 0 + m_baseColor_Override: {r: 1, g: 1, b: 1, a: 1} + m_detailColor1_Override: {r: 1, g: 1, b: 1, a: 1} + m_detailColor2_Override: {r: 1, g: 1, b: 1, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Urban.asset.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Urban.asset.meta new file mode 100644 index 0000000..30ddb2f --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Urban.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ef118b5e263da4b1fa4327ca1d3e0c7b +timeCreated: 1520536530 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Warm.asset b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Warm.asset new file mode 100644 index 0000000..af85a44 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Warm.asset @@ -0,0 +1,30 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 324a61621a4444024b4a9423715bd22b, type: 3} + m_Name: Warm + m_EditorClassIdentifier: + m_numColors: 5 + m_keyColor: {r: 1, g: 1, b: 1, a: 1} + m_colors: + - {r: 0.9222584, g: 0.8659846, b: 0.7840916, a: 1} + - {r: 0.74726087, g: 0.6510296, b: 0.54364824, a: 1} + - {r: 0.9862331, g: 0.975854, b: 0.9130279, a: 1} + - {r: 0.89864534, g: 0.65105844, b: 0.54662365, a: 1} + - {r: 0.84467775, g: 0.3877832, b: 0.29807296, a: 1} + m_hueRange: 0.185 + m_saturationRange: 0.682 + m_valueRange: 0.253 + m_setBaseColor_Override: 0 + m_setDetailColor1_Override: 0 + m_setDetailColor2_Override: 0 + m_baseColor_Override: {r: 1, g: 1, b: 1, a: 1} + m_detailColor1_Override: {r: 1, g: 1, b: 1, a: 1} + m_detailColor2_Override: {r: 1, g: 1, b: 1, a: 1} diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Warm.asset.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Warm.asset.meta new file mode 100644 index 0000000..672fe1f --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Palettes/Warm.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b01b6d453d33e40119c0f9472d50c45f +timeCreated: 1520536530 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures.meta new file mode 100644 index 0000000..da2768d --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: ad3eb3b8c15c8417fb462e9ab69c8534 +folderAsset: yes +timeCreated: 1524502522 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasFacades_base.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasFacades_base.png new file mode 100644 index 0000000..cecbf35 Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasFacades_base.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasFacades_base.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasFacades_base.png.meta new file mode 100644 index 0000000..b22b82b --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasFacades_base.png.meta @@ -0,0 +1,90 @@ +fileFormatVersion: 2 +guid: 4d520150ef3724e4bb52237605c761df +timeCreated: 1520397460 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: iPhone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasFacades_detailMask_1.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasFacades_detailMask_1.png new file mode 100644 index 0000000..4b61b50 Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasFacades_detailMask_1.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasFacades_detailMask_1.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasFacades_detailMask_1.png.meta new file mode 100644 index 0000000..ec2def9 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasFacades_detailMask_1.png.meta @@ -0,0 +1,121 @@ +fileFormatVersion: 2 +guid: 36bfefc139bfa434daf90848bb333e1d +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 7 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasFacades_detailMask_2.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasFacades_detailMask_2.png new file mode 100644 index 0000000..6f98350 Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasFacades_detailMask_2.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasFacades_detailMask_2.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasFacades_detailMask_2.png.meta new file mode 100644 index 0000000..f705e9c --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasFacades_detailMask_2.png.meta @@ -0,0 +1,90 @@ +fileFormatVersion: 2 +guid: aaebc04bedf1444bebad66d5386b3744 +timeCreated: 1520398500 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: iPhone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasRoofs_base.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasRoofs_base.png new file mode 100644 index 0000000..22f2b00 Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasRoofs_base.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasRoofs_base.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasRoofs_base.png.meta new file mode 100644 index 0000000..e9ce50d --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasRoofs_base.png.meta @@ -0,0 +1,74 @@ +fileFormatVersion: 2 +guid: 89d3c1f500b7e4b8bba0ce9b760e9134 +timeCreated: 1520629671 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasRoofs_detailMask_1.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasRoofs_detailMask_1.png new file mode 100644 index 0000000..2d0686c Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasRoofs_detailMask_1.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasRoofs_detailMask_1.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasRoofs_detailMask_1.png.meta new file mode 100644 index 0000000..5fd4699 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasRoofs_detailMask_1.png.meta @@ -0,0 +1,74 @@ +fileFormatVersion: 2 +guid: a7ad6933f58d64d56a4879cc266290b3 +timeCreated: 1520629672 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasRoofs_detailMask_2.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasRoofs_detailMask_2.png new file mode 100644 index 0000000..599cb47 Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasRoofs_detailMask_2.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasRoofs_detailMask_2.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasRoofs_detailMask_2.png.meta new file mode 100644 index 0000000..92de1fa --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/Assets/Textures/BuildingAtlasRoofs_detailMask_2.png.meta @@ -0,0 +1,74 @@ +fileFormatVersion: 2 +guid: abf274fea99064d7f9087e58ccaf6d27 +timeCreated: 1520629672 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleCityIcon.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleCityIcon.png new file mode 100644 index 0000000..e8cf5fa Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleCityIcon.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleCityIcon.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleCityIcon.png.meta new file mode 100644 index 0000000..f425281 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleCityIcon.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: ab72bb907cadc4143b9a4fde3bf8e91d +timeCreated: 1534195776 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleCoolIcon.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleCoolIcon.png new file mode 100644 index 0000000..bdcbafc Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleCoolIcon.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleCoolIcon.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleCoolIcon.png.meta new file mode 100644 index 0000000..67a4c85 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleCoolIcon.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 11000c2686c4f47a690631b13f750f1e +timeCreated: 1534195907 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleIcon.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleIcon.png new file mode 100644 index 0000000..5c86bb2 Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleIcon.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleIcon.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleIcon.png.meta new file mode 100644 index 0000000..b02e68c --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleIcon.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 1e03266b76f414711a005e4161875ebc +timeCreated: 1523562702 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleRainbowIcon.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleRainbowIcon.png new file mode 100644 index 0000000..5b3dee2 Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleRainbowIcon.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleRainbowIcon.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleRainbowIcon.png.meta new file mode 100644 index 0000000..ec2fcab --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleRainbowIcon.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 2fb18699267b74e5395eceee949e24e7 +timeCreated: 1534195907 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleUrbanIcon.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleUrbanIcon.png new file mode 100644 index 0000000..30e75bb Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleUrbanIcon.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleUrbanIcon.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleUrbanIcon.png.meta new file mode 100644 index 0000000..d7a44f9 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleUrbanIcon.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 11e8148c59b63433db9e2b1006915080 +timeCreated: 1534195675 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleWarmIcon.png b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleWarmIcon.png new file mode 100644 index 0000000..3364690 Binary files /dev/null and b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleWarmIcon.png differ diff --git a/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleWarmIcon.png.meta b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleWarmIcon.png.meta new file mode 100644 index 0000000..02b99c8 --- /dev/null +++ b/Resources/MapboxStyles/Styles/MapboxSampleStyles/Simple/SimpleWarmIcon.png.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 116cb03dcbf31428aa0639bb8f980e8c +timeCreated: 1534195907 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders.meta b/Shaders.meta new file mode 100644 index 0000000..2f3c740 --- /dev/null +++ b/Shaders.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ce8bcb7ed11f64e35aa8cd9056463e21 +folderAsset: yes +timeCreated: 1509042932 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/MapboxStyles.shader b/Shaders/MapboxStyles.shader new file mode 100644 index 0000000..1d7ebbe --- /dev/null +++ b/Shaders/MapboxStyles.shader @@ -0,0 +1,74 @@ +// Upgrade NOTE: upgraded instancing buffer 'Props' to new syntax. + +Shader "Mapbox/MapboxStyles" +{ + Properties + { + _BaseColor ("BaseColor", Color) = (1,1,1,1) + _DetailColor1 ("DetailColor1", Color) = (1,1,1,1) + _DetailColor2 ("DetailColor2", Color) = (1,1,1,1) + + _BaseTex ("Base", 2D) = "white" {} + _DetailTex1 ("Detail_1", 2D) = "white" {} + _DetailTex2 ("Detail_2", 2D) = "white" {} + + _Emission ("Emission", Range(0.0, 1.0)) = 0.1 + } + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 200 + + CGPROGRAM + // Physically based Standard lighting model, and enable shadows on all light types + #pragma surface surf Standard fullforwardshadows + + // Use shader model 3.0 target, to get nicer looking lighting + #pragma target 3.0 + + float4 _BaseColor; + float4 _DetailColor1; + float4 _DetailColor2; + + sampler2D _BaseTex; + sampler2D _DetailTex1; + sampler2D _DetailTex2; + + float _Emission; + + struct Input + { + float2 uv_BaseTex, uv_DetailTex1, uv_DetailTex2; + }; + + + + // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader. + // See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing. + // #pragma instancing_options assumeuniformscaling + UNITY_INSTANCING_BUFFER_START(Props) + // put more per-instance properties here + UNITY_INSTANCING_BUFFER_END(Props) + + void surf (Input IN, inout SurfaceOutputStandard o) + { + fixed4 baseTexture = tex2D (_BaseTex, IN.uv_BaseTex); + + fixed4 detailTexture1 = tex2D (_DetailTex1, IN.uv_DetailTex1); + fixed4 detailTexture2 = tex2D (_DetailTex2, IN.uv_DetailTex2); + + fixed4 baseDetail1_Result = lerp(_BaseColor, _DetailColor1, detailTexture1.a); + + fixed4 detail1Detail2_Result = lerp(baseDetail1_Result, _DetailColor2, detailTexture2.a); + + fixed4 c = baseTexture *= detail1Detail2_Result; + half3 e = c.rgb; + + o.Albedo = c.rgb; + o.Emission = e * _Emission; + o.Alpha = 1.0; + } + ENDCG + } + FallBack "Diffuse" +} diff --git a/Shaders/MapboxStyles.shader.meta b/Shaders/MapboxStyles.shader.meta new file mode 100644 index 0000000..3be2769 --- /dev/null +++ b/Shaders/MapboxStyles.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a58a57c7d09bd4d5a9dd79ebd542fea4 +timeCreated: 1520453579 +licenseType: Pro +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/MapboxStylesPerRenderer.shader b/Shaders/MapboxStylesPerRenderer.shader new file mode 100644 index 0000000..00e8a6e --- /dev/null +++ b/Shaders/MapboxStylesPerRenderer.shader @@ -0,0 +1,73 @@ +// Upgrade NOTE: upgraded instancing buffer 'Props' to new syntax. + +Shader "Mapbox/MapboxStylesPerRenderer" { + Properties + { + [PerRendererData]_BaseColor ("BaseColor", Color) = (1,1,1,1) + [PerRendererData]_DetailColor1 ("DetailColor1", Color) = (1,1,1,1) + [PerRendererData]_DetailColor2 ("DetailColor2", Color) = (1,1,1,1) + + _BaseTex ("Base", 2D) = "white" {} + _DetailTex1 ("Detail_1", 2D) = "white" {} + _DetailTex2 ("Detail_2", 2D) = "white" {} + + _Emission ("Emission", Range(0.0, 1.0)) = 0.1 + } + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 200 + + CGPROGRAM + // Physically based Standard lighting model, and enable shadows on all light types + #pragma surface surf Standard fullforwardshadows + + // Use shader model 3.0 target, to get nicer looking lighting + #pragma target 3.0 + + float4 _BaseColor; + float4 _DetailColor1; + float4 _DetailColor2; + + sampler2D _BaseTex; + sampler2D _DetailTex1; + sampler2D _DetailTex2; + + float _Emission; + + struct Input + { + float2 uv_BaseTex, uv_DetailTex1, uv_DetailTex2; + }; + + + + // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader. + // See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing. + // #pragma instancing_options assumeuniformscaling + UNITY_INSTANCING_BUFFER_START(Props) + // put more per-instance properties here + UNITY_INSTANCING_BUFFER_END(Props) + + void surf (Input IN, inout SurfaceOutputStandard o) + { + fixed4 baseTexture = tex2D (_BaseTex, IN.uv_BaseTex); + + fixed4 detailTexture1 = tex2D (_DetailTex1, IN.uv_DetailTex1); + fixed4 detailTexture2 = tex2D (_DetailTex2, IN.uv_DetailTex2); + + fixed4 baseDetail1_Result = lerp(_BaseColor, _DetailColor1, detailTexture1.a); + + fixed4 detail1Detail2_Result = lerp(baseDetail1_Result, _DetailColor2, detailTexture2.a); + + fixed4 c = baseTexture *= detail1Detail2_Result; + half3 e = c.rgb; + + o.Albedo = c.rgb; + o.Emission = e * _Emission; + o.Alpha = 1.0; + } + ENDCG + } + FallBack "Diffuse" +} diff --git a/Shaders/MapboxStylesPerRenderer.shader.meta b/Shaders/MapboxStylesPerRenderer.shader.meta new file mode 100644 index 0000000..ffdf3ce --- /dev/null +++ b/Shaders/MapboxStylesPerRenderer.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 02ca05f28416c4bbab659e473fa74ec6 +timeCreated: 1520623788 +licenseType: Pro +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Shaders/RasterWithTransparencyShader.shader b/Shaders/RasterWithTransparencyShader.shader new file mode 100644 index 0000000..213cc10 --- /dev/null +++ b/Shaders/RasterWithTransparencyShader.shader @@ -0,0 +1,93 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Mapbox/Raster With Transparency" +{ + Properties + { + _Color ("Color", Color) = (1,1,1,1) + _MainTex ("Albedo (RGB)", 2D) = "blue" {} + _Alpha ("Alpha", Float) = 1 + } + + Category + { + Tags { "Queue"="Transparent" "RenderType"="Transparent" } + Blend SrcAlpha OneMinusSrcAlpha + Cull Off Lighting Off ZWrite Off + + SubShader + { + Pass + { + BindChannels + { + Bind "Color", color + Bind "Vertex", vertex + Bind "TexCoord", texcoord + } + + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile_particles + #pragma fragmentoption ARB_precision_hint_fastest + + #include "UnityCG.cginc" + + // Use shader model 3.0 target, to get nicer looking lighting + #pragma target 3.0 + + sampler2D _MainTex; + float _Alpha; + float4 _MainTex_ST; + + fixed4 _Color; + + struct vertexIn + { + float4 vertex : POSITION; + float4 texcoord : TEXCOORD0; + fixed4 color : COLOR; + }; + + struct vertexOut + { + float4 pos : SV_POSITION; + float2 uv : UV_COORD0; + float4 color : COLOR; + float2 screenspaceUv : UV_COORD1; + }; + + vertexOut vert(vertexIn v) + { + vertexOut o; + o.pos = UnityObjectToClipPos (v.vertex); + o.color = v.color; + o.uv = v.texcoord.xy; + o.screenspaceUv = o.pos.xy; + return o; + } + + fixed4 frag(vertexOut o) : SV_Target + { + float2 uv = TRANSFORM_TEX(o.uv, _MainTex); + fixed4 texColor = tex2D(_MainTex, uv); + + fixed4 color = o.color * texColor; + // check how much color used for transparency equals c.rgb in range 0..1 + // 1=no match, 0=full match + fixed3 delta = texColor.rgb - _Color.rgb; + float match = dot(delta,delta); + float threshold = step(match,0.1); + + color.a = (1 - ((threshold) * (1 -_Color.a))) * _Alpha; + + return color; + } + + ENDCG + } + } + } + FallBack "Diffuse" +} \ No newline at end of file diff --git a/Shaders/RasterWithTransparencyShader.shader.meta b/Shaders/RasterWithTransparencyShader.shader.meta new file mode 100644 index 0000000..370564a --- /dev/null +++ b/Shaders/RasterWithTransparencyShader.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 4cff8ad2a7f4c41aa929f127a4b62f87 +timeCreated: 1509042938 +licenseType: Pro +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Textures.meta b/Textures.meta new file mode 100644 index 0000000..c0d7741 --- /dev/null +++ b/Textures.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ddaef7af8cc3345f7a3a01581fb377fd +folderAsset: yes +timeCreated: 1495662334 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Textures/CornerPanelRadius_12px_Fill.png b/Textures/CornerPanelRadius_12px_Fill.png new file mode 100644 index 0000000..2982cc7 Binary files /dev/null and b/Textures/CornerPanelRadius_12px_Fill.png differ diff --git a/Textures/CornerPanelRadius_12px_Fill.png.meta b/Textures/CornerPanelRadius_12px_Fill.png.meta new file mode 100644 index 0000000..8e9f0fe --- /dev/null +++ b/Textures/CornerPanelRadius_12px_Fill.png.meta @@ -0,0 +1,133 @@ +fileFormatVersion: 2 +guid: ae30072a59a25814e8cfe4b1f70242ed +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 256 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 16 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + 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: 12, y: 12, z: 12, w: 12} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + 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: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 256 + 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: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: MapboxAttribution + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Textures/CornerPanelRadius_12px_Stroke_1px.png b/Textures/CornerPanelRadius_12px_Stroke_1px.png new file mode 100644 index 0000000..1f0c4e8 Binary files /dev/null and b/Textures/CornerPanelRadius_12px_Stroke_1px.png differ diff --git a/Textures/CornerPanelRadius_12px_Stroke_1px.png.meta b/Textures/CornerPanelRadius_12px_Stroke_1px.png.meta new file mode 100644 index 0000000..b33ea13 --- /dev/null +++ b/Textures/CornerPanelRadius_12px_Stroke_1px.png.meta @@ -0,0 +1,133 @@ +fileFormatVersion: 2 +guid: 184ca10c8fb4d4c4b988276fd798c9dc +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 256 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 16 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + 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: 12, y: 12, z: 12, w: 12} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + 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: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 256 + 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: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: MapboxAttribution + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Textures/info.png b/Textures/info.png new file mode 100644 index 0000000..7aad44d Binary files /dev/null and b/Textures/info.png differ diff --git a/Textures/info.png.meta b/Textures/info.png.meta new file mode 100644 index 0000000..01fa25b --- /dev/null +++ b/Textures/info.png.meta @@ -0,0 +1,133 @@ +fileFormatVersion: 2 +guid: 82852ff66538d44ccb63c5afc39708a5 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 256 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + 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: 8 + 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: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 256 + 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: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: MapboxAttribution + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Textures/loadinggrid.png b/Textures/loadinggrid.png new file mode 100644 index 0000000..ee926dc Binary files /dev/null and b/Textures/loadinggrid.png differ diff --git a/Textures/loadinggrid.png.meta b/Textures/loadinggrid.png.meta new file mode 100644 index 0000000..9915d0e --- /dev/null +++ b/Textures/loadinggrid.png.meta @@ -0,0 +1,106 @@ +fileFormatVersion: 2 +guid: e2896a92727704803a9c422b043eae89 +timeCreated: 1506021165 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 2 + aniso: -1 + mipBias: -1 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 2 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 0 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: iPhone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Android + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: WebGL + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Textures/mapbox-attribution.png b/Textures/mapbox-attribution.png new file mode 100644 index 0000000..0a4c267 Binary files /dev/null and b/Textures/mapbox-attribution.png differ diff --git a/Textures/mapbox-attribution.png.meta b/Textures/mapbox-attribution.png.meta new file mode 100644 index 0000000..3e28edb --- /dev/null +++ b/Textures/mapbox-attribution.png.meta @@ -0,0 +1,133 @@ +fileFormatVersion: 2 +guid: 066eb96836b694d168eff135bd2aeaca +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 256 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + 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: 8 + 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: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 256 + 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: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: MapboxAttribution + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Textures/mapbox-logo-white.png b/Textures/mapbox-logo-white.png new file mode 100644 index 0000000..eb5cc53 Binary files /dev/null and b/Textures/mapbox-logo-white.png differ diff --git a/Textures/mapbox-logo-white.png.meta b/Textures/mapbox-logo-white.png.meta new file mode 100644 index 0000000..3367858 --- /dev/null +++ b/Textures/mapbox-logo-white.png.meta @@ -0,0 +1,133 @@ +fileFormatVersion: 2 +guid: fa730453dea644416a34148b2e436e78 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 256 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 16 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + 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: 8 + 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: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 256 + 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: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: MapboxAttribution + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity.meta b/Unity.meta new file mode 100644 index 0000000..f988499 --- /dev/null +++ b/Unity.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 230696630f4b5443484cd2ab1a257186 +folderAsset: yes +timeCreated: 1490801419 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Constants.cs b/Unity/Constants.cs new file mode 100644 index 0000000..d0beada --- /dev/null +++ b/Unity/Constants.cs @@ -0,0 +1,77 @@ +namespace Mapbox.Unity +{ + using UnityEngine; + + public static class Constants + { + public const string SDK_VERSION = "2.1.1"; + public const string SDK_SKU_ID = "05"; + + public static class Path + { + public const string CONFIG_FILE = "MapboxConfiguration.txt"; + public const string SCENELIST = "Assets/Mapbox/Resources/Mapbox/ScenesList.asset"; + public const string SHOULD_COLLECT_LOCATION_KEY = "MAPBOX_SHOULD_COLLECT_LOCATION"; + public const string TELEMETRY_TURNSTILE_LAST_TICKS_EDITOR_KEY = "MAPBOX_TELEMETRY_TURNSTILE_LAST_TICKS_EDITOR"; + public const string TELEMETRY_TURNSTILE_LAST_TICKS_FALLBACK_KEY = "MAPBOX_TELEMETRY_TURNSTILE_LAST_TICKS_FALLBACK"; + public const string DID_PROMPT_CONFIGURATION = "MAPBOX_DID_PROMPT_CONFIGURATION"; + public static readonly string MAPBOX_RESOURCES_RELATIVE = System.IO.Path.Combine("Mapbox", "MapboxConfiguration"); + public static readonly string MAPBOX_RESOURCES_ABSOLUTE = System.IO.Path.Combine(System.IO.Path.Combine(Application.dataPath, "Resources"), "Mapbox"); + + public static readonly string MAPBOX_USER = System.IO.Path.Combine("Assets", System.IO.Path.Combine("Mapbox", "User")); + public static readonly string MAPBOX_USER_MODIFIERS = System.IO.Path.Combine(MAPBOX_USER, "Modifiers"); + + public static readonly string MAP_FEATURE_STYLES_DEFAULT_STYLE_ASSETS = System.IO.Path.Combine("MapboxStyles", "DefaultStyleAssets"); + public static readonly string MAP_FEATURE_STYLES_SAMPLES = System.IO.Path.Combine(System.IO.Path.Combine("MapboxStyles", "Styles"), "MapboxSampleStyles"); + + public const string MAPBOX_STYLES_ASSETS_FOLDER = "Assets"; + public const string MAPBOX_STYLES_ATLAS_FOLDER = "Atlas"; + public const string MAPBOX_STYLES_MATERIAL_FOLDER = "Materials"; + public const string MAPBOX_STYLES_PALETTES_FOLDER = "Palettes"; + } + + /// + /// Store common vector constants to avoid the method access cost of Unity's convenience getters. + /// + public static class Math + { + public static readonly Vector3 Vector3Zero = new Vector3(0, 0, 0); + public static readonly Vector3 Vector3Up = new Vector3(0, 1, 0); + public static readonly Vector3 Vector3Down = new Vector3(0, -1, 0); + public static readonly Vector3 Vector3One = new Vector3(1, 1, 1); + public static readonly Vector3 Vector3Forward = new Vector3(0, 0, 1); + public static readonly Vector3 Vector3Unused = new Vector3(float.MinValue, float.MinValue, float.MinValue); + + public static Vector3 Vector3Right = new Vector3(1, 0, 0); + } + + /// + /// Store common style asset prefixes and suffixes to avoid string spelling errors in code. + /// + public static class StyleAssetNames + { + public const string ALTAS_SUFFIX = "AtlasInfo"; + public const string PALETTE_SUFFIX = "Palette"; + + public const string TOP_MATERIAL_SUFFIX = "TopMaterial"; + public const string SIDE_MATERIAL_SUFFIX = "SideMaterial"; + } + + public static class GUI + { + public static class Colors + { + public static readonly Color EDITOR_TEXT_COLOR = new Color(0.7f, 0.7f, 0.7f); + public static readonly Color EDITOR_NOTE_COLOR = new Color(1.0f, 0.8f, 0.0f); + public static readonly Color EDITOR_FEATURE_DEFAULT_COLOR = new Color(0.1764706f, 0.8509805f, 1.0f, 1.0f); + } + + public static class Styles + { + public static readonly GUIStyle EDITOR_NOTE_STYLE = new GUIStyle { wordWrap = true, normal = { textColor = Colors.EDITOR_NOTE_COLOR } }; + public static readonly GUIStyle EDITOR_TEXTURE_STYLE_DESCRIPTION_STYLE = new GUIStyle { wordWrap = true, normal = { textColor = Colors.EDITOR_TEXT_COLOR } }; + public static readonly GUIStyle EDITOR_TEXTURE_THUMBNAIL_STYLE = new GUIStyle { imagePosition = ImagePosition.ImageOnly, wordWrap = true }; + } + } + } +} diff --git a/Unity/Constants.cs.meta b/Unity/Constants.cs.meta new file mode 100644 index 0000000..159d28e --- /dev/null +++ b/Unity/Constants.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: b67e8fe074d514541929f4b6866ff464 +timeCreated: 1490302604 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers.meta b/Unity/DataContainers.meta new file mode 100644 index 0000000..b8e54e9 --- /dev/null +++ b/Unity/DataContainers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5add2134655e449d5ae03f7b1a0e42db +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/CameraBoundsTileProviderOptions.cs b/Unity/DataContainers/CameraBoundsTileProviderOptions.cs new file mode 100644 index 0000000..3251e10 --- /dev/null +++ b/Unity/DataContainers/CameraBoundsTileProviderOptions.cs @@ -0,0 +1,34 @@ +namespace Mapbox.Unity.Map +{ + using System; + using UnityEngine; + [Serializable] + public class CameraBoundsTileProviderOptions : ExtentOptions + { + public Camera camera; + public int visibleBuffer; + public int disposeBuffer; + + public override void SetOptions(ExtentOptions extentOptions) + { + CameraBoundsTileProviderOptions options = extentOptions as CameraBoundsTileProviderOptions; + if (options != null) + { + camera = options.camera; + visibleBuffer = options.visibleBuffer; + disposeBuffer = options.disposeBuffer; + } + else + { + Debug.LogError("ExtentOptions type mismatch : Using " + extentOptions.GetType() + " to set extent of type " + this.GetType()); + } + } + + public void SetOptions(Camera mapCamera, int visibleRange, int disposeRange) + { + camera = mapCamera; + visibleBuffer = visibleRange; + disposeBuffer = disposeRange; + } + } +} diff --git a/Unity/DataContainers/CameraBoundsTileProviderOptions.cs.meta b/Unity/DataContainers/CameraBoundsTileProviderOptions.cs.meta new file mode 100644 index 0000000..a5c98a7 --- /dev/null +++ b/Unity/DataContainers/CameraBoundsTileProviderOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 2a954ea9b37a847a796dd7c9a9eec9ef +timeCreated: 1519860268 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/ColliderOptions.cs b/Unity/DataContainers/ColliderOptions.cs new file mode 100644 index 0000000..9873fc3 --- /dev/null +++ b/Unity/DataContainers/ColliderOptions.cs @@ -0,0 +1,34 @@ +using Mapbox.Unity.SourceLayers; + +namespace Mapbox.Unity.Map +{ + using Mapbox.Unity.MeshGeneration.Modifiers; + using System; + + [Serializable] + public class ColliderOptions : ModifierProperties, ISubLayerColliderOptions + { + public override Type ModifierType + { + get + { + return typeof(ColliderModifier); + } + } + + public ColliderType colliderType = ColliderType.None; + + /// + /// Enable/Disable feature colliders and sets the type of colliders to use. + /// + /// Type of the collider to use on features. + public virtual void SetFeatureCollider(ColliderType colType) + { + if (colliderType != colType) + { + colliderType = colType; + HasChanged = true; + } + } + } +} diff --git a/Unity/DataContainers/ColliderOptions.cs.meta b/Unity/DataContainers/ColliderOptions.cs.meta new file mode 100644 index 0000000..5fc49e0 --- /dev/null +++ b/Unity/DataContainers/ColliderOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: f38b85c80ace3431c90c6b093436742d +timeCreated: 1522459497 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/ElevationModificationOptions.cs b/Unity/DataContainers/ElevationModificationOptions.cs new file mode 100644 index 0000000..081140d --- /dev/null +++ b/Unity/DataContainers/ElevationModificationOptions.cs @@ -0,0 +1,17 @@ +namespace Mapbox.Unity.Map +{ + using System; + using UnityEngine; + + [Serializable] + public class ElevationModificationOptions + { + [Tooltip("Mesh resolution of terrain, results in n x n grid")] + [Range(2,255)] + public int sampleCount = 10; + [Tooltip("Use world relative scale to scale terrain height.")] + public bool useRelativeHeight = false; + [Tooltip("Earth radius in Unity units.")] + public float earthRadius = 1000f; + } +} diff --git a/Unity/DataContainers/ElevationModificationOptions.cs.meta b/Unity/DataContainers/ElevationModificationOptions.cs.meta new file mode 100644 index 0000000..5db3659 --- /dev/null +++ b/Unity/DataContainers/ElevationModificationOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 3ea9e2e957a054a95bf8ae23752c1817 +timeCreated: 1519860268 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/ElevationRequiredOptions.cs b/Unity/DataContainers/ElevationRequiredOptions.cs new file mode 100644 index 0000000..6cdeacf --- /dev/null +++ b/Unity/DataContainers/ElevationRequiredOptions.cs @@ -0,0 +1,17 @@ +namespace Mapbox.Unity.Map +{ + using System; + using UnityEngine; + [Serializable] + public class ElevationRequiredOptions : MapboxDataProperty + { + [Range(0, 100)] + [Tooltip("Multiplication factor to vertically exaggerate elevation on terrain, does not work with Flat Terrain.")] + public float exaggerationFactor = 1; + + public override bool NeedsForceUpdate() + { + return true; + } + } +} diff --git a/Unity/DataContainers/ElevationRequiredOptions.cs.meta b/Unity/DataContainers/ElevationRequiredOptions.cs.meta new file mode 100644 index 0000000..e5934e0 --- /dev/null +++ b/Unity/DataContainers/ElevationRequiredOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ec77d5b3f43f8457c96da252d4a01aed +timeCreated: 1520011256 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/ExtentOptions.cs b/Unity/DataContainers/ExtentOptions.cs new file mode 100644 index 0000000..4979d13 --- /dev/null +++ b/Unity/DataContainers/ExtentOptions.cs @@ -0,0 +1,20 @@ +namespace Mapbox.Unity.Map +{ + using UnityEngine; + + public interface ITileProviderOptions + { + } + + public interface ICameraBoundsExtentOptions : ITileProviderOptions + { + void SetOptions(); + } + + public class ExtentOptions : ITileProviderOptions + { + public virtual void SetOptions(ExtentOptions extentOptions) + { + } + } +} diff --git a/Unity/DataContainers/ExtentOptions.cs.meta b/Unity/DataContainers/ExtentOptions.cs.meta new file mode 100644 index 0000000..d8fc03f --- /dev/null +++ b/Unity/DataContainers/ExtentOptions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e2169b8754ae6418f97dcea8b7ca62e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/GeometryExtrusionOptions.cs b/Unity/DataContainers/GeometryExtrusionOptions.cs new file mode 100644 index 0000000..1dd5859 --- /dev/null +++ b/Unity/DataContainers/GeometryExtrusionOptions.cs @@ -0,0 +1,268 @@ +using Mapbox.Unity.SourceLayers; + +namespace Mapbox.Unity.Map +{ + using System; + using Mapbox.Unity.MeshGeneration.Modifiers; + using Mapbox.Unity.MeshGeneration.Data; + using UnityEngine; + + [Serializable] + public class GeometryExtrusionOptions : ModifierProperties, ISubLayerExtrusionOptions + { + public override Type ModifierType + { + get + { + return typeof(HeightModifier); + } + } + + [SerializeField] + private string _selectedLayerName; + public ExtrusionType extrusionType = ExtrusionType.None; + public ExtrusionGeometryType extrusionGeometryType = ExtrusionGeometryType.RoofAndSide; + [Tooltip("Property name in feature layer to use for extrusion.")] + public string propertyName = "height"; + public string propertyDescription = ""; + public float minimumHeight = 0f; + public float maximumHeight = 0f; + [Tooltip("Scale factor to multiply the extrusion value of the feature.")] + public float extrusionScaleFactor = 1f; + + public GeometryExtrusionWithAtlasOptions ToGeometryExtrusionWithAtlasOptions() + { + return new GeometryExtrusionWithAtlasOptions(this); + } + + + /// + /// Disable mesh extrusion for the features in this layer. + /// + public virtual void DisableExtrusion() + { + if (extrusionType != ExtrusionType.None) + { + extrusionType = ExtrusionType.None; + HasChanged = true; + } + } + + /// + /// Sets the height value to be used for Absolute Height extrusion type. + /// Same field is used for the maximum height of Range Extrusion type so beware + /// of possible side effects. + /// + /// Fixed height value for all features in the layer. + public virtual void SetAbsoluteHeight(float absoluteHeight) + { + if (maximumHeight != absoluteHeight) + { + maximumHeight = absoluteHeight; + HasChanged = true; + } + } + + /// + /// Change the minimum and maximum height values used for Range Height option. + /// Maximum height is also used for Absolute Height option so beware of possible side + /// effects. + /// + /// Lower bound to be used for extrusion + /// Top bound to be used for extrusion + public virtual void SetHeightRange(float minHeight, float maxHeight) + { + if (minimumHeight != minHeight || + maximumHeight != maxHeight) + { + minimumHeight = minHeight; + maximumHeight = maxHeight; + HasChanged = true; + } + } + + /// + /// Sets the extrusion multiplier which will be used only in the Y axis (height). + /// + /// Multiplier value. + public virtual void SetExtrusionMultiplier(float multiplier) + { + if (extrusionScaleFactor != multiplier) + { + extrusionScaleFactor = multiplier; + HasChanged = true; + } + } + + /// + /// Changes extrusion type to "Absolute height" and extrudes all features by + /// the given fixed value. + /// + /// Option to create top and side polygons after extrusion. + /// Extrusion value + /// Height multiplier + public virtual void EnableAbsoluteExtrusion(ExtrusionGeometryType geometryType, float height, float scaleFactor = 1) + { + if (extrusionType != ExtrusionType.AbsoluteHeight || + extrusionGeometryType != geometryType || + !Mathf.Approximately(maximumHeight, height) || + !Mathf.Approximately(extrusionScaleFactor, scaleFactor)) + { + extrusionType = ExtrusionType.AbsoluteHeight; + extrusionGeometryType = geometryType; + maximumHeight = height; + extrusionScaleFactor = scaleFactor; + HasChanged = true; + } + } + + /// + /// Changes extrusion type to "Property" and extrudes all features by + /// the choosen property's value. + /// + /// Option to create top and side polygons after extrusion. + /// Name of the property to use for extrusion + /// Height multiplier + public virtual void EnablePropertyExtrusion(ExtrusionGeometryType geometryType, string propertyAttribute = "height", float scaleFactor = 1) + { + if (extrusionType != ExtrusionType.PropertyHeight || + extrusionGeometryType != geometryType || + propertyName != propertyAttribute || + !Mathf.Approximately(extrusionScaleFactor, scaleFactor)) + { + extrusionType = ExtrusionType.PropertyHeight; + extrusionGeometryType = geometryType; + propertyName = propertyAttribute; + extrusionScaleFactor = scaleFactor; + HasChanged = true; + } + } + + /// + /// Changes extrusion type to "Minimum Height" and extrudes all features by + /// the choosen property's value such that all vertices (roof) will be + /// flat at the lowest vertex elevation (after terrain elevation taken into account). + /// + /// Option to create top and side polygons after extrusion. + /// Name of the property to use for extrusion + /// Height multiplier + public virtual void EnableMinExtrusion(ExtrusionGeometryType extrusionGeometryType, string propertyName = "height", float extrusionScaleFactor = 1) + { + if (extrusionType != ExtrusionType.MinHeight || + this.extrusionGeometryType != extrusionGeometryType || + this.propertyName != propertyName || + !Mathf.Approximately(this.extrusionScaleFactor, extrusionScaleFactor)) + { + extrusionType = ExtrusionType.MinHeight; + this.extrusionGeometryType = extrusionGeometryType; + this.propertyName = propertyName; + this.extrusionScaleFactor = extrusionScaleFactor; + HasChanged = true; + } + } + + /// + /// Changes extrusion type to "Range Height" and extrudes all features by + /// the choosen property's value such that all vertices (roof) will be + /// flat at the highest vertex elevation (after terrain elevation taken into account). + /// + /// Option to create top and side polygons after extrusion. + /// Name of the property to use for extrusion + /// Height multiplier + void ISubLayerExtrusionOptions.EnableMaxExtrusion(ExtrusionGeometryType extrusionGeometryType, string propertyName, float extrusionScaleFactor) + { + if (extrusionType != ExtrusionType.MaxHeight || + this.extrusionGeometryType != extrusionGeometryType || + this.propertyName != propertyName || + !Mathf.Approximately(this.extrusionScaleFactor, extrusionScaleFactor)) + { + this.extrusionType = ExtrusionType.MaxHeight; + this.extrusionGeometryType = extrusionGeometryType; + this.propertyName = propertyName; + this.extrusionScaleFactor = extrusionScaleFactor; + HasChanged = true; + } + } + + /// /// + /// Changes extrusion type to "Minimum Height" and extrudes all features by + /// the choosen property's value such that they'll be in provided range. + /// Lower values will be increase to Minimum Height and higher values will + /// be lowered to Maximum height. + /// + /// Option to create top and side polygons after extrusion. + /// Lower bound to be used for extrusion + /// Top bound to be used for extrusion + /// Height multiplier + public virtual void EnableRangeExtrusion(ExtrusionGeometryType extrusionGeometryType, float minHeight, float maxHeight, float extrusionScaleFactor = 1) + { + if (extrusionType != ExtrusionType.RangeHeight || + this.extrusionGeometryType != extrusionGeometryType || + !Mathf.Approximately(minimumHeight, minHeight) || + !Mathf.Approximately(maximumHeight, maxHeight) || + !Mathf.Approximately(this.extrusionScaleFactor, extrusionScaleFactor)) + { + extrusionType = ExtrusionType.RangeHeight; + this.extrusionGeometryType = extrusionGeometryType; + minimumHeight = minHeight; + maximumHeight = maxHeight; + this.extrusionScaleFactor = extrusionScaleFactor; + HasChanged = true; + } + } + } + + [Serializable] + public class GeometryExtrusionWithAtlasOptions : ModifierProperties + { + public override Type ModifierType + { + get + { + return typeof(TextureSideWallModifier); + } + } + public UvMapType texturingType = UvMapType.Tiled; + public AtlasInfo atlasInfo; + public ExtrusionType extrusionType = ExtrusionType.None; + public ExtrusionGeometryType extrusionGeometryType = ExtrusionGeometryType.RoofAndSide; + public string propertyName = "height"; + public string propertyDescription = ""; + public float minimumHeight = 0f; + public float maximumHeight = 0f; + public float extrusionScaleFactor = 1f; + + public GeometryExtrusionWithAtlasOptions() + { + + } + public GeometryExtrusionWithAtlasOptions(GeometryExtrusionOptions extrusionOptions, UVModifierOptions uvOptions) + { + extrusionType = extrusionOptions.extrusionType; + extrusionGeometryType = extrusionOptions.extrusionGeometryType; + propertyName = extrusionOptions.propertyName; + minimumHeight = extrusionOptions.minimumHeight; + maximumHeight = extrusionOptions.maximumHeight; + extrusionScaleFactor = extrusionOptions.extrusionScaleFactor; + + texturingType = uvOptions.texturingType; + atlasInfo = uvOptions.atlasInfo; + } + + public GeometryExtrusionWithAtlasOptions(GeometryExtrusionOptions extrusionOptions) + { + extrusionType = extrusionOptions.extrusionType; + extrusionGeometryType = extrusionOptions.extrusionGeometryType; + propertyName = extrusionOptions.propertyName; + minimumHeight = extrusionOptions.minimumHeight; + maximumHeight = extrusionOptions.maximumHeight; + extrusionScaleFactor = extrusionOptions.extrusionScaleFactor; + } + + public GeometryExtrusionWithAtlasOptions(UVModifierOptions uvOptions) + { + texturingType = uvOptions.texturingType; + atlasInfo = uvOptions.atlasInfo; + } + } +} diff --git a/Unity/DataContainers/GeometryExtrusionOptions.cs.meta b/Unity/DataContainers/GeometryExtrusionOptions.cs.meta new file mode 100644 index 0000000..752d958 --- /dev/null +++ b/Unity/DataContainers/GeometryExtrusionOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 6b1ce30c2116b4d1dadcc0fd64b73d86 +timeCreated: 1519860268 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/GeometryMaterialOptions.cs b/Unity/DataContainers/GeometryMaterialOptions.cs new file mode 100644 index 0000000..d029cce --- /dev/null +++ b/Unity/DataContainers/GeometryMaterialOptions.cs @@ -0,0 +1,329 @@ +namespace Mapbox.Unity.Map +{ + using System; + using UnityEngine; + using System.IO; + using System.Collections.Generic; + using Mapbox.Unity.MeshGeneration.Modifiers; + using Mapbox.Unity.MeshGeneration.Data; + + [Serializable] + public class CustomStyleBundle + { + public UvMapType texturingType = UvMapType.Tiled; + public MaterialList[] materials = new MaterialList[2]; + public AtlasInfo atlasInfo; + public ScriptablePalette colorPalette; + + public CustomStyleBundle() + { + materials = new MaterialList[2]; + materials[0] = new MaterialList(); + materials[1] = new MaterialList(); + } + + private void AssignAssets(StyleAssetPathBundle styleAssetPathBundle) + { + Material topMaterial = Resources.Load(styleAssetPathBundle.topMaterialPath, typeof(Material)) as Material; + Material sideMaterial = Resources.Load(styleAssetPathBundle.sideMaterialPath, typeof(Material)) as Material; + + AtlasInfo atlas = Resources.Load(styleAssetPathBundle.atlasPath, typeof(AtlasInfo)) as AtlasInfo; + ScriptablePalette palette = Resources.Load(styleAssetPathBundle.palettePath, typeof(ScriptablePalette)) as ScriptablePalette; + + materials[0].Materials[0] = new Material(topMaterial); + materials[1].Materials[0] = new Material(sideMaterial); + atlasInfo = atlas; + colorPalette = palette; + } + + public void SetDefaultAssets(UvMapType mapType = UvMapType.Atlas) + { + StyleAssetPathBundle styleAssetPathBundle = new StyleAssetPathBundle("Default", Constants.Path.MAP_FEATURE_STYLES_DEFAULT_STYLE_ASSETS); + texturingType = mapType; + AssignAssets(styleAssetPathBundle); + } + } + + [Serializable] + public class GeometryMaterialOptions : ModifierProperties, ISubLayerTexturing + + { + public override Type ModifierType + { + get + { + return typeof(MaterialModifier); + } + } + private SubLayerDarkStyle _darkStyle; + public ISubLayerDarkStyle DarkStyle + { + get + { + if (_darkStyle == null) + { + _darkStyle = new SubLayerDarkStyle(this); + } + return _darkStyle; + } + } + + private SubLayerLightStyle _lightStyle; + public ISubLayerLightStyle LightStyle + { + get + { + if (_lightStyle == null) + { + _lightStyle = new SubLayerLightStyle(this); + } + return _lightStyle; + } + } + + private SubLayerColorStyle _colorStyle; + public ISubLayerColorStyle ColorStyle + { + get + { + if (_colorStyle == null) + { + _colorStyle = new SubLayerColorStyle(this); + } + return _colorStyle; + } + } + + private SubLayerSimpleStyle _simpleStyle; + public ISubLayerSimpleStyle SimpleStyle + { + get + { + if (_simpleStyle == null) + { + _simpleStyle = new SubLayerSimpleStyle(this); + } + return _simpleStyle; + } + } + + private SubLayerRealisticStyle _realisticStyle; + public ISubLayerRealisticStyle RealisticStyle + { + get + { + if (_realisticStyle == null) + { + _realisticStyle = new SubLayerRealisticStyle(this); + } + return _realisticStyle; + } + } + + private SubLayerFantasyStyle _fantasyStyle; + public ISubLayerFantasyStyle FantasyStyle + { + get + { + if (_fantasyStyle == null) + { + _fantasyStyle = new SubLayerFantasyStyle(this); + } + return _fantasyStyle; + } + } + + + private SubLayerCustomStyle _customStyle; + public ISubLayerCustomStyle CustomStyle + { + get + { + if (_customStyle == null) + { + _customStyle = new SubLayerCustomStyle(this); + } + return _customStyle; + } + } + + public StyleTypes style; + + public UvMapType texturingType = UvMapType.Tiled; + public MaterialList[] materials = new MaterialList[2]; + public AtlasInfo atlasInfo; + + public float lightStyleOpacity = 1.0f; + public float darkStyleOpacity = 1.0f; + + public Color colorStyleColor = Color.white; + + public SamplePalettes samplePalettes; + + public ScriptablePalette colorPalette; + + [SerializeField] + public CustomStyleBundle customStyleOptions; + + public GeometryMaterialOptions() + { + materials = new MaterialList[2]; + materials[0] = new MaterialList(); + materials[1] = new MaterialList(); + } + + /// + /// Sets up default values for GeometryMaterial Options. + /// If style is set to Custom, user defined values will be used. + /// + public void SetDefaultMaterialOptions() + { + string styleName = style.ToString(); + + if (customStyleOptions == null) + { + customStyleOptions = new CustomStyleBundle(); + customStyleOptions.SetDefaultAssets(); + } + if (style == StyleTypes.Custom) + { + //nothing to do. Use custom settings + } + else + { + string samplePaletteName = samplePalettes.ToString(); + + string path = Path.Combine(Constants.Path.MAP_FEATURE_STYLES_SAMPLES, Path.Combine(styleName, Constants.Path.MAPBOX_STYLES_ASSETS_FOLDER)); + + StyleAssetPathBundle styleAssetPathBundle = new StyleAssetPathBundle(styleName, path, samplePaletteName); + + AssignAssets(styleAssetPathBundle); + } + + switch (style) + { + case StyleTypes.Light: + Color lightColor = materials[0].Materials[0].color; + lightColor.a = lightStyleOpacity; + materials[0].Materials[0].color = lightColor; + + lightColor = materials[1].Materials[0].color; + lightColor.a = lightStyleOpacity; + materials[1].Materials[0].color = lightColor; + break; + case StyleTypes.Dark: + Color darkColor = materials[0].Materials[0].color; + darkColor.a = darkStyleOpacity; + materials[0].Materials[0].color = darkColor; + + darkColor = materials[1].Materials[0].color; + darkColor.a = darkStyleOpacity; + materials[1].Materials[0].color = darkColor; + break; + case StyleTypes.Color: + Color color = colorStyleColor; + materials[0].Materials[0].color = color; + materials[1].Materials[0].color = color; + break; + default: + break; + } + + if (style == StyleTypes.Satellite) + { + texturingType = UvMapType.Tiled; + } + else + { + texturingType = (style != StyleTypes.Custom && style == StyleTypes.Simple) ? UvMapType.AtlasWithColorPalette : UvMapType.Atlas; + } + } + + private void AssignAssets(StyleAssetPathBundle styleAssetPathBundle) + { + Material topMaterial = Resources.Load(styleAssetPathBundle.topMaterialPath, typeof(Material)) as Material; + Material sideMaterial = Resources.Load(styleAssetPathBundle.sideMaterialPath, typeof(Material)) as Material; + + AtlasInfo atlas = Resources.Load(styleAssetPathBundle.atlasPath, typeof(AtlasInfo)) as AtlasInfo; + ScriptablePalette palette = Resources.Load(styleAssetPathBundle.palettePath, typeof(ScriptablePalette)) as ScriptablePalette; + + Material[] tempMaterials = new Material[2]; + + + for (int i = 0; i < materials.Length; i++) + { + if (materials[i].Materials[0] != null) + { + tempMaterials[i] = materials[i].Materials[0]; + materials[i].Materials[0] = null; + } + } + + materials[0].Materials[0] = new Material(topMaterial); + materials[1].Materials[0] = new Material(sideMaterial); + + for (int i = 0; i < materials.Length; i++) + { + if (tempMaterials[i] != null) + { + tempMaterials[i].Destroy(); + } + } + + Resources.UnloadUnusedAssets(); + + atlasInfo = atlas; + colorPalette = palette; + + } + + public void SetDefaultAssets(UvMapType mapType = UvMapType.Atlas) + { + StyleAssetPathBundle styleAssetPathBundle = new StyleAssetPathBundle("Default", Constants.Path.MAP_FEATURE_STYLES_DEFAULT_STYLE_ASSETS); + texturingType = mapType; + AssignAssets(styleAssetPathBundle); + } + + /// + /// Sets the type of the style. + /// + /// Style type. + public void SetStyleType(StyleTypes styleType) + { + style = styleType; + HasChanged = true; + } + + + /// + /// Gets the type of style used in the layer. + /// + /// The style type. + public virtual StyleTypes GetStyleType() + { + return style; + } + + } + + [Serializable] + public class UVModifierOptions : ModifierProperties + { + public override Type ModifierType + { + get + { + return typeof(PolygonMeshModifier); + } + } + public StyleTypes style; + public UvMapType texturingType = UvMapType.Tiled; + public AtlasInfo atlasInfo; + + public GeometryExtrusionWithAtlasOptions ToGeometryExtrusionWithAtlasOptions() + { + return new GeometryExtrusionWithAtlasOptions(this); + } + } + +} diff --git a/Unity/DataContainers/GeometryMaterialOptions.cs.meta b/Unity/DataContainers/GeometryMaterialOptions.cs.meta new file mode 100644 index 0000000..8fa01a7 --- /dev/null +++ b/Unity/DataContainers/GeometryMaterialOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 86b7939f38d364d049e29aea11e9652c +timeCreated: 1519860268 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/ImageryRasterOptions.cs b/Unity/DataContainers/ImageryRasterOptions.cs new file mode 100644 index 0000000..c6386c1 --- /dev/null +++ b/Unity/DataContainers/ImageryRasterOptions.cs @@ -0,0 +1,20 @@ +namespace Mapbox.Unity.Map +{ + using System; + using UnityEngine; + [Serializable] + public class ImageryRasterOptions : MapboxDataProperty + { + [Tooltip("Use higher resolution Mapbox imagery for retina displays; better visual quality and larger texture sizes.")] + public bool useRetina = false; + [Tooltip("Use Unity compression for the tile texture.")] + public bool useCompression = false; + [Tooltip("Use texture with Unity generated mipmaps.")] + public bool useMipMap = false; + + public override bool NeedsForceUpdate() + { + return true; + } + } +} diff --git a/Unity/DataContainers/ImageryRasterOptions.cs.meta b/Unity/DataContainers/ImageryRasterOptions.cs.meta new file mode 100644 index 0000000..ad270e0 --- /dev/null +++ b/Unity/DataContainers/ImageryRasterOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: da8808496e454427ea89228f08bd6f78 +timeCreated: 1519860268 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/LayerModifierOptions.cs b/Unity/DataContainers/LayerModifierOptions.cs new file mode 100644 index 0000000..fed7fc2 --- /dev/null +++ b/Unity/DataContainers/LayerModifierOptions.cs @@ -0,0 +1,17 @@ +namespace Mapbox.Unity.Map +{ + using System; + using System.Collections.Generic; + using Mapbox.Unity.MeshGeneration.Modifiers; + using Mapbox.Unity.Utilities; + + [Serializable] + public class LayerModifierOptions + { + public PositionTargetType moveFeaturePositionTo; + [NodeEditorElement("Mesh Modifiers")] + public List MeshModifiers; + [NodeEditorElement("Game Object Modifiers")] + public List GoModifiers; + } +} diff --git a/Unity/DataContainers/LayerModifierOptions.cs.meta b/Unity/DataContainers/LayerModifierOptions.cs.meta new file mode 100644 index 0000000..d8b78c7 --- /dev/null +++ b/Unity/DataContainers/LayerModifierOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 7ad2d6d13d7344c03aa1317615ba9aea +timeCreated: 1519860268 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/LayerPerformanceOptions.cs b/Unity/DataContainers/LayerPerformanceOptions.cs new file mode 100644 index 0000000..8a33f51 --- /dev/null +++ b/Unity/DataContainers/LayerPerformanceOptions.cs @@ -0,0 +1,25 @@ +namespace Mapbox.Unity.Map +{ + using System; + using UnityEngine; + + [Serializable] + public class LayerPerformanceOptions : MapboxDataProperty + { + [Tooltip("Enable Coroutines to distribute tile loading using coroutines, reduces the load on the main thread and keeps applications responsive. First load may be slower but subsequent loading will be faster. ")] + public bool isEnabled = true; + [Tooltip("Number of feature entities to group in one single coroutine call. ")] + public int entityPerCoroutine = 20; + + public override bool HasChanged + { + set + { + if (value == true) + { + OnPropertyHasChanged(new VectorLayerUpdateArgs { property = this }); + } + } + } + } +} diff --git a/Unity/DataContainers/LayerPerformanceOptions.cs.meta b/Unity/DataContainers/LayerPerformanceOptions.cs.meta new file mode 100644 index 0000000..5d10ac2 --- /dev/null +++ b/Unity/DataContainers/LayerPerformanceOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 06b8a4cffda584d2995645a0c0c69bc5 +timeCreated: 1519860268 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/LayerSourceOptions.cs b/Unity/DataContainers/LayerSourceOptions.cs new file mode 100644 index 0000000..fd3f07b --- /dev/null +++ b/Unity/DataContainers/LayerSourceOptions.cs @@ -0,0 +1,32 @@ +namespace Mapbox.Unity.Map +{ + using System; + + [Serializable] + public class Style + { + public string Name; + public string Id; + public string Modified; + public string UserName; + } + + [Serializable] + public class LayerSourceOptions + { + public bool isActive; + public Style layerSource; + + public string Id + { + get + { + return layerSource.Id; + } + set + { + layerSource.Id = value; + } + } + } +} diff --git a/Unity/DataContainers/LayerSourceOptions.cs.meta b/Unity/DataContainers/LayerSourceOptions.cs.meta new file mode 100644 index 0000000..bb75a23 --- /dev/null +++ b/Unity/DataContainers/LayerSourceOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 2d109dd8fa7ac4aefa3e2dabac3a3e58 +timeCreated: 1519860268 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/LineGeometryOptions.cs b/Unity/DataContainers/LineGeometryOptions.cs new file mode 100644 index 0000000..0f01cbe --- /dev/null +++ b/Unity/DataContainers/LineGeometryOptions.cs @@ -0,0 +1,74 @@ +using Mapbox.Unity.SourceLayers; +using UnityEngine; + +namespace Mapbox.Unity.Map +{ + using Mapbox.Unity.MeshGeneration.Modifiers; + using System; + + [Serializable] + public class LineGeometryOptions : ModifierProperties, ISubLayerLineGeometryOptions + { + public override Type ModifierType + { + get + { + return typeof(LineMeshModifier); + } + } + + [Tooltip("Width of the line feature.")] + public float Width = 1.0f; + + [Tooltip("Miter Limit")] + public float MiterLimit = 0.2f; + + [Tooltip("Round Limit")] + public float RoundLimit = 1.05f; + + [Tooltip("Join type of the line feature")] + public JoinType JoinType = JoinType.Round; + + [Tooltip("Cap type of the line feature")] + public JoinType CapType = JoinType.Round; + + /// + /// Sets the width of the mesh generated for line features. + /// + /// Width of the mesh generated for line features. + public void SetLineWidth(float width) + { + if (Width != width) + { + Width = width; + HasChanged = true; + } + } + + /// + /// Sets the type of line joints + /// + /// Type of the joint + public void SetJoinType(LineJoinType join) + { + if ((int)JoinType != (int)join) + { + JoinType = (JoinType)join; + HasChanged = true; + } + } + + /// + /// Sets the type of line beginging and ending caps + /// + /// Type of the line begin and end caps + public void SetCapType(LineCapType cap) + { + if ((int)CapType != (int)cap) + { + CapType = (JoinType)cap; + HasChanged = true; + } + } + } +} diff --git a/Unity/DataContainers/LineGeometryOptions.cs.meta b/Unity/DataContainers/LineGeometryOptions.cs.meta new file mode 100644 index 0000000..222963f --- /dev/null +++ b/Unity/DataContainers/LineGeometryOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: cfba2df2ab678ce4c9dd019820140980 +timeCreated: 1522459497 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/LocationPrefabCategoryOptions.cs b/Unity/DataContainers/LocationPrefabCategoryOptions.cs new file mode 100644 index 0000000..a046ace --- /dev/null +++ b/Unity/DataContainers/LocationPrefabCategoryOptions.cs @@ -0,0 +1,72 @@ +namespace Mapbox.Unity.Map +{ + using UnityEngine; + using System.Collections.Generic; + + public static class LocationPrefabCategoryOptions + { + + static LocationPrefabCategoryOptions() + { + PopulateCategoriesToMakiDictionary(); + } + + private static Dictionary> CategoriesToMakiDictionary = new Dictionary> + { + {LocationPrefabCategories.ArtsAndEntertainment,new List{"art-gallery", "cinema", "stadium", "museum", "library", "zoo", "music", "theatre", "amusement-park"}}, + {LocationPrefabCategories.Food,new List{"cafe", "bakery", "fast-food", "grocery", "ice-cream", "restaurant"}}, + {LocationPrefabCategories.Nightlife,new List{"bar", "beer"}}, + {LocationPrefabCategories.OutdoorsAndRecreation,new List{"aquarium", "campsite", "attraction", "castle", "cemetery", "dog-park", "drinking-water", "garden", "golf", "monument", "park", "picnic-site", "playground", "swimming"}}, + {LocationPrefabCategories.Services,new List{"bank", "dentist", "toilet", "veterinary", "pharmacy", "college", "school", "hospital", "place-of-worship", "religious-christian", "religious-jewish", "religious-muslim", "police", "post", "doctor", "fire-station", "information", "town-hall", "prison", "embassy", "fuel", "laundry", "lodging"}}, + {LocationPrefabCategories.Shops,new List{"alcohol-shop", "clothing-store", "shop"}}, + {LocationPrefabCategories.Transportation,new List{"bus", "car", "bicycle-share", "bicycle", "airfield", "ferry", "harbor", "heliport"}}, + }; + + private static Dictionary MakiToCategoriesDictionary = new Dictionary(); + + + //Creates a reverse reference from the CategoriesToMakiDictionary + private static void PopulateCategoriesToMakiDictionary () + { + foreach(var item in CategoriesToMakiDictionary) + { + foreach(string makiTag in item.Value) + { + if (!MakiToCategoriesDictionary.ContainsKey(makiTag)) + { + MakiToCategoriesDictionary.Add(makiTag, item.Key); + } + } + } + } + + /// + /// Gets the maki tags list from a category + /// + /// The list of maki tags from supplied category. + /// + public static List GetMakiListFromCategory(LocationPrefabCategories category) + { + List returnList = new List(); + + CategoriesToMakiDictionary.TryGetValue(category, out returnList); + + return returnList; + } + + /// + /// Gets the category that the maki tag belongs to. + /// + /// The category from maki tag. + /// Maki tag + public static LocationPrefabCategories GetCategoryFromMakiTag(string makiTag) + { + LocationPrefabCategories returnCategory; + + if (MakiToCategoriesDictionary.TryGetValue(makiTag, out returnCategory)) + return returnCategory; + + return LocationPrefabCategories.AnyCategory; + } + } +} diff --git a/Unity/DataContainers/LocationPrefabCategoryOptions.cs.meta b/Unity/DataContainers/LocationPrefabCategoryOptions.cs.meta new file mode 100644 index 0000000..6b846f0 --- /dev/null +++ b/Unity/DataContainers/LocationPrefabCategoryOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: fcad5e29c050446fb8a3d19a42549875 +timeCreated: 1523660773 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/MapExtentOptions.cs b/Unity/DataContainers/MapExtentOptions.cs new file mode 100644 index 0000000..d0fe4d5 --- /dev/null +++ b/Unity/DataContainers/MapExtentOptions.cs @@ -0,0 +1,46 @@ +namespace Mapbox.Unity.Map +{ + using System; + using UnityEngine; + + [Serializable] + public class MapExtentOptions : MapboxDataProperty + { + public MapExtentType extentType = MapExtentType.CameraBounds; + public DefaultMapExtents defaultExtents = new DefaultMapExtents(); + + public MapExtentOptions(MapExtentType type) + { + extentType = type; + } + + public ExtentOptions GetTileProviderOptions() + { + ExtentOptions options = new ExtentOptions(); + switch (extentType) + { + case MapExtentType.CameraBounds: + options = defaultExtents.cameraBoundsOptions; + break; + case MapExtentType.RangeAroundCenter: + options = defaultExtents.rangeAroundCenterOptions; + break; + case MapExtentType.RangeAroundTransform: + options = defaultExtents.rangeAroundTransformOptions; + break; + default: + break; + } + return options; + } + } + + + [Serializable] + public class DefaultMapExtents : MapboxDataProperty + { + public CameraBoundsTileProviderOptions cameraBoundsOptions = new CameraBoundsTileProviderOptions(); + public RangeTileProviderOptions rangeAroundCenterOptions = new RangeTileProviderOptions(); + public RangeAroundTransformTileProviderOptions rangeAroundTransformOptions = new RangeAroundTransformTileProviderOptions(); + } +} diff --git a/Unity/DataContainers/MapExtentOptions.cs.meta b/Unity/DataContainers/MapExtentOptions.cs.meta new file mode 100644 index 0000000..37d0171 --- /dev/null +++ b/Unity/DataContainers/MapExtentOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: fe478189bf1ab44ce81a642a8a46a211 +timeCreated: 1519860268 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/MapLocationOptions.cs b/Unity/DataContainers/MapLocationOptions.cs new file mode 100644 index 0000000..30a9504 --- /dev/null +++ b/Unity/DataContainers/MapLocationOptions.cs @@ -0,0 +1,20 @@ +namespace Mapbox.Unity.Map +{ + using System; + using UnityEngine; + using Mapbox.Unity.Utilities; + [Serializable] + public class MapLocationOptions : MapboxDataProperty + { + [Geocode] + [Tooltip("The coordinates to build a map around")] + public string latitudeLongitude = "0,0"; + [Range(0, 22)] + [Tooltip("The zoom level of the map")] + public float zoom = 4.0f; + + //TODO : Add Coordinate conversion class. + [NonSerialized] + public MapCoordinateSystemType coordinateSystemType = MapCoordinateSystemType.WebMercator; + } +} diff --git a/Unity/DataContainers/MapLocationOptions.cs.meta b/Unity/DataContainers/MapLocationOptions.cs.meta new file mode 100644 index 0000000..3aeffab --- /dev/null +++ b/Unity/DataContainers/MapLocationOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 53cdeb2ee544b4361845e801728f9950 +timeCreated: 1519860268 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/MapOptions.cs b/Unity/DataContainers/MapOptions.cs new file mode 100644 index 0000000..daeb42a --- /dev/null +++ b/Unity/DataContainers/MapOptions.cs @@ -0,0 +1,22 @@ +namespace Mapbox.Unity.Map +{ + using System; + using UnityEngine; + [Serializable] + public class MapOptions : MapboxDataProperty + { + public MapLocationOptions locationOptions = new MapLocationOptions(); + public MapExtentOptions extentOptions = new MapExtentOptions(MapExtentType.RangeAroundCenter); + public MapPlacementOptions placementOptions = new MapPlacementOptions(); + public MapScalingOptions scalingOptions = new MapScalingOptions(); + [Tooltip("Texture used while tiles are loading.")] + public Texture2D loadingTexture = null; + public Material tileMaterial = null; + } + + [Serializable] + public class EditorPreviewOptions : MapboxDataProperty + { + public bool isPreviewEnabled = false; + } +} diff --git a/Unity/DataContainers/MapOptions.cs.meta b/Unity/DataContainers/MapOptions.cs.meta new file mode 100644 index 0000000..f389616 --- /dev/null +++ b/Unity/DataContainers/MapOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 5d04cfc6bdccb40148fc327eca9fd012 +timeCreated: 1519860268 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/MapPlacementOptions.cs b/Unity/DataContainers/MapPlacementOptions.cs new file mode 100644 index 0000000..176813c --- /dev/null +++ b/Unity/DataContainers/MapPlacementOptions.cs @@ -0,0 +1,13 @@ +using Mapbox.Unity.Map.Interfaces; + +namespace Mapbox.Unity.Map +{ + using System; + [Serializable] + public class MapPlacementOptions : MapboxDataProperty + { + public MapPlacementType placementType = MapPlacementType.AtLocationCenter; + public bool snapMapToZero = false; + public IMapPlacementStrategy placementStrategy; + } +} diff --git a/Unity/DataContainers/MapPlacementOptions.cs.meta b/Unity/DataContainers/MapPlacementOptions.cs.meta new file mode 100644 index 0000000..a343e2b --- /dev/null +++ b/Unity/DataContainers/MapPlacementOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: c075375ebec1542e9938c24aee596fca +timeCreated: 1519860268 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/MapScalingOptions.cs b/Unity/DataContainers/MapScalingOptions.cs new file mode 100644 index 0000000..afe2fed --- /dev/null +++ b/Unity/DataContainers/MapScalingOptions.cs @@ -0,0 +1,17 @@ +using Mapbox.Unity.Map.Interfaces; + +namespace Mapbox.Unity.Map +{ + using System; + using UnityEngine; + + [Serializable] + public class MapScalingOptions : MapboxDataProperty + { + public MapScalingType scalingType = MapScalingType.Custom; + [Tooltip("Size of each tile in Unity units.")] + public float unityTileSize = 100f; + + public IMapScalingStrategy scalingStrategy; + } +} diff --git a/Unity/DataContainers/MapScalingOptions.cs.meta b/Unity/DataContainers/MapScalingOptions.cs.meta new file mode 100644 index 0000000..05f8ea4 --- /dev/null +++ b/Unity/DataContainers/MapScalingOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 854768e662c984068bc22c2607fb9a45 +timeCreated: 1519860268 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/MapboxDataProperty.cs b/Unity/DataContainers/MapboxDataProperty.cs new file mode 100644 index 0000000..d3e8c51 --- /dev/null +++ b/Unity/DataContainers/MapboxDataProperty.cs @@ -0,0 +1,35 @@ +using Mapbox.Unity.MeshGeneration.Data; + +namespace Mapbox.Unity.Map +{ + public abstract class MapboxDataProperty + { + public event System.EventHandler PropertyHasChanged; + protected virtual void OnPropertyHasChanged(System.EventArgs e) + { + System.EventHandler handler = PropertyHasChanged; + if (handler != null) + { + handler(this, e); + } + } + public virtual bool HasChanged + { + set + { + if (value == true) + { + OnPropertyHasChanged(null /*Pass args here */); + } + } + } + public virtual bool NeedsForceUpdate() + { + return false; + } + public virtual void UpdateProperty(UnityTile tile) + { + + } + } +} diff --git a/Unity/DataContainers/MapboxDataProperty.cs.meta b/Unity/DataContainers/MapboxDataProperty.cs.meta new file mode 100644 index 0000000..f1ed43a --- /dev/null +++ b/Unity/DataContainers/MapboxDataProperty.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: d7e99aece91ce4463b09850af8e3df52 +timeCreated: 1536268482 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/MapboxEnums.cs b/Unity/DataContainers/MapboxEnums.cs new file mode 100644 index 0000000..22d74bd --- /dev/null +++ b/Unity/DataContainers/MapboxEnums.cs @@ -0,0 +1,422 @@ +namespace Mapbox.Unity.Map +{ + using System.ComponentModel; + + // Map related enums + public enum MapPresetType + { +#if !ENABLE_WINMD_SUPPORT + [Description("Map with imagery and terrain, used along with a location provider.")] +#endif + LocationBasedMap, +#if !ENABLE_WINMD_SUPPORT + [Description("Map with imagery and terrain and vector data - building,roads and poi's.")] +#endif + WorldSimulator, +#if !ENABLE_WINMD_SUPPORT + [Description("Map with imagery and terrain and vector data, used for AR tabletop scenario.")] +#endif + ARTableTop, +#if !ENABLE_WINMD_SUPPORT + [Description("Map with imagery and terrain and vector data, used for world scale AR scenario.")] +#endif + ARWorldScale, + } + + public enum MapPlacementType + { +#if !ENABLE_WINMD_SUPPORT + [Description("Map's root is located at the center of tile containing location specified.")] +#endif + AtTileCenter, +#if !ENABLE_WINMD_SUPPORT + [Description("Map's root is located at the location specified.")] +#endif + AtLocationCenter + } + + public enum MapScalingType + { +#if !ENABLE_WINMD_SUPPORT + [Description("Map is rendered at actual scale, unity to mercator conversion factor is ignored. ")] +#endif + WorldScale, +#if !ENABLE_WINMD_SUPPORT + [Description("Map is rendered at the scale defined by unity to mercator conversion factor. ")] +#endif + Custom + } + + public enum MapUnitType + { + meters, + kilometers, + miles + } + + public enum MapExtentType + { +#if !ENABLE_WINMD_SUPPORT + [Description("Map extent defined by the camera's viewport bounds.")] +#endif + CameraBounds, +#if !ENABLE_WINMD_SUPPORT + [Description("Map extent defined by range of tiles around map's center tile.")] +#endif + RangeAroundCenter, +#if !ENABLE_WINMD_SUPPORT + [Description("Map extent defined by range of tiles around a target transform.")] +#endif + RangeAroundTransform, +#if !ENABLE_WINMD_SUPPORT + [Description("Map extent defined by custom tile provider.")] +#endif + Custom, + } + + public enum MapCoordinateSystemType + { + WebMercator, + } + + //Layer related enums. + public enum MapLayerType + { + Imagery, + Elevation, + Vector + } + + public enum VectorPrimitiveType + { + Point, + Line, + Polygon, + Custom + } + + public enum UvMapType + { +#if !ENABLE_WINMD_SUPPORT + [Description("Use image texture using tiled UV.")] +#endif + Tiled = 0, +#if !ENABLE_WINMD_SUPPORT + [Description("Use an image texture atlas to define textures for roof & sides of buildings.")] +#endif + Atlas = 2, +#if !ENABLE_WINMD_SUPPORT + [Description("Use an image texture atlas and a color pallete to define textures for roof & sides of buildings.")] +#endif + AtlasWithColorPalette = 3, + } + + public enum ImagerySourceType + { +#if !ENABLE_WINMD_SUPPORT + [Description("Mapbox Streets is a comprehensive, general-purpose map that emphasizes accurate, legible styling of road and transit networks")] +#endif + MapboxStreets, +#if !ENABLE_WINMD_SUPPORT + [Description("Mapbox Outdoors is a general-purpose map with curated tilesets and specialized styling tailored to hiking, biking, and the most adventurous use cases.")] +#endif + MapboxOutdoors, +#if !ENABLE_WINMD_SUPPORT + [Description("Mapbox Light and Mapbox Dark are subtle, full-featured maps designed to provide geographic context while highlighting the data on your analytics dashboard, data visualization, or data overlay.")] +#endif + MapboxDark, +#if !ENABLE_WINMD_SUPPORT + [Description("Mapbox Light and Mapbox Dark are subtle, full-featured maps designed to provide geographic context while highlighting the data on your analytics dashboard, data visualization, or data overlay.")] +#endif + MapboxLight, +#if !ENABLE_WINMD_SUPPORT + [Description("Mapbox Satellite is our full global base map that is perfect as a blank canvas or an overlay for your own data.")] +#endif + MapboxSatellite, +#if !ENABLE_WINMD_SUPPORT + [Description("Mapbox Satellite Streets combines our Mapbox Satellite with vector data from Mapbox Streets. The comprehensive set of road, label, and POI information brings clarity and context to the crisp detail in our high-resolution satellite imagery.")] +#endif + MapboxSatelliteStreet, +#if !ENABLE_WINMD_SUPPORT + [Description("Use custom tilesets created using Mapbox studio.")] +#endif + Custom, +#if !ENABLE_WINMD_SUPPORT + [Description("Turn off image rendering.")] +#endif + None + } + + public enum ElevationSourceType + { +#if !ENABLE_WINMD_SUPPORT + [Description("Mapbox Terrain provides digital elevation model with worldwide coverage. ")] +#endif + MapboxTerrain, +#if !ENABLE_WINMD_SUPPORT + [Description("Use custom digital elevation model tileset.")] +#endif + Custom, +#if !ENABLE_WINMD_SUPPORT + [Description("Render flat terrain.")] +#endif + None + } + + public enum VectorSourceType + { +#if !ENABLE_WINMD_SUPPORT + [Description("Mapbox Streets along with unique identifiers for building features. Combines building footprints that may be in different tiles.")] +#endif + MapboxStreetsWithBuildingIds = 0, +#if !ENABLE_WINMD_SUPPORT + [Description("Mapbox Streets vector tiles are largely based on data from OpenStreetMap, a free & global source of geographic data built by volunteers.")] +#endif + MapboxStreets = 1, +#if !ENABLE_WINMD_SUPPORT + [Description("Mapbox Streets vector tiles are largely based on data from OpenStreetMap, a free & global source of geographic data built by volunteers.")] +#endif + MapboxStreetsV8WithBuildingIds = -1, +#if !ENABLE_WINMD_SUPPORT + [Description("Mapbox Streets vector tiles are largely based on data from OpenStreetMap, a free & global source of geographic data built by volunteers.")] +#endif + MapboxStreetsV8 = -2, +#if !ENABLE_WINMD_SUPPORT + [Description("Use custom tilesets created using Mapbox studio. ")] +#endif + Custom = 2, +#if !ENABLE_WINMD_SUPPORT + [Description("Turn off vector data rendering.")] +#endif + None = 3 + } + public enum ElevationLayerType + { +#if !ENABLE_WINMD_SUPPORT + [Description("Render flat terrain with no elevation.")] +#endif + FlatTerrain, +#if !ENABLE_WINMD_SUPPORT + [Description("Render terrain with elevation from the source specified.")] +#endif + TerrainWithElevation, +#if !ENABLE_WINMD_SUPPORT + [Description("Render low polygon terrain with elevation from the source specified")] +#endif + LowPolygonTerrain, + + // TODO : Might want to reconsider this option. +#if !ENABLE_WINMD_SUPPORT + [Description("Render terrain with no elevation for a globe.")] +#endif + GlobeTerrain + } + + public enum TileTerrainType + { + //starting from -1 to match ElevationLayerType + None = -1, + Flat = 0, + Elevated = 1, + LowPoly = 2, + Globe = 3 + } + + public enum ExtrusionType + { +#if !ENABLE_WINMD_SUPPORT + [Description("No extrusion.")] +#endif + None, +#if !ENABLE_WINMD_SUPPORT + [Description("Extrude features using the property value.")] +#endif + PropertyHeight, +#if !ENABLE_WINMD_SUPPORT + [Description("Extrude features using the property value. Sets height based on property's minimum height, if height isn't uniform. Results in flat tops.")] +#endif + MinHeight, +#if !ENABLE_WINMD_SUPPORT + [Description("Extrude features using the property value. Sets height based on property's maximum height, if height isn't uniform. Results in flat tops.")] +#endif + MaxHeight, +#if !ENABLE_WINMD_SUPPORT + [Description("Extrude features using the property value. Values are clamped in to min and max values if they are lower or greater than min,max values respectively.")] +#endif + RangeHeight, +#if !ENABLE_WINMD_SUPPORT + [Description("Extrude all features using the fixed value.")] +#endif + AbsoluteHeight, + + + } + + public enum ExtrusionGeometryType + { +#if !ENABLE_WINMD_SUPPORT + [Description("Extrudes both roof and side wall geometry of the vector feature.")] +#endif + RoofAndSide, +#if !ENABLE_WINMD_SUPPORT + [Description("Extrudes only roof geometry of the vector feature.")] +#endif + RoofOnly, +#if !ENABLE_WINMD_SUPPORT + [Description("Extrudes only side wall geometry of the vector feature.")] +#endif + SideOnly, + } + + public enum ColliderType + { +#if !ENABLE_WINMD_SUPPORT + [Description("No collider.")] +#endif + None, +#if !ENABLE_WINMD_SUPPORT + [Description("Box collider addded to the GameObject.")] +#endif + BoxCollider, +#if !ENABLE_WINMD_SUPPORT + [Description("Mesh collider added to the GameObject.")] +#endif + MeshCollider, +#if !ENABLE_WINMD_SUPPORT + [Description("Sphere collider added to the GameObject.")] +#endif + SphereCollider, + } + + public enum MapFeatureType + { +#if !ENABLE_WINMD_SUPPORT + [Description("Building Layer.")] +#endif + Building, +#if !ENABLE_WINMD_SUPPORT + [Description("Road Layer.")] +#endif + Road, +#if !ENABLE_WINMD_SUPPORT + [Description("Parkland Layer.")] +#endif + Parkland, + }; + + public enum StyleTypes + { +#if !ENABLE_WINMD_SUPPORT + [Description("Custom style.")] +#endif + Custom, +#if !ENABLE_WINMD_SUPPORT + [Description("Simple style combines stylized vector designs with scriptable palettes to create a simple, procedurally colored rendering style.")] +#endif + Simple, +#if !ENABLE_WINMD_SUPPORT + [Description("Light style uses colored materials to create light, greyscale shading for your map.")] +#endif + Light, +#if !ENABLE_WINMD_SUPPORT + [Description("Dark style uses colored materials to create dark, greyscale shading for your map.")] +#endif + Dark, +#if !ENABLE_WINMD_SUPPORT + [Description("Realistic style combines modern, urban designs with physically based rendering materials to help create a contemporary, realistic rendering style.")] +#endif + Realistic, +#if !ENABLE_WINMD_SUPPORT + [Description("Fantasy style combines old world medieval designs with physically based rendering materials to help create a fantasy rendering style.")] +#endif + Fantasy, +#if !ENABLE_WINMD_SUPPORT + [Description("Satellite style uses high-resolution satellite imagery as a texture set. The comprehensive set of road, label, and POI information brings clarity and context to the crisp detail in our high-resolution satellite imagery.")] +#endif + Satellite, +#if !ENABLE_WINMD_SUPPORT + [Description("Color style uses user-defined color and opacity to create colorful, flat shading for your map.")] +#endif + Color, + } + + public enum SamplePalettes + { + City, + Urban, + Warm, + Cool, + Rainbow + } + + public enum LocationPrefabFindBy + { +#if !ENABLE_WINMD_SUPPORT + [Description("Display points of interest based on a choice of categories")] +#endif + MapboxCategory, +#if !ENABLE_WINMD_SUPPORT + [Description("Display points of interest based on name")] +#endif + POIName, +#if !ENABLE_WINMD_SUPPORT + [Description("Display points of interest at specific address or geographical co-ordinates on the map")] +#endif + AddressOrLatLon, + } + + public enum LocationPrefabCategories + { + None = 0, + AnyCategory = ~0, + ArtsAndEntertainment = 1 << 0, + Food = 1 << 1, + Nightlife = 1 << 2, + OutdoorsAndRecreation = 1 << 3, + Services = 1 << 4, + Shops = 1 << 5, + Transportation = 1 << 6 + } + + public enum FeatureProcessingStage + { + PreProcess, + Process, + PostProcess + } + + public enum PresetFeatureType + { + Buildings, + Roads, + Landuse, + Points, + Custom + } + + public enum JoinType + { + Miter = 0, + Round = 1, + Bevel = 2, + Butt, + Square, + Fakeround, + Flipbevel + } + + public enum LineJoinType + { + Miter = 0, + Round = 1, + Bevel = 2 + } + + public enum LineCapType + { + Butt = 3, + Round = 1, + Square = 4 + } + +} diff --git a/Unity/DataContainers/MapboxEnums.cs.meta b/Unity/DataContainers/MapboxEnums.cs.meta new file mode 100644 index 0000000..1280af8 --- /dev/null +++ b/Unity/DataContainers/MapboxEnums.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 076cfb625c7cd447089acf2294b1d75e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/RangeAroundTransformTileProviderOptions.cs b/Unity/DataContainers/RangeAroundTransformTileProviderOptions.cs new file mode 100644 index 0000000..f70fdb9 --- /dev/null +++ b/Unity/DataContainers/RangeAroundTransformTileProviderOptions.cs @@ -0,0 +1,31 @@ +namespace Mapbox.Unity.Map +{ + using System; + using UnityEngine; + [Serializable] + public class RangeAroundTransformTileProviderOptions : ExtentOptions + { + public Transform targetTransform; + public int visibleBuffer; + public int disposeBuffer; + + public override void SetOptions(ExtentOptions extentOptions) + { + RangeAroundTransformTileProviderOptions options = extentOptions as RangeAroundTransformTileProviderOptions; + if (options != null) + { + SetOptions(options.targetTransform, options.visibleBuffer, options.disposeBuffer); + } + else + { + Debug.LogError("ExtentOptions type mismatch : Using " + extentOptions.GetType() + " to set extent of type " + this.GetType()); + } + } + public void SetOptions(Transform tgtTransform = null, int visibleRange = 1, int disposeRange = 1) + { + targetTransform = tgtTransform; + visibleBuffer = visibleRange; + disposeBuffer = disposeRange; + } + } +} diff --git a/Unity/DataContainers/RangeAroundTransformTileProviderOptions.cs.meta b/Unity/DataContainers/RangeAroundTransformTileProviderOptions.cs.meta new file mode 100644 index 0000000..9418ced --- /dev/null +++ b/Unity/DataContainers/RangeAroundTransformTileProviderOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: fe9e24e68033f4630b1635d66c71a3cc +timeCreated: 1519860268 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/RangeTileProviderOptions.cs b/Unity/DataContainers/RangeTileProviderOptions.cs new file mode 100644 index 0000000..d60e87c --- /dev/null +++ b/Unity/DataContainers/RangeTileProviderOptions.cs @@ -0,0 +1,42 @@ +namespace Mapbox.Unity.Map +{ + using System; + using UnityEngine; + + [Serializable] + public class RangeTileProviderOptions : ExtentOptions + { + [Range(0, 10)] + public int west = 1; + [Range(0, 10)] + public int north = 1; + [Range(0, 10)] + public int east = 1; + [Range(0, 10)] + public int south = 1; + + public override void SetOptions(ExtentOptions extentOptions) + { + RangeTileProviderOptions options = extentOptions as RangeTileProviderOptions; + if (options != null) + { + west = options.west; + north = options.north; + east = options.east; + south = options.south; + } + else + { + Debug.LogError("ExtentOptions type mismatch : Using " + extentOptions.GetType() + " to set extent of type " + this.GetType()); + } + } + + public void SetOptions(int northRange = 1, int southRange = 1, int eastRange = 1, int westRange = 1) + { + west = westRange; + north = northRange; + east = eastRange; + south = southRange; + } + } +} diff --git a/Unity/DataContainers/RangeTileProviderOptions.cs.meta b/Unity/DataContainers/RangeTileProviderOptions.cs.meta new file mode 100644 index 0000000..bef029c --- /dev/null +++ b/Unity/DataContainers/RangeTileProviderOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: c619de083ef9446b4b774933701dd923 +timeCreated: 1519860268 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/SpawnPrefabOptions.cs b/Unity/DataContainers/SpawnPrefabOptions.cs new file mode 100644 index 0000000..1ff4ad4 --- /dev/null +++ b/Unity/DataContainers/SpawnPrefabOptions.cs @@ -0,0 +1,26 @@ +namespace Mapbox.Unity.Map +{ + using System.Collections; + using System.Collections.Generic; + using UnityEngine; + using Mapbox.Unity.MeshGeneration.Modifiers; + using System; + using Mapbox.Unity.Map; + + [Serializable] + public class SpawnPrefabOptions : ModifierProperties + { + public override Type ModifierType + { + get + { + return typeof(PrefabModifier); + } + } + + public GameObject prefab; + public bool scaleDownWithWorld = true; + [NonSerialized] + public Action> AllPrefabsInstatiated = delegate { }; + } +} \ No newline at end of file diff --git a/Unity/DataContainers/SpawnPrefabOptions.cs.meta b/Unity/DataContainers/SpawnPrefabOptions.cs.meta new file mode 100644 index 0000000..86c84de --- /dev/null +++ b/Unity/DataContainers/SpawnPrefabOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ae0dbe1711e344fd9908394c6270d93a +timeCreated: 1523916609 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/TerrainColliderOptions.cs b/Unity/DataContainers/TerrainColliderOptions.cs new file mode 100644 index 0000000..0c6af17 --- /dev/null +++ b/Unity/DataContainers/TerrainColliderOptions.cs @@ -0,0 +1,28 @@ +namespace Mapbox.Unity.Map +{ + using System; + using Mapbox.Unity.MeshGeneration.Data; + using UnityEngine; + [Serializable] + public class TerrainColliderOptions : MapboxDataProperty + { + [Tooltip("Add Unity Physics collider to terrain tiles, used for detecting collisions etc.")] + public bool addCollider = false; + + public override void UpdateProperty(UnityTile tile) + { + var existingCollider = tile.Collider; + if (addCollider) + { + if (existingCollider == null) + { + tile.gameObject.AddComponent(); + } + } + else + { + tile.Collider.Destroy(); + } + } + } +} diff --git a/Unity/DataContainers/TerrainColliderOptions.cs.meta b/Unity/DataContainers/TerrainColliderOptions.cs.meta new file mode 100644 index 0000000..a492fcc --- /dev/null +++ b/Unity/DataContainers/TerrainColliderOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 5e3e24bd5ee1ac74eb27105f96121ab9 +timeCreated: 1520011256 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/TerrainSideWallOptions.cs b/Unity/DataContainers/TerrainSideWallOptions.cs new file mode 100644 index 0000000..3355c3f --- /dev/null +++ b/Unity/DataContainers/TerrainSideWallOptions.cs @@ -0,0 +1,15 @@ +namespace Mapbox.Unity.Map +{ + using System; + using UnityEngine; + [Serializable] + public class TerrainSideWallOptions + { + [Tooltip("Adds side walls to terrain meshes, reduces visual artifacts.")] + public bool isActive = false; + [Tooltip("Height of side walls.")] + public float wallHeight = 10; + [Tooltip("Unity material to use for side walls.")] + public Material wallMaterial; + } +} diff --git a/Unity/DataContainers/TerrainSideWallOptions.cs.meta b/Unity/DataContainers/TerrainSideWallOptions.cs.meta new file mode 100644 index 0000000..02082a6 --- /dev/null +++ b/Unity/DataContainers/TerrainSideWallOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: cd7e5d3c41f4f4894871e76b0d68a448 +timeCreated: 1519860268 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/TileJsonData.cs b/Unity/DataContainers/TileJsonData.cs new file mode 100644 index 0000000..d81e84c --- /dev/null +++ b/Unity/DataContainers/TileJsonData.cs @@ -0,0 +1,184 @@ +namespace Mapbox.Unity.Map +{ + using System; + using System.Collections.Generic; + using Mapbox.Platform.TilesetTileJSON; + using UnityEngine; + + [Serializable] + public class TileJsonData + { + public readonly string commonLayersKey = "(layer found in more than one data source)"; + public readonly string optionalPropertiesString = "(may not appear across all locations)"; + /// + /// This boolean is to check if tile JSON data has loaded after the data source has changed + /// + public bool tileJSONLoaded = false; + + /// + /// Layer Display Names seen in the editor + /// + public List LayerDisplayNames = new List(); + + /// + /// Property Display Names seen in the editor + /// + public Dictionary> PropertyDisplayNames = new Dictionary>(); + + /// + /// The description of the property in a layer + /// + public Dictionary> LayerPropertyDescriptionDictionary = new Dictionary>(); + + /// + /// List of data sources (tileset ids) linked to a layer name + /// + public Dictionary> LayerSourcesDictionary = new Dictionary>(); + + /// + /// Dictionary containting the list of layers in a source + /// + public Dictionary> SourceLayersDictionary = new Dictionary>(); + + public void ClearData() + { + tileJSONLoaded = false; + LayerPropertyDescriptionDictionary.Clear(); + LayerSourcesDictionary.Clear(); + SourceLayersDictionary.Clear(); + LayerDisplayNames.Clear(); + PropertyDisplayNames.Clear(); + } + + public void ProcessTileJSONData(TileJSONResponse tjr) + { + tileJSONLoaded = true; + List layerPropertiesList = new List(); + + if (tjr == null || tjr.VectorLayers == null || tjr.VectorLayers.Length == 0) + { + return; + } + + ClearData(); + + var propertyName = ""; + var propertyDescription = ""; + var layerSource = ""; + + foreach (var layer in tjr.VectorLayers) + { + //load layer names + var layerName = layer.Id; + layerPropertiesList = new List(); + layerSource = layer.Source; + + //loading layer sources + if (LayerSourcesDictionary.ContainsKey(layerName)) + { + LayerSourcesDictionary[layerName].Add(layerSource); + } + else + { + LayerSourcesDictionary.Add(layerName, new List() { layerSource }); + } + + //loading layers to a data source + if (SourceLayersDictionary.ContainsKey(layerSource)) + { + List sourceList = new List(); + LayerSourcesDictionary.TryGetValue(layerName, out sourceList); + + if (sourceList.Count > 1 && sourceList.Contains(layerSource)) // the current layerName has more than one source + { + if (SourceLayersDictionary.ContainsKey(commonLayersKey)) + { + SourceLayersDictionary[commonLayersKey].Add(layerName); + } + else + { + SourceLayersDictionary.Add(commonLayersKey, new List() { layerName }); + } + + if (LayerDisplayNames.Contains(layerName)) + { + LayerDisplayNames.Remove(layerName); + } + LayerDisplayNames.Add(layerName); + } + else + { + SourceLayersDictionary[layerSource].Add(layerName); + LayerDisplayNames.Add(layerName); + } + } + else + { + SourceLayersDictionary.Add(layerSource, new List() { layerName }); + LayerDisplayNames.Add(layerName); + } + + + //Load properties + foreach (var property in layer.Fields) + { + propertyName = property.Key; + propertyDescription = property.Value; + layerPropertiesList.Add(propertyName); + + //adding property descriptions + if (LayerPropertyDescriptionDictionary.ContainsKey(layerName)) + { + if (!LayerPropertyDescriptionDictionary[layerName].ContainsKey(propertyName)) + { + LayerPropertyDescriptionDictionary[layerName].Add(propertyName, propertyDescription); + } + } + else + { + LayerPropertyDescriptionDictionary.Add(layerName, new Dictionary() { { propertyName, propertyDescription } }); + } + + //Loading display names for properties + if (PropertyDisplayNames.ContainsKey(layerName)) + { + if (!PropertyDisplayNames[layerName].Contains(propertyName)) + { + PropertyDisplayNames[layerName].Add(propertyName); + + //logic to add the list of masked properties from all sources that are not #1 + if (LayerSourcesDictionary[layerName].Count > 1 && !string.IsNullOrEmpty(tjr.Source)) + { + var firstSource = tjr.Source.Split(new string[] { "," }, System.StringSplitOptions.None)[0].Trim(); + if (layerSource != firstSource) + { + if (PropertyDisplayNames[layerName].Contains(propertyName)) + { + PropertyDisplayNames[layerName].Remove(propertyName); + } + + PropertyDisplayNames[layerName].Add(propertyName); + } + } + } + } + else + { + PropertyDisplayNames.Add(layerName, new List { propertyName }); + } + } + + if (PropertyDisplayNames.ContainsKey(layerName) && PropertyDisplayNames[layerName].Count > 1) + { + PropertyDisplayNames[layerName].Sort(); + } + } + + + if (LayerDisplayNames.Count > 1) + { + LayerDisplayNames.Sort(); + } + } + } +} \ No newline at end of file diff --git a/Unity/DataContainers/TileJsonData.cs.meta b/Unity/DataContainers/TileJsonData.cs.meta new file mode 100644 index 0000000..2d8b785 --- /dev/null +++ b/Unity/DataContainers/TileJsonData.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 52cf051b4afa24ba6895b9a42b179eed +timeCreated: 1524801966 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/TileStats.cs b/Unity/DataContainers/TileStats.cs new file mode 100644 index 0000000..9d3bd1a --- /dev/null +++ b/Unity/DataContainers/TileStats.cs @@ -0,0 +1,51 @@ +namespace Mapbox.Unity.Map +{ + using System; + using System.Collections.Generic; + using Mapbox.Json; + + public class TileStats + { + [JsonProperty("account")] + public string account; + + [JsonProperty("tilesetid")] + public string tilesetid; + + [JsonProperty("layers")] + public LayerStats[] layers; + } + + public class LayerStats + { + [JsonProperty("account")] + public string account; + + [JsonProperty("tilesetid")] + public string tilesetid; + + [JsonProperty("layer")] + public string layer; + + [JsonProperty("geometry")] + public string geometry; + + [JsonProperty("count")] + public string count; + + [JsonProperty("attributes")] + public AttributeStats[] attributes; + } + + public class AttributeStats + { + [JsonProperty("attribute")] + public string attribute; + + [JsonProperty("type")] + public string type; + + [JsonProperty("values")] + public string[] values; + } +} diff --git a/Unity/DataContainers/TileStats.cs.meta b/Unity/DataContainers/TileStats.cs.meta new file mode 100644 index 0000000..1baea27 --- /dev/null +++ b/Unity/DataContainers/TileStats.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a54ae05a24f6b499c8ef1d26ffedbbf6 +timeCreated: 1530635960 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/TileStatsFetcher.cs b/Unity/DataContainers/TileStatsFetcher.cs new file mode 100644 index 0000000..90c13b7 --- /dev/null +++ b/Unity/DataContainers/TileStatsFetcher.cs @@ -0,0 +1,50 @@ +namespace Mapbox.Unity.Map +{ + using System.IO; + using Mapbox.Unity.Map; + using UnityEngine; + using System.Text; + using Mapbox.Json; + + public class TileStatsFetcher + { + private static TileStatsFetcher _instance; + private string _filePath = "Assets/Mapbox/Unity/DataContainers/streets-v7-stats.json"; + public static TileStatsFetcher Instance + { + get + { + if (_instance == null) + { + _instance = new TileStatsFetcher(); + } + return _instance; + } + } + /// + /// Gets the tile stats json for the supplied source Id. + /// + /// A prepopulated instance. + /// Source Id of the Mapbox Tileset. + public TileStats GetTileStats(VectorSourceType sourceType) + { + TileStats stats = null; + switch (sourceType) + { + case VectorSourceType.MapboxStreets: + case VectorSourceType.MapboxStreetsWithBuildingIds: + using (Stream stream = new FileStream(_filePath, FileMode.Open)) + { + using (StreamReader reader = new StreamReader(stream)) + { + stats = JsonConvert.DeserializeObject(reader.ReadToEnd()); + } + } + break; + default: + break; + } + return stats; + } + } +} diff --git a/Unity/DataContainers/TileStatsFetcher.cs.meta b/Unity/DataContainers/TileStatsFetcher.cs.meta new file mode 100644 index 0000000..63df452 --- /dev/null +++ b/Unity/DataContainers/TileStatsFetcher.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 7fcfafee1945e413e804e0b0e25ae560 +timeCreated: 1530635960 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/UnifiedMapOptions.cs b/Unity/DataContainers/UnifiedMapOptions.cs new file mode 100644 index 0000000..bf3925e --- /dev/null +++ b/Unity/DataContainers/UnifiedMapOptions.cs @@ -0,0 +1,18 @@ +namespace Mapbox.Unity.Map +{ + using System; + using Mapbox.Unity.Utilities; + + [Serializable] + public class UnifiedMapOptions + { + public MapPresetType mapPreset = MapPresetType.LocationBasedMap; + public MapOptions mapOptions = new MapOptions(); + [NodeEditorElement("Image Layer")] + public ImageryLayerProperties imageryLayerProperties = new ImageryLayerProperties(); + [NodeEditorElement("Terrain Layer")] + public ElevationLayerProperties elevationLayerProperties = new ElevationLayerProperties(); + [NodeEditorElement("Vector Layer")] + public VectorLayerProperties vectorLayerProperties = new VectorLayerProperties(); + } +} diff --git a/Unity/DataContainers/UnifiedMapOptions.cs.meta b/Unity/DataContainers/UnifiedMapOptions.cs.meta new file mode 100644 index 0000000..92d8b82 --- /dev/null +++ b/Unity/DataContainers/UnifiedMapOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 4ee20976ba70747b18ae908f30927ca9 +timeCreated: 1519860268 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/UnityLayerOptions.cs b/Unity/DataContainers/UnityLayerOptions.cs new file mode 100644 index 0000000..a902f89 --- /dev/null +++ b/Unity/DataContainers/UnityLayerOptions.cs @@ -0,0 +1,21 @@ +using Mapbox.Unity.MeshGeneration.Data; + +namespace Mapbox.Unity.Map +{ + using System; + using UnityEngine; + + [Serializable] + public class UnityLayerOptions : MapboxDataProperty + { + [Tooltip("Add terrain tiles to Unity Layer")] + public bool addToLayer = false; + [Tooltip("Unity Layer id to which terrain tiles will get added.")] + public int layerId = 0; + + public override void UpdateProperty(UnityTile tile) + { + tile.gameObject.layer = layerId; + } + } +} diff --git a/Unity/DataContainers/UnityLayerOptions.cs.meta b/Unity/DataContainers/UnityLayerOptions.cs.meta new file mode 100644 index 0000000..f071196 --- /dev/null +++ b/Unity/DataContainers/UnityLayerOptions.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 8ecbb47ee371342fb90233bf8ae8c471 +timeCreated: 1519860268 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/DataContainers/streets-v7-stats.json b/Unity/DataContainers/streets-v7-stats.json new file mode 100644 index 0000000..f7b040a --- /dev/null +++ b/Unity/DataContainers/streets-v7-stats.json @@ -0,0 +1,1855 @@ +{ + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layers":[ + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"landuse", + "geometry":"Polygon", + "count":null, + "attributes":[ + { + "attribute":"class", + "type":"string", + "values":[ + "agriculture", + "cemetery", + "glacier", + "grass", + "hospital", + "industrial", + "park", + "parking", + "piste", + "pitch", + "rock", + "sand", + "school", + "scrub", + "wood", + "aboriginal_lands" + ] + }, + { + "attribute":"type", + "type":"string" + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"waterway", + "geometry":"LineString", + "count":null, + "attributes":[ + { + "attribute":"class", + "type":"string", + "values":[ + "river", + "canal", + "stream", + "stream_intermittent", + "ditch", + "drain" + ] + }, + { + "attribute":"type", + "type":"string", + "values":[ + "river", + "canal", + "stream", + "ditch", + "drain" + ] + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"water", + "geometry":"Polygon", + "count":null, + "attributes":[ + + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"aeroway", + "geometry":"LineString", + "count":null, + "attributes":[ + { + "attribute":"type", + "type":"string", + "values":[ + "runway", + "taxiway", + "apron", + "helipad" + ] + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"barrier_line", + "geometry":"LineString", + "count":null, + "attributes":[ + { + "attribute":"class", + "type":"string", + "values":[ + "fence", + "hedge", + "cliff", + "gate", + "land" + ] + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"building", + "geometry":"Polygon", + "count":null, + "attributes":[ + { + "attribute":"extrude", + "type":"string", + "values":[ + "true", + "false" + ] + }, + { + "attribute":"height", + "type":"number", + "min":0, + "max":999 + }, + { + "attribute":"min_height", + "type":"number", + "min":0, + "max":999 + }, + { + "attribute":"type", + "type":"string", + "values":[ + "building", + "house", + "residential", + "garage", + "apartments", + "hut", + "industrial", + "roof", + "shed", + "detached", + "commercial", + "garages", + "terrace", + "building:part", + "school", + "retail", + "farm_auxilary", + "construction", + "church", + "greenhouse", + "barn", + "service", + "cabin", + "manufacture", + "warehouse", + "farm", + "civic", + "office", + "collapsed", + "university", + "public", + "hangar", + "hospital", + "entrance", + "static_caravan", + "hotel", + "chapel", + "semidetached_house", + "ger", + "kindergarten", + "damaged", + "transportation", + "train_station", + "dormitory", + "commercial;residential", + "storage_tank", + "stable", + "trullo", + "houseboat", + "shop", + "ruins" + ] + }, + { + "attribute":"underground", + "type":"string", + "values":[ + "true", + "false" + ] + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"landuse_overlay", + "geometry":"Polygon", + "count":null, + "attributes":[ + { + "attribute":"class", + "type":"string", + "values":[ + "national_park", + "wetland", + "wetland_noveg" + ] + }, + { + "attribute":"type", + "type":"string" + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"road", + "geometry":"LineString", + "count":null, + "attributes":[ + { + "attribute":"class", + "type":"string", + "values":[ + "motorway", + "motorway_link", + "trunk", + "primary", + "secondary", + "tertiary", + "level_crossing", + "link", + "street", + "street_limited", + "pedestrian", + "construction", + "track", + "service", + "ferry", + "path", + "major_rail", + "minor_rail", + "aerialway", + "golf", + "turning_circle", + "mini_roundabout", + "turning_loop", + "traffic_signals" + ] + }, + { + "attribute":"layer", + "type":"number", + "min":-5, + "max":5, + "values":[ + -5, + -4, + -3, + -2, + -1, + 0, + 1, + 2, + 3, + 4, + 5 + ] + }, + { + "attribute":"oneway", + "type":"string", + "values":[ + "true", + "false" + ] + }, + { + "attribute":"structure", + "type":"string", + "values":[ + "none", + "bridge", + "tunnel", + "ford" + ] + }, + { + "attribute":"type", + "type":"string", + "values":[ + "motorway", + "motorway_link", + "trunk", + "primary", + "secondary", + "tertiary", + "trunk_link", + "primary_link", + "secondary_link", + "tertiary_link", + "residential", + "unclassified", + "road", + "living_street", + "level_crossing", + "raceway", + "pedestrian", + "platform", + "construction:motorway", + "construction:motorway_link", + "construction:trunk", + "construction:trunk_link", + "construction:primary", + "construction:primary_link", + "construction:secondary", + "construction:secondary_link", + "construction:tertiary", + "construction:tertiary_link", + "construction:unclassified", + "construction:residential", + "construction:road", + "construction:living_street", + "construction:pedestrian", + "construction", + "track:grade1", + "track:grade2", + "track:grade3", + "track:grade4", + "track:grade5", + "track", + "service:alley", + "service:emergency_access", + "service:drive_through", + "service:driveway", + "service:parking_aisle", + "service", + "ferry", + "ferry_auto", + "steps", + "corridor", + "sidewalk", + "crossing", + "piste", + "mountain_bike", + "hiking", + "trail", + "cycleway", + "footway", + "path", + "bridleway", + "rail", + "subway", + "narrow_gauge", + "funicular", + "light_rail", + "miniature", + "monorail", + "preserved", + "tram", + "aerialway:cable_car", + "aerialway:gondola", + "aerialway:mixed_lift", + "aerialway:chair_lift", + "aerialway:drag_lift", + "aerialway:magic_carpet", + "aerialway", + "hole", + "turning_circle", + "mini_roundabout", + "traffic_signals" + ] + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"admin", + "geometry":"LineString", + "count":null, + "attributes":[ + { + "attribute":"admin_level", + "type":"number", + "min":2, + "max":4, + "values":[ + 2, + 3, + 4 + ] + }, + { + "attribute":"disputed", + "type":"number", + "min":0, + "max":1, + "values":[ + 1, + 0 + ] + }, + { + "attribute":"iso_3166_1", + "type":"string", + "values":[ + "TR", + "RU", + "TH", + "US", + "VN", + "JP", + "AZ", + "DZ", + "PH", + "KE", + "RO", + "FR", + "IN", + "ID", + "CH", + "CN", + "NG", + "PH", + "AF", + "FR", + "IR", + "MX", + "CO", + "TZ", + "DO", + "BR", + "EC", + "EG", + "UA", + "US", + "AR-PY", + "PE", + "YE", + "KH", + "DE", + "GT", + "TN", + "RU", + "AR", + "MN", + "NO", + "UY", + "LY", + "CU", + "ES", + "SE", + "KR", + "TD", + "VE", + "NI", + "IT", + "AO", + "PY", + "BI", + "HN", + "PL", + "IQ", + "NL", + "PG", + "SD", + "BE-NL", + "FM", + "AE", + "KZ", + "CF", + "CI", + "GR", + "VE", + "MM", + "SV", + "LA", + "LB", + "SA", + "SO", + "BF", + "CA", + "LR", + "MY", + "NA", + "NZ", + "SY", + "KI", + "MH", + "JM", + "KP", + "BJ", + "JO", + "GE", + "SN", + "TL", + "UZ", + "JP", + "MR", + "AM", + "CD", + "ET", + "ZA", + "ZW", + "AU", + "BY" + ] + }, + { + "attribute":"maritime", + "type":"number", + "min":0, + "max":1, + "values":[ + 1, + 0 + ] + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"country_label", + "geometry":"Point", + "count":null, + "attributes":[ + { + "attribute":"name", + "type":"string" + }, + { + "attribute":"name_de", + "type":"string" + }, + { + "attribute":"name_en", + "type":"string" + }, + { + "attribute":"name_es", + "type":"string" + }, + { + "attribute":"name_fr", + "type":"string" + }, + { + "attribute":"name_ru", + "type":"string" + }, + { + "attribute":"name_zh", + "type":"string" + }, + { + "attribute":"name_pt", + "type":"string" + }, + { + "attribute":"name_ar", + "type":"string" + }, + { + "attribute":"parent", + "type":"string" + }, + { + "attribute":"code", + "type":"string" + }, + { + "attribute":"scalerank", + "type":"number", + "min":1, + "max":6, + "values":[ + 1, + 2, + 3, + 4, + 5, + 6 + ] + }, + { + "attribute":"type", + "type":"string", + "values":[ + "country", + "territory", + "disputed territory", + "sar" + ] + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"marine_label", + "geometry":"LineString", + "count":null, + "attributes":[ + { + "attribute":"name", + "type":"string" + }, + { + "attribute":"name_en", + "type":"string" + }, + { + "attribute":"name_fr", + "type":"string" + }, + { + "attribute":"name_de", + "type":"string" + }, + { + "attribute":"name_es", + "type":"string" + }, + { + "attribute":"name_ru", + "type":"string" + }, + { + "attribute":"name_zh", + "type":"string" + }, + { + "attribute":"name_pt", + "type":"string" + }, + { + "attribute":"name_ar", + "type":"string" + }, + { + "attribute":"labelrank", + "type":"number", + "min":1, + "max":6, + "values":[ + 1, + 2, + 3, + 4, + 5, + 6 + ] + }, + { + "attribute":"placement", + "type":"string", + "values":[ + "point", + "line" + ] + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"state_label", + "geometry":"Point", + "count":null, + "attributes":[ + { + "attribute":"name", + "type":"string" + }, + { + "attribute":"name_en", + "type":"string" + }, + { + "attribute":"name_fr", + "type":"string" + }, + { + "attribute":"name_de", + "type":"string" + }, + { + "attribute":"name_es", + "type":"string" + }, + { + "attribute":"name_ru", + "type":"string" + }, + { + "attribute":"name_zh", + "type":"string" + }, + { + "attribute":"name_pt", + "type":"string" + }, + { + "attribute":"name_ar", + "type":"string" + }, + { + "attribute":"abbr", + "type":"string" + }, + { + "attribute":"area", + "type":"number", + "min":0, + "max":2527923 + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"place_label", + "geometry":"Point", + "count":null, + "attributes":[ + { + "attribute":"name", + "type":"string" + }, + { + "attribute":"name_de", + "type":"string" + }, + { + "attribute":"name_en", + "type":"string" + }, + { + "attribute":"name_es", + "type":"string" + }, + { + "attribute":"name_fr", + "type":"string" + }, + { + "attribute":"name_ru", + "type":"string" + }, + { + "attribute":"name_zh", + "type":"string" + }, + { + "attribute":"name_zh-Hans", + "type":"string" + }, + { + "attribute":"name_pt", + "type":"string" + }, + { + "attribute":"name_ar", + "type":"string" + }, + { + "attribute":"localrank", + "type":"number", + "min":1, + "max":99 + }, + { + "attribute":"capital", + "type":"number", + "min":2, + "max":6, + "values":[ + 2, + 3, + 4, + 5, + 6 + ] + }, + { + "attribute":"ldir", + "type":"string", + "values":[ + "N", + "E", + "S", + "W", + "NE", + "SE", + "SW", + "NW" + ] + }, + { + "attribute":"scalerank", + "type":"number", + "min":0, + "max":9, + "values":[ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ] + }, + { + "attribute":"type", + "type":"string", + "values":[ + "city", + "town", + "village", + "hamlet", + "suburb", + "neighbourhood", + "island", + "islet", + "archipelago", + "residential", + "aboriginal_lands" + ] + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"water_label", + "geometry":"Point", + "count":null, + "attributes":[ + { + "attribute":"name", + "type":"string" + }, + { + "attribute":"name_de", + "type":"string" + }, + { + "attribute":"name_en", + "type":"string" + }, + { + "attribute":"name_es", + "type":"string" + }, + { + "attribute":"name_fr", + "type":"string" + }, + { + "attribute":"name_ru", + "type":"string" + }, + { + "attribute":"name_zh", + "type":"string" + }, + { + "attribute":"name_zh-Hans", + "type":"string" + }, + { + "attribute":"name_pt", + "type":"string" + }, + { + "attribute":"name_ar", + "type":"string" + }, + { + "attribute":"area", + "type":"number", + "min":0, + "max":999999999999 + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"airport_label", + "geometry":"Point", + "count":null, + "attributes":[ + { + "attribute":"name", + "type":"string" + }, + { + "attribute":"name_de", + "type":"string" + }, + { + "attribute":"name_en", + "type":"string" + }, + { + "attribute":"name_es", + "type":"string" + }, + { + "attribute":"name_fr", + "type":"string" + }, + { + "attribute":"name_ru", + "type":"string" + }, + { + "attribute":"name_zh", + "type":"string" + }, + { + "attribute":"name_zh-Hans", + "type":"string" + }, + { + "attribute":"name_pt", + "type":"string" + }, + { + "attribute":"name_ar", + "type":"string" + }, + { + "attribute":"maki", + "type":"string", + "values":[ + "airport", + "airfield", + "heliport", + "rocket" + ] + }, + { + "attribute":"ref", + "type":"string" + }, + { + "attribute":"scalerank", + "type":"number", + "min":1, + "max":4, + "values":[ + 1, + 2, + 3, + 4 + ] + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"rail_station_label", + "geometry":"Point", + "count":null, + "attributes":[ + { + "attribute":"name", + "type":"string" + }, + { + "attribute":"name_de", + "type":"string" + }, + { + "attribute":"name_en", + "type":"string" + }, + { + "attribute":"name_es", + "type":"string" + }, + { + "attribute":"name_fr", + "type":"string" + }, + { + "attribute":"name_ru", + "type":"string" + }, + { + "attribute":"name_zh", + "type":"string" + }, + { + "attribute":"name_zh-Hans", + "type":"string" + }, + { + "attribute":"name_pt", + "type":"string" + }, + { + "attribute":"name_ar", + "type":"string" + }, + { + "attribute":"maki", + "type":"string", + "values":[ + "rail", + "rail-metro", + "rail-light", + "entrance" + ] + }, + { + "attribute":"network", + "type":"string", + "values":[ + "barcelona-metro", + "boston-t", + "chongqing-rail-transit", + "de-s-bahn", + "de-s-bahn.de-u-bahn", + "de-u-bahn", + "delhi-metro", + "gb-national-rail", + "gb-national-rail.london-dlr", + "gb-national-rail.london-dlr.london-overground.london-tfl-rail.london-underground", + "gb-national-rail.london-dlr.london-overground.london-underground", + "gb-national-rail.london-dlr.london-underground", + "gb-national-rail.london-overground", + "gb-national-rail.london-overground.london-underground", + "gb-national-rail.london-overground.london-tfl-rail.london-underground", + "gb-national-rail.london-tfl-rail", + "gb-national-rail.london-tfl-rail.london-overground", + "gb-national-rail.london-tfl-rail.london-underground", + "gb-national-rail.london-underground", + "hong-kong-mtr", + "kiev-metro", + "london-dlr", + "london-dlr.london-tfl-rail", + "london-dlr.london-tfl-rail.london-underground", + "london-dlr.london-underground", + "london-overground", + "london-overground.london-tfl-rail", + "london-overground.london-tfl-rail.london-underground", + "london-overground.london-underground", + "london-tfl-rail", + "london-tfl-rail.london-underground", + "london-underground", + "madrid-metro", + "mexico-city-metro", + "milan-metro", + "moscow-metro", + "new-york-subway", + "osaka-subway", + "oslo-metro", + "paris-metro", + "paris-metro.paris-rer", + "paris-rer", + "paris-rer.paris-transilien", + "paris-transilien", + "philadelphia-septa", + "san-francisco-bart", + "singapore-mrt", + "stockholm-metro", + "taipei-metro", + "tokyo-metro", + "vienna-u-bahn", + "washington-metro", + "rail", + "rail-metro", + "rail-light", + "entrance" + ] + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"mountain_peak_label", + "geometry":"Point", + "count":null, + "attributes":[ + { + "attribute":"name", + "type":"string" + }, + { + "attribute":"name_de", + "type":"string" + }, + { + "attribute":"name_en", + "type":"string" + }, + { + "attribute":"name_es", + "type":"string" + }, + { + "attribute":"name_fr", + "type":"string" + }, + { + "attribute":"name_ru", + "type":"string" + }, + { + "attribute":"name_zh", + "type":"string" + }, + { + "attribute":"name_zh-Hans", + "type":"string" + }, + { + "attribute":"name_pt", + "type":"string" + }, + { + "attribute":"name_ar", + "type":"string" + }, + { + "attribute":"maki", + "type":"string", + "values":[ + "mountain", + "volcano" + ] + }, + { + "attribute":"elevation_ft", + "type":"number", + "min":0, + "max":30000 + }, + { + "attribute":"elevation_m", + "type":"number", + "min":0, + "max":9144 + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"poi_label", + "geometry":"Point", + "count":null, + "attributes":[ + { + "attribute":"ref", + "type":"string" + }, + { + "attribute":"name", + "type":"string" + }, + { + "attribute":"name_de", + "type":"string" + }, + { + "attribute":"name_en", + "type":"string" + }, + { + "attribute":"name_es", + "type":"string" + }, + { + "attribute":"name_fr", + "type":"string" + }, + { + "attribute":"name_ru", + "type":"string" + }, + { + "attribute":"name_zh", + "type":"string" + }, + { + "attribute":"name_zh-Hans", + "type":"string" + }, + { + "attribute":"name_pt", + "type":"string" + }, + { + "attribute":"name_ar", + "type":"string" + }, + { + "attribute":"localrank", + "type":"number", + "min":1, + "max":99 + }, + { + "attribute":"maki", + "type":"string", + "values":[ + "alcohol-shop", + "amusement-park", + "aquarium", + "art-gallery", + "attraction", + "bakery", + "bank", + "bar", + "beer", + "bicycle", + "bicycle-share", + "bus", + "cafe", + "car", + "castle", + "campsite", + "cemetery", + "cinema", + "clothing-store", + "college", + "dentist", + "doctor", + "dog-park", + "drinking-water", + "embassy", + "fast-food", + "ferry", + "fire-station", + "fuel", + "garden", + "golf", + "grocery", + "harbor", + "hospital", + "ice-cream", + "information", + "laundry", + "library", + "lodging", + "marker", + "monument", + "museum", + "music", + "park", + "pharmacy", + "picnic-site", + "place-of-worship", + "playground", + "religious-christian", + "religious-jewish", + "religious-muslim", + "police", + "post", + "prison", + "restaurant", + "school", + "shop", + "stadium", + "swimming", + "theatre", + "toilet", + "town-hall", + "suitcase", + "veterinary", + "zoo" + ] + }, + { + "attribute":"type", + "type":"string", + "values":[ + "Alcohol", + "Wine", + "Bakery", + "Bank", + "Bar", + "Nightclub", + "Biergarten", + "Bicycle", + "Bicycle Rental", + "Bus Station", + "Cafe", + "Car", + "Camp Site", + "Caravan Sit", + "Cemetery", + "Graveyard", + "Cinema", + "Clothes", + "Botique", + "College", + "University", + "Dog Park", + "Embassy", + "Fast Food", + "Ferry Terminal", + "Fire Station", + "Fuel", + "Florist", + "Garden Centre", + "Garden", + "Golf Course", + "Grocery", + "Supermarket", + "Convenience", + "Market", + "Greengrocer", + "Harbour", + "Marina", + "Hospital", + "Laundry", + "Library", + "Hotel", + "Hostel", + "Motel", + "Guest House", + "Alpine Hut", + "Monument", + "Museum", + "Music", + "Park", + "Nature Reserve", + "Common", + "Viewpoint", + "Picnic Site", + "Village Green", + "Conservation", + "Park", + "Wood", + "Forest", + "National Park", + "Forest", + "Photo", + "Camera", + "Photo Studio", + "Place Of Worship", + "Bed And Breakfast", + "Police", + "Post Office", + "Prison", + "Restaurant", + "School", + "Kindergarten", + "Mall", + "Shoes", + "Department Store", + "Chemist", + "Jewelery", + "Gift", + "Toys", + "Stationary", + "Variety Store", + "Outdoor", + "Boutique", + "Fabric", + "General", + "Second Hand", + "Antiques", + "Frame", + "Books", + "Electronic", + "Swimming Pool", + "Theatre", + "Townhall", + "Public Building", + "Courthouse", + "Community Centre", + "Travel Agency", + "Zoo", + "Boat Storage", + "Bureau De Change", + "Car Wash", + "Clinic", + "Community Centre", + "Dentist", + "Doctors", + "Driving School", + "Ice Cream", + "Marketplace", + "Nursing Home", + "Social Facility", + "Veterinar", + "Conservation", + "Military", + "Quarry", + "Garden", + "Playground", + "Recreation Ground", + "Sports Centre", + "Stadium", + "Aquarium", + "Attraction", + "Chalet", + "Picnic Site", + "Resort", + "Theme Park", + "Viewpoint", + "Archaeological Site", + "Battlefield", + "Castle", + "Fort", + "Palace", + "Ruins", + "Ship", + "Tomb", + "Wreck", + "Beach", + "Glacier", + "Marsh", + "Wetland", + "Terrace", + "Shed", + "Retail", + "Greenhouse", + "Hairdresser", + "Car Repair", + "Car", + "Butcher", + "Mall", + "Furniture", + "Company", + "Government", + "Estate Agent", + "Insurance" + ] + }, + { + "attribute":"scalerank", + "type":"number", + "min":1, + "max":5, + "values":[ + 1, + 2, + 3, + 4, + 5 + ] + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"motorway_junction", + "geometry":"Point", + "count":null, + "attributes":[ + { + "attribute":"ref", + "type":"string" + }, + { + "attribute":"reflen", + "type":"number", + "min":0, + "max":9 + }, + { + "attribute":"name", + "type":"string" + }, + { + "attribute":"class", + "type":"string", + "values":[ + "motorway", + "motorway_link", + "trunk", + "primary", + "secondary", + "tertiary", + "link", + "street", + "street_limited", + "pedestrian", + "construction", + "track", + "service", + "ferry", + "path" + ] + }, + { + "attribute":"type", + "type":"string", + "values":[ + "motorway", + "motorway_link", + "trunk", + "primary", + "secondary", + "tertiary", + "trunk_link", + "primary_link", + "secondary_link", + "tertiary_link", + "residential", + "unclassified", + "road", + "living_street", + "raceway", + "pedestrian", + "platform", + "construction:motorway", + "construction:motorway_link", + "construction:trunk", + "construction:trunk_link", + "construction:primary", + "construction:primary_link", + "construction:secondary", + "construction:secondary_link", + "construction:tertiary", + "construction:tertiary_link", + "construction:unclassified", + "construction:residential", + "construction:road", + "construction:living_street", + "construction:pedestrian", + "construction", + "track:grade1", + "track:grade2", + "track:grade3", + "track:grade4", + "track:grade5", + "track", + "service:alley", + "service:emergency_access", + "service:drive_through", + "service:driveway", + "service:parking_aisle", + "service", + "ferry", + "ferry_auto", + "steps", + "corridor", + "sidewalk", + "crossing", + "piste", + "mountain_bike", + "hiking", + "trail", + "cycleway", + "footway", + "path", + "bridleway" + ] + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"road_label", + "geometry":null, + "count":null, + "attributes":[ + { + "attribute":"name", + "type":"string" + }, + { + "attribute":"name_de", + "type":"string" + }, + { + "attribute":"name_en", + "type":"string" + }, + { + "attribute":"name_es", + "type":"string" + }, + { + "attribute":"name_fr", + "type":"string" + }, + { + "attribute":"name_ru", + "type":"string" + }, + { + "attribute":"name_zh", + "type":"string" + }, + { + "attribute":"name_zh-Hans", + "type":"string" + }, + { + "attribute":"name_pt", + "type":"string" + }, + { + "attribute":"name_ar", + "type":"string" + }, + { + "attribute":"len", + "type":"number", + "min":0, + "max":99 + }, + { + "attribute":"iso_3166_2", + "type":"string" + }, + { + "attribute":"localrank", + "type":"number", + "min":0, + "max":99 + }, + { + "attribute":"class", + "type":"string", + "values":[ + "motorway", + "motorway_link", + "trunk", + "primary", + "secondary", + "tertiary", + "link", + "street", + "street_limited", + "pedestrian", + "construction", + "track", + "service", + "ferry", + "path", + "major_rail", + "minor_rail", + "aerialway", + "golf", + "turning_circle", + "mini_roundabout", + "turnng_loop", + "traffic_signals" + ] + }, + { + "attribute":"ref", + "type":"string" + }, + { + "attribute":"reflen", + "type":"number", + "min":0, + "max":9 + }, + { + "attribute":"shield", + "type":"string", + "values":[ + "default", + "at-motorway", + "at-expressway", + "at-state-b", + "br-federal", + "br-state", + "bg-motorway", + "bg-national", + "hr-motorway", + "hr-state", + "hr-county", + "cz-motorway", + "cz-expressway", + "cz-road", + "dk-primary", + "dk-secondary", + "fi-main", + "fi-trunk", + "fi-regional", + "de-motorway", + "de-federal", + "gr-motorway", + "gr-national", + "hu-motorway", + "hu-main", + "in-national", + "in-state", + "nz-state", + "pe-national", + "pe-regional", + "pl-motorway", + "pl-expressway", + "pl-national", + "pl-voivodeship", + "ro-motorway", + "ro-national", + "ro-county", + "ro-communal", + "rs-motorway", + "rs-state-1b", + "rs-state-2a", + "rs-state-2b", + "sk-highway", + "sk-road", + "si-motorway", + "si-expressway", + "si-main", + "za-national", + "za-provincial", + "za-regional", + "za-metropolitan", + "se-main", + "ch-motorway", + "ch-main", + "mx-federal", + "mx-state", + "us-highway", + "us-highway-alternate", + "us-highway-business", + "us-highway-bypass", + "us-highway-duplex", + "us-interstate", + "us-interstate-business", + "us-interstate-duplex", + "us-interstate-truck", + "us-state", + "e-road" + ] + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"waterway_label", + "geometry":"LineString", + "count":null, + "attributes":[ + { + "attribute":"name", + "type":"string" + }, + { + "attribute":"name_de", + "type":"string" + }, + { + "attribute":"name_en", + "type":"string" + }, + { + "attribute":"name_es", + "type":"string" + }, + { + "attribute":"name_fr", + "type":"string" + }, + { + "attribute":"name_ru", + "type":"string" + }, + { + "attribute":"name_zh", + "type":"string" + }, + { + "attribute":"name_zh-Hans", + "type":"string" + }, + { + "attribute":"name_pt", + "type":"string" + }, + { + "attribute":"name_ar", + "type":"string" + }, + { + "attribute":"class", + "type":"string", + "values":[ + "river", + "canal", + "stream", + "stream_intermittent", + "drain", + "ditch" + ] + }, + { + "attribute":"type", + "type":"string", + "values":[ + "river", + "canal", + "stream", + "drain", + "ditch" + ] + } + ] + }, + { + "account":"mapbox", + "tilesetid":"mapbox.mapbox-streets-v7", + "layer":"housenum_label", + "geometry":"Point", + "count":null, + "attributes":[ + { + "attribute":"house_num", + "type":"string" + } + ] + } + ] +} \ No newline at end of file diff --git a/Unity/DataContainers/streets-v7-stats.json.meta b/Unity/DataContainers/streets-v7-stats.json.meta new file mode 100644 index 0000000..96d26f5 --- /dev/null +++ b/Unity/DataContainers/streets-v7-stats.json.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 575f56052354f4672bed93408ec3e403 +timeCreated: 1530664790 +licenseType: Pro +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor.meta b/Unity/Editor.meta new file mode 100644 index 0000000..630b920 --- /dev/null +++ b/Unity/Editor.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 7910a23e9d0cc47fc9fb15102d280728 +folderAsset: yes +timeCreated: 1480532369 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/AddMonoBehavioursModifierDrawer.cs b/Unity/Editor/AddMonoBehavioursModifierDrawer.cs new file mode 100644 index 0000000..27c1ce4 --- /dev/null +++ b/Unity/Editor/AddMonoBehavioursModifierDrawer.cs @@ -0,0 +1,56 @@ +namespace Mapbox.Editor +{ + using Mapbox.Unity.MeshGeneration.Modifiers; + using UnityEditor; + using UnityEngine; + + [CustomPropertyDrawer(typeof(AddMonoBehavioursModifierType))] + class AddMonoBehavioursModifierDrawer : PropertyDrawer + { + const int _offset = 40; + MonoScript _monoscript; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, label, property); + + position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); + var scriptRect = new Rect(position.x, position.y, position.width, position.height - _offset); + var helpRect = new Rect(position.x, position.y + _offset / 2, position.width, _offset); + var typeStringProperty = property.FindPropertyRelative("_typeString"); + var monoscriptProperty = property.FindPropertyRelative("_script"); + + EditorGUI.BeginChangeCheck(); + + _monoscript = monoscriptProperty.objectReferenceValue as MonoScript; + _monoscript = EditorGUI.ObjectField(scriptRect, _monoscript, typeof(MonoScript), false) as MonoScript; + + if (EditorGUI.EndChangeCheck()) + { + var type = _monoscript.GetClass(); + if (type != null && type.IsSubclassOf(typeof(MonoBehaviour))) + { + monoscriptProperty.objectReferenceValue = _monoscript; + typeStringProperty.stringValue = _monoscript.GetClass().ToString(); + } + else + { + monoscriptProperty.objectReferenceValue = null; + typeStringProperty.stringValue = ""; + } + } + + if (monoscriptProperty.objectReferenceValue == null) + { + EditorGUI.HelpBox(helpRect, "Selected object is not a MonoBehaviour!", MessageType.Error); + } + + EditorGUI.EndProperty(); + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return base.GetPropertyHeight(property, label) + _offset; + } + } +} \ No newline at end of file diff --git a/Unity/Editor/AddMonoBehavioursModifierDrawer.cs.meta b/Unity/Editor/AddMonoBehavioursModifierDrawer.cs.meta new file mode 100644 index 0000000..c5bfdfe --- /dev/null +++ b/Unity/Editor/AddMonoBehavioursModifierDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 46a3e6ae0815b434c88985c91af9364d +timeCreated: 1499902265 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/AtlasTemplateGenerator.cs b/Unity/Editor/AtlasTemplateGenerator.cs new file mode 100644 index 0000000..aa7f39e --- /dev/null +++ b/Unity/Editor/AtlasTemplateGenerator.cs @@ -0,0 +1,339 @@ +using UnityEngine; +using UnityEditor; +using System.Collections; +using System.Collections.Generic; +using Mapbox.Unity.MeshGeneration.Data; +using System.IO; + +namespace Mapbox.Editor +{ + + class AtlasTemplateGenerator : EditorWindow + { + [MenuItem("Mapbox/Atlas Template Generator")] + public static void ShowWindow() + { + EditorWindow.GetWindow(typeof(AtlasTemplateGenerator)); + } + + public class PixelRect + { + public int x; + public int y; + + public int xx; + public int yy; + } + + public string m_saveFileName = "AtlasTemplate"; + + public Texture2D m_texture; + + public AtlasInfo m_atlasInfo; + + public Color[] m_colors; + + public int m_textureResolution = 2048; + + public bool m_generateFacadesTemplate = true; + public bool m_generateRoofsTemplate = false; + + private int _drawCount; + + private const int _DEFAULT_TEX_SIZE = 2048; + private const int _MIN_TEX_SIZE = 512; + private const int _MAX_TEX_SIZE = 2048; + + private const float _cellRatioMargin = 0.01f; + + private void Awake() + { + CreateTexture(); + } + + private void CreateTexture() + { + m_texture = new Texture2D(m_textureResolution, m_textureResolution, TextureFormat.ARGB32, false); + m_texture.filterMode = FilterMode.Point; + } + + void OnGUI() + { + GUILayout.Space(20); + + GUIStyle titleStyle = new GUIStyle(EditorStyles.label); + + titleStyle.fontSize = 32; + titleStyle.normal.textColor = Color.white; + titleStyle.fontStyle = FontStyle.Bold; + + titleStyle.stretchWidth = true; + titleStyle.stretchHeight = true; + + titleStyle.alignment = TextAnchor.MiddleCenter; + + GUILayout.BeginVertical(); + + EditorGUILayout.LabelField("Mapbox Atlas Template Generator", titleStyle, GUILayout.Height(100)); + + GUILayout.BeginHorizontal(); + GUILayout.BeginVertical(GUILayout.MinWidth(200), GUILayout.MaxWidth(300)); + + EditorGUI.BeginChangeCheck(); + + EditorGUI.indentLevel++; + + m_atlasInfo = EditorGUILayout.ObjectField("Atlas info:", m_atlasInfo, typeof(AtlasInfo), true) as Mapbox.Unity.MeshGeneration.Data.AtlasInfo; + + EditorGUILayout.Space(); + + m_generateFacadesTemplate = EditorGUILayout.Toggle("Create Facades", m_generateFacadesTemplate); + m_generateRoofsTemplate = EditorGUILayout.Toggle("Create Roofs", m_generateRoofsTemplate); + + if (EditorGUI.EndChangeCheck()) + { + if (m_atlasInfo != null) + { + int facadeCount = m_generateFacadesTemplate ? m_atlasInfo.Textures.Count : 0; + int roofCount = m_generateRoofsTemplate ? m_atlasInfo.Roofs.Count : 0; + + int textureCount = facadeCount + roofCount; + + m_colors = new Color[textureCount]; + + float hueIncrement = (float)1.0f / textureCount; + float hue = 0.0f; + + for (int i = 0; i < textureCount; i++) + { + m_colors[i] = Color.HSVToRGB(hue, 1.0f, 1.0f); + hue += hueIncrement; + } + } + else + { + m_colors = new Color[0]; + CreateTexture(); + } + } + + EditorGUI.BeginChangeCheck(); + + m_textureResolution = Mathf.Clamp(EditorGUILayout.IntField("Texture resolution:", m_textureResolution), _MIN_TEX_SIZE, _MAX_TEX_SIZE); + + if (EditorGUI.EndChangeCheck()) + { + CreateTexture(); + } + + EditorGUILayout.Space(); + + if (m_colors != null) + { + for (int i = 0; i < m_colors.Length; i++) + { + string colorFieldName = string.Format("Color {0}", i); + m_colors[i] = EditorGUILayout.ColorField(colorFieldName, m_colors[i]); + } + } + + if (GUILayout.Button("Generate Template")) + { + if (m_atlasInfo == null) + { + EditorUtility.DisplayDialog("Atlas Template Generator", "Error: No AtlasInfo object selected.", "Ok"); + return; + } + if (!m_generateFacadesTemplate && !m_generateRoofsTemplate) + { + EditorUtility.DisplayDialog("Atlas Template Generator", "Error: Template generation requires Create Facades and/or Create Roofs to be enabled.", "Ok"); + return; + } + GenerateTemplate(); + } + + EditorGUILayout.Space(); + + if (GUILayout.Button("Save to file")) + { + SaveTextureAsPNG(); + } + + EditorGUI.indentLevel--; + + GUILayout.EndVertical(); + + GUIStyle boxStyle = new GUIStyle(); + + boxStyle.alignment = TextAnchor.UpperLeft; + + GUILayout.Box(m_texture, boxStyle, GUILayout.Width(300), GUILayout.Height(300), GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); + + GUILayout.EndHorizontal(); + GUILayout.EndVertical(); + + GUILayout.Space(20); + } + + private int GetPixelCoorFromAtlasRatio(float ratio) + { + return (int)(m_textureResolution * ratio); + } + + private PixelRect ConvertUVRectToPixelRect(Rect atlasRect) + { + PixelRect pixelRect = new PixelRect(); + pixelRect.x = GetPixelCoorFromAtlasRatio(atlasRect.x); + pixelRect.y = GetPixelCoorFromAtlasRatio(atlasRect.y); + pixelRect.xx = GetPixelCoorFromAtlasRatio(atlasRect.x + atlasRect.width); + pixelRect.yy = GetPixelCoorFromAtlasRatio(atlasRect.y + atlasRect.height); + return pixelRect; + } + + private void DrawRect(PixelRect pr, Color color) + { + for (int i = pr.x; i < pr.xx; i++) + { + for (int j = pr.y; j < pr.yy; j++) + { + m_texture.SetPixel(i, j, color); + } + } + } + + private void DrawWatermark(int x, int y) + { + m_texture.SetPixel(x, y, Color.black); + m_texture.SetPixel(x + 3, y, Color.black); + m_texture.SetPixel(x, y + 3, Color.black); + m_texture.SetPixel(x + 3, y + 3, Color.black); + + m_texture.SetPixel(x + 1, y + 1, Color.black); + m_texture.SetPixel(x + 2, y + 1, Color.black); + m_texture.SetPixel(x + 1, y + 2, Color.black); + m_texture.SetPixel(x + 2, y + 2, Color.black); + } + + private void DrawCornerWatermarks(PixelRect pr) + { + DrawWatermark(pr.x, pr.y); + DrawWatermark(pr.xx - 4, pr.y); + DrawWatermark(pr.x, pr.yy - 4); + DrawWatermark(pr.xx - 4, pr.yy - 4); + } + + private void DrawDebugCross(PixelRect pr) + { + int centerX = (pr.x + pr.xx) / 2; + int centerY = (pr.y + pr.yy) / 2; + + m_texture.SetPixel(centerX, centerY, Color.black); + + for (int x = pr.x; x < pr.xx; x++) + { + m_texture.SetPixel(x, centerY, Color.black); + m_texture.SetPixel(x, centerY - 1, Color.black); + m_texture.SetPixel(x, centerY + 1, Color.black); + } + + for (int y = pr.y; y < pr.yy; y++) + { + m_texture.SetPixel(centerX, y, Color.black); + m_texture.SetPixel(centerX - 1, y, Color.black); + m_texture.SetPixel(centerX + 1, y, Color.black); + } + } + + private void DrawAtlasEntityData(List aeList) + { + for (int i = 0; i < aeList.Count; i++) + { + AtlasEntity ae = aeList[i]; + + Rect baseRect = ae.TextureRect; + + float topRatio = ae.TopSectionRatio * baseRect.height; + float bottomRatio = ae.BottomSectionRatio * baseRect.height; + float middleRatio = baseRect.height - (topRatio + bottomRatio); + + Rect groundFloorRect = new Rect(baseRect.x, baseRect.y, baseRect.width, bottomRatio); + Rect topFloorRect = new Rect(baseRect.x, baseRect.y + baseRect.height - topRatio, baseRect.width, topRatio); + + PixelRect basePixelRect = ConvertUVRectToPixelRect(baseRect); + PixelRect groundFloorPixelRect = ConvertUVRectToPixelRect(groundFloorRect); + PixelRect topFloorPixelRect = ConvertUVRectToPixelRect(topFloorRect); + + Color color = m_colors[_drawCount]; + Color colorLight = (color + Color.white) / 2; + Color colorDark = (color + Color.black) / 2; + + DrawRect(basePixelRect, color); + DrawRect(groundFloorPixelRect, colorLight); + DrawRect(topFloorPixelRect, colorDark); + + DrawDebugCross(groundFloorPixelRect); + DrawDebugCross(topFloorPixelRect); + + int numColumns = (int)ae.ColumnCount; + int numMidFloors = ae.MidFloorCount; + + float colWidth = baseRect.width / numColumns; + float floorHeight = middleRatio / numMidFloors; + + float midFloorBase = baseRect.y + bottomRatio; + + float mrgn = _cellRatioMargin; + float halfMrgn = mrgn / 2; + + for (int j = 0; j < numMidFloors; j++) + { + float floorStart = midFloorBase + (floorHeight * j); + + for (int k = 0; k < numColumns; k++) + { + float columnStart = baseRect.x + (colWidth * k); + + Rect cellRect = new Rect(columnStart + halfMrgn, floorStart + halfMrgn, colWidth - mrgn, floorHeight - mrgn); + PixelRect cellPixelRect = ConvertUVRectToPixelRect(cellRect); + + DrawRect(cellPixelRect, Color.white); + DrawDebugCross(cellPixelRect); + } + } + DrawCornerWatermarks(groundFloorPixelRect); + DrawCornerWatermarks(topFloorPixelRect); + _drawCount++; + } + } + + public void GenerateTemplate() + { + _drawCount = 0; + if (m_generateFacadesTemplate) + { + DrawAtlasEntityData(m_atlasInfo.Textures); + } + if (m_generateRoofsTemplate) + { + DrawAtlasEntityData(m_atlasInfo.Roofs); + } + m_texture.Apply(); + } + + public void SaveTextureAsPNG() + { + var path = EditorUtility.SaveFilePanel("Save texture as PNG", "Assets", "AtlasTemplate.png", "png"); + if (path.Length == 0) + { + return; + } + byte[] pngData = m_texture.EncodeToPNG(); + if (pngData != null) + { + File.WriteAllBytes(path, pngData); + Debug.Log(pngData.Length / 1024 + "Kb was saved as: " + path); + AssetDatabase.Refresh(); + } + } + } +} \ No newline at end of file diff --git a/Unity/Editor/AtlasTemplateGenerator.cs.meta b/Unity/Editor/AtlasTemplateGenerator.cs.meta new file mode 100644 index 0000000..21bcf61 --- /dev/null +++ b/Unity/Editor/AtlasTemplateGenerator.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: cc814d64f35ad4f1bbce68318166b67e +timeCreated: 1520544854 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/Build.meta b/Unity/Editor/Build.meta new file mode 100644 index 0000000..17939ad --- /dev/null +++ b/Unity/Editor/Build.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 28d2b990a838d44e1b28195d8465d645 +folderAsset: yes +timeCreated: 1495491662 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/Build/Mapbox_iOS_build.cs b/Unity/Editor/Build/Mapbox_iOS_build.cs new file mode 100644 index 0000000..fd502c4 --- /dev/null +++ b/Unity/Editor/Build/Mapbox_iOS_build.cs @@ -0,0 +1,48 @@ +#if UNITY_IOS +namespace Mapbox.Editor.Build +{ + using UnityEngine; + using UnityEditor; + using UnityEditor.Callbacks; + using UnityEditor.iOS.Xcode; + using System.IO; + using System.Linq; + using System.Text.RegularExpressions; + using System.Globalization; + + public class Mapbox_iOS_build : MonoBehaviour + { + [PostProcessBuild] + public static void AppendBuildProperty(BuildTarget buildTarget, string pathToBuiltProject) + { + if (buildTarget == BuildTarget.iOS) + { + PBXProject proj = new PBXProject(); + // path to pbxproj file + string projPath = pathToBuiltProject + "/Unity-iPhone.xcodeproj/project.pbxproj"; + + var file = File.ReadAllText(projPath); + proj.ReadFromString(file); +#if UNITY_2019_1_OR_NEWER + string target = proj.GetUnityFrameworkTargetGuid(); +#else + string target = proj.TargetGuidByName("Unity-iPhone"); +#endif + + var defaultIncludePath = "Mapbox/Core/Plugins/iOS/MapboxMobileEvents/include"; + var includePaths = Directory.GetDirectories(Application.dataPath, "include", SearchOption.AllDirectories); + var includePath = includePaths + .Select(path => Regex.Replace(path, Application.dataPath + "/", "")) + .Where(path => path.EndsWith(defaultIncludePath, true, CultureInfo.InvariantCulture)) + .DefaultIfEmpty(defaultIncludePath) + .First(); + + proj.AddBuildProperty(target, "HEADER_SEARCH_PATHS", "$(SRCROOT)/Libraries/" + includePath); + proj.AddBuildProperty(target, "OTHER_LDFLAGS", "-ObjC -lz"); + + File.WriteAllText(projPath, proj.WriteToString()); + } + } + } +} +#endif diff --git a/Unity/Editor/Build/Mapbox_iOS_build.cs.meta b/Unity/Editor/Build/Mapbox_iOS_build.cs.meta new file mode 100644 index 0000000..2d819c6 --- /dev/null +++ b/Unity/Editor/Build/Mapbox_iOS_build.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4ab2c6d9be5e048179de762cb9bf3cd1 +timeCreated: 1495323965 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/ClearFileCache.cs b/Unity/Editor/ClearFileCache.cs new file mode 100644 index 0000000..c6033fe --- /dev/null +++ b/Unity/Editor/ClearFileCache.cs @@ -0,0 +1,19 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + + [InitializeOnLoad] + public class ClearFileCache : MonoBehaviour + { + + + [MenuItem("Mapbox/Clear File Cache")] + public static void ClearAllCachFiles() + { + Unity.MapboxAccess.Instance.ClearAllCacheFiles(); + } + + + } +} diff --git a/Unity/Editor/ClearFileCache.cs.meta b/Unity/Editor/ClearFileCache.cs.meta new file mode 100644 index 0000000..1a96540 --- /dev/null +++ b/Unity/Editor/ClearFileCache.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 588d3a5d675244fc1a1d927b580b99a3 +timeCreated: 1497883479 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/EditorHelper.cs b/Unity/Editor/EditorHelper.cs new file mode 100644 index 0000000..032e60b --- /dev/null +++ b/Unity/Editor/EditorHelper.cs @@ -0,0 +1,289 @@ +namespace Mapbox.Editor +{ + using UnityEngine; + using UnityEditor; + using System; + using System.Collections.Generic; + using System.Linq; + using System.Reflection; + using Mapbox.Unity.Map; + using Mapbox.Unity.MeshGeneration.Data; + + /// + /// EditorHelper class provides methods for working with serialzed properties. + /// Methods in this class are based on the spacepuppy-unity-framework, available at the url below. + /// https://github.com/lordofduct/spacepuppy-unity-framework/tree/d8d592e212b26cad53264421d22c3d26c6799923/SpacepuppyBaseEditor. + /// + public static class EditorHelper + { + + [UnityEditor.Callbacks.DidReloadScripts] + private static void OnScriptsReloaded() + { + if (Application.isEditor) + { + AbstractMap abstractMap = UnityEngine.Object.FindObjectOfType(); + + if (abstractMap == null) + { + return; + } + + UnityTile[] unityTiles = abstractMap.GetComponentsInChildren(); + + for (int i = 0; i < unityTiles.Length; i++) + { + UnityEngine.Object.DestroyImmediate(unityTiles[i].gameObject); + } + + abstractMap.DestroyChildObjects(); + if (EditorApplication.isPlaying) + { + abstractMap.ResetMap(); + return; + } + if (abstractMap.IsEditorPreviewEnabled == true) + { + if (EditorApplication.isPlayingOrWillChangePlaymode) + { + return; + } + else + { + abstractMap.DisableEditorPreview(); + abstractMap.EnableEditorPreview(); + } + } + } + } + + + public static void CheckForModifiedProperty(SerializedProperty property, T targetObject, bool forceHasChanged = false) + { + MapboxDataProperty targetObjectAsDataProperty = GetMapboxDataPropertyObject(targetObject); + if (targetObjectAsDataProperty != null) + { + targetObjectAsDataProperty.HasChanged = forceHasChanged || property.serializedObject.ApplyModifiedProperties(); + } + } + + public static void CheckForModifiedProperty(SerializedProperty property, bool forceHasChanged = false) + { + CheckForModifiedProperty(property, GetTargetObjectOfProperty(property), forceHasChanged); + } + + public static MapboxDataProperty GetMapboxDataPropertyObject(T targetObject) + { + return targetObject as MapboxDataProperty; + } + + public static bool DidModifyProperty(SerializedProperty property, T targetObject) + { + MapboxDataProperty targetObjectAsDataProperty = targetObject as MapboxDataProperty; + return (property.serializedObject.ApplyModifiedProperties() && targetObjectAsDataProperty != null); + } + + public static bool DidModifyProperty(SerializedProperty property) + { + return DidModifyProperty(property, GetTargetObjectOfProperty(property)); + } + + public static IEnumerable GetChildren(this SerializedProperty property) + { + property = property.Copy(); + var nextElement = property.Copy(); + bool hasNextElement = nextElement.NextVisible(false); + if (!hasNextElement) + { + nextElement = null; + } + + property.NextVisible(true); + while (true) + { + if ((SerializedProperty.EqualContents(property, nextElement))) + { + yield break; + } + + yield return property; + + bool hasNext = property.NextVisible(false); + if (!hasNext) + { + break; + } + } + } + + public static System.Type GetTargetType(this SerializedObject obj) + { + if (obj == null) return null; + + if (obj.isEditingMultipleObjects) + { + var c = obj.targetObjects[0]; + return c.GetType(); + } + else + { + return obj.targetObject.GetType(); + } + } + + + /// + /// Gets the object the property represents. + /// + /// + /// + public static object GetTargetObjectOfProperty(SerializedProperty prop) + { + var path = prop.propertyPath.Replace(".Array.data[", "["); + object obj = prop.serializedObject.targetObject; + var elements = path.Split('.'); + foreach (var element in elements) + { + if (element.Contains("[")) + { + var elementName = element.Substring(0, element.IndexOf("[", StringComparison.CurrentCulture)); + var index = System.Convert.ToInt32(element.Substring(element.IndexOf("[", StringComparison.CurrentCulture)).Replace("[", "").Replace("]", "")); + obj = GetValue_Imp(obj, elementName, index); + } + else + { + obj = GetValue_Imp(obj, element); + } + } + return obj; + } + + public static void SetTargetObjectOfProperty(SerializedProperty prop, object value) + { + var path = prop.propertyPath.Replace(".Array.data[", "["); + object obj = prop.serializedObject.targetObject; + var elements = path.Split('.'); + foreach (var element in elements.Take(elements.Length - 1)) + { + if (element.Contains("[")) + { + var elementName = element.Substring(0, element.IndexOf("[", StringComparison.CurrentCulture)); + var index = System.Convert.ToInt32(element.Substring(element.IndexOf("[", StringComparison.CurrentCulture)).Replace("[", "").Replace("]", "")); + obj = GetValue_Imp(obj, elementName, index); + } + else + { + obj = GetValue_Imp(obj, element); + } + } + + if (System.Object.ReferenceEquals(obj, null)) return; + + try + { + var element = elements.Last(); + + if (element.Contains("[")) + { + var tp = obj.GetType(); + var elementName = element.Substring(0, element.IndexOf("[", StringComparison.CurrentCulture)); + var index = System.Convert.ToInt32(element.Substring(element.IndexOf("[", StringComparison.CurrentCulture)).Replace("[", "").Replace("]", "")); + var field = tp.GetField(elementName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); + var arr = field.GetValue(obj) as System.Collections.IList; + arr[index] = value; + } + else + { + var tp = obj.GetType(); + var field = tp.GetField(element, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); + if (field != null) + { + field.SetValue(obj, value); + } + } + + } + catch + { + return; + } + } + + + /// + /// Gets the object that the property is a member of + /// + /// + /// + public static object GetTargetObjectWithProperty(SerializedProperty prop) + { + var path = prop.propertyPath.Replace(".Array.data[", "["); + object obj = prop.serializedObject.targetObject; + var elements = path.Split('.'); + foreach (var element in elements.Take(elements.Length - 1)) + { + if (element.Contains("[")) + { + var elementName = element.Substring(0, element.IndexOf("[", StringComparison.CurrentCulture)); + var index = System.Convert.ToInt32(element.Substring(element.IndexOf("[", StringComparison.CurrentCulture)).Replace("[", "").Replace("]", "")); + obj = GetValue_Imp(obj, elementName, index); + } + else + { + obj = GetValue_Imp(obj, element); + } + } + return obj; + } + + private static object GetValue_Imp(object source, string name) + { + if (source == null) + return null; + var type = source.GetType(); + + while (type != null) + { + var f = type.GetField(name, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); + if (f != null) + return f.GetValue(source); + + var p = type.GetProperty(name, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase); + if (p != null) + return p.GetValue(source, null); + + type = type.BaseType; + } + return null; + } + + private static object GetValue_Imp(object source, string name, int index) + { + var enumerable = GetValue_Imp(source, name) as System.Collections.IEnumerable; + if (enumerable == null) return null; + var enm = enumerable.GetEnumerator(); + + for (int i = 0; i <= index; i++) + { + if (!enm.MoveNext()) return null; + } + return enm.Current; + } + + public static int GetChildPropertyCount(SerializedProperty property, bool includeGrandChildren = false) + { + var pstart = property.Copy(); + var pend = property.GetEndProperty(); + int cnt = 0; + + pstart.Next(true); + while (!SerializedProperty.EqualContents(pstart, pend)) + { + cnt++; + pstart.Next(includeGrandChildren); + } + + return cnt; + } + } +} \ No newline at end of file diff --git a/Unity/Editor/EditorHelper.cs.meta b/Unity/Editor/EditorHelper.cs.meta new file mode 100644 index 0000000..4a59f5e --- /dev/null +++ b/Unity/Editor/EditorHelper.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 7390a064088424109a975353ccf6e504 +timeCreated: 1536113196 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/FactoryEditor.cs b/Unity/Editor/FactoryEditor.cs new file mode 100644 index 0000000..bcb1306 --- /dev/null +++ b/Unity/Editor/FactoryEditor.cs @@ -0,0 +1,13 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using Mapbox.Unity.MeshGeneration.Factories; + + [CustomEditor(typeof(AbstractTileFactory))] + public class FactoryEditor : Editor + { + public override void OnInspectorGUI() + { + } + } +} \ No newline at end of file diff --git a/Unity/Editor/FactoryEditor.cs.meta b/Unity/Editor/FactoryEditor.cs.meta new file mode 100644 index 0000000..7333a38 --- /dev/null +++ b/Unity/Editor/FactoryEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a71b284f467d4de4584d5f813a75c7c0 +timeCreated: 1490923136 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/FeatureBehaviourEditor.cs b/Unity/Editor/FeatureBehaviourEditor.cs new file mode 100644 index 0000000..2811b09 --- /dev/null +++ b/Unity/Editor/FeatureBehaviourEditor.cs @@ -0,0 +1,27 @@ +namespace Mapbox.Editor +{ + using UnityEngine; + using UnityEditor; + using Mapbox.Unity.MeshGeneration.Components; + + [CustomEditor(typeof(FeatureBehaviour))] + public class FeatureBehaviourEditor : Editor + { + FeatureBehaviour _beh; + + public void OnEnable() + { + _beh = (FeatureBehaviour)target; + } + + public override void OnInspectorGUI() + { + DrawDefaultInspector(); + + if (GUILayout.Button("Show Properties")) + { + _beh.ShowDebugData(); + } + } + } +} \ No newline at end of file diff --git a/Unity/Editor/FeatureBehaviourEditor.cs.meta b/Unity/Editor/FeatureBehaviourEditor.cs.meta new file mode 100644 index 0000000..ec35ba6 --- /dev/null +++ b/Unity/Editor/FeatureBehaviourEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 54536e5537a66a842818be9fc7a7d6f3 +timeCreated: 1499870444 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/FeatureSectionMultiColumnHeader.cs b/Unity/Editor/FeatureSectionMultiColumnHeader.cs new file mode 100644 index 0000000..dcf6ec8 --- /dev/null +++ b/Unity/Editor/FeatureSectionMultiColumnHeader.cs @@ -0,0 +1,71 @@ +using System; +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEditor.IMGUI.Controls; + using UnityEngine; + internal class FeatureSectionMultiColumnHeader : MultiColumnHeader + { + Mode m_Mode; + + public enum Mode + { + LargeHeader, + DefaultHeader, + MinimumHeaderWithoutSorting + } + + public FeatureSectionMultiColumnHeader(MultiColumnHeaderState state) + : base(state) + { + mode = Mode.DefaultHeader; + } + + public Mode mode + { + get + { + return m_Mode; + } + set + { + m_Mode = value; + switch (m_Mode) + { + case Mode.LargeHeader: + canSort = true; + height = 37f; + break; + case Mode.DefaultHeader: + canSort = true; + height = DefaultGUI.defaultHeight; + break; + case Mode.MinimumHeaderWithoutSorting: + canSort = false; + height = DefaultGUI.minimumHeight; + break; + } + } + } + + protected override void ColumnHeaderGUI(MultiColumnHeaderState.Column column, Rect headerRect, int columnIndex) + { + // Default column header gui + base.ColumnHeaderGUI(column, headerRect, columnIndex); + + // Add additional info for large header + if (mode == Mode.LargeHeader) + { + // Show example overlay stuff on some of the columns + if (columnIndex > 2) + { + headerRect.xMax -= 3f; + var oldAlignment = EditorStyles.largeLabel.alignment; + EditorStyles.largeLabel.alignment = TextAnchor.UpperRight; + GUI.Label(headerRect, 36 + columnIndex + "%", EditorStyles.largeLabel); + EditorStyles.largeLabel.alignment = oldAlignment; + } + } + } + } +} \ No newline at end of file diff --git a/Unity/Editor/FeatureSectionMultiColumnHeader.cs.meta b/Unity/Editor/FeatureSectionMultiColumnHeader.cs.meta new file mode 100644 index 0000000..c12a8f2 --- /dev/null +++ b/Unity/Editor/FeatureSectionMultiColumnHeader.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 07bf8462a630d4aad95ad6e2fb8b2923 +timeCreated: 1530231284 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/FeatureSubLayerTreeView.cs b/Unity/Editor/FeatureSubLayerTreeView.cs new file mode 100644 index 0000000..e032ca0 --- /dev/null +++ b/Unity/Editor/FeatureSubLayerTreeView.cs @@ -0,0 +1,194 @@ +namespace Mapbox.Editor +{ + using System.Collections.Generic; + using UnityEngine; + using UnityEditor.IMGUI.Controls; + using UnityEditor; + using Mapbox.Unity.Map; + + internal class FeatureSubLayerTreeView : TreeViewWithTreeModel + { + public SerializedProperty Layers; + private float kToggleWidth = 18f; + public int uniqueId; + public static int uniqueIdPoI = 1000; + public static int uniqueIdFeature = 3000; + public int maxElementsAdded = 0; + + public bool hasChanged = false; + + const float kRowHeights = 15f; + const float nameOffset = 15f; + + MultiColumnHeaderState m_MultiColumnHeaderState; + private GUIStyle columnStyle = new GUIStyle() + { + alignment = TextAnchor.MiddleCenter, + normal = new GUIStyleState() { textColor = Color.white } + }; + + public FeatureSubLayerTreeView(TreeViewState state, MultiColumnHeader multicolumnHeader, TreeModel model, int uniqueIdentifier = 3000) : base(state, multicolumnHeader, model) + { + showAlternatingRowBackgrounds = true; + showBorder = true; + customFoldoutYOffset = (kRowHeights - EditorGUIUtility.singleLineHeight) * 0.5f; // center foldout in the row since we also center content. See RowGUI + extraSpaceBeforeIconAndLabel = kToggleWidth; + uniqueId = uniqueIdentifier; + Reload(); + } + + protected override bool CanRename(TreeViewItem item) + { + // Only allow rename if we can show the rename overlay with a certain width (label might be clipped by other columns) + Rect renameRect = GetRenameRect(treeViewRect, 0, item); + return renameRect.width > 30; + } + + protected override void RenameEnded(RenameEndedArgs args) + { + if (Layers == null || Layers.arraySize == 0) + { + return; + } + + if (args.acceptedRename) + { + var element = treeModel.Find(args.itemID); + element.name = string.IsNullOrEmpty(args.newName.Trim()) ? args.originalName : args.newName; + element.Name = string.IsNullOrEmpty(args.newName.Trim()) ? args.originalName : args.newName; + var layer = Layers.GetArrayElementAtIndex(args.itemID - uniqueId); + layer.FindPropertyRelative("coreOptions.sublayerName").stringValue = element.name; + Reload(); + } + } + + protected override Rect GetRenameRect(Rect rowRect, int row, TreeViewItem item) + { + Rect cellRect = GetCellRectForTreeFoldouts(rowRect); + cellRect.xMin = nameOffset; + CenterRectUsingSingleLineHeight(ref cellRect); + return base.GetRenameRect(cellRect, row, item); + } + + public void RemoveItemFromTree(int id) + { + treeModel.RemoveElements(new List() { id }); + } + + public void AddElementToTree(SerializedProperty subLayer) + { + var name = subLayer.FindPropertyRelative("coreOptions.sublayerName").stringValue; + var id = Layers.arraySize - 1 + uniqueId; + + if (treeModel.Find(id) != null) + { + Debug.Log(" found one. exiting"); + return; + } + + var type = ((PresetFeatureType)subLayer.FindPropertyRelative("presetFeatureType").enumValueIndex).ToString(); + FeatureTreeElement element = new FeatureTreeElement(name, 0, id); + element.Name = name; + element.Type = type; + treeModel.AddElement(element, treeModel.root, treeModel.numberOfDataElements - 1); + } + + protected override void RowGUI(RowGUIArgs args) + { + var rowItem = (TreeViewItem)args.item; + for (int i = 0; i < args.GetNumVisibleColumns(); ++i) + { + CellGUI(args.GetCellRect(i), rowItem, (FeatureSubLayerColumns)args.GetColumn(i), ref args); + } + } + + void CellGUI(Rect cellRect, TreeViewItem item, FeatureSubLayerColumns column, ref RowGUIArgs args) + { + // Center cell rect vertically (makes it easier to place controls, icons etc in the cells) + if (Layers == null || Layers.arraySize == 0) + { + return; + } + + if (Layers.arraySize <= args.item.id - uniqueId) + { + return; + } + + var layer = Layers.GetArrayElementAtIndex(args.item.id - uniqueId); + CenterRectUsingSingleLineHeight(ref cellRect); + if (column == FeatureSubLayerColumns.Name) + { + Rect toggleRect = cellRect; + toggleRect.x += GetContentIndent(item); + toggleRect.width = kToggleWidth; + + EditorGUI.BeginChangeCheck(); + item.data.isActive = layer.FindPropertyRelative("coreOptions.isActive").boolValue; + if (toggleRect.xMax < cellRect.xMax) + { + item.data.isActive = EditorGUI.Toggle(toggleRect, item.data.isActive); // hide when outside cell rect + } + layer.FindPropertyRelative("coreOptions.isActive").boolValue = item.data.isActive; + if (EditorGUI.EndChangeCheck()) + { + VectorSubLayerProperties vectorSubLayerProperties = (VectorSubLayerProperties)EditorHelper.GetTargetObjectOfProperty(layer); + EditorHelper.CheckForModifiedProperty(layer, vectorSubLayerProperties.coreOptions); + } + + cellRect.xMin += nameOffset; // Adding some gap between the checkbox and the name + args.rowRect = cellRect; + + layer.FindPropertyRelative("coreOptions.sublayerName").stringValue = item.data.Name; + //This draws the name property + base.RowGUI(args); + } + if (column == FeatureSubLayerColumns.Type) + { + cellRect.xMin += 15f; // Adding some gap between the checkbox and the name + + var typeString = ((PresetFeatureType)layer.FindPropertyRelative("presetFeatureType").intValue).ToString(); + item.data.Type = typeString; + EditorGUI.LabelField(cellRect, item.data.Type, columnStyle); + } + } + + // All columns + enum FeatureSubLayerColumns + { + Name, + Type + } + + public static MultiColumnHeaderState CreateDefaultMultiColumnHeaderState() + { + var columns = new[] + { + //Name column + new MultiColumnHeaderState.Column + { + headerContent = new GUIContent("Name"), + contextMenuText = "Name", + headerTextAlignment = TextAlignment.Center, + autoResize = true, + canSort = false, + allowToggleVisibility = false, + }, + + //Type column + new MultiColumnHeaderState.Column + { + headerContent = new GUIContent("Type"), + contextMenuText = "Type", + headerTextAlignment = TextAlignment.Center, + autoResize = true, + canSort = false, + allowToggleVisibility = false + } + }; + + var state = new MultiColumnHeaderState(columns); + return state; + } + } +} \ No newline at end of file diff --git a/Unity/Editor/FeatureSubLayerTreeView.cs.meta b/Unity/Editor/FeatureSubLayerTreeView.cs.meta new file mode 100644 index 0000000..32b2cc3 --- /dev/null +++ b/Unity/Editor/FeatureSubLayerTreeView.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 6959c2320c56c4d89be4ff0e9d2a1b73 +timeCreated: 1525818947 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/FeatureTreeElement.cs b/Unity/Editor/FeatureTreeElement.cs new file mode 100644 index 0000000..d809352 --- /dev/null +++ b/Unity/Editor/FeatureTreeElement.cs @@ -0,0 +1,18 @@ +namespace Mapbox.Editor +{ + using System; + using UnityEngine; + using Random = UnityEngine.Random; + [Serializable] + public class FeatureTreeElement : TreeElement + { + public string Name; + public string Type; + public bool isActive; + + public FeatureTreeElement(string name, int depth, int id) : base(name, depth, id) + { + isActive = true; + } + } +} diff --git a/Unity/Editor/FeatureTreeElement.cs.meta b/Unity/Editor/FeatureTreeElement.cs.meta new file mode 100644 index 0000000..bcf503a --- /dev/null +++ b/Unity/Editor/FeatureTreeElement.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: e5ff51a6bc84040388ff12a051e5a758 +timeCreated: 1530231284 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/GeocodeAttributeDrawer.cs b/Unity/Editor/GeocodeAttributeDrawer.cs new file mode 100644 index 0000000..ccf889e --- /dev/null +++ b/Unity/Editor/GeocodeAttributeDrawer.cs @@ -0,0 +1,34 @@ +namespace Mapbox.Editor +{ + using UnityEngine; + using UnityEditor; + using Mapbox.Unity.Utilities; + using Mapbox.Unity.Map; + + /// + /// Custom property drawer for geocodes + /// Includes a search window to enable search of Lat/Lon via geocoder. + /// Requires a Mapbox token be set for the project + /// + [CustomPropertyDrawer(typeof(GeocodeAttribute))] + public class GeocodeAttributeDrawer : PropertyDrawer + { + const string searchButtonContent = "Search"; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + float buttonWidth = EditorGUIUtility.singleLineHeight * 4; + + Rect fieldRect = new Rect(position.x, position.y, position.width - buttonWidth, EditorGUIUtility.singleLineHeight); + Rect buttonRect = new Rect(position.x + position.width - buttonWidth, position.y, buttonWidth, EditorGUIUtility.singleLineHeight); + + EditorGUI.PropertyField(fieldRect, property); + + if (GUI.Button(buttonRect, searchButtonContent)) + { + object objectToUpdate = EditorHelper.GetTargetObjectWithProperty(property); + GeocodeAttributeSearchWindow.Open(property, objectToUpdate); + } + } + } +} \ No newline at end of file diff --git a/Unity/Editor/GeocodeAttributeDrawer.cs.meta b/Unity/Editor/GeocodeAttributeDrawer.cs.meta new file mode 100644 index 0000000..7c97eed --- /dev/null +++ b/Unity/Editor/GeocodeAttributeDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 860c0aa37e7b91f49be4dbfdeb25951f +timeCreated: 1484134996 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/GeocodeAttributeSearchWindow.cs b/Unity/Editor/GeocodeAttributeSearchWindow.cs new file mode 100644 index 0000000..fe7d55c --- /dev/null +++ b/Unity/Editor/GeocodeAttributeSearchWindow.cs @@ -0,0 +1,184 @@ +namespace Mapbox.Editor +{ + using UnityEngine; + using UnityEditor; + using System; + using System.Collections.Generic; + using Mapbox.Geocoding; + using Mapbox.Unity; + using System.Globalization; + using Mapbox.Unity.Map; + using Mapbox.Editor; + + public class GeocodeAttributeSearchWindow : EditorWindow + { + SerializedProperty _coordinateProperty; + object _objectToUpdate; + + private bool _updateAbstractMap; + + string _searchInput = ""; + + ForwardGeocodeResource _resource; + + List _features; + + System.Action _callback; + + const string searchFieldName = "searchField"; + const float width = 320f; + const float height = 300f; + + bool _isSearching = false; + + void OnEnable() + { + _resource = new ForwardGeocodeResource(""); + EditorApplication.playModeStateChanged += OnModeChanged; + } + + void OnDisable() + { + EditorApplication.playModeStateChanged -= OnModeChanged; + } + + bool hasSetFocus = false; + + public static void Open(SerializedProperty property, object objectToUpdate = null) + { + GeocodeAttributeSearchWindow window = EditorWindow.GetWindow(true, "Search for location"); + + window._coordinateProperty = property; + if (objectToUpdate != null) + { + window._objectToUpdate = objectToUpdate; + } + + Event e = Event.current; + Vector2 mousePos = GUIUtility.GUIToScreenPoint(e.mousePosition); + + window.position = new Rect(mousePos.x - width, mousePos.y, width, height); + } + + void OnModeChanged(PlayModeStateChange state) + { + Close(); + } + + void OnGUI() + { + GUILayout.Label("Search for a location"); + + string oldSearchInput = _searchInput; + + GUI.SetNextControlName(searchFieldName); + _searchInput = GUILayout.TextField(_searchInput); + + if (_searchInput.Length == 0) + { + GUILayout.Label("Type in a location to find it's latitude and longtitude"); + } + else + { + bool changed = oldSearchInput != _searchInput; + if (changed) + { + HandleUserInput(_searchInput); + } + + if (_features.Count > 0) + { + GUILayout.Label("Results:"); + for (int i = 0; i < _features.Count; i++) + { + Feature feature = _features[i]; + string coordinates = feature.Center.x.ToString(CultureInfo.InvariantCulture) + ", " + + feature.Center.y.ToString(CultureInfo.InvariantCulture); + + //abreviated coords for display in the UI + string truncatedCoordinates = feature.Center.x.ToString("F2", CultureInfo.InvariantCulture) + ", " + + feature.Center.y.ToString("F2", CultureInfo.InvariantCulture); + + //split feature name and add elements until the maxButtonContentLenght is exceeded + string[] featureNameSplit = feature.PlaceName.Split(','); + string buttonContent = ""; + int maxButtonContentLength = 30; + for (int j = 0; j < featureNameSplit.Length; j++) + { + if(buttonContent.Length + featureNameSplit[j].Length < maxButtonContentLength) + { + if(String.IsNullOrEmpty(buttonContent)) + { + buttonContent = featureNameSplit[j]; + } + else + { + buttonContent = buttonContent + "," + featureNameSplit[j]; + } + } + } + + if (buttonContent.Length < maxButtonContentLength + 15) + { + buttonContent = buttonContent + "," + " (" + truncatedCoordinates + ")"; + } + + + if (GUILayout.Button(buttonContent)) + { + _coordinateProperty.stringValue = coordinates; + _coordinateProperty.serializedObject.ApplyModifiedProperties(); + EditorUtility.SetDirty(_coordinateProperty.serializedObject.targetObject); + + if(_objectToUpdate != null) + { + EditorHelper.CheckForModifiedProperty(_coordinateProperty, _objectToUpdate, true); + } + Close(); + } + } + } + else + { + if (_isSearching) + GUILayout.Label("Searching..."); + else + GUILayout.Label("No search results"); + } + } + + if (!hasSetFocus) + { + GUI.FocusControl(searchFieldName); + hasSetFocus = true; + } + } + + void HandleUserInput(string searchString) + { + _features = new List(); + _isSearching = true; + + if (!string.IsNullOrEmpty(searchString)) + { + _resource.Query = searchString; + MapboxAccess.Instance.Geocoder.Geocode(_resource, HandleGeocoderResponse); + } + } + + void HandleGeocoderResponse(ForwardGeocodeResponse res) + { + //null if no internet connection + if (res != null) + { + //null if invalid token + if (res.Features != null) + { + _features = res.Features; + } + } + _isSearching = false; + this.Repaint(); + } + } +} diff --git a/Unity/Editor/GeocodeAttributeSearchWindow.cs.meta b/Unity/Editor/GeocodeAttributeSearchWindow.cs.meta new file mode 100644 index 0000000..3b60faf --- /dev/null +++ b/Unity/Editor/GeocodeAttributeSearchWindow.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d99190dd95ea8a245ba1f7c8c3084d0a +timeCreated: 1484136312 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/LayerModifierEditor.cs b/Unity/Editor/LayerModifierEditor.cs new file mode 100644 index 0000000..44b5d75 --- /dev/null +++ b/Unity/Editor/LayerModifierEditor.cs @@ -0,0 +1,33 @@ +namespace Mapbox.Editor +{ + using UnityEngine; + using UnityEditor; + using Mapbox.Unity.MeshGeneration.Modifiers; + + [CustomEditor(typeof(LayerModifier))] + public class LayerModifierEditor : Editor + { + public SerializedProperty layerId_Prop; + private MonoScript script; + + void OnEnable() + { + layerId_Prop = serializedObject.FindProperty("_layerId"); + + script = MonoScript.FromScriptableObject((LayerModifier)target); + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + + GUI.enabled = false; + script = EditorGUILayout.ObjectField("Script", script, typeof(MonoScript), false) as MonoScript; + GUI.enabled = true; + + layerId_Prop.intValue = EditorGUILayout.LayerField("Layer", layerId_Prop.intValue); + + serializedObject.ApplyModifiedProperties(); + } + } +} \ No newline at end of file diff --git a/Unity/Editor/LayerModifierEditor.cs.meta b/Unity/Editor/LayerModifierEditor.cs.meta new file mode 100644 index 0000000..b52cadf --- /dev/null +++ b/Unity/Editor/LayerModifierEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ae3383f13b58e544ba5c12293fff5957 +timeCreated: 1494349684 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/MapImageFactoryEditor.cs b/Unity/Editor/MapImageFactoryEditor.cs new file mode 100644 index 0000000..dc81412 --- /dev/null +++ b/Unity/Editor/MapImageFactoryEditor.cs @@ -0,0 +1,35 @@ +namespace Mapbox.Editor +{ + using UnityEngine; + using UnityEditor; + using Mapbox.Unity.MeshGeneration.Factories; + + [CustomEditor(typeof(MapImageFactory))] + public class MapImageFactoryEditor : FactoryEditor + { + public SerializedProperty layerProperties; + private MonoScript script; + + void OnEnable() + { + layerProperties = serializedObject.FindProperty("_properties"); + script = MonoScript.FromScriptableObject((MapImageFactory)target); + + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + + GUI.enabled = false; + script = EditorGUILayout.ObjectField("Script", script, typeof(MonoScript), false) as MonoScript; + GUI.enabled = true; + + EditorGUILayout.Space(); + EditorGUILayout.PropertyField(layerProperties); + EditorGUILayout.Space(); + + serializedObject.ApplyModifiedProperties(); + } + } +} \ No newline at end of file diff --git a/Unity/Editor/MapImageFactoryEditor.cs.meta b/Unity/Editor/MapImageFactoryEditor.cs.meta new file mode 100644 index 0000000..f3a661e --- /dev/null +++ b/Unity/Editor/MapImageFactoryEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 26b414693cf1ad341bd50344ab4198f8 +timeCreated: 1490923136 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/MapManagerEditor.cs b/Unity/Editor/MapManagerEditor.cs new file mode 100644 index 0000000..d32cba6 --- /dev/null +++ b/Unity/Editor/MapManagerEditor.cs @@ -0,0 +1,370 @@ +using System; + +namespace Mapbox.Editor +{ + using UnityEngine; + using UnityEditor; + using Mapbox.Unity.Map; + using Mapbox.Platform.TilesetTileJSON; + using System.Collections.Generic; + using Mapbox.VectorTile.ExtensionMethods; + + [CustomEditor(typeof(AbstractMap))] + [CanEditMultipleObjects] + public class MapManagerEditor : Editor + { + private string objectId = ""; + private Color previewButtonColor = new Color(0.7f, 1.0f, 0.7f); + /// + /// Gets or sets a value indicating whether to show general section . + /// + /// true then show general section; otherwise hide, false. + bool ShowGeneral + { + get + { + return EditorPrefs.GetBool(objectId + "MapManagerEditor_showGeneral"); + } + set + { + EditorPrefs.SetBool(objectId + "MapManagerEditor_showGeneral", value); + } + } + /// + /// Gets or sets a value to show or hide Image section. + /// + /// true if show image; otherwise, false. + bool ShowImage + { + get + { + return EditorPrefs.GetBool(objectId + "MapManagerEditor_showImage"); + } + set + { + EditorPrefs.SetBool(objectId + "MapManagerEditor_showImage", value); + } + } + /// + /// Gets or sets a value to show or hide Terrain section + /// + /// true if show terrain; otherwise, false. + bool ShowTerrain + { + get + { + return EditorPrefs.GetBool(objectId + "MapManagerEditor_showTerrain"); + } + set + { + EditorPrefs.SetBool(objectId + "MapManagerEditor_showTerrain", value); + } + } + + /// + /// Gets or sets a value to show or hide Map Layers section show features. + /// + /// true if show features; otherwise, false. + bool ShowMapLayers + { + get + { + return EditorPrefs.GetBool(objectId + "MapManagerEditor_showMapLayers"); + } + set + { + EditorPrefs.SetBool(objectId + "MapManagerEditor_showMapLayers", value); + } + } + + bool ShowPosition + { + get + { + return EditorPrefs.GetBool(objectId + "MapManagerEditor_showPosition"); + } + set + { + EditorPrefs.SetBool(objectId + "MapManagerEditor_showPosition", value); + } + } + + private GUIContent tilesetIdGui = new GUIContent + { + text = "Tileset Id", + tooltip = "Id of the tileset." + }; + + bool _isGUIContentSet = false; + GUIContent[] _sourceTypeContent; + static float _lineHeight = EditorGUIUtility.singleLineHeight; + + VectorLayerPropertiesDrawer _vectorLayerDrawer = new VectorLayerPropertiesDrawer(); + + public override void OnInspectorGUI() + { + objectId = serializedObject.targetObject.GetInstanceID().ToString(); + serializedObject.Update(); + EditorGUILayout.BeginVertical(); + EditorGUILayout.Space(); + + var previewOptions = serializedObject.FindProperty("_previewOptions"); + var prevProp = previewOptions.FindPropertyRelative("isPreviewEnabled"); + var prev = prevProp.boolValue; + + Color guiColor = GUI.color; + GUI.color = (prev) ? previewButtonColor : guiColor; + + GUIStyle style = new GUIStyle("Button"); + style.alignment = TextAnchor.MiddleCenter; + + if (!Application.isPlaying) + { + prevProp.boolValue = GUILayout.Toggle(prevProp.boolValue, "Enable Preview", style); + GUI.color = guiColor; + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + } + + ShowGeneral = EditorGUILayout.Foldout(ShowGeneral, new GUIContent { text = "GENERAL", tooltip = "Options related to map data" }); + + if (ShowGeneral) + { + DrawMapOptions(serializedObject); + } + ShowSepartor(); + + ShowImage = EditorGUILayout.Foldout(ShowImage, "IMAGE"); + if (ShowImage) + { + GUILayout.Space(-1.5f * _lineHeight); + ShowSection(serializedObject.FindProperty("_imagery"), "_layerProperty"); + } + + ShowSepartor(); + + ShowTerrain = EditorGUILayout.Foldout(ShowTerrain, "TERRAIN"); + if (ShowTerrain) + { + GUILayout.Space(-1.5f * _lineHeight); + ShowSection(serializedObject.FindProperty("_terrain"), "_layerProperty"); + } + + ShowSepartor(); + + ShowMapLayers = EditorGUILayout.Foldout(ShowMapLayers, "MAP LAYERS"); + if (ShowMapLayers) + { + DrawMapLayerOptions(); + } + EditorGUILayout.EndVertical(); + + EditorGUILayout.Space(); + + serializedObject.ApplyModifiedProperties(); + var vectorDataProperty = serializedObject.FindProperty("_vectorData"); + var layerProperty = vectorDataProperty.FindPropertyRelative("_layerProperty"); + _vectorLayerDrawer.PostProcessLayerProperties(layerProperty); + if (!Application.isPlaying) + { + if (prevProp.boolValue && !prev) + { + ((AbstractMap)serializedObject.targetObject).EnableEditorPreview(); + } + else if (prev && !prevProp.boolValue) + { + ((AbstractMap)serializedObject.targetObject).DisableEditorPreview(); + } + } + } + + void ShowSection(SerializedProperty property, string propertyName) + { + EditorGUILayout.Space(); + EditorGUILayout.PropertyField(property.FindPropertyRelative(propertyName)); + } + + void ShowSepartor() + { + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + EditorGUILayout.Space(); + } + + void DrawMapOptions(SerializedObject mapObject) + { + var property = mapObject.FindProperty("_options"); + if (!((AbstractMap)serializedObject.targetObject).IsAccessTokenValid) + { + EditorGUILayout.HelpBox("Invalid Access Token. Please add a valid access token using the Mapbox > Setup Menu", MessageType.Error); + } + + EditorGUILayout.LabelField("Location ", GUILayout.Height(_lineHeight)); + + EditorGUILayout.PropertyField(property.FindPropertyRelative("locationOptions")); + + + var extentOptions = property.FindPropertyRelative("extentOptions"); + var extentOptionsType = extentOptions.FindPropertyRelative("extentType"); + + + if ((MapExtentType)extentOptionsType.enumValueIndex == MapExtentType.Custom) + { + var tileProviderProperty = mapObject.FindProperty("_tileProvider"); + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(extentOptionsType); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(extentOptions); + } + EditorGUI.indentLevel++; + EditorGUILayout.PropertyField(tileProviderProperty); + EditorGUI.indentLevel--; + } + else + { + GUILayout.Space(-_lineHeight); + EditorGUILayout.PropertyField(extentOptions); + } + + EditorGUI.BeginChangeCheck(); + + EditorGUILayout.PropertyField(serializedObject.FindProperty("_initializeOnStart")); + + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + ShowPosition = EditorGUILayout.Foldout(ShowPosition, "Others"); + if (ShowPosition) + { + GUILayout.Space(-_lineHeight); + + EditorGUI.BeginChangeCheck(); + var placementOptions = property.FindPropertyRelative("placementOptions"); + EditorGUILayout.PropertyField(placementOptions); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(placementOptions); + } + + GUILayout.Space(-_lineHeight); + + EditorGUI.BeginChangeCheck(); + var scalingOptions = property.FindPropertyRelative("scalingOptions"); + EditorGUILayout.PropertyField(scalingOptions); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(scalingOptions); + } + + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(property.FindPropertyRelative("loadingTexture")); + EditorGUILayout.PropertyField(property.FindPropertyRelative("tileMaterial")); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + } + } + + void DrawMapLayerOptions() + { + var vectorDataProperty = serializedObject.FindProperty("_vectorData"); + var layerProperty = vectorDataProperty.FindPropertyRelative("_layerProperty"); + var layerSourceProperty = layerProperty.FindPropertyRelative("sourceOptions"); + var sourceTypeProperty = layerProperty.FindPropertyRelative("_sourceType"); + VectorSourceType sourceTypeValue = (VectorSourceType)sourceTypeProperty.enumValueIndex; + var layerSourceId = layerProperty.FindPropertyRelative("sourceOptions.layerSource.Id"); + string layerString = layerSourceId.stringValue; + var isActiveProperty = layerSourceProperty.FindPropertyRelative("isActive"); + + var displayNames = sourceTypeProperty.enumDisplayNames; + var names = sourceTypeProperty.enumNames; + int count = sourceTypeProperty.enumDisplayNames.Length; + if (!_isGUIContentSet) + { + _sourceTypeContent = new GUIContent[count]; + + var index = 0; + foreach (var name in names) + { + _sourceTypeContent[index] = new GUIContent + { + text = displayNames[index], + tooltip = ((VectorSourceType)Enum.Parse(typeof(VectorSourceType), name)).Description(), + }; + index++; + } + // + // for (int extIdx = 0; extIdx < count; extIdx++) + // { + // _sourceTypeContent[extIdx] = new GUIContent + // { + // text = displayNames[extIdx], + // tooltip = ((VectorSourceType)extIdx).Description(), + // }; + // } + + _isGUIContentSet = true; + } + + EditorGUI.BeginChangeCheck(); + sourceTypeProperty.enumValueIndex = EditorGUILayout.Popup(new GUIContent + { + text = "Data Source", + tooltip = "Source tileset for Vector Data" + }, sourceTypeProperty.enumValueIndex, _sourceTypeContent); + + //sourceTypeValue = (VectorSourceType)sourceTypeProperty.enumValueIndex; + sourceTypeValue = ((VectorSourceType)Enum.Parse(typeof(VectorSourceType), names[sourceTypeProperty.enumValueIndex])); + + switch (sourceTypeValue) + { + case VectorSourceType.MapboxStreets: + case VectorSourceType.MapboxStreetsV8: + case VectorSourceType.MapboxStreetsWithBuildingIds: + case VectorSourceType.MapboxStreetsV8WithBuildingIds: + var sourcePropertyValue = MapboxDefaultVector.GetParameters(sourceTypeValue); + layerSourceId.stringValue = sourcePropertyValue.Id; + GUI.enabled = false; + EditorGUILayout.PropertyField(layerSourceProperty, tilesetIdGui); + GUI.enabled = true; + isActiveProperty.boolValue = true; + break; + case VectorSourceType.Custom: + EditorGUILayout.PropertyField(layerSourceProperty, tilesetIdGui); + isActiveProperty.boolValue = true; + break; + case VectorSourceType.None: + isActiveProperty.boolValue = false; + break; + default: + isActiveProperty.boolValue = false; + break; + } + + if (sourceTypeValue != VectorSourceType.None) + { + var isStyleOptimized = layerProperty.FindPropertyRelative("useOptimizedStyle"); + EditorGUILayout.PropertyField(isStyleOptimized); + + if (isStyleOptimized.boolValue) + { + EditorGUILayout.PropertyField(layerProperty.FindPropertyRelative("optimizedStyle"), new GUIContent("Style Options")); + } + GUILayout.Space(-_lineHeight); + EditorGUILayout.PropertyField(layerProperty.FindPropertyRelative("performanceOptions"), new GUIContent("Perfomance Options")); + } + + EditorGUILayout.Space(); + ShowSepartor(); + + _vectorLayerDrawer.DrawUI(layerProperty); + + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(layerProperty); + } + } + } +} diff --git a/Unity/Editor/MapManagerEditor.cs.meta b/Unity/Editor/MapManagerEditor.cs.meta new file mode 100644 index 0000000..5f5579e --- /dev/null +++ b/Unity/Editor/MapManagerEditor.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 0fe5a867f0f1546009ebdda576486b9e +timeCreated: 1518137782 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/MapboxConfigurationWindow.cs b/Unity/Editor/MapboxConfigurationWindow.cs new file mode 100644 index 0000000..575cd64 --- /dev/null +++ b/Unity/Editor/MapboxConfigurationWindow.cs @@ -0,0 +1,668 @@ +namespace Mapbox.Editor +{ + using System.Collections.Generic; + using UnityEngine; + using UnityEditor.SceneManagement; + using UnityEditor; + using System.IO; + using System.Collections; + using Mapbox.Unity; + using Mapbox.Tokens; + using Mapbox.Json; + using Mapbox.Unity.Utilities; + using Mapbox.Unity.Utilities.DebugTools; + using UnityEditor.Callbacks; + using System; + + public class MapboxConfigurationWindow : EditorWindow + { + public static MapboxConfigurationWindow instance; + static MapboxConfiguration _mapboxConfig; + static MapboxTokenStatus _currentTokenStatus = MapboxTokenStatus.StatusNotYetSet; + static MapboxAccess _mapboxAccess; + static bool _waitingToLoad = false; + + //default mapboxconfig + static string _configurationFile; + static string _accessToken = ""; + [Range(0, 1000)] + static int _memoryCacheSize = 500; + [Range(0, 3000)] + static int _fileCacheSize = 25000; + static int _webRequestTimeout = 30; + static bool _autoRefreshCache = false; + + //mapbox access callbacks + static bool _listeningForTokenValidation = false; + static bool _validating = false; + static string _lastValidatedToken; + + //gui flags + bool _showConfigurationFoldout; + bool _showChangelogFoldout; + Vector2 _scrollPosition; + + //samples + static int _selectedSample; + static ScenesList _sceneList; + static GUIContent[] _sampleContent; + string _sceneToOpen; + + //prefabs + static int _selectedPrefab; + static ScenesList _prefabList; + static GUIContent[] _prefabContent; + + + //styles + GUISkin _skin; + Color _defaultContentColor; + Color _defaultBackgroundColor; + GUIStyle _titleStyle; + GUIStyle _bodyStyle; + GUIStyle _linkStyle; + + GUIStyle _textFieldStyle; + GUIStyle _submitButtonStyle; + + GUIStyle _validButtonStyle; + Color _validContentColor; + Color _validBackgroundColor; + + GUIStyle _invalidFieldStyle; + GUIStyle _invalidButtonStyle; + Color _invalidContentColor; + Color _invalidBackgroundColor; + GUIStyle _errorStyle; + + GUIStyle _verticalGroup; + GUIStyle _horizontalGroup; + GUIStyle _scrollViewStyle; + + GUIStyle _sampleButtonStyle; + + + [DidReloadScripts] + public static void ShowWindowOnImport() + { + if (ShouldShowConfigurationWindow()) + { + PlayerPrefs.SetInt(Constants.Path.DID_PROMPT_CONFIGURATION, 1); + PlayerPrefs.Save(); + InitWhenLoaded(); + } + } + + [MenuItem("Mapbox/Setup")] + static void InitWhenLoaded() + { + if (EditorApplication.isCompiling && !_waitingToLoad) + { + //subscribe to updates + _waitingToLoad = true; + EditorApplication.update += InitWhenLoaded; + return; + } + + if (!EditorApplication.isCompiling) + { + //unsubscribe from updates if waiting + if (_waitingToLoad) + { + EditorApplication.update -= InitWhenLoaded; + _waitingToLoad = false; + } + + Init(); + } + } + + static void Init() + { + Runnable.EnableRunnableInEditor(); + + //verify that the config file exists + _configurationFile = Path.Combine(Unity.Constants.Path.MAPBOX_RESOURCES_ABSOLUTE, Unity.Constants.Path.CONFIG_FILE); + if (!Directory.Exists(Unity.Constants.Path.MAPBOX_RESOURCES_ABSOLUTE)) + { + Directory.CreateDirectory(Unity.Constants.Path.MAPBOX_RESOURCES_ABSOLUTE); + } + + if (!File.Exists(_configurationFile)) + { + _mapboxConfig = new MapboxConfiguration + { + AccessToken = _accessToken, + MemoryCacheSize = (uint)_memoryCacheSize, + FileCacheSize = (uint)_fileCacheSize, + AutoRefreshCache = _autoRefreshCache, + DefaultTimeout = _webRequestTimeout + }; + var json = JsonUtility.ToJson(_mapboxConfig); + File.WriteAllText(_configurationFile, json); + AssetDatabase.Refresh(); + } + + //finish opening the window after the assetdatabase is refreshed. + EditorApplication.delayCall += OpenWindow; + } + + static void OpenWindow() + { + EditorApplication.delayCall -= OpenWindow; + + //setup mapboxaccess listener + _mapboxAccess = MapboxAccess.Instance; + if (!_listeningForTokenValidation) + { + _mapboxAccess.OnTokenValidation += HandleValidationResponse; + _listeningForTokenValidation = true; + } + + //setup local variables from mapbox config file + _mapboxConfig = _mapboxAccess.Configuration; + if (_mapboxConfig != null) + { + _accessToken = _mapboxConfig.AccessToken; + _memoryCacheSize = (int)_mapboxConfig.MemoryCacheSize; + _fileCacheSize = (int)_mapboxConfig.FileCacheSize; + _autoRefreshCache = _mapboxConfig.AutoRefreshCache; + _webRequestTimeout = (int)_mapboxConfig.DefaultTimeout; + + } + + //validate current config + if (!string.IsNullOrEmpty(_accessToken)) + { + SubmitConfiguration(); + } + + //cache sample scene gui content + GetSceneList(); + _selectedSample = -1; + + //instantiate the config window + instance = GetWindow(typeof(MapboxConfigurationWindow)) as MapboxConfigurationWindow; + instance.minSize = new Vector2(800, 350); + instance.titleContent = new GUIContent("Mapbox Setup"); + instance.Show(); + + } + + static void GetSceneList() + { + _prefabList = Resources.Load("Mapbox/PrefabList"); + _sceneList = Resources.Load("Mapbox/ScenesList"); + + _prefabContent = LoadContent(_prefabList); + _sampleContent = LoadContent(_sceneList); + + } + + static GUIContent[] LoadContent(ScenesList list) + { + + //exclude scenes with no image data + var content = new List(); + if (list != null) + { + for (int i = 0; i < list.SceneList.Length; i++) + { + if (list.SceneList[i] != null) + { + if (File.Exists(list.SceneList[i].ScenePath)) + { + if (list.SceneList[i].Image != null) + { + content.Add(list.SceneList[i]); + } + } + } + } + } + + var outputContent = new GUIContent[content.Count]; + for (int i = 0; i < outputContent.Length; i++) + { + outputContent[i] = new GUIContent(content[i].Name, content[i].Image, content[i].ScenePath); + } + + return outputContent; + + } + + + /// + /// Unity Events + /// + + private void OnDisable() { AssetDatabase.Refresh(); } + + private void OnDestroy() { AssetDatabase.Refresh(); } + + private void OnLostFocus() { AssetDatabase.Refresh(); } + + + /// + /// Mapbox access + /// + private static void SubmitConfiguration() + { + var mapboxConfiguration = new MapboxConfiguration + { + AccessToken = _accessToken, + MemoryCacheSize = (uint)_memoryCacheSize, + FileCacheSize = (uint)_fileCacheSize, + AutoRefreshCache = _autoRefreshCache, + DefaultTimeout = _webRequestTimeout + }; + _mapboxAccess.SetConfiguration(mapboxConfiguration, false); + _validating = true; + } + + private static void HandleValidationResponse(MapboxTokenStatus status) + { + _currentTokenStatus = status; + _validating = false; + _lastValidatedToken = _accessToken; + + //save the config + _configurationFile = Path.Combine(Unity.Constants.Path.MAPBOX_RESOURCES_ABSOLUTE, Unity.Constants.Path.CONFIG_FILE); + var json = JsonUtility.ToJson(_mapboxAccess.Configuration); + File.WriteAllText(_configurationFile, json); + } + + + void OnGUI() + { + //only run after init + if (instance == null) + { + //TODO: loading message? + InitWhenLoaded(); + return; + } + + InitStyles(); + + _scrollPosition = EditorGUILayout.BeginScrollView(_scrollPosition, _scrollViewStyle); + EditorGUILayout.BeginVertical(); + // Access token link. + DrawAccessTokenLink(); + + // Access token entry and validation. + DrawAccessTokenField(); + + // Draw the validation error, if one exists + DrawError(); + EditorGUILayout.EndVertical(); + + EditorGUILayout.BeginVertical(_verticalGroup); + + // Configuration + DrawConfigurationSettings(); + GUILayout.Space(8); + + // Changelog + DrawChangelog(); + + EditorGUILayout.EndVertical(); + + // Draw Prefab Examples + if (_prefabContent.Length > 0) + { + EditorGUILayout.BeginVertical(_verticalGroup); + DrawPrefabLinks(); + EditorGUILayout.EndVertical(); + + } + + // Draw Example links if the scenelist asset is where it should be. + if (_sampleContent.Length > 0) + { + EditorGUILayout.BeginVertical(_verticalGroup); + DrawExampleLinks(); + EditorGUILayout.EndVertical(); + } + EditorGUILayout.EndScrollView(); + } + + void InitStyles() + { + _defaultContentColor = GUI.contentColor; + _defaultBackgroundColor = GUI.backgroundColor; + + _titleStyle = new GUIStyle(GUI.skin.FindStyle("IN TitleText")); + _titleStyle.padding.left = 3; + _bodyStyle = new GUIStyle(GUI.skin.FindStyle("WordWrapLabel")); + _linkStyle = new GUIStyle(GUI.skin.FindStyle("PR PrefabLabel")); + _linkStyle.padding.left = 0; + _linkStyle.padding.top = -1; + + _textFieldStyle = new GUIStyle(GUI.skin.FindStyle("TextField")); + _textFieldStyle.margin.right = 0; + _textFieldStyle.margin.top = 0; + + _submitButtonStyle = new GUIStyle(GUI.skin.FindStyle("ButtonRight")); + _submitButtonStyle.padding.top = 0; + _submitButtonStyle.margin.top = 0; + _submitButtonStyle.fixedWidth = 200; + + _validButtonStyle = new GUIStyle(GUI.skin.FindStyle("LODSliderRange")); + _validButtonStyle.alignment = TextAnchor.MiddleCenter; + _validButtonStyle.padding = new RectOffset(0, 0, 0, 0); + _validButtonStyle.border = new RectOffset(0, 0, 5, -2); + _validButtonStyle.fixedWidth = 60; + + _validContentColor = new Color(1, 1, 1, .7f); + _validBackgroundColor = new Color(.2f, .8f, .2f, 1); + _invalidContentColor = new Color(1, 1, 1, .7f); + _invalidBackgroundColor = new Color(.8f, .2f, .2f, 1); + + _errorStyle = new GUIStyle(GUI.skin.FindStyle("ErrorLabel")); + _errorStyle.padding.left = 5; + + _verticalGroup = new GUIStyle(); + _verticalGroup.margin = new RectOffset(0, 0, 0, 35); + _horizontalGroup = new GUIStyle(); + _horizontalGroup.padding = new RectOffset(0, 0, 4, 4); + _scrollViewStyle = new GUIStyle(GUI.skin.FindStyle("scrollview")); + _scrollViewStyle.padding = new RectOffset(20, 20, 40, 0); + + _sampleButtonStyle = new GUIStyle(GUI.skin.FindStyle("button")); + _sampleButtonStyle.imagePosition = ImagePosition.ImageAbove; + _sampleButtonStyle.padding = new RectOffset(0, 0, 5, 5); + _sampleButtonStyle.fontStyle = FontStyle.Bold; + } + + void DrawAccessTokenLink() + { + + EditorGUILayout.LabelField("Access Token", _titleStyle); + + EditorGUILayout.BeginHorizontal(_horizontalGroup); + if (string.IsNullOrEmpty(_accessToken)) + { + //fit box to text to create an 'inline link' + GUIContent labelContent = new GUIContent("Copy your free token from"); + GUIContent linkContent = new GUIContent("mapbox.com"); + + EditorGUILayout.LabelField(labelContent, _bodyStyle, GUILayout.Width(_bodyStyle.CalcSize(labelContent).x)); + + if (GUILayout.Button(linkContent, _linkStyle)) + { + Application.OpenURL("https://www.mapbox.com/studio/account/tokens/"); + } + + //create link cursor + var rect = GUILayoutUtility.GetLastRect(); + rect.width = _linkStyle.CalcSize(new GUIContent(linkContent)).x; + EditorGUIUtility.AddCursorRect(rect, MouseCursor.Link); + + GUILayout.FlexibleSpace(); + + } + else + { + + GUIContent labelContent = new GUIContent("Manage your tokens at"); + GUIContent linkContent = new GUIContent("mapbox.com/studio/accounts/tokens/"); + + EditorGUILayout.LabelField(labelContent, _bodyStyle, GUILayout.Width(_bodyStyle.CalcSize(labelContent).x)); + + if (GUILayout.Button(linkContent, _linkStyle)) + { + Application.OpenURL("https://www.mapbox.com/studio/account/tokens/"); + } + + //create link cursor + var rect = GUILayoutUtility.GetLastRect(); + rect.width = _linkStyle.CalcSize(new GUIContent(linkContent)).x; + EditorGUIUtility.AddCursorRect(rect, MouseCursor.Link); + + GUILayout.FlexibleSpace(); + + } + EditorGUILayout.EndHorizontal(); + + } + + void DrawAccessTokenField() + { + EditorGUILayout.BeginHorizontal(_horizontalGroup); + + //_accessToken is empty + if (string.IsNullOrEmpty(_accessToken)) + { + _accessToken = EditorGUILayout.TextField("", _accessToken, _textFieldStyle); + EditorGUI.BeginDisabledGroup(true); + GUILayout.Button("Submit", _submitButtonStyle); + EditorGUI.EndDisabledGroup(); + } + else + { + //_accessToken is being validated + if (_validating) + { + EditorGUI.BeginDisabledGroup(true); + _accessToken = EditorGUILayout.TextField("", _accessToken, _textFieldStyle); + GUILayout.Button("Checking", _submitButtonStyle); + EditorGUI.EndDisabledGroup(); + } + //_accessToken is the same as the already submitted token + else if (string.Equals(_lastValidatedToken, _accessToken)) + { + //valid token + if (_currentTokenStatus == MapboxTokenStatus.TokenValid) + { + GUI.backgroundColor = _validBackgroundColor; + GUI.contentColor = _validContentColor; + + _accessToken = EditorGUILayout.TextField("", _accessToken, _textFieldStyle); + GUILayout.Button("Valid", _validButtonStyle); + + GUI.contentColor = _defaultContentColor; + GUI.backgroundColor = _defaultBackgroundColor; + + } + //invalid token + else + { + + GUI.contentColor = _invalidContentColor; + GUI.backgroundColor = _invalidBackgroundColor; + + _accessToken = EditorGUILayout.TextField("", _accessToken, _textFieldStyle); + GUILayout.Button("Invalid", _validButtonStyle); + + GUI.contentColor = _defaultContentColor; + GUI.backgroundColor = _defaultBackgroundColor; + + } + //Submit button + if (GUILayout.Button("Submit", _submitButtonStyle)) + { + SubmitConfiguration(); + } + + } + //_accessToken is a new, unsubmitted token. + else + { + _accessToken = EditorGUILayout.TextField("", _accessToken, _textFieldStyle); + + if (GUILayout.Button("Submit", _submitButtonStyle)) + { + SubmitConfiguration(); + } + } + } + + EditorGUILayout.EndHorizontal(); + + } + + void DrawError() + { + //draw the error message, if one exists + EditorGUILayout.BeginHorizontal(_horizontalGroup); + + if (_currentTokenStatus != MapboxTokenStatus.TokenValid + && _currentTokenStatus != MapboxTokenStatus.StatusNotYetSet + && string.Equals(_lastValidatedToken, _accessToken) + && !_validating) + { + EditorGUILayout.LabelField(_currentTokenStatus.ToString(), _errorStyle); + } + + EditorGUILayout.EndHorizontal(); + + } + + void DrawChangelog() + { + EditorGUI.indentLevel = 2; + + GUIContent linkContent = new GUIContent("v" + Constants.SDK_VERSION + " changelog"); + + if (GUILayout.Button(linkContent, _linkStyle)) + { + Application.OpenURL("https://github.com/mapbox/mapbox-unity-sdk/blob/develop/documentation/docs/05-changelog.md"); + } + + EditorGUI.indentLevel = 0; + } + + void DrawConfigurationSettings() + { + _showConfigurationFoldout = EditorGUILayout.Foldout(_showConfigurationFoldout, "Configuration", true); + + if (_showConfigurationFoldout) + { + EditorGUIUtility.labelWidth = 240f; + EditorGUI.indentLevel = 2; + _memoryCacheSize = EditorGUILayout.IntSlider("Mem Cache Size (# of tiles)", _memoryCacheSize, 0, 1000); + _fileCacheSize = EditorGUILayout.IntSlider("File Cache Size (# of tiles)", _fileCacheSize, 0, 3000); + _autoRefreshCache = EditorGUILayout.Toggle(new GUIContent("Auto refresh cache", "Automatically update tiles in the local ambient cache if there is a newer version available online. ATTENTION: for every tile displayed (even a cached one) a webrequest needs to be made to check for updates."), _autoRefreshCache); + _webRequestTimeout = EditorGUILayout.IntField("Default Web Request Timeout (s)", _webRequestTimeout); + + EditorGUILayout.BeginHorizontal(_horizontalGroup); + GUILayout.Space(35f); + if (GUILayout.Button("Save")) + { + SubmitConfiguration(); + } + EditorGUI.indentLevel = 0; + EditorGUIUtility.labelWidth = 0f; + EditorGUILayout.EndHorizontal(); + } + + } + + void DrawPrefabLinks() + { + EditorGUI.BeginDisabledGroup(_currentTokenStatus != MapboxTokenStatus.TokenValid + || _validating); + + if (_currentTokenStatus == MapboxTokenStatus.TokenValid) + { + EditorGUILayout.LabelField("Map Prefabs", _titleStyle); + } + else + { + EditorGUILayout.LabelField("Map Prefabs", "Paste your mapbox access token to get started", _titleStyle); + } + + EditorGUILayout.BeginHorizontal(_horizontalGroup); + EditorGUILayout.LabelField("Choose a starting scene to see each location-based prefab in action, or go to the prefabs folder and add them to your existing scene.", _bodyStyle); + EditorGUILayout.EndHorizontal(); + + int rowCount = 4; + EditorGUILayout.BeginHorizontal(); + + _selectedPrefab = GUILayout.SelectionGrid(-1, _prefabContent, rowCount, _sampleButtonStyle); + + if (_selectedPrefab != -1) + { + EditorApplication.isPaused = false; + EditorApplication.isPlaying = false; + + _sceneToOpen = _prefabContent[_selectedPrefab].tooltip; + EditorApplication.update += OpenAndPlayScene; + } + + EditorGUILayout.EndHorizontal(); + EditorGUI.EndDisabledGroup(); + + } + + void DrawExampleLinks() + { + EditorGUI.BeginDisabledGroup(_currentTokenStatus != MapboxTokenStatus.TokenValid + || _validating); + + if (_currentTokenStatus == MapboxTokenStatus.TokenValid) + { + EditorGUILayout.LabelField("Example Scenes", _titleStyle); + } + else + { + EditorGUILayout.LabelField("Example Scenes", _titleStyle); + } + + + int rowCount = 4; + EditorGUILayout.BeginHorizontal(_horizontalGroup); + + _selectedSample = GUILayout.SelectionGrid(-1, _sampleContent, rowCount, _sampleButtonStyle); + + if (_selectedSample != -1) + { + EditorApplication.isPaused = false; + EditorApplication.isPlaying = false; + + _sceneToOpen = _sampleContent[_selectedSample].tooltip; + EditorApplication.update += OpenAndPlayScene; + } + + EditorGUILayout.EndHorizontal(); + EditorGUI.EndDisabledGroup(); + } + + private void OpenAndPlayScene() + { + if (EditorApplication.isPlaying) + { + return; + } + + EditorApplication.update -= OpenAndPlayScene; + + if (EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo()) + { + EditorSceneManager.OpenScene(_sceneToOpen); + EditorApplication.isPlaying = true; + + var editorWindow = GetWindow(typeof(MapboxConfigurationWindow)); + editorWindow.Close(); + + } + else + { + _sceneToOpen = null; + _selectedPrefab = -1; + _selectedSample = -1; + } + } + + static bool ShouldShowConfigurationWindow() + { + if (!PlayerPrefs.HasKey(Constants.Path.DID_PROMPT_CONFIGURATION)) + { + PlayerPrefs.SetInt(Constants.Path.DID_PROMPT_CONFIGURATION, 0); + } + + return PlayerPrefs.GetInt(Constants.Path.DID_PROMPT_CONFIGURATION) == 0; + } + } +} diff --git a/Unity/Editor/MapboxConfigurationWindow.cs.meta b/Unity/Editor/MapboxConfigurationWindow.cs.meta new file mode 100644 index 0000000..1c48af6 --- /dev/null +++ b/Unity/Editor/MapboxConfigurationWindow.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 276c74102975f4a52b0d286bdb580c2e +timeCreated: 1490214747 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/MaterialModifierEditor.cs b/Unity/Editor/MaterialModifierEditor.cs new file mode 100644 index 0000000..8a882b8 --- /dev/null +++ b/Unity/Editor/MaterialModifierEditor.cs @@ -0,0 +1,34 @@ +namespace Mapbox.Editor +{ + using UnityEngine; + using UnityEditor; + using Mapbox.Unity.MeshGeneration.Modifiers; + + [CustomEditor(typeof(MaterialModifier))] + public class MaterialModifierEditor : UnityEditor.Editor + { + + private MonoScript script; + private SerializedProperty _materials; + + private void OnEnable() + { + script = MonoScript.FromScriptableObject((MaterialModifier)target); + _materials = serializedObject.FindProperty("_options"); + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + GUI.enabled = false; + script = EditorGUILayout.ObjectField("Script", script, typeof(MonoScript), false) as MonoScript; + GUI.enabled = true; + + EditorGUILayout.Space(); + EditorGUILayout.PropertyField(_materials); + EditorGUILayout.Space(); + + serializedObject.ApplyModifiedProperties(); + } + } +} \ No newline at end of file diff --git a/Unity/Editor/MaterialModifierEditor.cs.meta b/Unity/Editor/MaterialModifierEditor.cs.meta new file mode 100644 index 0000000..d3edb99 --- /dev/null +++ b/Unity/Editor/MaterialModifierEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a416905e274b84a428108fb5b0ee6bb7 +timeCreated: 1504124010 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/MergedModifierStackEditor.cs b/Unity/Editor/MergedModifierStackEditor.cs new file mode 100644 index 0000000..85c0223 --- /dev/null +++ b/Unity/Editor/MergedModifierStackEditor.cs @@ -0,0 +1,104 @@ +namespace Mapbox.Editor +{ + using UnityEngine; + using UnityEditor; + using Mapbox.Unity.MeshGeneration.Modifiers; + + [CustomEditor(typeof(MergedModifierStack))] + public class MergedModifierStackEditor : UnityEditor.Editor + { + private MonoScript script; + private Texture2D _magnifier; + + private void OnEnable() + { + script = MonoScript.FromScriptableObject((MergedModifierStack)target); + _magnifier = EditorGUIUtility.FindTexture("d_ViewToolZoom"); + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + GUI.enabled = false; + script = EditorGUILayout.ObjectField("Script", script, typeof(MonoScript), false) as MonoScript; + GUI.enabled = true; + + EditorGUILayout.Space(); + + EditorGUILayout.Space(); + EditorGUILayout.LabelField("Mesh Modifiers"); + var facs = serializedObject.FindProperty("MeshModifiers"); + for (int i = 0; i < facs.arraySize; i++) + { + var ind = i; + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.BeginVertical(); + GUILayout.Space(5); + facs.GetArrayElementAtIndex(ind).objectReferenceValue = EditorGUILayout.ObjectField(facs.GetArrayElementAtIndex(i).objectReferenceValue, typeof(MeshModifier), false) as ScriptableObject; + EditorGUILayout.EndVertical(); + + if (GUILayout.Button(_magnifier, (GUIStyle)"minibuttonleft", GUILayout.Width(30))) + { + ScriptableCreatorWindow.Open(typeof(MeshModifier), facs, ind); + } + if (GUILayout.Button(new GUIContent("-"), (GUIStyle)"minibuttonright", GUILayout.Width(30), GUILayout.Height(22))) + { + facs.DeleteArrayElementAtIndex(ind); + } + EditorGUILayout.EndHorizontal(); + } + + EditorGUILayout.Space(); + EditorGUILayout.BeginHorizontal(); + if (GUILayout.Button(new GUIContent("Add New Empty"), (GUIStyle)"minibuttonleft")) + { + facs.arraySize++; + facs.GetArrayElementAtIndex(facs.arraySize - 1).objectReferenceValue = null; + } + if (GUILayout.Button(new GUIContent("Find Asset"), (GUIStyle)"minibuttonright")) + { + ScriptableCreatorWindow.Open(typeof(MeshModifier), facs); + } + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.Space(); + EditorGUILayout.LabelField("Game Object Modifiers"); + var facs2 = serializedObject.FindProperty("GoModifiers"); + for (int i = 0; i < facs2.arraySize; i++) + { + var ind = i; + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.BeginVertical(); + GUILayout.Space(5); + facs2.GetArrayElementAtIndex(ind).objectReferenceValue = EditorGUILayout.ObjectField(facs2.GetArrayElementAtIndex(i).objectReferenceValue, typeof(GameObjectModifier), false) as ScriptableObject; + + EditorGUILayout.EndVertical(); + + if (GUILayout.Button(_magnifier, (GUIStyle)"minibuttonleft", GUILayout.Width(30))) + { + ScriptableCreatorWindow.Open(typeof(GameObjectModifier), facs2, ind); + } + if (GUILayout.Button(new GUIContent("-"), (GUIStyle)"minibuttonright", GUILayout.Width(30), GUILayout.Height(22))) + { + facs2.DeleteArrayElementAtIndex(ind); + } + EditorGUILayout.EndHorizontal(); + } + + EditorGUILayout.Space(); + EditorGUILayout.BeginHorizontal(); + if (GUILayout.Button(new GUIContent("Add New Empty"), (GUIStyle)"minibuttonleft")) + { + facs2.arraySize++; + facs2.GetArrayElementAtIndex(facs2.arraySize - 1).objectReferenceValue = null; + } + if (GUILayout.Button(new GUIContent("Find Asset"), (GUIStyle)"minibuttonright")) + { + ScriptableCreatorWindow.Open(typeof(GameObjectModifier), facs2); + } + EditorGUILayout.EndHorizontal(); + + serializedObject.ApplyModifiedProperties(); + } + } +} \ No newline at end of file diff --git a/Unity/Editor/MergedModifierStackEditor.cs.meta b/Unity/Editor/MergedModifierStackEditor.cs.meta new file mode 100644 index 0000000..c2e799f --- /dev/null +++ b/Unity/Editor/MergedModifierStackEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c0ec3bc7bc8e146dc8ee1fcfcded456a +timeCreated: 1504124010 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/ModifierStackEditor.cs b/Unity/Editor/ModifierStackEditor.cs new file mode 100644 index 0000000..a087d1f --- /dev/null +++ b/Unity/Editor/ModifierStackEditor.cs @@ -0,0 +1,107 @@ +namespace Mapbox.Editor +{ + using UnityEngine; + using UnityEditor; + using Mapbox.Unity.MeshGeneration.Modifiers; + + [CustomEditor(typeof(ModifierStack))] + public class ModifierStackEditor : UnityEditor.Editor + { + + private MonoScript script; + private SerializedProperty _positionType; + private Texture2D _magnifier; + + private void OnEnable() + { + script = MonoScript.FromScriptableObject((ModifierStack)target); + _positionType = serializedObject.FindProperty("moveFeaturePositionTo"); + _magnifier = EditorGUIUtility.FindTexture("d_ViewToolZoom"); + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + GUI.enabled = false; + script = EditorGUILayout.ObjectField("Script", script, typeof(MonoScript), false) as MonoScript; + GUI.enabled = true; + + EditorGUILayout.Space(); + EditorGUILayout.PropertyField(_positionType, new GUIContent("Feature Position")); + + + EditorGUILayout.Space(); + EditorGUILayout.LabelField("Mesh Modifiers"); + var meshfac = serializedObject.FindProperty("MeshModifiers"); + for (int i = 0; i < meshfac.arraySize; i++) + { + var ind = i; + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.BeginVertical(); + GUILayout.Space(5); + meshfac.GetArrayElementAtIndex(ind).objectReferenceValue = EditorGUILayout.ObjectField(meshfac.GetArrayElementAtIndex(i).objectReferenceValue, typeof(MeshModifier), false) as ScriptableObject; + EditorGUILayout.EndVertical(); + if (GUILayout.Button(_magnifier, (GUIStyle)"minibuttonleft", GUILayout.Width(30))) + { + ScriptableCreatorWindow.Open(typeof(MeshModifier), meshfac, ind); + } + if (GUILayout.Button(new GUIContent("-"), (GUIStyle)"minibuttonright", GUILayout.Width(30), GUILayout.Height(22))) + { + meshfac.DeleteArrayElementAtIndex(ind); + } + EditorGUILayout.EndHorizontal(); + } + + EditorGUILayout.Space(); + EditorGUILayout.BeginHorizontal(); + if (GUILayout.Button(new GUIContent("Add New Empty"), (GUIStyle)"minibuttonleft")) + { + meshfac.arraySize++; + meshfac.GetArrayElementAtIndex(meshfac.arraySize - 1).objectReferenceValue = null; + } + if (GUILayout.Button(new GUIContent("Find Asset"), (GUIStyle)"minibuttonright")) + { + ScriptableCreatorWindow.Open(typeof(MeshModifier), meshfac); + } + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.Space(); + EditorGUILayout.LabelField("Game Object Modifiers"); + var gofac = serializedObject.FindProperty("GoModifiers"); + for (int i = 0; i < gofac.arraySize; i++) + { + var ind = i; + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.BeginVertical(); + GUILayout.Space(5); + gofac.GetArrayElementAtIndex(ind).objectReferenceValue = EditorGUILayout.ObjectField(gofac.GetArrayElementAtIndex(i).objectReferenceValue, typeof(GameObjectModifier), false) as ScriptableObject; + EditorGUILayout.EndVertical(); + + if (GUILayout.Button(_magnifier, (GUIStyle)"minibuttonleft", GUILayout.Width(30))) + { + ScriptableCreatorWindow.Open(typeof(GameObjectModifier), gofac, ind); + } + if (GUILayout.Button(new GUIContent("-"), (GUIStyle)"minibuttonright", GUILayout.Width(30), GUILayout.Height(22))) + { + gofac.DeleteArrayElementAtIndex(ind); + } + EditorGUILayout.EndHorizontal(); + } + + EditorGUILayout.Space(); + EditorGUILayout.BeginHorizontal(); + if (GUILayout.Button(new GUIContent("Add New Empty"), (GUIStyle)"minibuttonleft")) + { + gofac.arraySize++; + gofac.GetArrayElementAtIndex(gofac.arraySize - 1).objectReferenceValue = null; + } + if (GUILayout.Button(new GUIContent("Find Asset"), (GUIStyle)"minibuttonright")) + { + ScriptableCreatorWindow.Open(typeof(GameObjectModifier), gofac); + } + EditorGUILayout.EndHorizontal(); + + serializedObject.ApplyModifiedProperties(); + } + } +} \ No newline at end of file diff --git a/Unity/Editor/ModifierStackEditor.cs.meta b/Unity/Editor/ModifierStackEditor.cs.meta new file mode 100644 index 0000000..38f98dd --- /dev/null +++ b/Unity/Editor/ModifierStackEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c0cd73e58c7a441cd81f138edd9bbb31 +timeCreated: 1504124010 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PointsOfInterestSubLayerTreeView.cs b/Unity/Editor/PointsOfInterestSubLayerTreeView.cs new file mode 100644 index 0000000..3afff90 --- /dev/null +++ b/Unity/Editor/PointsOfInterestSubLayerTreeView.cs @@ -0,0 +1,82 @@ +namespace Mapbox.Editor +{ + using System.Collections; + using System.Collections.Generic; + using UnityEngine; + using UnityEditor.IMGUI.Controls; + using UnityEditor; + using Mapbox.Unity.Map; + + public class PointsOfInterestSubLayerTreeView : TreeView + { + public SerializedProperty Layers; + private float kToggleWidth = 18f; + private const int uniqueId = 0; + + public bool hasChanged = false; + + public PointsOfInterestSubLayerTreeView(TreeViewState state) + : base(state) + { + showAlternatingRowBackgrounds = true; + showBorder = true; + Reload(); + } + + protected override TreeViewItem BuildRoot() + { + // The root item is required to have a depth of -1, and the rest of the items increment from that. + var root = new TreeViewItem { id = -1, depth = -1, displayName = "Root" }; + + var items = new List(); + var index = 0; + + if (Layers != null) + { + for (int i = 0; i < Layers.arraySize; i++) + { + var name = Layers.GetArrayElementAtIndex(i).FindPropertyRelative("coreOptions.sublayerName").stringValue; + items.Add(new TreeViewItem { id = index + uniqueId, depth = 1, displayName = name }); + index++; + } + } + + // Utility method that initializes the TreeViewItem.children and .parent for all items. + SetupParentsAndChildrenFromDepths(root, items); + + // Return root of the tree + return root; + } + + protected override bool CanRename(TreeViewItem item) + { + return true; + } + + protected override void RenameEnded(RenameEndedArgs args) + { + if (Layers == null) + { + return; + } + + var layer = Layers.GetArrayElementAtIndex(args.itemID - uniqueId); + layer.FindPropertyRelative("coreOptions.sublayerName").stringValue = string.IsNullOrEmpty(args.newName.Trim()) ? args.originalName : args.newName; + } + + protected override void RowGUI(RowGUIArgs args) + { + Rect toggleRect = args.rowRect; + toggleRect.width = kToggleWidth; + var item = Layers.GetArrayElementAtIndex(args.item.id - uniqueId); + EditorGUI.BeginChangeCheck(); + item.FindPropertyRelative("coreOptions.isActive").boolValue = EditorGUI.Toggle(toggleRect, item.FindPropertyRelative("coreOptions.isActive").boolValue); + if(EditorGUI.EndChangeCheck()) + { + hasChanged = true; + } + args.item.displayName = item.FindPropertyRelative("coreOptions.sublayerName").stringValue; + base.RowGUI(args); + } + } +} diff --git a/Unity/Editor/PointsOfInterestSubLayerTreeView.cs.meta b/Unity/Editor/PointsOfInterestSubLayerTreeView.cs.meta new file mode 100644 index 0000000..41a150a --- /dev/null +++ b/Unity/Editor/PointsOfInterestSubLayerTreeView.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 430429020c0a64703b89ac33585da3e7 +timeCreated: 1530564120 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PopupSelectionMenu.cs b/Unity/Editor/PopupSelectionMenu.cs new file mode 100644 index 0000000..58745da --- /dev/null +++ b/Unity/Editor/PopupSelectionMenu.cs @@ -0,0 +1,161 @@ +using UnityEngine; +using UnityEditor; +using System.Collections.Generic; +using System; +using System.IO; +using System.Reflection; +using Mapbox.Unity; +using Mapbox.Unity.Map; + +namespace Mapbox.Editor +{ + /// + /// Pop up menu for selecting, creating and assigning modifier instances to AbstractMap. + /// + public class PopupSelectionMenu : PopupWindowContent + { + + private Type _type; + + private List _modTypes; + + private SerializedProperty _finalize; + + private Vector2 _scrollPos; + + public override Vector2 GetWindowSize() + { + return new Vector2(250, 250); + } + + public override void OnGUI(Rect rect) + { + if (_modTypes == null || _modTypes.Count == 0) + { + _modTypes = new List(); + + AppDomain currentDomain = AppDomain.CurrentDomain; + Assembly[] assemblies = currentDomain.GetAssemblies(); + for (int i = 0; i < assemblies.Length; i++) + { + Type[] types = assemblies[i].GetTypes(); + for (int j = 0; j < types.Length; j++) + { + if (types[j].IsSubclassOf(_type)) + { + _modTypes.Add(types[j]); + } + } + } + } + + GUILayout.Label(String.Format("{0}s", _type.Name), EditorStyles.boldLabel); + var st = new GUIStyle(); + st.padding = new RectOffset(0, 0, 15, 15); + _scrollPos = EditorGUILayout.BeginScrollView(_scrollPos, st); + + for (int i = 0; i < _modTypes.Count; i++) + { + Type asset = _modTypes[i]; + if (asset == null) //yea turns out this can happen + continue; + var style = GUI.skin.button; + style.alignment = TextAnchor.MiddleLeft; + string shortTypeName = GetShortTypeName(asset.ToString()); + if (GUILayout.Button(shortTypeName, style)) + { + CreateNewModiferInstance(asset, shortTypeName); + editorWindow.Close(); + } + } + EditorGUILayout.EndScrollView(); + } + + /// + /// Gets the short name of the type. + /// + /// The short type name. + /// Input. + private string GetShortTypeName(string input) + { + int pos = input.LastIndexOf(".", StringComparison.CurrentCulture) + 1; + return input.Substring(pos, input.Length - pos); + } + + /// + /// Creates the new modifer instance. + /// + /// Type. + /// Name. + private void CreateNewModiferInstance(Type type, string name) + { + var modifierInstance = ScriptableObject.CreateInstance(type); + + string pathCandidate = Constants.Path.MAPBOX_USER_MODIFIERS; + if (!Directory.Exists(pathCandidate)) + { + + string userFolder = Constants.Path.MAPBOX_USER; + if (!Directory.Exists(userFolder)) + { + string parentPath = System.IO.Path.Combine("Assets", "Mapbox"); + AssetDatabase.CreateFolder(parentPath, "User"); + } + AssetDatabase.CreateFolder(userFolder, "Modifiers"); + } + + foreach (UnityEngine.Object obj in Selection.GetFiltered(typeof(UnityEngine.Object), SelectionMode.Assets)) + { + pathCandidate = AssetDatabase.GetAssetPath(obj); + if (!string.IsNullOrEmpty(pathCandidate) && File.Exists(pathCandidate)) + { + pathCandidate = Path.GetDirectoryName(pathCandidate); + break; + } + } + + string combinedPath = string.Format("{0}{1}.asset", Path.Combine(pathCandidate, "New"), name); + string uniqueAssetPath = AssetDatabase.GenerateUniqueAssetPath(combinedPath); + + modifierInstance.name = name; + + AssetDatabase.CreateAsset(modifierInstance, uniqueAssetPath); + + AssetDatabase.SaveAssets(); + AssetDatabase.Refresh(); + + AddNewInstanceToArray(modifierInstance); + + Debug.Log(string.Format("Created new {0} modifer at {1}", name, uniqueAssetPath)); + } + + /// + /// Adds the new instance to array. + /// + /// Object. + public void AddNewInstanceToArray(object obj) + { + ScriptableObject asset = obj as ScriptableObject; + + _finalize.arraySize++; + _finalize.GetArrayElementAtIndex(_finalize.arraySize - 1).objectReferenceValue = asset; + + MapboxDataProperty mapboxDataProperty = (MapboxDataProperty)EditorHelper.GetTargetObjectWithProperty(_finalize); + if (_finalize.serializedObject.ApplyModifiedProperties() && mapboxDataProperty != null) + { + mapboxDataProperty.HasChanged = true; + } + } + + /// + /// Initializes a new instance of the class. + /// + /// T. + /// P. + public PopupSelectionMenu(Type t, SerializedProperty p) + { + _type = t; + _finalize = p; + } + } +} diff --git a/Unity/Editor/PopupSelectionMenu.cs.meta b/Unity/Editor/PopupSelectionMenu.cs.meta new file mode 100644 index 0000000..abfb974 --- /dev/null +++ b/Unity/Editor/PopupSelectionMenu.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a6c73878fee204232a755433b391ccd5 +timeCreated: 1526401331 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers.meta b/Unity/Editor/PropertyDrawers.meta new file mode 100644 index 0000000..cfc5623 --- /dev/null +++ b/Unity/Editor/PropertyDrawers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0963d53ec1a1b453bbcf67aa71a02a1d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/BehaviorModifiersSectionDrawer.cs b/Unity/Editor/PropertyDrawers/BehaviorModifiersSectionDrawer.cs new file mode 100644 index 0000000..e7aa86f --- /dev/null +++ b/Unity/Editor/PropertyDrawers/BehaviorModifiersSectionDrawer.cs @@ -0,0 +1,218 @@ +namespace Mapbox.Editor +{ + using UnityEngine; + using System.Collections; + using UnityEditor; + using Mapbox.Unity.Map; + using Mapbox.Unity.MeshGeneration.Modifiers; + + public class BehaviorModifiersSectionDrawer + { + string objectId = ""; + + bool showGameplay + { + get + { + return EditorPrefs.GetBool(objectId + "VectorSubLayerProperties_showGameplay"); + } + set + { + EditorPrefs.SetBool(objectId + "VectorSubLayerProperties_showGameplay", value); + } + } + + public void DrawUI(SerializedProperty layerProperty, VectorPrimitiveType primitiveTypeProp, VectorSourceType sourceType) + { + + showGameplay = EditorGUILayout.Foldout(showGameplay, "Behavior Modifiers"); + if (showGameplay) + { + + bool isPrimitiveTypeValidForBuidingIds = (primitiveTypeProp == VectorPrimitiveType.Polygon || primitiveTypeProp == VectorPrimitiveType.Custom); + bool isSourceValidForBuildingIds = sourceType != VectorSourceType.MapboxStreets; + + layerProperty.FindPropertyRelative("honorBuildingIdSetting").boolValue = isPrimitiveTypeValidForBuidingIds && isSourceValidForBuildingIds; + + if (layerProperty.FindPropertyRelative("honorBuildingIdSetting").boolValue == true) + { + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(layerProperty.FindPropertyRelative("buildingsWithUniqueIds"), new GUIContent + { + text = "Buildings With Unique Ids", + tooltip = + "Turn on this setting only when rendering 3D buildings from the Mapbox Streets with Building Ids tileset. Using this setting with any other polygon layers or source will result in visual artifacts. " + }); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(layerProperty); + } + } + + var subLayerCoreOptions = layerProperty.FindPropertyRelative("coreOptions"); + var combineMeshesProperty = subLayerCoreOptions.FindPropertyRelative("combineMeshes"); + + EditorGUILayout.BeginHorizontal(); + if (combineMeshesProperty.boolValue == false) + { + var featurePositionProperty = layerProperty.FindPropertyRelative("moveFeaturePositionTo"); + GUIContent dropDownLabel = new GUIContent + { + text = "Feature Position", + tooltip = "Position to place feature in the tile. " + }; + + GUIContent[] dropDownItems = new GUIContent[featurePositionProperty.enumDisplayNames.Length]; + + for (int i = 0; i < featurePositionProperty.enumDisplayNames.Length; i++) + { + dropDownItems[i] = new GUIContent + { + text = featurePositionProperty.enumDisplayNames[i] + }; + } + EditorGUI.BeginChangeCheck(); + featurePositionProperty.enumValueIndex = EditorGUILayout.Popup(dropDownLabel, featurePositionProperty.enumValueIndex, dropDownItems); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(layerProperty); + } + } + EditorGUILayout.EndHorizontal(); + DrawMeshModifiers(layerProperty); + DrawGoModifiers(layerProperty); + } + } + + private void DrawMeshModifiers(SerializedProperty property) + { + + EditorGUILayout.BeginVertical(); + EditorGUILayout.LabelField(new GUIContent + { + text = "Mesh Modifiers", + tooltip = "Modifiers that manipulate the features mesh. " + }); + + var meshfac = property.FindPropertyRelative("MeshModifiers"); + + for (int i = 0; i < meshfac.arraySize; i++) + { + var ind = i; + EditorGUILayout.BeginHorizontal(); + + EditorGUILayout.BeginVertical(); + meshfac.GetArrayElementAtIndex(ind).objectReferenceValue = + EditorGUILayout.ObjectField(meshfac.GetArrayElementAtIndex(i).objectReferenceValue, typeof(MeshModifier), false) + as ScriptableObject; + + EditorGUILayout.EndVertical(); + + if (GUILayout.Button(new GUIContent("x"), (GUIStyle)"minibuttonright", GUILayout.Width(30))) + { + bool elementWasDeleted = false; + if (meshfac.arraySize > 0) + { + meshfac.DeleteArrayElementAtIndex(ind); + elementWasDeleted = true; + } + if (meshfac.arraySize > 0) + { + meshfac.DeleteArrayElementAtIndex(ind); + } + if (elementWasDeleted) + { + EditorHelper.CheckForModifiedProperty(property); + } + } + + EditorGUILayout.EndHorizontal(); + } + + EditorGUI.indentLevel++; + EditorGUILayout.BeginHorizontal(); + GUILayout.Space(EditorGUI.indentLevel * 12); + Rect buttonRect = GUILayoutUtility.GetLastRect(); + if (GUILayout.Button(new GUIContent("Add New"), (GUIStyle)"minibuttonleft")) + { + PopupWindow.Show(buttonRect, new PopupSelectionMenu(typeof(MeshModifier), meshfac)); + if (Event.current.type == EventType.Repaint) buttonRect = GUILayoutUtility.GetLastRect(); + } + + if (GUILayout.Button(new GUIContent("Add Existing"), (GUIStyle)"minibuttonright")) + { + ScriptableCreatorWindow.Open(typeof(MeshModifier), meshfac, -1, null, property); + } + + EditorGUILayout.EndHorizontal(); + EditorGUILayout.EndVertical(); + EditorGUI.indentLevel--; + } + + private void DrawGoModifiers(SerializedProperty property) + { + + EditorGUILayout.BeginVertical(); + + EditorGUILayout.LabelField(new GUIContent + { + text = "Game Object Modifiers", + tooltip = "Modifiers that manipulate the GameObject after mesh generation." + }); + var gofac = property.FindPropertyRelative("GoModifiers"); + + for (int i = 0; i < gofac.arraySize; i++) + { + var ind = i; + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.BeginVertical(); + GUILayout.Space(5); + gofac.GetArrayElementAtIndex(ind).objectReferenceValue = + EditorGUILayout.ObjectField(gofac.GetArrayElementAtIndex(i).objectReferenceValue, typeof(GameObjectModifier), + false) as ScriptableObject; + EditorGUILayout.EndVertical(); + + if (GUILayout.Button(new GUIContent("x"), GUILayout.Width(30))) + { + bool elementWasDeleted = false; + if (gofac.arraySize > 0) + { + gofac.DeleteArrayElementAtIndex(ind); + elementWasDeleted = true; + } + if (gofac.arraySize > 0) + { + gofac.DeleteArrayElementAtIndex(ind); + } + if (elementWasDeleted) + { + EditorHelper.CheckForModifiedProperty(property); + } + } + + EditorGUILayout.EndHorizontal(); + } + + EditorGUI.indentLevel++; + EditorGUILayout.BeginHorizontal(); + GUILayout.Space(EditorGUI.indentLevel * 12); + Rect buttonRect = GUILayoutUtility.GetLastRect(); + + if (GUILayout.Button(new GUIContent("Add New"), (GUIStyle)"minibuttonleft")) + { + PopupWindow.Show(buttonRect, new PopupSelectionMenu(typeof(GameObjectModifier), gofac)); + if (Event.current.type == EventType.Repaint) buttonRect = GUILayoutUtility.GetLastRect(); + } + + if (GUILayout.Button(new GUIContent("Add Existing"), (GUIStyle)"minibuttonright")) + { + + ScriptableCreatorWindow.Open(typeof(GameObjectModifier), gofac, -1, null, property); + } + + EditorGUILayout.EndHorizontal(); + EditorGUI.indentLevel--; + EditorGUILayout.EndVertical(); + } + } +} diff --git a/Unity/Editor/PropertyDrawers/BehaviorModifiersSectionDrawer.cs.meta b/Unity/Editor/PropertyDrawers/BehaviorModifiersSectionDrawer.cs.meta new file mode 100644 index 0000000..0da75f0 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/BehaviorModifiersSectionDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 4301f1990a1f8417280b87eb43510a4c +timeCreated: 1533828994 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/CameraBoundsTileProviderOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/CameraBoundsTileProviderOptionsDrawer.cs new file mode 100644 index 0000000..6c3f149 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/CameraBoundsTileProviderOptionsDrawer.cs @@ -0,0 +1,25 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + + [CustomPropertyDrawer(typeof(CameraBoundsTileProviderOptions))] + public class CameraBoundsTileProviderOptionsDrawer : PropertyDrawer + { + static float _lineHeight = EditorGUIUtility.singleLineHeight; + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + var camera = property.FindPropertyRelative("camera"); + EditorGUI.PropertyField(position, camera, new GUIContent + { + text = camera.displayName, + tooltip = "Camera to control map extent." + }); + } + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return 1 * _lineHeight; + } + } +} \ No newline at end of file diff --git a/Unity/Editor/PropertyDrawers/CameraBoundsTileProviderOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/CameraBoundsTileProviderOptionsDrawer.cs.meta new file mode 100644 index 0000000..18a3fbf --- /dev/null +++ b/Unity/Editor/PropertyDrawers/CameraBoundsTileProviderOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: edfd5847c11274df4a63d74e142d6695 +timeCreated: 1517858264 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/ColliderOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/ColliderOptionsDrawer.cs new file mode 100644 index 0000000..ac8fe95 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/ColliderOptionsDrawer.cs @@ -0,0 +1,58 @@ +namespace Mapbox.Editor +{ + using System.Collections; + using System.Collections.Generic; + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + using Mapbox.VectorTile.ExtensionMethods; + using Mapbox.Editor; + + [CustomPropertyDrawer(typeof(ColliderOptions))] + public class ColliderOptionsDrawer : PropertyDrawer + { + static float lineHeight = EditorGUIUtility.singleLineHeight; + bool isGUIContentSet = false; + GUIContent[] colliderTypeContent; + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, null, property); + var colliderTypeLabel = new GUIContent + { + text = "Collider Type", + tooltip = "The type of collider added to game objects in this layer." + }; + var colliderTypeProperty = property.FindPropertyRelative("colliderType"); + + var displayNames = colliderTypeProperty.enumDisplayNames; + int count = colliderTypeProperty.enumDisplayNames.Length; + + if (!isGUIContentSet) + { + colliderTypeContent = new GUIContent[count]; + for (int extIdx = 0; extIdx < count; extIdx++) + { + colliderTypeContent[extIdx] = new GUIContent + { + text = displayNames[extIdx], + tooltip = EnumExtensions.Description((ColliderType)extIdx), + }; + } + isGUIContentSet = true; + } + + EditorGUI.BeginChangeCheck(); + colliderTypeProperty.enumValueIndex = EditorGUILayout.Popup(colliderTypeLabel, colliderTypeProperty.enumValueIndex, colliderTypeContent); + if(EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + EditorGUI.EndProperty(); + } + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return lineHeight; + } + } +} diff --git a/Unity/Editor/PropertyDrawers/ColliderOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/ColliderOptionsDrawer.cs.meta new file mode 100644 index 0000000..76bd76f --- /dev/null +++ b/Unity/Editor/PropertyDrawers/ColliderOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 05ab73c42b3654a68823b6793c470531 +timeCreated: 1522459817 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/CoreVectorLayerPropertiesDrawer.cs b/Unity/Editor/PropertyDrawers/CoreVectorLayerPropertiesDrawer.cs new file mode 100644 index 0000000..467f5ba --- /dev/null +++ b/Unity/Editor/PropertyDrawers/CoreVectorLayerPropertiesDrawer.cs @@ -0,0 +1,57 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + using System.Collections.Generic; + using System.Linq; + using System; + using Mapbox.VectorTile.ExtensionMethods; + using Mapbox.Editor; + + [CustomPropertyDrawer(typeof(CoreVectorLayerProperties))] + public class CoreVectorLayerPropertiesDrawer : PropertyDrawer + { + bool _isGUIContentSet = false; + GUIContent[] _primitiveTypeContent; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + + EditorGUI.BeginProperty(position, null, property); + + var primitiveType = property.FindPropertyRelative("geometryType"); + + var primitiveTypeLabel = new GUIContent + { + text = "Primitive Type", + tooltip = "Primitive geometry type of the visualizer, allowed primitives - point, line, polygon." + }; + + var displayNames = primitiveType.enumDisplayNames; + int count = primitiveType.enumDisplayNames.Length; + + if (!_isGUIContentSet) + { + _primitiveTypeContent = new GUIContent[count]; + for (int extIdx = 0; extIdx < count; extIdx++) + { + _primitiveTypeContent[extIdx] = new GUIContent + { + text = displayNames[extIdx], + tooltip = EnumExtensions.Description((VectorPrimitiveType)extIdx), + }; + } + _isGUIContentSet = true; + } + + EditorGUI.BeginChangeCheck(); + primitiveType.enumValueIndex = EditorGUILayout.Popup(primitiveTypeLabel, primitiveType.enumValueIndex, _primitiveTypeContent); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + EditorGUI.EndProperty(); + } + } +} diff --git a/Unity/Editor/PropertyDrawers/CoreVectorLayerPropertiesDrawer.cs.meta b/Unity/Editor/PropertyDrawers/CoreVectorLayerPropertiesDrawer.cs.meta new file mode 100644 index 0000000..9027c2c --- /dev/null +++ b/Unity/Editor/PropertyDrawers/CoreVectorLayerPropertiesDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a198cd5919ca149099130ba68e0f258b +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/ElevationLayerPropertiesDrawer.cs b/Unity/Editor/PropertyDrawers/ElevationLayerPropertiesDrawer.cs new file mode 100644 index 0000000..e41c822 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/ElevationLayerPropertiesDrawer.cs @@ -0,0 +1,163 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + using Mapbox.VectorTile.ExtensionMethods; + + [CustomPropertyDrawer(typeof(ElevationLayerProperties))] + public class ElevationLayerPropertiesDrawer : PropertyDrawer + { + string objectId = ""; + static float lineHeight = EditorGUIUtility.singleLineHeight; + GUIContent[] sourceTypeContent; + bool isGUIContentSet = false; + + bool ShowPosition + { + get + { + return EditorPrefs.GetBool(objectId + "ElevationLayerProperties_showPosition"); + } + set + { + EditorPrefs.SetBool(objectId + "ElevationLayerProperties_showPosition", value); + } + } + + private GUIContent _tilesetIdGui = new GUIContent + { + text = "Tileset Id", + tooltip = "Id of the tileset." + }; + + string CustomSourceTilesetId + { + get + { + return EditorPrefs.GetString(objectId + "ElevationLayerProperties_customSourceTilesetId"); + } + set + { + EditorPrefs.SetString(objectId + "ElevationLayerProperties_customSourceTilesetId", value); + } + } + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + objectId = property.serializedObject.targetObject.GetInstanceID().ToString(); + + var sourceTypeProperty = property.FindPropertyRelative("sourceType"); + + var displayNames = sourceTypeProperty.enumDisplayNames; + int count = sourceTypeProperty.enumDisplayNames.Length; + if (!isGUIContentSet) + { + sourceTypeContent = new GUIContent[count]; + for (int extIdx = 0; extIdx < count; extIdx++) + { + sourceTypeContent[extIdx] = new GUIContent + { + text = displayNames[extIdx], + tooltip = ((ElevationSourceType)extIdx).Description(), + }; + } + isGUIContentSet = true; + } + var sourceTypeLabel = new GUIContent { text = "Data Source", tooltip = "Source tileset for Terrain." }; + + EditorGUI.BeginChangeCheck(); + sourceTypeProperty.enumValueIndex = EditorGUILayout.Popup(sourceTypeLabel, sourceTypeProperty.enumValueIndex, sourceTypeContent); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + var sourceTypeValue = (ElevationSourceType)sourceTypeProperty.enumValueIndex; + + var sourceOptionsProperty = property.FindPropertyRelative("sourceOptions"); + var layerSourceProperty = sourceOptionsProperty.FindPropertyRelative("layerSource"); + var layerSourceId = layerSourceProperty.FindPropertyRelative("Id"); + + EditorGUI.BeginChangeCheck(); + + switch (sourceTypeValue) + { + case ElevationSourceType.MapboxTerrain: + var sourcePropertyValue = MapboxDefaultElevation.GetParameters(sourceTypeValue); + layerSourceId.stringValue = sourcePropertyValue.Id; + GUI.enabled = false; + EditorGUILayout.PropertyField(sourceOptionsProperty, _tilesetIdGui); + GUI.enabled = true; + break; + case ElevationSourceType.Custom: + layerSourceId.stringValue = string.IsNullOrEmpty(CustomSourceTilesetId) ? MapboxDefaultElevation.GetParameters(ElevationSourceType.MapboxTerrain).Id : CustomSourceTilesetId; + EditorGUILayout.PropertyField(sourceOptionsProperty, _tilesetIdGui); + CustomSourceTilesetId = layerSourceId.stringValue; + break; + default: + break; + } + + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + var elevationLayerType = property.FindPropertyRelative("elevationLayerType"); + + if (sourceTypeValue == ElevationSourceType.None) + { + GUI.enabled = false; + elevationLayerType.enumValueIndex = (int)ElevationLayerType.FlatTerrain; + } + + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(property.FindPropertyRelative("elevationLayerType"), new GUIContent { text = elevationLayerType.displayName, tooltip = ((ElevationLayerType)elevationLayerType.enumValueIndex).Description() }); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + if (sourceTypeValue == ElevationSourceType.None) + { + GUI.enabled = true; + } + + GUILayout.Space(-lineHeight); + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(property.FindPropertyRelative("colliderOptions"), true); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property.FindPropertyRelative("colliderOptions")); + } + GUILayout.Space(2 * -lineHeight); + + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(property.FindPropertyRelative("requiredOptions"), true); + GUILayout.Space(-lineHeight); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + ShowPosition = EditorGUILayout.Foldout(ShowPosition, "Others"); + + if (ShowPosition) + { + EditorGUI.BeginChangeCheck(); + + EditorGUILayout.PropertyField(property.FindPropertyRelative("modificationOptions"), true); + + EditorGUILayout.PropertyField(property.FindPropertyRelative("sideWallOptions"), true); + + EditorGUILayout.PropertyField(property.FindPropertyRelative("unityLayerOptions"), true); + + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + } + } + } +} diff --git a/Unity/Editor/PropertyDrawers/ElevationLayerPropertiesDrawer.cs.meta b/Unity/Editor/PropertyDrawers/ElevationLayerPropertiesDrawer.cs.meta new file mode 100644 index 0000000..d6d27eb --- /dev/null +++ b/Unity/Editor/PropertyDrawers/ElevationLayerPropertiesDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: becc811ca916a4717bf81685180e605d +timeCreated: 1520010402 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/ElevationModificationOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/ElevationModificationOptionsDrawer.cs new file mode 100644 index 0000000..e2396bf --- /dev/null +++ b/Unity/Editor/PropertyDrawers/ElevationModificationOptionsDrawer.cs @@ -0,0 +1,28 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + + [CustomPropertyDrawer(typeof(ElevationModificationOptions))] + public class ElevationModificationOptionsDrawer : PropertyDrawer + { + static float lineHeight = EditorGUIUtility.singleLineHeight; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, label, property); + EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), property.FindPropertyRelative("sampleCount")); + position.y += lineHeight; + EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), property.FindPropertyRelative("useRelativeHeight")); + position.y += lineHeight; + EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), property.FindPropertyRelative("earthRadius")); + EditorGUI.EndProperty(); + } + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + // Reserve space for the total visible properties. + return 3.0f * lineHeight; + } + } +} \ No newline at end of file diff --git a/Unity/Editor/PropertyDrawers/ElevationModificationOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/ElevationModificationOptionsDrawer.cs.meta new file mode 100644 index 0000000..eb93b48 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/ElevationModificationOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 299ec1d2adf5f4418aa69f1441d59731 +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/ElevationRequiredOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/ElevationRequiredOptionsDrawer.cs new file mode 100644 index 0000000..5c2c041 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/ElevationRequiredOptionsDrawer.cs @@ -0,0 +1,27 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + + [CustomPropertyDrawer(typeof(ElevationRequiredOptions))] + public class ElevationRequiredOptionsDrawer : PropertyDrawer + { + static float lineHeight = EditorGUIUtility.singleLineHeight; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, label, property); + + position.y += lineHeight; + EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), property.FindPropertyRelative("exaggerationFactor")); + + EditorGUI.EndProperty(); + } + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + // Reserve space for the total visible properties. + return 3.0f * lineHeight; + } + } +} diff --git a/Unity/Editor/PropertyDrawers/ElevationRequiredOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/ElevationRequiredOptionsDrawer.cs.meta new file mode 100644 index 0000000..b9251f6 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/ElevationRequiredOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 0b69c5574214341c9888bda16d659aee +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/FeaturesSubLayerPropertiesDrawer.cs b/Unity/Editor/PropertyDrawers/FeaturesSubLayerPropertiesDrawer.cs new file mode 100644 index 0000000..28f71ea --- /dev/null +++ b/Unity/Editor/PropertyDrawers/FeaturesSubLayerPropertiesDrawer.cs @@ -0,0 +1,696 @@ +namespace Mapbox.Editor +{ + using System.Collections.Generic; + using System.Linq; + using UnityEngine; + using UnityEditor; + using Mapbox.Unity.Map; + using UnityEditor.IMGUI.Controls; + using Mapbox.Unity.MeshGeneration.Modifiers; + using Mapbox.VectorTile.ExtensionMethods; + using Mapbox.Unity.MeshGeneration.Filters; + using Mapbox.Platform.TilesetTileJSON; + using Mapbox.Editor; + using System; + + public class FeaturesSubLayerPropertiesDrawer + { + static float _lineHeight = EditorGUIUtility.singleLineHeight; + GUIContent[] _sourceTypeContent; + bool _isGUIContentSet = false; + bool _isInitialized = false; + private TileJsonData tileJSONData; + private static TileJSONResponse tileJSONResponse; + static TileJsonData tileJsonData = new TileJsonData(); + int _layerIndex = 0; + GUIContent[] _layerTypeContent; + private static VectorSubLayerProperties subLayerProperties; + private TreeModel treeModel; + + private static string[] names; + [SerializeField] + TreeViewState m_TreeViewState; + + [SerializeField] + MultiColumnHeaderState m_MultiColumnHeaderState; + + public bool isLayerAdded = false; + bool m_Initialized = false; + string objectId = ""; + private string TilesetId + { + get + { + return EditorPrefs.GetString(objectId + "VectorSubLayerProperties_tilesetId"); + } + set + { + EditorPrefs.SetString(objectId + "VectorSubLayerProperties_tilesetId", value); + } + } + + bool ShowPosition + { + get + { + return EditorPrefs.GetBool(objectId + "VectorSubLayerProperties_showPosition"); + } + set + { + EditorPrefs.SetBool(objectId + "VectorSubLayerProperties_showPosition", value); + } + } + + int SelectionIndex + { + get + { + return EditorPrefs.GetInt(objectId + "VectorSubLayerProperties_selectionIndex"); + } + set + { + EditorPrefs.SetInt(objectId + "VectorSubLayerProperties_selectionIndex", value); + } + } + + ModelingSectionDrawer _modelingSectionDrawer = new ModelingSectionDrawer(); + BehaviorModifiersSectionDrawer _behaviorModifierSectionDrawer = new BehaviorModifiersSectionDrawer(); + + private static TileStats _streetsV7TileStats; + private static string[] subTypeValues; + FeatureSubLayerTreeView layerTreeView; + IList selectedLayers = new List(); + public void DrawUI(SerializedProperty property) + { + + objectId = property.serializedObject.targetObject.GetInstanceID().ToString(); + var serializedMapObject = property.serializedObject; + AbstractMap mapObject = (AbstractMap)serializedMapObject.targetObject; + tileJSONData = mapObject.VectorData.GetTileJsonData(); + + var sourceTypeProperty = property.FindPropertyRelative("_sourceType"); + var sourceTypeValue = (VectorSourceType)sourceTypeProperty.enumValueIndex; + + var displayNames = sourceTypeProperty.enumDisplayNames; + var names = sourceTypeProperty.enumNames; + int count = sourceTypeProperty.enumDisplayNames.Length; + if (!_isGUIContentSet) + { + _sourceTypeContent = new GUIContent[count]; + + var index = 0; + foreach (var name in names) + { + _sourceTypeContent[index] = new GUIContent + { + text = displayNames[index], + tooltip = ((VectorSourceType)Enum.Parse(typeof(VectorSourceType), name)).Description(), + }; + index++; + } + + // for (int index0 = 0; index0 < count; index0++) + // { + // _sourceTypeContent[index0] = new GUIContent + // { + // text = displayNames[index0], + // tooltip = ((VectorSourceType)index0).Description(), + // }; + // } + _isGUIContentSet = true; + } + + //sourceTypeValue = (VectorSourceType)sourceTypeProperty.enumValueIndex; + sourceTypeValue = ((VectorSourceType)Enum.Parse(typeof(VectorSourceType), names[sourceTypeProperty.enumValueIndex])); + var sourceOptionsProperty = property.FindPropertyRelative("sourceOptions"); + var layerSourceProperty = sourceOptionsProperty.FindPropertyRelative("layerSource"); + var layerSourceId = layerSourceProperty.FindPropertyRelative("Id"); + var isActiveProperty = sourceOptionsProperty.FindPropertyRelative("isActive"); + switch (sourceTypeValue) + { + case VectorSourceType.MapboxStreets: + case VectorSourceType.MapboxStreetsV8: + case VectorSourceType.MapboxStreetsWithBuildingIds: + case VectorSourceType.MapboxStreetsV8WithBuildingIds: + var sourcePropertyValue = MapboxDefaultVector.GetParameters(sourceTypeValue); + layerSourceId.stringValue = sourcePropertyValue.Id; + GUI.enabled = false; + if (_isInitialized) + { + LoadEditorTileJSON(property, sourceTypeValue, layerSourceId.stringValue); + } + else + { + _isInitialized = true; + } + if (tileJSONData.PropertyDisplayNames.Count == 0 && tileJSONData.tileJSONLoaded) + { + EditorGUILayout.HelpBox("Invalid Tileset Id / There might be a problem with the internet connection.", MessageType.Error); + } + GUI.enabled = true; + isActiveProperty.boolValue = true; + break; + case VectorSourceType.Custom: + if (_isInitialized) + { + string test = layerSourceId.stringValue; + LoadEditorTileJSON(property, sourceTypeValue, layerSourceId.stringValue); + } + else + { + _isInitialized = true; + } + if (tileJSONData.PropertyDisplayNames.Count == 0 && tileJSONData.tileJSONLoaded) + { + EditorGUILayout.HelpBox("Invalid Tileset Id / There might be a problem with the internet connection.", MessageType.Error); + } + isActiveProperty.boolValue = true; + break; + case VectorSourceType.None: + isActiveProperty.boolValue = false; + break; + default: + isActiveProperty.boolValue = false; + break; + } + + if (sourceTypeValue != VectorSourceType.None) + { + EditorGUILayout.LabelField(new GUIContent + { + text = "Map Features", + tooltip = "Visualizers for vector features contained in a layer. " + }); + + var subLayerArray = property.FindPropertyRelative("vectorSubLayers"); + + var layersRect = EditorGUILayout.GetControlRect(GUILayout.MinHeight(Mathf.Max(subLayerArray.arraySize + 1, 1) * _lineHeight + MultiColumnHeader.DefaultGUI.defaultHeight), + GUILayout.MaxHeight((subLayerArray.arraySize + 1) * _lineHeight + MultiColumnHeader.DefaultGUI.defaultHeight)); + + if (!m_Initialized) + { + bool firstInit = m_MultiColumnHeaderState == null; + var headerState = FeatureSubLayerTreeView.CreateDefaultMultiColumnHeaderState(); + if (MultiColumnHeaderState.CanOverwriteSerializedFields(m_MultiColumnHeaderState, headerState)) + { + MultiColumnHeaderState.OverwriteSerializedFields(m_MultiColumnHeaderState, headerState); + } + m_MultiColumnHeaderState = headerState; + + var multiColumnHeader = new FeatureSectionMultiColumnHeader(headerState); + + if (firstInit) + { + multiColumnHeader.ResizeToFit(); + } + + treeModel = new TreeModel(GetData(subLayerArray)); + if (m_TreeViewState == null) + { + m_TreeViewState = new TreeViewState(); + } + + if (layerTreeView == null) + { + layerTreeView = new FeatureSubLayerTreeView(m_TreeViewState, multiColumnHeader, treeModel); + } + layerTreeView.multiColumnHeader = multiColumnHeader; + m_Initialized = true; + } + layerTreeView.Layers = subLayerArray; + layerTreeView.Reload(); + layerTreeView.OnGUI(layersRect); + + if (layerTreeView.hasChanged) + { + EditorHelper.CheckForModifiedProperty(property); + layerTreeView.hasChanged = false; + } + + selectedLayers = layerTreeView.GetSelection(); + + //if there are selected elements, set the selection index at the first element. + //if not, use the Selection index to persist the selection at the right index. + if (selectedLayers.Count > 0) + { + //ensure that selectedLayers[0] isn't out of bounds + if (selectedLayers[0] - FeatureSubLayerTreeView.uniqueIdFeature > subLayerArray.arraySize - 1) + { + selectedLayers[0] = subLayerArray.arraySize - 1 + FeatureSubLayerTreeView.uniqueIdFeature; + } + + SelectionIndex = selectedLayers[0]; + } + else + { + if (SelectionIndex > 0 && (SelectionIndex - FeatureSubLayerTreeView.uniqueIdFeature <= subLayerArray.arraySize - 1)) + { + selectedLayers = new int[1] { SelectionIndex }; + layerTreeView.SetSelection(selectedLayers); + } + } + + GUILayout.Space(EditorGUIUtility.singleLineHeight); + + EditorGUILayout.BeginHorizontal(); + GenericMenu menu = new GenericMenu(); + foreach (var name in Enum.GetNames(typeof(PresetFeatureType))) + { + menu.AddItem(new GUIContent() { text = name }, false, FetchPresetProperties, name); + } + GUILayout.Space(0); // do not remove this line; it is needed for the next line to work + Rect rect = GUILayoutUtility.GetLastRect(); + rect.y += 2 * _lineHeight / 3; + + if (EditorGUILayout.DropdownButton(new GUIContent { text = "Add Feature" }, FocusType.Passive, (GUIStyle)"minibuttonleft")) + { + menu.DropDown(rect); + } + + //Assign subLayerProperties after fetching it from the presets class. This happens everytime an element is added + if (subLayerProperties != null) + { + subLayerArray.arraySize++; + var subLayer = subLayerArray.GetArrayElementAtIndex(subLayerArray.arraySize - 1); + SetSubLayerProps(subLayer); + + //Refreshing the tree + layerTreeView.Layers = subLayerArray; + layerTreeView.AddElementToTree(subLayer); + layerTreeView.Reload(); + + selectedLayers = new int[1] { subLayerArray.arraySize - 1 + FeatureSubLayerTreeView.uniqueIdFeature }; + layerTreeView.SetSelection(selectedLayers); + subLayerProperties = null; // setting this to null so that the if block is not called again + + if (EditorHelper.DidModifyProperty(property)) + { + isLayerAdded = true; + } + } + + if (GUILayout.Button(new GUIContent("Remove Selected"), (GUIStyle)"minibuttonright")) + { + foreach (var index in selectedLayers.OrderByDescending(i => i)) + { + if (layerTreeView != null) + { + var subLayer = subLayerArray.GetArrayElementAtIndex(index - FeatureSubLayerTreeView.uniqueIdFeature); + + VectorLayerProperties vectorLayerProperties = (VectorLayerProperties)EditorHelper.GetTargetObjectOfProperty(property); + VectorSubLayerProperties vectorSubLayerProperties = (VectorSubLayerProperties)EditorHelper.GetTargetObjectOfProperty(subLayer); + + vectorLayerProperties.OnSubLayerPropertyRemoved(new VectorLayerUpdateArgs { property = vectorSubLayerProperties }); + + layerTreeView.RemoveItemFromTree(index); + subLayerArray.DeleteArrayElementAtIndex(index - FeatureSubLayerTreeView.uniqueIdFeature); + layerTreeView.treeModel.SetData(GetData(subLayerArray)); + } + } + + selectedLayers = new int[0]; + layerTreeView.SetSelection(selectedLayers); + } + + EditorGUILayout.EndHorizontal(); + + GUILayout.Space(EditorGUIUtility.singleLineHeight); + + if (selectedLayers.Count == 1 && subLayerArray.arraySize != 0 && selectedLayers[0] - FeatureSubLayerTreeView.uniqueIdFeature >= 0) + { + //ensure that selectedLayers[0] isn't out of bounds + if (selectedLayers[0] - FeatureSubLayerTreeView.uniqueIdFeature > subLayerArray.arraySize - 1) + { + selectedLayers[0] = subLayerArray.arraySize - 1 + FeatureSubLayerTreeView.uniqueIdFeature; + } + + SelectionIndex = selectedLayers[0]; + + var layerProperty = subLayerArray.GetArrayElementAtIndex(SelectionIndex - FeatureSubLayerTreeView.uniqueIdFeature); + + layerProperty.isExpanded = true; + var subLayerCoreOptions = layerProperty.FindPropertyRelative("coreOptions"); + bool isLayerActive = subLayerCoreOptions.FindPropertyRelative("isActive").boolValue; + if (!isLayerActive) + { + GUI.enabled = false; + } + + DrawLayerVisualizerProperties(sourceTypeValue, layerProperty, property); + + if (!isLayerActive) + { + GUI.enabled = true; + } + } + else + { + GUILayout.Label("Select a visualizer to see properties"); + } + } + } + + IList GetData(SerializedProperty subLayerArray) + { + List elements = new List(); + string name = string.Empty; + string type = string.Empty; + int id = 0; + var root = new FeatureTreeElement("Root", -1, 0); + elements.Add(root); + for (int i = 0; i < subLayerArray.arraySize; i++) + { + var subLayer = subLayerArray.GetArrayElementAtIndex(i); + name = subLayer.FindPropertyRelative("coreOptions.sublayerName").stringValue; + id = i + FeatureSubLayerTreeView.uniqueIdFeature; + type = ((PresetFeatureType)subLayer.FindPropertyRelative("presetFeatureType").enumValueIndex).ToString(); + FeatureTreeElement element = new FeatureTreeElement(name, 0, id); + element.Name = name; + element.name = name; + element.Type = type; + elements.Add(element); + } + return elements; + } + + /// + /// Fetches the preset properties using the supplied PresetFeatureType + /// + /// Name. + void FetchPresetProperties(object name) + { + PresetFeatureType featureType = ((PresetFeatureType)Enum.Parse(typeof(PresetFeatureType), name.ToString())); + subLayerProperties = PresetSubLayerPropertiesFetcher.GetSubLayerProperties(featureType); + } + + /// + /// Sets the sub layer properties for the newly added layer + /// + /// Sub layer. + void SetSubLayerProps(SerializedProperty subLayer) + { + subLayer.FindPropertyRelative("coreOptions.sublayerName").stringValue = subLayerProperties.coreOptions.sublayerName; + subLayer.FindPropertyRelative("presetFeatureType").enumValueIndex = (int)subLayerProperties.presetFeatureType; + // Set defaults here because SerializedProperty copies the previous element. + var subLayerCoreOptions = subLayer.FindPropertyRelative("coreOptions"); + CoreVectorLayerProperties coreOptions = subLayerProperties.coreOptions; + subLayerCoreOptions.FindPropertyRelative("isActive").boolValue = coreOptions.isActive; + subLayerCoreOptions.FindPropertyRelative("layerName").stringValue = coreOptions.layerName; + subLayerCoreOptions.FindPropertyRelative("geometryType").enumValueIndex = (int)coreOptions.geometryType; + subLayerCoreOptions.FindPropertyRelative("snapToTerrain").boolValue = coreOptions.snapToTerrain; + subLayerCoreOptions.FindPropertyRelative("combineMeshes").boolValue = coreOptions.combineMeshes; + + var subLayerlineGeometryOptions = subLayer.FindPropertyRelative("lineGeometryOptions"); + var lineGeometryOptions = subLayerProperties.lineGeometryOptions; + subLayerlineGeometryOptions.FindPropertyRelative("Width").floatValue = lineGeometryOptions.Width; + subLayerlineGeometryOptions.FindPropertyRelative("CapType").enumValueIndex = (int)lineGeometryOptions.CapType; + subLayerlineGeometryOptions.FindPropertyRelative("JoinType").enumValueIndex = (int)lineGeometryOptions.JoinType; + subLayerlineGeometryOptions.FindPropertyRelative("MiterLimit").floatValue = lineGeometryOptions.MiterLimit; + subLayerlineGeometryOptions.FindPropertyRelative("RoundLimit").floatValue = lineGeometryOptions.RoundLimit; + + + var subLayerExtrusionOptions = subLayer.FindPropertyRelative("extrusionOptions"); + var extrusionOptions = subLayerProperties.extrusionOptions; + subLayerExtrusionOptions.FindPropertyRelative("extrusionType").enumValueIndex = (int)extrusionOptions.extrusionType; + subLayerExtrusionOptions.FindPropertyRelative("extrusionGeometryType").enumValueIndex = (int)extrusionOptions.extrusionGeometryType; + subLayerExtrusionOptions.FindPropertyRelative("propertyName").stringValue = extrusionOptions.propertyName; + subLayerExtrusionOptions.FindPropertyRelative("extrusionScaleFactor").floatValue = extrusionOptions.extrusionScaleFactor; + subLayerExtrusionOptions.FindPropertyRelative("maximumHeight").floatValue = extrusionOptions.maximumHeight; + + var subLayerFilterOptions = subLayer.FindPropertyRelative("filterOptions"); + var filterOptions = subLayerProperties.filterOptions; + subLayerFilterOptions.FindPropertyRelative("filters").ClearArray(); + subLayerFilterOptions.FindPropertyRelative("combinerType").enumValueIndex = (int)filterOptions.combinerType; + //Add any future filter related assignments here + + var subLayerGeometryMaterialOptions = subLayer.FindPropertyRelative("materialOptions"); + var materialOptions = subLayerProperties.materialOptions; + subLayerGeometryMaterialOptions.FindPropertyRelative("style").enumValueIndex = (int)materialOptions.style; + + var mats = subLayerGeometryMaterialOptions.FindPropertyRelative("materials"); + mats.arraySize = 2; + + var topMatArray = mats.GetArrayElementAtIndex(0).FindPropertyRelative("Materials"); + var sideMatArray = mats.GetArrayElementAtIndex(1).FindPropertyRelative("Materials"); + + if (topMatArray.arraySize == 0) + { + topMatArray.arraySize = 1; + } + if (sideMatArray.arraySize == 0) + { + sideMatArray.arraySize = 1; + } + + var topMat = topMatArray.GetArrayElementAtIndex(0); + var sideMat = sideMatArray.GetArrayElementAtIndex(0); + + var atlas = subLayerGeometryMaterialOptions.FindPropertyRelative("atlasInfo"); + var palette = subLayerGeometryMaterialOptions.FindPropertyRelative("colorPalette"); + var lightStyleOpacity = subLayerGeometryMaterialOptions.FindPropertyRelative("lightStyleOpacity"); + var darkStyleOpacity = subLayerGeometryMaterialOptions.FindPropertyRelative("darkStyleOpacity"); + var colorStyleColor = subLayerGeometryMaterialOptions.FindPropertyRelative("colorStyleColor"); + var customStyleOptions = subLayerGeometryMaterialOptions.FindPropertyRelative("customStyleOptions"); + + topMat.objectReferenceValue = materialOptions.materials[0].Materials[0]; + sideMat.objectReferenceValue = materialOptions.materials[1].Materials[0]; + atlas.objectReferenceValue = materialOptions.atlasInfo; + palette.objectReferenceValue = materialOptions.colorPalette; + lightStyleOpacity.floatValue = materialOptions.lightStyleOpacity; + darkStyleOpacity.floatValue = materialOptions.darkStyleOpacity; + colorStyleColor.colorValue = materialOptions.colorStyleColor; + //set custom style options. + var customMats = customStyleOptions.FindPropertyRelative("materials"); + customMats.arraySize = 2; + + var customTopMatArray = customMats.GetArrayElementAtIndex(0).FindPropertyRelative("Materials"); + var customSideMatArray = customMats.GetArrayElementAtIndex(1).FindPropertyRelative("Materials"); + + if (customTopMatArray.arraySize == 0) + { + customTopMatArray.arraySize = 1; + } + if (customSideMatArray.arraySize == 0) + { + customSideMatArray.arraySize = 1; + } + + var customTopMat = customTopMatArray.GetArrayElementAtIndex(0); + var customSideMat = customSideMatArray.GetArrayElementAtIndex(0); + + + customTopMat.objectReferenceValue = materialOptions.customStyleOptions.materials[0].Materials[0]; + customSideMat.objectReferenceValue = materialOptions.customStyleOptions.materials[1].Materials[0]; + customStyleOptions.FindPropertyRelative("atlasInfo").objectReferenceValue = materialOptions.customStyleOptions.atlasInfo; + customStyleOptions.FindPropertyRelative("colorPalette").objectReferenceValue = materialOptions.customStyleOptions.colorPalette; + + subLayer.FindPropertyRelative("buildingsWithUniqueIds").boolValue = subLayerProperties.buildingsWithUniqueIds; + subLayer.FindPropertyRelative("moveFeaturePositionTo").enumValueIndex = (int)subLayerProperties.moveFeaturePositionTo; + subLayer.FindPropertyRelative("MeshModifiers").ClearArray(); + subLayer.FindPropertyRelative("GoModifiers").ClearArray(); + + var subLayerColliderOptions = subLayer.FindPropertyRelative("colliderOptions"); + subLayerColliderOptions.FindPropertyRelative("colliderType").enumValueIndex = (int)subLayerProperties.colliderOptions.colliderType; + } + + private void UpdateMe() + { + Debug.Log("Update!"); + } + + void DrawLayerVisualizerProperties(VectorSourceType sourceType, SerializedProperty layerProperty, SerializedProperty property) + { + var subLayerCoreOptions = layerProperty.FindPropertyRelative("coreOptions"); + + var subLayerName = subLayerCoreOptions.FindPropertyRelative("sublayerName").stringValue; + var visualizerLayer = subLayerCoreOptions.FindPropertyRelative("layerName").stringValue; + var subLayerType = PresetSubLayerPropertiesFetcher.GetPresetTypeFromLayerName(visualizerLayer); + + GUILayout.Space(-_lineHeight); + layerProperty.FindPropertyRelative("presetFeatureType").intValue = (int)subLayerType; + + GUILayout.Space(_lineHeight); + //*********************** LAYER NAME BEGINS ***********************************// + VectorPrimitiveType primitiveTypeProp = (VectorPrimitiveType)subLayerCoreOptions.FindPropertyRelative("geometryType").enumValueIndex; + + var serializedMapObject = property.serializedObject; + AbstractMap mapObject = (AbstractMap)serializedMapObject.targetObject; + tileJsonData = mapObject.VectorData.GetTileJsonData(); + + var layerDisplayNames = tileJsonData.LayerDisplayNames; + + EditorGUI.BeginChangeCheck(); + DrawLayerName(subLayerCoreOptions, layerDisplayNames); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(subLayerCoreOptions); + } + //*********************** LAYER NAME ENDS ***********************************// + + EditorGUI.indentLevel++; + + //*********************** FILTERS SECTION BEGINS ***********************************// + var filterOptions = layerProperty.FindPropertyRelative("filterOptions"); + filterOptions.FindPropertyRelative("_selectedLayerName").stringValue = subLayerCoreOptions.FindPropertyRelative("layerName").stringValue; + GUILayout.Space(-_lineHeight); + EditorGUILayout.PropertyField(filterOptions, new GUIContent("Filters")); + //*********************** FILTERS SECTION ENDS ***********************************// + + + + //*********************** MODELING SECTION BEGINS ***********************************// + _modelingSectionDrawer.DrawUI(subLayerCoreOptions, layerProperty, primitiveTypeProp); + //*********************** MODELING SECTION ENDS ***********************************// + + + //*********************** TEXTURING SECTION BEGINS ***********************************// + if (primitiveTypeProp != VectorPrimitiveType.Point && primitiveTypeProp != VectorPrimitiveType.Custom) + { + GUILayout.Space(-_lineHeight); + EditorGUILayout.PropertyField(layerProperty.FindPropertyRelative("materialOptions")); + } + //*********************** TEXTURING SECTION ENDS ***********************************// + + + //*********************** GAMEPLAY SECTION BEGINS ***********************************// + _behaviorModifierSectionDrawer.DrawUI(layerProperty, primitiveTypeProp, sourceType); + //*********************** GAMEPLAY SECTION ENDS ***********************************// + + EditorGUI.indentLevel--; + } + + private void LoadEditorTileJSON(SerializedProperty property, VectorSourceType sourceTypeValue, string sourceString) + { + if (sourceTypeValue != VectorSourceType.None && !string.IsNullOrEmpty(sourceString)) + { + if (tileJSONResponse == null || string.IsNullOrEmpty(sourceString) || sourceString != TilesetId) + { + try + { + Unity.MapboxAccess.Instance.TileJSON.Get(sourceString, (response) => + { + //if the code has reached this point it means that there is a valid access token + tileJSONResponse = response; + if (response == null || response.VectorLayers == null) //indicates bad tileresponse + { + tileJSONData.ClearData(); + return; + } + tileJSONData.ProcessTileJSONData(response); + }); + } + catch (System.Exception) + { + //no valid access token causes MapboxAccess to throw an error and hence setting this property + tileJSONData.ClearData(); + } + } + else if (tileJSONData.LayerPropertyDescriptionDictionary.Count == 0) + { + tileJSONData.ProcessTileJSONData(tileJSONResponse); + } + } + else + { + tileJSONData.ClearData(); + } + TilesetId = sourceString; + } + + public void DrawLayerName(SerializedProperty property, List layerDisplayNames) + { + + var layerNameLabel = new GUIContent + { + text = "Data Layer", + tooltip = "The layer name from the Mapbox tileset that would be used for visualizing a feature" + }; + + //disable the selection if there is no layer + if (layerDisplayNames.Count == 0) + { + EditorGUILayout.LabelField(layerNameLabel, new GUIContent("No layers found: Invalid TilesetId / No Internet."), (GUIStyle)"minipopUp"); + return; + } + + //check the string value at the current _layerIndex to verify that the stored index matches the property string. + var layerString = property.FindPropertyRelative("layerName").stringValue; + if (layerDisplayNames.Contains(layerString)) + { + //if the layer contains the current layerstring, set it's index to match + _layerIndex = layerDisplayNames.FindIndex(s => s.Equals(layerString)); + + } + else + { + //if the selected layer isn't in the source, add a placeholder entry + _layerIndex = 0; + layerDisplayNames.Insert(0, layerString); + if (!tileJsonData.LayerPropertyDescriptionDictionary.ContainsKey(layerString)) + { + tileJsonData.LayerPropertyDescriptionDictionary.Add(layerString, new Dictionary()); + } + + } + + //create the display name guicontent array with an additional entry for the currently selected item + _layerTypeContent = new GUIContent[layerDisplayNames.Count]; + for (int extIdx = 0; extIdx < layerDisplayNames.Count; extIdx++) + { + _layerTypeContent[extIdx] = new GUIContent + { + text = layerDisplayNames[extIdx], + }; + } + + //draw the layer selection popup + _layerIndex = EditorGUILayout.Popup(layerNameLabel, _layerIndex, _layerTypeContent); + var parsedString = layerDisplayNames.ToArray()[_layerIndex].Split(new string[] { tileJsonData.commonLayersKey }, System.StringSplitOptions.None)[0].Trim(); + property.FindPropertyRelative("layerName").stringValue = parsedString; + } + + private string[] GetSubTypeValues(SerializedProperty layerProperty, string visualizerLayer, VectorSourceType sourceType) + { + string[] typesArray = null; + string roadLayer = layerProperty.FindPropertyRelative("roadLayer").stringValue; + string landuseLayer = layerProperty.FindPropertyRelative("landuseLayer").stringValue; + + if (visualizerLayer == roadLayer || visualizerLayer == landuseLayer) + { + _streetsV7TileStats = TileStatsFetcher.Instance.GetTileStats(sourceType); + if (_streetsV7TileStats != null && _streetsV7TileStats.layers != null && _streetsV7TileStats.layers.Length != 0) + { + foreach (var layer in _streetsV7TileStats.layers) + { + if (layer.layer != visualizerLayer) + { + continue; + } + + string presetPropertyName = ""; + if (layer.layer == roadLayer) + { + presetPropertyName = layerProperty.FindPropertyRelative("roadLayer_TypeProperty").stringValue; + } + else if (layer.layer == landuseLayer) + { + presetPropertyName = layerProperty.FindPropertyRelative("landuseLayer_TypeProperty").stringValue; + } + + if (layer.attributes != null && layer.attributes.Length > 0) + { + foreach (var attributeItem in layer.attributes) + { + if (attributeItem.attribute == presetPropertyName) + { + typesArray = attributeItem.values; + } + } + } + } + } + } + return typesArray; + } + } +} diff --git a/Unity/Editor/PropertyDrawers/FeaturesSubLayerPropertiesDrawer.cs.meta b/Unity/Editor/PropertyDrawers/FeaturesSubLayerPropertiesDrawer.cs.meta new file mode 100644 index 0000000..eac4b52 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/FeaturesSubLayerPropertiesDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a49c4311b159a483a8d3a61c78ac50bf +timeCreated: 1525818948 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/GeometryExtrusionOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/GeometryExtrusionOptionsDrawer.cs new file mode 100644 index 0000000..0729046 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/GeometryExtrusionOptionsDrawer.cs @@ -0,0 +1,240 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + using Mapbox.VectorTile.ExtensionMethods; + using System.Linq; + using Mapbox.Platform.TilesetTileJSON; + using System.Collections.Generic; + using Mapbox.Editor; + + [CustomPropertyDrawer(typeof(GeometryExtrusionOptions))] + public class GeometryExtrusionOptionsDrawer : PropertyDrawer + { + //indices for tileJSON lookup + int _propertyIndex = 0; + private static List _propertyNamesList = new List(); + GUIContent[] _propertyNameContent; + + GUIContent[] extrusionTypeContent; + bool isGUIContentSet = false; + static TileJsonData tileJsonData = new TileJsonData(); + static TileJSONResponse tileJsonResponse; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + var extrusionTypeProperty = property.FindPropertyRelative("extrusionType"); + var displayNames = extrusionTypeProperty.enumDisplayNames; + int count = extrusionTypeProperty.enumDisplayNames.Length; + + if (!isGUIContentSet) + { + extrusionTypeContent = new GUIContent[count]; + for (int extIdx = 0; extIdx < count; extIdx++) + { + extrusionTypeContent[extIdx] = new GUIContent + { + text = displayNames[extIdx], + tooltip = EnumExtensions.Description((ExtrusionType)extIdx), + }; + } + isGUIContentSet = true; + } + + var extrusionTypeLabel = new GUIContent + { + text = "Extrusion Type", + tooltip = "Type of geometry extrusion" + }; + + EditorGUI.BeginChangeCheck(); + extrusionTypeProperty.enumValueIndex = EditorGUILayout.Popup(extrusionTypeLabel, extrusionTypeProperty.enumValueIndex, extrusionTypeContent); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + var sourceTypeValue = (Unity.Map.ExtrusionType)extrusionTypeProperty.enumValueIndex; + + var minHeightProperty = property.FindPropertyRelative("minimumHeight"); + var maxHeightProperty = property.FindPropertyRelative("maximumHeight"); + + var extrusionGeometryType = property.FindPropertyRelative("extrusionGeometryType"); + var extrusionGeometryGUI = new GUIContent { text = "Geometry Type", tooltip = EnumExtensions.Description((Unity.Map.ExtrusionGeometryType)extrusionGeometryType.enumValueIndex) }; + EditorGUI.indentLevel++; + + EditorGUI.BeginChangeCheck(); + + switch (sourceTypeValue) + { + case Unity.Map.ExtrusionType.None: + break; + case Unity.Map.ExtrusionType.PropertyHeight: + EditorGUILayout.PropertyField(extrusionGeometryType, extrusionGeometryGUI); + DrawPropertyDropDown(property, position); + break; + case Unity.Map.ExtrusionType.MinHeight: + EditorGUILayout.PropertyField(extrusionGeometryType, extrusionGeometryGUI); + DrawPropertyDropDown(property, position); + break; + case Unity.Map.ExtrusionType.MaxHeight: + EditorGUILayout.PropertyField(extrusionGeometryType, extrusionGeometryGUI); + DrawPropertyDropDown(property, position); + break; + case Unity.Map.ExtrusionType.RangeHeight: + EditorGUILayout.PropertyField(extrusionGeometryType, extrusionGeometryGUI); + DrawPropertyDropDown(property, position); + EditorGUILayout.PropertyField(minHeightProperty); + EditorGUILayout.PropertyField(maxHeightProperty); + if (minHeightProperty.floatValue > maxHeightProperty.floatValue) + { + EditorGUILayout.HelpBox("Maximum Height less than Minimum Height!", MessageType.Error); + } + break; + case Unity.Map.ExtrusionType.AbsoluteHeight: + EditorGUILayout.PropertyField(extrusionGeometryType, extrusionGeometryGUI); + EditorGUILayout.PropertyField(maxHeightProperty, new GUIContent { text = "Height" }); + break; + default: + break; + } + + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(property.FindPropertyRelative("extrusionScaleFactor"), new GUIContent { text = "Scale Factor" }); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + EditorGUI.indentLevel--; + } + + private void DrawPropertyDropDown(SerializedProperty property, Rect position) + { + var selectedLayerName = property.FindPropertyRelative("_selectedLayerName").stringValue; + + var serializedMapObject = property.serializedObject; + AbstractMap mapObject = (AbstractMap)serializedMapObject.targetObject; + tileJsonData = mapObject.VectorData.GetTileJsonData(); + + DrawPropertyName(property, position, selectedLayerName); + } + + private void DrawPropertyName(SerializedProperty property, Rect position, string selectedLayerName) + { + var parsedString = "No property selected"; + var descriptionString = "No description available"; + + if (string.IsNullOrEmpty(selectedLayerName) || tileJsonData == null || !tileJsonData.PropertyDisplayNames.ContainsKey(selectedLayerName)) + { + DrawWarningMessage(position); + } + else + { + var propertyDisplayNames = tileJsonData.PropertyDisplayNames[selectedLayerName]; + _propertyNamesList = new List(propertyDisplayNames); + + //check if the selection is valid + var propertyString = property.FindPropertyRelative("propertyName").stringValue; + if (_propertyNamesList.Contains(propertyString)) + { + //if the layer contains the current layerstring, set it's index to match + _propertyIndex = propertyDisplayNames.FindIndex(s => s.Equals(propertyString)); + + + //create guicontent for a valid layer + _propertyNameContent = new GUIContent[_propertyNamesList.Count]; + for (int extIdx = 0; extIdx < _propertyNamesList.Count; extIdx++) + { + var parsedPropertyString = _propertyNamesList[extIdx].Split(new string[] { tileJsonData.optionalPropertiesString }, System.StringSplitOptions.None)[0].Trim(); + _propertyNameContent[extIdx] = new GUIContent + { + text = _propertyNamesList[extIdx], + tooltip = tileJsonData.LayerPropertyDescriptionDictionary[selectedLayerName][parsedPropertyString] + }; + } + + //display popup + var propertyNameLabel = new GUIContent { text = "Property Name", tooltip = "The name of the property in the selected Mapbox layer that will be used for extrusion" }; + + EditorGUI.BeginChangeCheck(); + _propertyIndex = EditorGUILayout.Popup(propertyNameLabel, _propertyIndex, _propertyNameContent); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + //set new string values based on selection + parsedString = _propertyNamesList[_propertyIndex].Split(new string[] { tileJsonData.optionalPropertiesString }, System.StringSplitOptions.None)[0].Trim(); + descriptionString = tileJsonData.LayerPropertyDescriptionDictionary[selectedLayerName][parsedString]; + + } + else + { + //if the selected layer isn't in the source, add a placeholder entry + _propertyIndex = 0; + _propertyNamesList.Insert(0, propertyString); + + //create guicontent for an invalid layer + _propertyNameContent = new GUIContent[_propertyNamesList.Count]; + + //first property gets a unique tooltip + _propertyNameContent[0] = new GUIContent + { + text = _propertyNamesList[0], + tooltip = "Unavialable in Selected Layer" + }; + + for (int extIdx = 1; extIdx < _propertyNamesList.Count; extIdx++) + { + var parsedPropertyString = _propertyNamesList[extIdx].Split(new string[] { tileJsonData.optionalPropertiesString }, System.StringSplitOptions.None)[0].Trim(); + _propertyNameContent[extIdx] = new GUIContent + { + text = _propertyNamesList[extIdx], + tooltip = tileJsonData.LayerPropertyDescriptionDictionary[selectedLayerName][parsedPropertyString] + }; + } + + //display popup + var propertyNameLabel = new GUIContent { text = "Property Name", tooltip = "The name of the property in the selected Mapbox layer that will be used for extrusion" }; + + EditorGUI.BeginChangeCheck(); + _propertyIndex = EditorGUILayout.Popup(propertyNameLabel, _propertyIndex, _propertyNameContent); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + //set new string values based on the offset + parsedString = _propertyNamesList[_propertyIndex].Split(new string[] { tileJsonData.optionalPropertiesString }, System.StringSplitOptions.None)[0].Trim(); + descriptionString = "Unavailable in Selected Layer."; + + } + + property.FindPropertyRelative("propertyName").stringValue = parsedString; + property.FindPropertyRelative("propertyDescription").stringValue = descriptionString; + + } + + descriptionString = string.IsNullOrEmpty(descriptionString) ? "No description available" : descriptionString; + + var propertyDescriptionPrefixLabel = new GUIContent { text = "Property Description", tooltip = "Factual information about the selected property" }; + EditorGUILayout.LabelField(propertyDescriptionPrefixLabel, new GUIContent(descriptionString), (GUIStyle)"wordWrappedLabel"); + } + + private void DrawWarningMessage(Rect position) + { + GUIStyle labelStyle = new GUIStyle(EditorStyles.popup); + labelStyle.fontStyle = FontStyle.Bold; + var layerNameLabel = new GUIContent { text = "Property Name", tooltip = "The name of the property in the selected Mapbox layer that will be used for extrusion" }; + EditorGUILayout.LabelField(layerNameLabel, new GUIContent("No properties found in layer"), labelStyle); + return; + } + } +} diff --git a/Unity/Editor/PropertyDrawers/GeometryExtrusionOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/GeometryExtrusionOptionsDrawer.cs.meta new file mode 100644 index 0000000..92e0ea9 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/GeometryExtrusionOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: d66413ab6b7d648e2ba3cfd4e1d72382 +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/GeometryMaterialOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/GeometryMaterialOptionsDrawer.cs new file mode 100644 index 0000000..2015d56 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/GeometryMaterialOptionsDrawer.cs @@ -0,0 +1,239 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity; + using Mapbox.Editor; + using Mapbox.Unity.Map; + using Mapbox.Unity.MeshGeneration.Data; + using Mapbox.VectorTile.ExtensionMethods; + using System.IO; + using System.Collections.Generic; + + public class StyleIconBundle + { + public string path; + public Texture texture; + public void Load() + { + if (texture == null) + { + texture = Resources.Load(path) as Texture; + } + } + + public StyleIconBundle(string styleName, string paletteName = "") + { + path = Path.Combine(Constants.Path.MAP_FEATURE_STYLES_SAMPLES, Path.Combine(styleName, string.Format("{0}Icon", (styleName + paletteName)))); + } + } + + [CustomPropertyDrawer(typeof(GeometryMaterialOptions))] + public class GeometryMaterialOptionsDrawer : PropertyDrawer + { + static float lineHeight = EditorGUIUtility.singleLineHeight; + private string objectId = ""; + bool showTexturing + { + get + { + return EditorPrefs.GetBool(objectId + "VectorSubLayerProperties_showTexturing"); + } + set + { + EditorPrefs.SetBool(objectId + "VectorSubLayerProperties_showTexturing", value); + } + } + + private Dictionary _styleIconBundles = new Dictionary() + { + {StyleTypes.Simple, new StyleIconBundle(StyleTypes.Simple.ToString())}, + {StyleTypes.Realistic, new StyleIconBundle(StyleTypes.Realistic.ToString())}, + {StyleTypes.Fantasy, new StyleIconBundle(StyleTypes.Fantasy.ToString())}, + {StyleTypes.Light, new StyleIconBundle(StyleTypes.Light.ToString())}, + {StyleTypes.Dark, new StyleIconBundle(StyleTypes.Dark.ToString())}, + {StyleTypes.Color, new StyleIconBundle(StyleTypes.Color.ToString())}, + {StyleTypes.Satellite, new StyleIconBundle(StyleTypes.Satellite.ToString())}, + }; + + private Dictionary _paletteIconBundles = new Dictionary() + { + {SamplePalettes.City, new StyleIconBundle(StyleTypes.Simple.ToString(), SamplePalettes.City.ToString())}, + {SamplePalettes.Cool, new StyleIconBundle(StyleTypes.Simple.ToString(), SamplePalettes.Cool.ToString())}, + {SamplePalettes.Rainbow, new StyleIconBundle(StyleTypes.Simple.ToString(), SamplePalettes.Rainbow.ToString())}, + {SamplePalettes.Urban, new StyleIconBundle(StyleTypes.Simple.ToString(), SamplePalettes.Urban.ToString())}, + {SamplePalettes.Warm, new StyleIconBundle(StyleTypes.Simple.ToString(), SamplePalettes.Warm.ToString())}, + }; + + /// + /// Loads the default style icons. + /// + + private void LoadDefaultStyleIcons() + { + foreach (var key in _styleIconBundles.Keys) + { + _styleIconBundles[key].Load(); + } + foreach (var key in _paletteIconBundles.Keys) + { + _paletteIconBundles[key].Load(); + } + } + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + + objectId = property.serializedObject.targetObject.GetInstanceID().ToString(); + + showTexturing = EditorGUILayout.Foldout(showTexturing, new GUIContent { text = "Texturing", tooltip = "Material options to texture the generated building geometry" }); + if (showTexturing) + { + LoadDefaultStyleIcons(); + EditorGUI.BeginProperty(position, label, property); + + var styleTypeLabel = new GUIContent { text = "Style Type", tooltip = "Texturing style for feature; choose from sample style or create your own by choosing Custom. " }; + var styleType = property.FindPropertyRelative("style"); + + GUIContent[] styleTypeGuiContent = new GUIContent[styleType.enumDisplayNames.Length]; + for (int i = 0; i < styleType.enumDisplayNames.Length; i++) + { + styleTypeGuiContent[i] = new GUIContent + { + text = styleType.enumDisplayNames[i] + }; + } + + EditorGUI.BeginChangeCheck(); + styleType.enumValueIndex = EditorGUILayout.Popup(styleTypeLabel, styleType.enumValueIndex, styleTypeGuiContent); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + EditorGUI.indentLevel++; + if ((StyleTypes)styleType.enumValueIndex != StyleTypes.Custom) + { + GUILayout.BeginHorizontal(); + + var style = (StyleTypes)styleType.enumValueIndex; + + Texture2D thumbnailTexture = (Texture2D)_styleIconBundles[style].texture; + + if ((StyleTypes)styleType.enumValueIndex == StyleTypes.Simple) + { + var samplePaletteType = property.FindPropertyRelative("samplePalettes"); + var palette = (SamplePalettes)samplePaletteType.enumValueIndex; + thumbnailTexture = (Texture2D)_paletteIconBundles[palette].texture; + } + + string descriptionLabel = EnumExtensions.Description(style); + EditorGUILayout.LabelField(new GUIContent(" ", thumbnailTexture), Constants.GUI.Styles.EDITOR_TEXTURE_THUMBNAIL_STYLE, GUILayout.Height(60), GUILayout.Width(EditorGUIUtility.labelWidth - 60)); + EditorGUILayout.TextArea(descriptionLabel, (GUIStyle)"wordWrappedLabel"); + + GUILayout.EndHorizontal(); + + EditorGUI.BeginChangeCheck(); + + switch ((StyleTypes)styleType.enumValueIndex) + { + case StyleTypes.Simple: + var samplePaletteType = property.FindPropertyRelative("samplePalettes"); + var samplePaletteTypeLabel = new GUIContent { text = "Palette Type", tooltip = "Palette type for procedural colorization; choose from sample palettes or create your own by choosing Custom. " }; + + GUIContent[] samplePaletteTypeGuiContent = new GUIContent[samplePaletteType.enumDisplayNames.Length]; + for (int i = 0; i < samplePaletteType.enumDisplayNames.Length; i++) + { + samplePaletteTypeGuiContent[i] = new GUIContent + { + text = samplePaletteType.enumDisplayNames[i] + }; + } + samplePaletteType.enumValueIndex = EditorGUILayout.Popup(samplePaletteTypeLabel, samplePaletteType.enumValueIndex, samplePaletteTypeGuiContent); + break; + case StyleTypes.Light: + property.FindPropertyRelative("lightStyleOpacity").floatValue = EditorGUILayout.Slider("Opacity", property.FindPropertyRelative("lightStyleOpacity").floatValue, 0.0f, 1.0f); + break; + case StyleTypes.Dark: + property.FindPropertyRelative("darkStyleOpacity").floatValue = EditorGUILayout.Slider("Opacity", property.FindPropertyRelative("darkStyleOpacity").floatValue, 0.0f, 1.0f); + break; + case StyleTypes.Color: + property.FindPropertyRelative("colorStyleColor").colorValue = EditorGUILayout.ColorField("Color", property.FindPropertyRelative("colorStyleColor").colorValue); + break; + default: + break; + } + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + } + else + { + var customStyleProperty = property.FindPropertyRelative("customStyleOptions"); + var texturingType = customStyleProperty.FindPropertyRelative("texturingType"); + + int valIndex = texturingType.enumValueIndex == 0 ? 0 : texturingType.enumValueIndex + 1; + var texturingTypeGUI = new GUIContent { text = "Texturing Type", tooltip = EnumExtensions.Description((UvMapType)valIndex) }; + + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(texturingType, texturingTypeGUI); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + var matList = customStyleProperty.FindPropertyRelative("materials"); + if (matList.arraySize == 0) + { + matList.arraySize = 2; + } + GUILayout.Space(-lineHeight); + + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(matList.GetArrayElementAtIndex(0), new GUIContent { text = "Top Material", tooltip = "Unity material to use for extruded top/roof mesh. " }); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + + GUILayout.Space(-lineHeight); + + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(matList.GetArrayElementAtIndex(1), new GUIContent { text = "Side Material", tooltip = "Unity material to use for extruded side/wall mesh. " }); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + EditorGUI.BeginChangeCheck(); + + if ((UvMapType)texturingType.enumValueIndex + 1 == UvMapType.Atlas) + { + var atlasInfo = customStyleProperty.FindPropertyRelative("atlasInfo"); + EditorGUILayout.ObjectField(atlasInfo, new GUIContent { text = "Altas Info", tooltip = "Atlas information scriptable object, this defines how the texture roof and wall texture atlases will be used. " }); + } + if ((UvMapType)texturingType.enumValueIndex + 1 == UvMapType.AtlasWithColorPalette) + { + var atlasInfo = customStyleProperty.FindPropertyRelative("atlasInfo"); + EditorGUILayout.ObjectField(atlasInfo, new GUIContent { text = "Altas Info", tooltip = "Atlas information scriptable object, this defines how the texture roof and wall texture atlases will be used. " }); + + var colorPalette = customStyleProperty.FindPropertyRelative("colorPalette"); + EditorGUILayout.ObjectField(colorPalette, new GUIContent { text = "Color Palette", tooltip = "Color palette scriptable object, allows texture features to be procedurally colored at runtime. Requires materials that use the MapboxPerRenderer shader. " }); + + EditorGUILayout.LabelField(new GUIContent { text = "Note: Atlas With Color Palette requires materials that use the MapboxPerRenderer shader." }, Constants.GUI.Styles.EDITOR_NOTE_STYLE); + } + + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + } + EditorGUI.indentLevel--; + EditorGUI.EndProperty(); + } + } + } +} \ No newline at end of file diff --git a/Unity/Editor/PropertyDrawers/GeometryMaterialOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/GeometryMaterialOptionsDrawer.cs.meta new file mode 100644 index 0000000..7884763 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/GeometryMaterialOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: e8e9adb2cd7094d48acbefb75a01436b +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/ImageryLayerPropertiesDrawer.cs b/Unity/Editor/PropertyDrawers/ImageryLayerPropertiesDrawer.cs new file mode 100644 index 0000000..431aac8 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/ImageryLayerPropertiesDrawer.cs @@ -0,0 +1,97 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + using Mapbox.VectorTile.ExtensionMethods; + + [CustomPropertyDrawer(typeof(ImageryLayerProperties))] + public class ImageryLayerPropertiesDrawer : PropertyDrawer + { + GUIContent[] sourceTypeContent; + bool isGUIContentSet = false; + + private GUIContent _tilesetIdGui = new GUIContent + { + text = "Tileset Id", + tooltip = "Id of the tileset." + }; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + var sourceTypeProperty = property.FindPropertyRelative("sourceType"); + var sourceTypeValue = (ImagerySourceType)sourceTypeProperty.enumValueIndex; + + var displayNames = sourceTypeProperty.enumDisplayNames; + int count = sourceTypeProperty.enumDisplayNames.Length; + if (!isGUIContentSet) + { + sourceTypeContent = new GUIContent[count]; + for (int extIdx = 0; extIdx < count; extIdx++) + { + sourceTypeContent[extIdx] = new GUIContent + { + text = displayNames[extIdx], + tooltip = EnumExtensions.Description((ImagerySourceType)extIdx), + }; + } + isGUIContentSet = true; + } + + // Draw label. + var sourceTypeLabel = new GUIContent { text = "Data Source", tooltip = "Source tileset for Imagery." }; + + EditorGUI.BeginChangeCheck(); + sourceTypeProperty.enumValueIndex = EditorGUILayout.Popup(sourceTypeLabel, sourceTypeProperty.enumValueIndex, sourceTypeContent); + if(EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + sourceTypeValue = (ImagerySourceType)sourceTypeProperty.enumValueIndex; + + var sourceOptionsProperty = property.FindPropertyRelative("sourceOptions"); + var layerSourceProperty = sourceOptionsProperty.FindPropertyRelative("layerSource"); + var layerSourceId = layerSourceProperty.FindPropertyRelative("Id"); + + EditorGUI.BeginChangeCheck(); + + switch (sourceTypeValue) + { + case ImagerySourceType.MapboxStreets: + case ImagerySourceType.MapboxOutdoors: + case ImagerySourceType.MapboxDark: + case ImagerySourceType.MapboxLight: + case ImagerySourceType.MapboxSatellite: + case ImagerySourceType.MapboxSatelliteStreet: + var sourcePropertyValue = MapboxDefaultImagery.GetParameters(sourceTypeValue); + layerSourceId.stringValue = sourcePropertyValue.Id; + GUI.enabled = false; + EditorGUILayout.PropertyField(sourceOptionsProperty, _tilesetIdGui); + GUI.enabled = true; + break; + case ImagerySourceType.Custom: + EditorGUILayout.PropertyField(sourceOptionsProperty, new GUIContent { text = "Tileset Id / Style URL", tooltip = _tilesetIdGui.tooltip }); + break; + case ImagerySourceType.None: + break; + default: + break; + } + + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + if (sourceTypeValue != ImagerySourceType.None) + { + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(property.FindPropertyRelative("rasterOptions")); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + } + } + } +} diff --git a/Unity/Editor/PropertyDrawers/ImageryLayerPropertiesDrawer.cs.meta b/Unity/Editor/PropertyDrawers/ImageryLayerPropertiesDrawer.cs.meta new file mode 100644 index 0000000..4ebbe1a --- /dev/null +++ b/Unity/Editor/PropertyDrawers/ImageryLayerPropertiesDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 8d00c4bf63fb7481bba0b0a96c4e9b03 +timeCreated: 1517889179 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/ImageryRasterOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/ImageryRasterOptionsDrawer.cs new file mode 100644 index 0000000..0fbc95e --- /dev/null +++ b/Unity/Editor/PropertyDrawers/ImageryRasterOptionsDrawer.cs @@ -0,0 +1,32 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + + [CustomPropertyDrawer(typeof(ImageryRasterOptions))] + public class ImageryRasterOptionsDrawer : PropertyDrawer + { + static float lineHeight = EditorGUIUtility.singleLineHeight; + bool showPosition = true; + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, label, property); + position.height = lineHeight; + foreach (var item in property) + { + var subproperty = item as SerializedProperty; + EditorGUI.PropertyField(position, subproperty, true); + position.height = lineHeight; + position.y += lineHeight; + } + + EditorGUI.EndProperty(); + } + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + int rows = (showPosition) ? 3 : 1; + return (float)rows * lineHeight; + } + } +} diff --git a/Unity/Editor/PropertyDrawers/ImageryRasterOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/ImageryRasterOptionsDrawer.cs.meta new file mode 100644 index 0000000..3254b30 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/ImageryRasterOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 6eff4b0718ee34d37913417f65afad08 +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/LayerPerformanceOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/LayerPerformanceOptionsDrawer.cs new file mode 100644 index 0000000..28e0adc --- /dev/null +++ b/Unity/Editor/PropertyDrawers/LayerPerformanceOptionsDrawer.cs @@ -0,0 +1,26 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + + [CustomPropertyDrawer(typeof(LayerPerformanceOptions))] + public class LayerPerformanceOptionsDrawer : PropertyDrawer + { + SerializedProperty isActiveProperty; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + isActiveProperty = property.FindPropertyRelative("isEnabled"); + + isActiveProperty.boolValue = EditorGUILayout.Toggle(new GUIContent("Enable Coroutines"), isActiveProperty.boolValue); + + if (isActiveProperty.boolValue == true) + { + EditorGUI.indentLevel++; + EditorGUILayout.PropertyField(property.FindPropertyRelative("entityPerCoroutine"), true); + EditorGUI.indentLevel--; + } + } + } +} diff --git a/Unity/Editor/PropertyDrawers/LayerPerformanceOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/LayerPerformanceOptionsDrawer.cs.meta new file mode 100644 index 0000000..5facc09 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/LayerPerformanceOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 16db3da0a971247e79b6bb10e0d26862 +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/LayerSourceOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/LayerSourceOptionsDrawer.cs new file mode 100644 index 0000000..a5a395f --- /dev/null +++ b/Unity/Editor/PropertyDrawers/LayerSourceOptionsDrawer.cs @@ -0,0 +1,24 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + + [CustomPropertyDrawer(typeof(LayerSourceOptions))] + public class LayerSourceOptionsDrawer : PropertyDrawer + { + static float lineHeight = EditorGUIUtility.singleLineHeight; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, label, property); + position.height = lineHeight; + EditorGUI.PropertyField(position, property.FindPropertyRelative("layerSource"), label); + EditorGUI.EndProperty(); + } + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return lineHeight; + } + } +} diff --git a/Unity/Editor/PropertyDrawers/LayerSourceOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/LayerSourceOptionsDrawer.cs.meta new file mode 100644 index 0000000..b97c093 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/LayerSourceOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 66a87ffd5023a4fbe889f65e3fdcb4ac +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/LineGeometryOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/LineGeometryOptionsDrawer.cs new file mode 100644 index 0000000..3c71e20 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/LineGeometryOptionsDrawer.cs @@ -0,0 +1,37 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + using System.Collections.Generic; + using System.Linq; + using System; + using Mapbox.VectorTile.ExtensionMethods; + + [CustomPropertyDrawer(typeof(LineGeometryOptions))] + public class LineGeometryOptionsDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginChangeCheck(); + + EditorGUILayout.PropertyField(property.FindPropertyRelative("Width")); + property.FindPropertyRelative("JoinType").enumValueIndex = (int)((LineJoinType)EditorGUILayout.EnumPopup("Join Type", (LineJoinType)property.FindPropertyRelative("JoinType").intValue)); + if (property.FindPropertyRelative("JoinType").enumValueIndex == (int)LineJoinType.Miter || property.FindPropertyRelative("JoinType").enumValueIndex == (int)LineJoinType.Bevel) + { + EditorGUILayout.PropertyField(property.FindPropertyRelative("MiterLimit")); + } + else if (property.FindPropertyRelative("JoinType").enumValueIndex == (int)LineJoinType.Round) + { + EditorGUILayout.PropertyField(property.FindPropertyRelative("RoundLimit")); + } + + property.FindPropertyRelative("CapType").enumValueIndex = (int)((LineCapType)EditorGUILayout.EnumPopup("Cap Type", (LineCapType)property.FindPropertyRelative("CapType").intValue)); + + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + } + } +} diff --git a/Unity/Editor/PropertyDrawers/LineGeometryOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/LineGeometryOptionsDrawer.cs.meta new file mode 100644 index 0000000..81a938a --- /dev/null +++ b/Unity/Editor/PropertyDrawers/LineGeometryOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 81806f31401d69747ba09bd8aa3e4c73 +timeCreated: 1537464920 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/MapExtentOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/MapExtentOptionsDrawer.cs new file mode 100644 index 0000000..1ec5f1e --- /dev/null +++ b/Unity/Editor/PropertyDrawers/MapExtentOptionsDrawer.cs @@ -0,0 +1,77 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + using Mapbox.VectorTile.ExtensionMethods; + + [CustomPropertyDrawer(typeof(MapExtentOptions))] + public class MapExtentOptionsDrawer : PropertyDrawer + { + static string extTypePropertyName = "extentType"; + static float _lineHeight = EditorGUIUtility.singleLineHeight; + GUIContent[] extentTypeContent; + bool isGUIContentSet = false; + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + var kindProperty = property.FindPropertyRelative(extTypePropertyName); + var displayNames = kindProperty.enumDisplayNames; + int count = kindProperty.enumDisplayNames.Length; + if (!isGUIContentSet) + { + extentTypeContent = new GUIContent[count]; + for (int extIdx = 0; extIdx < count; extIdx++) + { + extentTypeContent[extIdx] = new GUIContent + { + text = displayNames[extIdx], + tooltip = EnumExtensions.Description((MapExtentType)extIdx), + }; + } + isGUIContentSet = true; + } + // Draw label. + var extentTypeLabel = new GUIContent + { + text = label.text, + tooltip = "Options to determine the geographic extent of the world for which the map tiles will be requested.", + }; + EditorGUI.BeginChangeCheck(); + kindProperty.enumValueIndex = EditorGUILayout.Popup(extentTypeLabel, kindProperty.enumValueIndex, extentTypeContent, GUILayout.Height(_lineHeight)); + + var kind = (MapExtentType)kindProperty.enumValueIndex; + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + EditorGUI.indentLevel++; + + GUILayout.Space(-_lineHeight); + SerializedProperty defaultExtentsProp = property.FindPropertyRelative("defaultExtents"); + EditorGUI.BeginChangeCheck(); + + switch (kind) + { + case MapExtentType.CameraBounds: + GUILayout.Space(_lineHeight); + EditorGUILayout.PropertyField(defaultExtentsProp.FindPropertyRelative("cameraBoundsOptions"), new GUIContent { text = "CameraOptions-" }); + break; + case MapExtentType.RangeAroundCenter: + EditorGUILayout.PropertyField(defaultExtentsProp.FindPropertyRelative("rangeAroundCenterOptions"), new GUIContent { text = "RangeAroundCenter" }); + break; + case MapExtentType.RangeAroundTransform: + GUILayout.Space(_lineHeight); + EditorGUILayout.PropertyField(defaultExtentsProp.FindPropertyRelative("rangeAroundTransformOptions"), new GUIContent { text = "RangeAroundTransform" }); + break; + default: + break; + } + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(defaultExtentsProp); + } + EditorGUI.indentLevel--; + } + } +} \ No newline at end of file diff --git a/Unity/Editor/PropertyDrawers/MapExtentOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/MapExtentOptionsDrawer.cs.meta new file mode 100644 index 0000000..da6dcc1 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/MapExtentOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 61582b113819848348a7a1a629916371 +timeCreated: 1517858264 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/MapLocationOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/MapLocationOptionsDrawer.cs new file mode 100644 index 0000000..b5cf930 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/MapLocationOptionsDrawer.cs @@ -0,0 +1,32 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + + [CustomPropertyDrawer(typeof(MapLocationOptions))] + public class MapLocationOptionsDrawer : PropertyDrawer + { + static float _lineHeight = EditorGUIUtility.singleLineHeight; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.indentLevel++; + GUILayout.Space(-1f * _lineHeight); + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(property.FindPropertyRelative("latitudeLongitude")); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(property.FindPropertyRelative("zoom"), GUILayout.Height(_lineHeight)); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + EditorGUI.indentLevel--; + } + } +} \ No newline at end of file diff --git a/Unity/Editor/PropertyDrawers/MapLocationOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/MapLocationOptionsDrawer.cs.meta new file mode 100644 index 0000000..7f5cbdf --- /dev/null +++ b/Unity/Editor/PropertyDrawers/MapLocationOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: cba048f4ed8d1458e88aee6ae0ae4226 +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/MapOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/MapOptionsDrawer.cs new file mode 100644 index 0000000..5dae84c --- /dev/null +++ b/Unity/Editor/PropertyDrawers/MapOptionsDrawer.cs @@ -0,0 +1,78 @@ +using Mapbox.Unity.Map.TileProviders; + +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + [CustomPropertyDrawer(typeof(MapOptions))] + public class MapOptionsDrawer : PropertyDrawer + { + static float lineHeight = EditorGUIUtility.singleLineHeight; + bool showPosition = false; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, label, property); + + position.height = lineHeight; + EditorGUI.LabelField(position, "Location "); + position.y += lineHeight; + EditorGUILayout.PropertyField(property.FindPropertyRelative("locationOptions")); + position.y += EditorGUI.GetPropertyHeight(property.FindPropertyRelative("locationOptions")); + var extentOptions = property.FindPropertyRelative("extentOptions"); + var extentOptionsType = extentOptions.FindPropertyRelative("extentType"); + if ((MapExtentType)extentOptionsType.enumValueIndex == MapExtentType.Custom) + { + var test = property.serializedObject.FindProperty("_tileProvider"); + + EditorGUI.PropertyField(position, test); + position.y += lineHeight; + } + else + { + EditorGUI.PropertyField(position, property.FindPropertyRelative("extentOptions")); + + position.y += EditorGUI.GetPropertyHeight(property.FindPropertyRelative("extentOptions")); + } + + showPosition = EditorGUI.Foldout(position, showPosition, "Others"); + if (showPosition) + { + position.y += lineHeight; + EditorGUILayout.PropertyField(property.FindPropertyRelative("placementOptions")); + + position.y += EditorGUI.GetPropertyHeight(property.FindPropertyRelative("placementOptions")); + EditorGUI.PropertyField(position, property.FindPropertyRelative("scalingOptions")); + + } + EditorGUI.EndProperty(); + + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + // Reserve space for the total visible properties. + float height = 2.0f * lineHeight; + if (showPosition) + { + height += EditorGUI.GetPropertyHeight(property.FindPropertyRelative("placementOptions")); + height += EditorGUI.GetPropertyHeight(property.FindPropertyRelative("scalingOptions")); + } + height += EditorGUI.GetPropertyHeight(property.FindPropertyRelative("locationOptions")); + height += EditorGUI.GetPropertyHeight(property.FindPropertyRelative("extentOptions")); + return height; + } + } + + [CustomPropertyDrawer(typeof(AbstractTileProvider))] + public class AbstractTileProviderDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, label, property); + EditorGUI.ObjectField(position, property); + EditorGUI.EndProperty(); + } + } +} \ No newline at end of file diff --git a/Unity/Editor/PropertyDrawers/MapOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/MapOptionsDrawer.cs.meta new file mode 100644 index 0000000..c49e9c4 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/MapOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 9f76f257073bf49efbf18d1e75531f2a +timeCreated: 1520010402 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/MapPlacementOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/MapPlacementOptionsDrawer.cs new file mode 100644 index 0000000..9516025 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/MapPlacementOptionsDrawer.cs @@ -0,0 +1,38 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + using Mapbox.VectorTile.ExtensionMethods; + + [CustomPropertyDrawer(typeof(MapPlacementOptions))] + public class MapPlacementOptionsDrawer : PropertyDrawer + { + GUIContent[] placementTypeContent; + bool isGUIContentSet = false; + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + var placementType = property.FindPropertyRelative("placementType"); + var snapMapToTerrain = property.FindPropertyRelative("snapMapToZero"); + + var displayNames = placementType.enumDisplayNames; + int count = placementType.enumDisplayNames.Length; + if (!isGUIContentSet) + { + placementTypeContent = new GUIContent[count]; + for (int extIdx = 0; extIdx < count; extIdx++) + { + placementTypeContent[extIdx] = new GUIContent + { + text = displayNames[extIdx], + tooltip = EnumExtensions.Description((MapPlacementType)extIdx), + }; + } + isGUIContentSet = true; + } + + placementType.enumValueIndex = EditorGUILayout.Popup(new GUIContent { text = label.text, tooltip = "Placement of Map root.", }, placementType.enumValueIndex, placementTypeContent); + EditorGUILayout.PropertyField(snapMapToTerrain, new GUIContent { text = snapMapToTerrain.displayName, tooltip = "If checked, map's root will be snapped to zero. " }); + } + } +} diff --git a/Unity/Editor/PropertyDrawers/MapPlacementOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/MapPlacementOptionsDrawer.cs.meta new file mode 100644 index 0000000..41df501 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/MapPlacementOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 5156142fbca0a4c7bbc4b5949bd9a004 +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/MapScalingOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/MapScalingOptionsDrawer.cs new file mode 100644 index 0000000..8639b39 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/MapScalingOptionsDrawer.cs @@ -0,0 +1,46 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + using Mapbox.VectorTile.ExtensionMethods; + + [CustomPropertyDrawer(typeof(MapScalingOptions))] + public class MapScalingOptionsDrawer : PropertyDrawer + { + static float lineHeight = EditorGUIUtility.singleLineHeight; + GUIContent[] scalingTypeContent; + bool isGUIContentSet = false; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + var scalingType = property.FindPropertyRelative("scalingType"); + var displayNames = scalingType.enumDisplayNames; + int count = scalingType.enumDisplayNames.Length; + if (!isGUIContentSet) + { + scalingTypeContent = new GUIContent[count]; + for (int extIdx = 0; extIdx < count; extIdx++) + { + scalingTypeContent[extIdx] = new GUIContent + { + text = displayNames[extIdx], + tooltip = EnumExtensions.Description((MapScalingType)extIdx), + }; + } + isGUIContentSet = true; + } + + // Draw label. + var scalingTypeLabel = new GUIContent { text = label.text, tooltip = "Scale of map in game units.", }; + + scalingType.enumValueIndex = EditorGUILayout.Popup(scalingTypeLabel, scalingType.enumValueIndex, scalingTypeContent); + + if ((MapScalingType)scalingType.enumValueIndex == MapScalingType.Custom) + { + position.y += lineHeight; + EditorGUILayout.PropertyField(property.FindPropertyRelative("unityTileSize")); + } + } + } +} \ No newline at end of file diff --git a/Unity/Editor/PropertyDrawers/MapScalingOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/MapScalingOptionsDrawer.cs.meta new file mode 100644 index 0000000..3aace9f --- /dev/null +++ b/Unity/Editor/PropertyDrawers/MapScalingOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 3273da310cf694e0982177c792acf843 +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/MaterialListDrawer.cs b/Unity/Editor/PropertyDrawers/MaterialListDrawer.cs new file mode 100644 index 0000000..2015535 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/MaterialListDrawer.cs @@ -0,0 +1,22 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.MeshGeneration.Modifiers; + + [CustomPropertyDrawer(typeof(MaterialList))] + public class MaterialListDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, label, property); + var matArray = property.FindPropertyRelative("Materials"); + if (matArray.arraySize == 0) + { + matArray.arraySize = 1; + } + EditorGUILayout.PropertyField(property.FindPropertyRelative("Materials").GetArrayElementAtIndex(0), label); + EditorGUI.EndProperty(); + } + } +} \ No newline at end of file diff --git a/Unity/Editor/PropertyDrawers/MaterialListDrawer.cs.meta b/Unity/Editor/PropertyDrawers/MaterialListDrawer.cs.meta new file mode 100644 index 0000000..baebce5 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/MaterialListDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ac4d01f35c9334c9f90ce5c57523f06c +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/ModelingSectionDrawer.cs b/Unity/Editor/PropertyDrawers/ModelingSectionDrawer.cs new file mode 100644 index 0000000..748e0a4 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/ModelingSectionDrawer.cs @@ -0,0 +1,93 @@ +namespace Mapbox.Editor +{ + using UnityEngine; + using System; + using System.Collections; + using UnityEditor; + using Mapbox.Unity.Map; + using Mapbox.Editor; + using Mapbox.Unity.MeshGeneration.Modifiers; + + public class ModelingSectionDrawer + { + private string objectId = ""; + bool showModeling + { + get + { + return EditorPrefs.GetBool(objectId + "VectorSubLayerProperties_showModeling"); + } + set + { + EditorPrefs.SetBool(objectId + "VectorSubLayerProperties_showModeling", value); + } + } + static float _lineHeight = EditorGUIUtility.singleLineHeight; + + public void DrawUI(SerializedProperty subLayerCoreOptions, SerializedProperty layerProperty, VectorPrimitiveType primitiveTypeProp) + { + + objectId = layerProperty.serializedObject.targetObject.GetInstanceID().ToString(); + + EditorGUILayout.BeginVertical(); + showModeling = EditorGUILayout.Foldout(showModeling, new GUIContent { text = "Modeling", tooltip = "This section provides you with options to fine tune your meshes" }); + if (showModeling) + { + GUILayout.Space(-_lineHeight); + EditorGUILayout.PropertyField(subLayerCoreOptions); + + if (primitiveTypeProp == VectorPrimitiveType.Line) + { + GUILayout.Space(-_lineHeight); + var lineGeometryOptions = layerProperty.FindPropertyRelative("lineGeometryOptions"); + EditorGUILayout.PropertyField(lineGeometryOptions); + } + + if (primitiveTypeProp != VectorPrimitiveType.Point && primitiveTypeProp != VectorPrimitiveType.Custom) + { + GUILayout.Space(-_lineHeight); + var extrusionOptions = layerProperty.FindPropertyRelative("extrusionOptions"); + extrusionOptions.FindPropertyRelative("_selectedLayerName").stringValue = subLayerCoreOptions.FindPropertyRelative("layerName").stringValue; + EditorGUILayout.PropertyField(extrusionOptions); + + EditorGUI.BeginChangeCheck(); + var snapToTerrainProperty = subLayerCoreOptions.FindPropertyRelative("snapToTerrain"); + snapToTerrainProperty.boolValue = EditorGUILayout.Toggle(snapToTerrainProperty.displayName, snapToTerrainProperty.boolValue); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(subLayerCoreOptions); + } + } + + if (primitiveTypeProp != VectorPrimitiveType.Point) + { + EditorGUI.BeginChangeCheck(); + var combineMeshesProperty = subLayerCoreOptions.FindPropertyRelative("combineMeshes"); + combineMeshesProperty.boolValue = EditorGUILayout.Toggle(combineMeshesProperty.displayName, combineMeshesProperty.boolValue); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(subLayerCoreOptions); + } + } + + if (primitiveTypeProp != VectorPrimitiveType.Point && primitiveTypeProp != VectorPrimitiveType.Custom) + { + GUILayout.Space(-_lineHeight); + + var colliderOptionsProperty = layerProperty.FindPropertyRelative("colliderOptions"); + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(colliderOptionsProperty); + if (EditorGUI.EndChangeCheck()) + { + Debug.Log("Collider UI changed"); + EditorHelper.CheckForModifiedProperty(colliderOptionsProperty); + } + } + } + EditorGUILayout.EndVertical(); + } + + + + } +} diff --git a/Unity/Editor/PropertyDrawers/ModelingSectionDrawer.cs.meta b/Unity/Editor/PropertyDrawers/ModelingSectionDrawer.cs.meta new file mode 100644 index 0000000..991bbcd --- /dev/null +++ b/Unity/Editor/PropertyDrawers/ModelingSectionDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 39f85c0d2d7cb4b5e989cf0edd7109a9 +timeCreated: 1529620234 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/PointsOfInterestSubLayerPropertiesDrawer.cs b/Unity/Editor/PropertyDrawers/PointsOfInterestSubLayerPropertiesDrawer.cs new file mode 100644 index 0000000..189432c --- /dev/null +++ b/Unity/Editor/PropertyDrawers/PointsOfInterestSubLayerPropertiesDrawer.cs @@ -0,0 +1,232 @@ +namespace Mapbox.Unity.Map +{ + using UnityEngine; + using System.Collections.Generic; + using UnityEditor; + using Mapbox.Editor; + using UnityEditor.IMGUI.Controls; + using System.Linq; + + public class PointsOfInterestSubLayerPropertiesDrawer + { + string objectId = ""; + static float _lineHeight = EditorGUIUtility.singleLineHeight; + + FeatureSubLayerTreeView layerTreeView; + IList selectedLayers = new List(); + + private TreeModel treeModel; + [SerializeField] + TreeViewState m_TreeViewState; + + [SerializeField] + MultiColumnHeaderState m_MultiColumnHeaderState; + + bool m_Initialized = false; + public bool isLayerAdded = false; + + int SelectionIndex + { + get + { + return EditorPrefs.GetInt(objectId + "LocationPrefabsLayerProperties_selectionIndex"); + } + set + { + EditorPrefs.SetInt(objectId + "LocationPrefabsLayerProperties_selectionIndex", value); + } + } + + public void DrawUI(SerializedProperty property) + { + objectId = property.serializedObject.targetObject.GetInstanceID().ToString(); + var prefabItemArray = property.FindPropertyRelative("locationPrefabList"); + var layersRect = EditorGUILayout.GetControlRect(GUILayout.MinHeight(Mathf.Max(prefabItemArray.arraySize + 1, 1) * _lineHeight + MultiColumnHeader.DefaultGUI.defaultHeight), + GUILayout.MaxHeight((prefabItemArray.arraySize + 1) * _lineHeight + MultiColumnHeader.DefaultGUI.defaultHeight)); + + if (!m_Initialized) + { + bool firstInit = m_MultiColumnHeaderState == null; + var headerState = FeatureSubLayerTreeView.CreateDefaultMultiColumnHeaderState(); + if (MultiColumnHeaderState.CanOverwriteSerializedFields(m_MultiColumnHeaderState, headerState)) + { + MultiColumnHeaderState.OverwriteSerializedFields(m_MultiColumnHeaderState, headerState); + } + m_MultiColumnHeaderState = headerState; + + var multiColumnHeader = new FeatureSectionMultiColumnHeader(headerState); + + if (firstInit) + { + multiColumnHeader.ResizeToFit(); + } + + treeModel = new TreeModel(GetData(prefabItemArray)); + if (m_TreeViewState == null) + { + m_TreeViewState = new TreeViewState(); + } + + if (layerTreeView == null) + { + layerTreeView = new FeatureSubLayerTreeView(m_TreeViewState, multiColumnHeader, treeModel, FeatureSubLayerTreeView.uniqueIdPoI); + } + layerTreeView.multiColumnHeader = multiColumnHeader; + m_Initialized = true; + } + + + layerTreeView.Layers = prefabItemArray; + layerTreeView.Reload(); + layerTreeView.OnGUI(layersRect); + + if (layerTreeView.hasChanged) + { + EditorHelper.CheckForModifiedProperty(property); + layerTreeView.hasChanged = false; + } + + selectedLayers = layerTreeView.GetSelection(); + //if there are selected elements, set the selection index at the first element. + //if not, use the Selection index to persist the selection at the right index. + if (selectedLayers.Count > 0) + { + //ensure that selectedLayers[0] isn't out of bounds + if (selectedLayers[0] - FeatureSubLayerTreeView.uniqueIdPoI > prefabItemArray.arraySize - 1) + { + selectedLayers[0] = prefabItemArray.arraySize - 1 + FeatureSubLayerTreeView.uniqueIdPoI; + } + + SelectionIndex = selectedLayers[0]; + + } + else + { + selectedLayers = new int[1] { SelectionIndex }; + if (SelectionIndex > 0 && (SelectionIndex - FeatureSubLayerTreeView.uniqueIdPoI <= prefabItemArray.arraySize - 1)) + { + layerTreeView.SetSelection(selectedLayers); + } + } + + + GUILayout.Space(EditorGUIUtility.singleLineHeight); + EditorGUILayout.BeginHorizontal(); + + if (GUILayout.Button(new GUIContent("Add Layer"), (GUIStyle)"minibuttonleft")) + { + prefabItemArray.arraySize++; + + var prefabItem = prefabItemArray.GetArrayElementAtIndex(prefabItemArray.arraySize - 1); + var prefabItemName = prefabItem.FindPropertyRelative("coreOptions.sublayerName"); + + prefabItemName.stringValue = "New Location"; + + // Set defaults here because SerializedProperty copies the previous element. + prefabItem.FindPropertyRelative("coreOptions.isActive").boolValue = true; + prefabItem.FindPropertyRelative("coreOptions.snapToTerrain").boolValue = true; + prefabItem.FindPropertyRelative("presetFeatureType").enumValueIndex = (int)PresetFeatureType.Points; + var categories = prefabItem.FindPropertyRelative("categories"); + categories.intValue = (int)(LocationPrefabCategories.AnyCategory);//To select any category option + + var density = prefabItem.FindPropertyRelative("density"); + density.intValue = 15;//To select all locations option + + //Refreshing the tree + layerTreeView.Layers = prefabItemArray; + layerTreeView.AddElementToTree(prefabItem); + layerTreeView.Reload(); + + selectedLayers = new int[1] { prefabItemArray.arraySize - 1 }; + layerTreeView.SetSelection(selectedLayers); + + if (EditorHelper.DidModifyProperty(property)) + { + isLayerAdded = true; + } + } + + if (GUILayout.Button(new GUIContent("Remove Selected"), (GUIStyle)"minibuttonright")) + { + foreach (var index in selectedLayers.OrderByDescending(i => i)) + { + if (layerTreeView != null) + { + var poiSubLayer = prefabItemArray.GetArrayElementAtIndex(index - FeatureSubLayerTreeView.uniqueIdPoI); + + VectorLayerProperties vectorLayerProperties = (VectorLayerProperties)EditorHelper.GetTargetObjectOfProperty(property); + PrefabItemOptions poiSubLayerProperties = (PrefabItemOptions)EditorHelper.GetTargetObjectOfProperty(poiSubLayer); + + vectorLayerProperties.OnSubLayerPropertyRemoved(new VectorLayerUpdateArgs { property = poiSubLayerProperties }); + + layerTreeView.RemoveItemFromTree(index); + prefabItemArray.DeleteArrayElementAtIndex(index - FeatureSubLayerTreeView.uniqueIdPoI); + layerTreeView.treeModel.SetData(GetData(prefabItemArray)); + } + } + selectedLayers = new int[0]; + layerTreeView.SetSelection(selectedLayers); + } + + EditorGUILayout.EndHorizontal(); + + if (selectedLayers.Count == 1 && prefabItemArray.arraySize != 0 && selectedLayers[0] - FeatureSubLayerTreeView.uniqueIdPoI >= 0) + { + //ensure that selectedLayers[0] isn't out of bounds + if (selectedLayers[0] - FeatureSubLayerTreeView.uniqueIdPoI > prefabItemArray.arraySize - 1) + { + selectedLayers[0] = prefabItemArray.arraySize - 1 + FeatureSubLayerTreeView.uniqueIdPoI; + } + SelectionIndex = selectedLayers[0]; + + var layerProperty = prefabItemArray.GetArrayElementAtIndex(SelectionIndex - FeatureSubLayerTreeView.uniqueIdPoI); + + layerProperty.isExpanded = true; + var subLayerCoreOptions = layerProperty.FindPropertyRelative("coreOptions"); + bool isLayerActive = subLayerCoreOptions.FindPropertyRelative("isActive").boolValue; + if (!isLayerActive) + { + GUI.enabled = false; + } + DrawLayerLocationPrefabProperties(layerProperty, property); + if (!isLayerActive) + { + GUI.enabled = true; + } + } + else + { + GUILayout.Space(15); + GUILayout.Label("Select a visualizer to see properties"); + } + } + + void DrawLayerLocationPrefabProperties(SerializedProperty layerProperty, SerializedProperty property) + { + EditorGUILayout.PropertyField(layerProperty); + } + + IList GetData(SerializedProperty subLayerArray) + { + List elements = new List(); + string name = string.Empty; + string type = string.Empty; + int id = 0; + var root = new FeatureTreeElement("Root", -1, 0); + elements.Add(root); + for (int i = 0; i < subLayerArray.arraySize; i++) + { + var subLayer = subLayerArray.GetArrayElementAtIndex(i); + name = subLayer.FindPropertyRelative("coreOptions.sublayerName").stringValue; + id = i + FeatureSubLayerTreeView.uniqueIdPoI; + type = PresetFeatureType.Points.ToString(); + FeatureTreeElement element = new FeatureTreeElement(name, 0, id); + element.Name = name; + element.name = name; + element.Type = type; + elements.Add(element); + } + return elements; + } + } +} diff --git a/Unity/Editor/PropertyDrawers/PointsOfInterestSubLayerPropertiesDrawer.cs.meta b/Unity/Editor/PropertyDrawers/PointsOfInterestSubLayerPropertiesDrawer.cs.meta new file mode 100644 index 0000000..7f23736 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/PointsOfInterestSubLayerPropertiesDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 20fb110d2102743939c89f5a3ab9c3a4 +timeCreated: 1525818946 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/PrefabItemOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/PrefabItemOptionsDrawer.cs new file mode 100644 index 0000000..1a2c472 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/PrefabItemOptionsDrawer.cs @@ -0,0 +1,223 @@ +namespace Mapbox.Editor +{ + using UnityEngine; + using Mapbox.Unity.Map; + using UnityEditor; + using System; + using System.Collections.Generic; + using Mapbox.VectorTile.ExtensionMethods; + + [CustomPropertyDrawer(typeof(PrefabItemOptions))] + public class PrefabItemOptionsDrawer : PropertyDrawer + { + + static float _lineHeight = EditorGUIUtility.singleLineHeight; + const string searchButtonContent = "Search"; + + private GUIContent prefabLocationsTitle = new GUIContent + { + text = "Prefab Locations", + tooltip = "Where on the map to spawn the selected prefab" + }; + + + private GUIContent findByDropDown = new GUIContent + { + text = "Find by", + tooltip = "Find points-of-interest by category, name, or address" + }; + + private GUIContent categoriesDropDown = new GUIContent + { + text = "Category", + tooltip = "Spawn at locations in the categories selected" + }; + + private GUIContent densitySlider = new GUIContent + { + text = "Density", + tooltip = "The number of prefabs to spawn per-tile; try a lower number if the map is cluttered" + }; + + private GUIContent nameField = new GUIContent + { + text = "Name", + tooltip = "Spawn at locations containing this name string" + }; + + GUIContent[] findByPropContent; + bool isGUIContentSet = false; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + GUILayout.Space(-_lineHeight); + var prefabItemCoreOptions = property.FindPropertyRelative("coreOptions"); + GUILayout.Label(prefabItemCoreOptions.FindPropertyRelative("sublayerName").stringValue + " Properties"); + + //Prefab Game Object + EditorGUI.indentLevel++; + var spawnPrefabOptions = property.FindPropertyRelative("spawnPrefabOptions"); + + EditorGUILayout.PropertyField(spawnPrefabOptions); + + GUILayout.Space(1); + EditorGUI.indentLevel--; + + //Prefab Locations title + GUILayout.Label(prefabLocationsTitle); + + //FindBy drop down + EditorGUILayout.BeginHorizontal(); + + var findByProp = property.FindPropertyRelative("findByType"); + + var displayNames = findByProp.enumDisplayNames; + int count = findByProp.enumDisplayNames.Length; + if (!isGUIContentSet) + { + findByPropContent = new GUIContent[count]; + for (int extIdx = 0; extIdx < count; extIdx++) + { + findByPropContent[extIdx] = new GUIContent + { + text = displayNames[extIdx], + tooltip = ((LocationPrefabFindBy)extIdx).Description(), + }; + } + isGUIContentSet = true; + } + + EditorGUI.indentLevel++; + + EditorGUI.BeginChangeCheck(); + findByProp.enumValueIndex = EditorGUILayout.Popup(findByDropDown, findByProp.enumValueIndex, findByPropContent); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + EditorGUILayout.EndHorizontal(); + + switch ((LocationPrefabFindBy)findByProp.enumValueIndex) + { + case (LocationPrefabFindBy.MapboxCategory): + ShowCategoryOptions(property); + break; + case (LocationPrefabFindBy.AddressOrLatLon): + ShowAddressOrLatLonUI(property); + break; + case (LocationPrefabFindBy.POIName): + ShowPOINames(property); + break; + default: + break; + } + EditorGUI.indentLevel--; + } + + private void ShowCategoryOptions(SerializedProperty property) + { + //Category drop down + EditorGUI.BeginChangeCheck(); + var categoryProp = property.FindPropertyRelative("categories"); + categoryProp.intValue = (int)(LocationPrefabCategories)(EditorGUILayout.EnumFlagsField(categoriesDropDown, (LocationPrefabCategories)categoryProp.intValue)); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + ShowDensitySlider(property); + } + + private void ShowAddressOrLatLonUI(SerializedProperty property) + { + //EditorGUILayout.BeginVertical(); + var coordinateProperties = property.FindPropertyRelative("coordinates"); + + for (int i = 0; i < coordinateProperties.arraySize; i++) + { + EditorGUILayout.BeginHorizontal(); + //get the element to draw + var coordinate = coordinateProperties.GetArrayElementAtIndex(i); + + //label for each location. + var coordinateLabel = String.Format("Location {0}", i); + + // draw coordinate string. + EditorGUI.BeginChangeCheck(); + coordinate.stringValue = EditorGUILayout.TextField(coordinateLabel, coordinate.stringValue); + + if(EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property, true); + } + // draw search button. + if (GUILayout.Button(new GUIContent(searchButtonContent), (GUIStyle)"minibuttonleft", GUILayout.MaxWidth(100))) + { + object propertyObject = EditorHelper.GetTargetObjectOfProperty(property); + GeocodeAttributeSearchWindow.Open(coordinate, propertyObject); + } + + //include a remove button in the row + if (GUILayout.Button(new GUIContent(" X "), (GUIStyle)"minibuttonright", GUILayout.MaxWidth(30))) + { + coordinateProperties.DeleteArrayElementAtIndex(i); + EditorHelper.CheckForModifiedProperty(property); + } + EditorGUILayout.EndHorizontal(); + } + + EditorGUILayout.BeginHorizontal(); + GUILayout.Space(EditorGUIUtility.labelWidth - 3); + + if (GUILayout.Button(new GUIContent("Add Location"), (GUIStyle)"minibutton")) + { + coordinateProperties.arraySize++; + var newElement = coordinateProperties.GetArrayElementAtIndex(coordinateProperties.arraySize - 1); + newElement.stringValue = ""; + EditorHelper.CheckForModifiedProperty(property); + } + EditorGUILayout.EndHorizontal(); + } + + + private void ShowPOINames(SerializedProperty property) + { + //Name field + var categoryProp = property.FindPropertyRelative("nameString"); + + EditorGUI.BeginChangeCheck(); + categoryProp.stringValue = EditorGUILayout.TextField(nameField, categoryProp.stringValue); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + ShowDensitySlider(property); + } + + private void ShowDensitySlider(SerializedProperty property) + { + //Density slider + var densityProp = property.FindPropertyRelative("density"); + + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(densityProp, densitySlider); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + GUI.enabled = true; + densityProp.serializedObject.ApplyModifiedProperties(); + } + + private Rect GetNewRect(Rect position) + { + return new Rect(position.x, position.y, position.width, _lineHeight); + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return _lineHeight; + } + } +} diff --git a/Unity/Editor/PropertyDrawers/PrefabItemOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/PrefabItemOptionsDrawer.cs.meta new file mode 100644 index 0000000..691c3c8 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/PrefabItemOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: e267a35441e2f4c19a4b96c23afad4ae +timeCreated: 1523396148 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/RangeAroundTransformTileProviderOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/RangeAroundTransformTileProviderOptionsDrawer.cs new file mode 100644 index 0000000..cd72431 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/RangeAroundTransformTileProviderOptionsDrawer.cs @@ -0,0 +1,28 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + + [CustomPropertyDrawer(typeof(RangeAroundTransformTileProviderOptions))] + public class RangeAroundTransformTileProviderOptionsDrawer : PropertyDrawer + { + static float lineHeight = EditorGUIUtility.singleLineHeight; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + foreach (var item in property) + { + var subproperty = item as SerializedProperty; + EditorGUI.PropertyField(position, subproperty, true); + position.height = lineHeight; + position.y += lineHeight; + } + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return 3 * lineHeight; + } + } +} \ No newline at end of file diff --git a/Unity/Editor/PropertyDrawers/RangeAroundTransformTileProviderOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/RangeAroundTransformTileProviderOptionsDrawer.cs.meta new file mode 100644 index 0000000..3d3abb2 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/RangeAroundTransformTileProviderOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 758132744af3642f2ae9a7c31ce9c0d9 +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/RangeTileProviderOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/RangeTileProviderOptionsDrawer.cs new file mode 100644 index 0000000..f29868a --- /dev/null +++ b/Unity/Editor/PropertyDrawers/RangeTileProviderOptionsDrawer.cs @@ -0,0 +1,22 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + + [CustomPropertyDrawer(typeof(RangeTileProviderOptions))] + public class RangeTileProviderOptionsDrawer : PropertyDrawer + { + static float lineHeight = EditorGUIUtility.singleLineHeight; + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + foreach (var item in property) + { + var subproperty = item as SerializedProperty; + EditorGUILayout.PropertyField(subproperty, true); + position.height = lineHeight; + position.y += lineHeight; + } + } + } +} \ No newline at end of file diff --git a/Unity/Editor/PropertyDrawers/RangeTileProviderOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/RangeTileProviderOptionsDrawer.cs.meta new file mode 100644 index 0000000..6176e26 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/RangeTileProviderOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 59524ff7910c146abad051df9ab054db +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/SpawnPrefabOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/SpawnPrefabOptionsDrawer.cs new file mode 100644 index 0000000..c3f03e9 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/SpawnPrefabOptionsDrawer.cs @@ -0,0 +1,47 @@ +namespace Mapbox.Unity.Map +{ + using System.Collections; + using System.Collections.Generic; + using UnityEngine; + using Mapbox.Unity.MeshGeneration.Modifiers; + using UnityEditor; + using Mapbox.Editor; + + [CustomPropertyDrawer(typeof(SpawnPrefabOptions))] + public class SpawnPrefabOptionsDrawer : PropertyDrawer + { + static float lineHeight = EditorGUIUtility.singleLineHeight; + + private GUIContent prefabContent = new GUIContent + { + text = "Prefab", + tooltip = "The prefab to be spawned" + }; + + private GUIContent scalePrefabContent = new GUIContent + { + text = "Scale down with world", + tooltip = "The prefab will scale with the map object" + }; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, label, property); + position.height = 2.5f * lineHeight; + EditorGUI.BeginChangeCheck(); + property.FindPropertyRelative("prefab").objectReferenceValue = EditorGUI.ObjectField(new Rect(position.x, position.y, position.width, lineHeight), prefabContent, property.FindPropertyRelative("prefab").objectReferenceValue, typeof(UnityEngine.GameObject), false); + position.y += lineHeight; + EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), property.FindPropertyRelative("scaleDownWithWorld"), scalePrefabContent); + if(EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + EditorGUI.EndProperty(); + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return 2.0f * lineHeight; + } + } +} diff --git a/Unity/Editor/PropertyDrawers/SpawnPrefabOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/SpawnPrefabOptionsDrawer.cs.meta new file mode 100644 index 0000000..37481c4 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/SpawnPrefabOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: d2da764c4c82845efbcea6530b3c8120 +timeCreated: 1523922185 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/StyleOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/StyleOptionsDrawer.cs new file mode 100644 index 0000000..04cd7e8 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/StyleOptionsDrawer.cs @@ -0,0 +1,23 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + + [CustomPropertyDrawer(typeof(Style))] + public class StyleOptionsDrawer : PropertyDrawer + { + static float lineHeight = EditorGUIUtility.singleLineHeight; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + GUILayout.Space(-lineHeight); + EditorGUILayout.PropertyField(property.FindPropertyRelative("Id"), label); + } + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + // Reserve space for the total visible properties. + return lineHeight; + } + } +} diff --git a/Unity/Editor/PropertyDrawers/StyleOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/StyleOptionsDrawer.cs.meta new file mode 100644 index 0000000..36ae7ac --- /dev/null +++ b/Unity/Editor/PropertyDrawers/StyleOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 971e17905b31043f3914e1efda0ef7d7 +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/StyleSearchAttributeDrawer.cs b/Unity/Editor/PropertyDrawers/StyleSearchAttributeDrawer.cs new file mode 100644 index 0000000..48aef77 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/StyleSearchAttributeDrawer.cs @@ -0,0 +1,57 @@ +namespace Mapbox.Editor +{ + using UnityEngine; + using UnityEditor; + using Mapbox.Unity.Utilities; + using Mapbox.Unity; + + /// + /// Custom property drawer for style searching. + /// Includes a search window to enable listing of styles associated with a username. + /// Requires a Mapbox token be set for the project. + /// + [CustomPropertyDrawer(typeof(StyleSearchAttribute))] + public class StyleSearchAttributeDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); + EditorGUILayout.HelpBox("Style Id and Modified date is required for optimized tileset feature. You can copy&paste those values from Styles page under your Mapbox Account or use the search feature to fetch them automatically.", MessageType.Info); + EditorGUI.indentLevel++; + + + var id = property.FindPropertyRelative("Id"); + + var name = property.FindPropertyRelative("Name"); + var modified = property.FindPropertyRelative("Modified"); + + id.stringValue = EditorGUILayout.TextField("Style Id: ", id.stringValue); + name.stringValue = EditorGUILayout.TextField("Name: ", name.stringValue); + modified.stringValue = EditorGUILayout.TextField("Modified: ", modified.stringValue); + + EditorGUILayout.BeginHorizontal(); + if (string.IsNullOrEmpty(MapboxAccess.Instance.Configuration.AccessToken)) + { + GUI.enabled = false; + GUILayout.Button("Need Mapbox Access Token"); + GUI.enabled = true; + } + else + { + if (GUILayout.Button("Search")) + { + StyleSearchWindow.Open(property); + } + } + + if (GUILayout.Button("Clear", GUILayout.Width(100))) + { + id.stringValue = ""; + name.stringValue = ""; + modified.stringValue = ""; + } + EditorGUILayout.EndHorizontal(); + EditorGUI.indentLevel--; + } + } +} diff --git a/Unity/Editor/PropertyDrawers/StyleSearchAttributeDrawer.cs.meta b/Unity/Editor/PropertyDrawers/StyleSearchAttributeDrawer.cs.meta new file mode 100644 index 0000000..8e30259 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/StyleSearchAttributeDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ecd235e0566324c96b4039ca60f6b2fe +timeCreated: 1500479391 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/TerrainColliderOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/TerrainColliderOptionsDrawer.cs new file mode 100644 index 0000000..fa3d242 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/TerrainColliderOptionsDrawer.cs @@ -0,0 +1,27 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + + [CustomPropertyDrawer(typeof(TerrainColliderOptions))] + public class TerrainColliderOptionsDrawer : PropertyDrawer + { + static float lineHeight = EditorGUIUtility.singleLineHeight; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, label, property); + + position.y += lineHeight; + EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), property.FindPropertyRelative("addCollider")); + + EditorGUI.EndProperty(); + } + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + // Reserve space for the total visible properties. + return 3.0f * lineHeight; + } + } +} diff --git a/Unity/Editor/PropertyDrawers/TerrainColliderOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/TerrainColliderOptionsDrawer.cs.meta new file mode 100644 index 0000000..084e9e6 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/TerrainColliderOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 2749f8cef0c9ccc4b9f4ca3c94f34a4b +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/TerrainSideWallOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/TerrainSideWallOptionsDrawer.cs new file mode 100644 index 0000000..95a9573 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/TerrainSideWallOptionsDrawer.cs @@ -0,0 +1,41 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + + [CustomPropertyDrawer(typeof(TerrainSideWallOptions))] + public class TerrainSideWallOptionsDrawer : PropertyDrawer + { + static float lineHeight = EditorGUIUtility.singleLineHeight; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + var isSidewallActiveProp = property.FindPropertyRelative("isActive"); + EditorGUI.BeginProperty(position, label, property); + + EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), isSidewallActiveProp, new GUIContent("Show Sidewalls")); + if (isSidewallActiveProp.boolValue == true) + { + EditorGUI.indentLevel++; + position.y += lineHeight; + EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), property.FindPropertyRelative("wallHeight")); + position.y += lineHeight; + EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), property.FindPropertyRelative("wallMaterial")); + EditorGUI.indentLevel--; + } + + EditorGUI.EndProperty(); + } + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + // Reserve space for the total visible properties. + var isSidewallActiveProp = property.FindPropertyRelative("isActive"); + if (isSidewallActiveProp.boolValue == true) + { + return 3.0f * lineHeight; + } + return 1.0f * lineHeight; + } + } +} \ No newline at end of file diff --git a/Unity/Editor/PropertyDrawers/TerrainSideWallOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/TerrainSideWallOptionsDrawer.cs.meta new file mode 100644 index 0000000..353fa30 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/TerrainSideWallOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 7e18fe9e46c4e4426ae988fe03893a06 +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/UnityLayerOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/UnityLayerOptionsDrawer.cs new file mode 100644 index 0000000..e6fcb11 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/UnityLayerOptionsDrawer.cs @@ -0,0 +1,34 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + + [CustomPropertyDrawer(typeof(UnityLayerOptions))] + public class UnityLayerOptionsDrawer : PropertyDrawer + { + static float lineHeight = EditorGUIUtility.singleLineHeight; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + var addtoLayerProp = property.FindPropertyRelative("addToLayer"); + EditorGUI.BeginProperty(position, label, property); + + EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), addtoLayerProp, new GUIContent { text = "Add to Unity layer" }); + if (addtoLayerProp.boolValue == true) + { + EditorGUI.indentLevel++; + var layerId = property.FindPropertyRelative("layerId"); + layerId.intValue = EditorGUILayout.LayerField("Layer", layerId.intValue); + EditorGUI.indentLevel--; + } + + EditorGUI.EndProperty(); + } + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + // Reserve space for the total visible properties. + return 1.0f * lineHeight; + } + } +} \ No newline at end of file diff --git a/Unity/Editor/PropertyDrawers/UnityLayerOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/UnityLayerOptionsDrawer.cs.meta new file mode 100644 index 0000000..38ec704 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/UnityLayerOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: bdef06805a8a74efdac863d35cbc5ea3 +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/VectorFilterOptionsDrawer.cs b/Unity/Editor/PropertyDrawers/VectorFilterOptionsDrawer.cs new file mode 100644 index 0000000..aabe26c --- /dev/null +++ b/Unity/Editor/PropertyDrawers/VectorFilterOptionsDrawer.cs @@ -0,0 +1,273 @@ +namespace Mapbox.Editor +{ + using UnityEditor; + using UnityEngine; + using Mapbox.Unity.Map; + using Mapbox.Unity.MeshGeneration.Filters; + using System.Linq; + using System.Collections.Generic; + + [CustomPropertyDrawer(typeof(VectorFilterOptions))] + public class VectorFilterOptionsDrawer : PropertyDrawer + { + //indices for tileJSON lookup + int _propertyIndex = 0; + List _propertyNamesList = new List(); + GUIContent[] _propertyNameContent; + + private string[] descriptionArray; + static float lineHeight = EditorGUIUtility.singleLineHeight; + private string objectId = ""; + bool showFilters + { + get + { + return EditorPrefs.GetBool(objectId + "VectorSubLayerProperties_showFilters"); + } + set + { + EditorPrefs.SetBool(objectId + "VectorSubLayerProperties_showFilters", value); + } + } + + GUIContent operatorGui = new GUIContent { text = "Operator", tooltip = "Filter operator to apply. " }; + GUIContent numValueGui = new GUIContent { text = "Num Value", tooltip = "Numeric value to match using the operator. " }; + GUIContent strValueGui = new GUIContent { text = "Str Value", tooltip = "String value to match using the operator. " }; + GUIContent minValueGui = new GUIContent { text = "Min", tooltip = "Minimum numeric value to match using the operator. " }; + GUIContent maxValueGui = new GUIContent { text = "Max", tooltip = "Maximum numeric value to match using the operator. " }; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + objectId = property.serializedObject.targetObject.GetInstanceID().ToString(); + VectorFilterOptions options = (VectorFilterOptions)EditorHelper.GetTargetObjectOfProperty(property); + + showFilters = EditorGUILayout.Foldout(showFilters, new GUIContent { text = "Filters", tooltip = "Filter features in a vector layer based on criterion specified. " }); + if (showFilters) + { + var propertyFilters = property.FindPropertyRelative("filters"); + + for (int i = 0; i < propertyFilters.arraySize; i++) + { + DrawLayerFilter(property, propertyFilters, i, options); + } + if (propertyFilters.arraySize > 0) + { + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(property.FindPropertyRelative("combinerType")); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + } + EditorGUI.indentLevel++; + EditorGUILayout.BeginHorizontal(); + GUILayout.Space(EditorGUI.indentLevel * 12); + + EditorGUI.BeginChangeCheck(); + if (GUILayout.Button(new GUIContent("Add New Empty"), (GUIStyle)"minibutton")) + { + options.AddFilter(); + } + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + EditorGUILayout.EndHorizontal(); + EditorGUI.indentLevel--; + } + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return lineHeight; + } + + private void DrawLayerFilter(SerializedProperty originalProperty, SerializedProperty propertyFilters, int index, VectorFilterOptions vectorFilterOptions) + { + var property = propertyFilters.GetArrayElementAtIndex(index); + + var filterOperatorProp = property.FindPropertyRelative("filterOperator"); + + EditorGUILayout.BeginVertical(); + + EditorGUILayout.BeginHorizontal(); + + EditorGUILayout.LabelField(new GUIContent { text = "Key", tooltip = "Name of the property to use as key. This property is case sensitive." }, GUILayout.MaxWidth(150)); + + switch ((LayerFilterOperationType)filterOperatorProp.enumValueIndex) + { + case LayerFilterOperationType.IsEqual: + case LayerFilterOperationType.IsGreater: + case LayerFilterOperationType.IsLess: + EditorGUILayout.LabelField(operatorGui, GUILayout.MaxWidth(150)); + EditorGUILayout.LabelField(numValueGui, GUILayout.MaxWidth(100)); + break; + case LayerFilterOperationType.Contains: + EditorGUILayout.LabelField(operatorGui, GUILayout.MaxWidth(150)); + EditorGUILayout.LabelField(strValueGui, GUILayout.MaxWidth(100)); + break; + case LayerFilterOperationType.IsInRange: + EditorGUILayout.LabelField(operatorGui, GUILayout.MaxWidth(150)); + EditorGUILayout.LabelField(minValueGui, GUILayout.MaxWidth(100)); + EditorGUILayout.LabelField(maxValueGui, GUILayout.MaxWidth(100)); + break; + default: + break; + } + + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.BeginHorizontal(); + + var selectedLayerName = originalProperty.FindPropertyRelative("_selectedLayerName").stringValue; + + DrawPropertyDropDown(originalProperty, property); + + EditorGUI.BeginChangeCheck(); + filterOperatorProp.enumValueIndex = EditorGUILayout.Popup(filterOperatorProp.enumValueIndex, filterOperatorProp.enumDisplayNames, GUILayout.MaxWidth(150)); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + EditorGUI.BeginChangeCheck(); + switch ((LayerFilterOperationType)filterOperatorProp.enumValueIndex) + { + case LayerFilterOperationType.IsEqual: + case LayerFilterOperationType.IsGreater: + case LayerFilterOperationType.IsLess: + property.FindPropertyRelative("Min").doubleValue = EditorGUILayout.DoubleField(property.FindPropertyRelative("Min").doubleValue, GUILayout.MaxWidth(100)); + break; + case LayerFilterOperationType.Contains: + property.FindPropertyRelative("PropertyValue").stringValue = EditorGUILayout.TextField(property.FindPropertyRelative("PropertyValue").stringValue, GUILayout.MaxWidth(150)); + break; + case LayerFilterOperationType.IsInRange: + property.FindPropertyRelative("Min").doubleValue = EditorGUILayout.DoubleField(property.FindPropertyRelative("Min").doubleValue, GUILayout.MaxWidth(100)); + property.FindPropertyRelative("Max").doubleValue = EditorGUILayout.DoubleField(property.FindPropertyRelative("Max").doubleValue, GUILayout.MaxWidth(100)); + break; + default: + break; + } + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(property); + } + + if (GUILayout.Button(new GUIContent(" X "), (GUIStyle)"minibuttonright", GUILayout.Width(30))) + { + vectorFilterOptions.RemoveFilter(index); + propertyFilters.DeleteArrayElementAtIndex(index); + } + + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.EndVertical(); + } + + private void DrawPropertyDropDown(SerializedProperty originalProperty, SerializedProperty filterProperty) + { + + var selectedLayerName = originalProperty.FindPropertyRelative("_selectedLayerName").stringValue; + AbstractMap mapObject = (AbstractMap)originalProperty.serializedObject.targetObject; + TileJsonData tileJsonData = mapObject.VectorData.GetTileJsonData(); + + if (string.IsNullOrEmpty(selectedLayerName) || !tileJsonData.PropertyDisplayNames.ContainsKey(selectedLayerName)) + { + DrawWarningMessage(); + return; + } + + var parsedString = "no property selected"; + var descriptionString = "no description available"; + var propertyDisplayNames = tileJsonData.PropertyDisplayNames[selectedLayerName]; + _propertyNamesList = new List(propertyDisplayNames); + + var propertyString = filterProperty.FindPropertyRelative("Key").stringValue; + //check if the selection is valid + if (_propertyNamesList.Contains(propertyString)) + { + //if the layer contains the current layerstring, set it's index to match + _propertyIndex = propertyDisplayNames.FindIndex(s => s.Equals(propertyString)); + + //create guicontent for a valid layer + _propertyNameContent = new GUIContent[_propertyNamesList.Count]; + for (int extIdx = 0; extIdx < _propertyNamesList.Count; extIdx++) + { + var parsedPropertyString = _propertyNamesList[extIdx].Split(new string[] { tileJsonData.optionalPropertiesString }, System.StringSplitOptions.None)[0].Trim(); + _propertyNameContent[extIdx] = new GUIContent + { + text = _propertyNamesList[extIdx], + tooltip = tileJsonData.LayerPropertyDescriptionDictionary[selectedLayerName][parsedPropertyString] + }; + } + + //display popup + EditorGUI.BeginChangeCheck(); + _propertyIndex = EditorGUILayout.Popup(_propertyIndex, _propertyNameContent, GUILayout.MaxWidth(150)); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(filterProperty); + } + + //set new string values based on selection + parsedString = _propertyNamesList[_propertyIndex].Split(new string[] { tileJsonData.optionalPropertiesString }, System.StringSplitOptions.None)[0].Trim(); + descriptionString = tileJsonData.LayerPropertyDescriptionDictionary[selectedLayerName][parsedString]; + + } + else + { + //if the selected layer isn't in the source, add a placeholder entry + _propertyIndex = 0; + _propertyNamesList.Insert(0, propertyString); + + //create guicontent for an invalid layer + _propertyNameContent = new GUIContent[_propertyNamesList.Count]; + + //first property gets a unique tooltip + _propertyNameContent[0] = new GUIContent + { + text = _propertyNamesList[0], + tooltip = "Unavialable in Selected Layer" + }; + + for (int extIdx = 1; extIdx < _propertyNamesList.Count; extIdx++) + { + var parsedPropertyString = _propertyNamesList[extIdx].Split(new string[] { tileJsonData.optionalPropertiesString }, System.StringSplitOptions.None)[0].Trim(); + _propertyNameContent[extIdx] = new GUIContent + { + text = _propertyNamesList[extIdx], + tooltip = tileJsonData.LayerPropertyDescriptionDictionary[selectedLayerName][parsedPropertyString] + }; + } + + //display popup + EditorGUI.BeginChangeCheck(); + _propertyIndex = EditorGUILayout.Popup(_propertyIndex, _propertyNameContent, GUILayout.MaxWidth(150)); + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(filterProperty); + } + + //set new string values based on the offset + parsedString = _propertyNamesList[_propertyIndex].Split(new string[] { tileJsonData.optionalPropertiesString }, System.StringSplitOptions.None)[0].Trim(); + descriptionString = "Unavailable in Selected Layer."; + + } + EditorGUI.BeginChangeCheck(); + filterProperty.FindPropertyRelative("Key").stringValue = parsedString; + if (EditorGUI.EndChangeCheck()) + { + EditorHelper.CheckForModifiedProperty(filterProperty); + } + filterProperty.FindPropertyRelative("KeyDescription").stringValue = descriptionString; + } + + private void DrawWarningMessage() + { + GUIStyle labelStyle = new GUIStyle(EditorStyles.popup); + labelStyle.fontStyle = FontStyle.Bold; + EditorGUILayout.LabelField(new GUIContent(), new GUIContent("No properties"), labelStyle, new GUILayoutOption[] { GUILayout.MaxWidth(155) }); + return; + } + } +} diff --git a/Unity/Editor/PropertyDrawers/VectorFilterOptionsDrawer.cs.meta b/Unity/Editor/PropertyDrawers/VectorFilterOptionsDrawer.cs.meta new file mode 100644 index 0000000..3b6fd6d --- /dev/null +++ b/Unity/Editor/PropertyDrawers/VectorFilterOptionsDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 477b699ee418f4c6cb9c7896e2137c15 +timeCreated: 1521052834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/PropertyDrawers/VectorLayerPropertiesDrawer.cs b/Unity/Editor/PropertyDrawers/VectorLayerPropertiesDrawer.cs new file mode 100644 index 0000000..3092f0c --- /dev/null +++ b/Unity/Editor/PropertyDrawers/VectorLayerPropertiesDrawer.cs @@ -0,0 +1,138 @@ +namespace Mapbox.Editor +{ + using System; + using UnityEngine; + using UnityEditor; + using Mapbox.Unity.Map; + + public class VectorLayerPropertiesDrawer + { + private string objectId = ""; + /// + /// Gets or sets a value to show or hide Vector section . + /// + /// true if show vector; otherwise, false. + bool ShowLocationPrefabs + { + get + { + return EditorPrefs.GetBool(objectId + "VectorLayerProperties_showLocationPrefabs"); + } + set + { + EditorPrefs.SetBool(objectId + "VectorLayerProperties_showLocationPrefabs", value); + } + } + + /// + /// Gets or sets a value to show or hide Vector section . + /// + /// true if show vector; otherwise, false. + bool ShowFeatures + { + get + { + return EditorPrefs.GetBool(objectId + "VectorLayerProperties_showFeatures"); + } + set + { + EditorPrefs.SetBool(objectId + "VectorLayerProperties_showFeatures", value); + } + } + + private GUIContent _requiredTilesetIdGui = new GUIContent + { + text = "Required Tileset Id", + tooltip = "For location prefabs to spawn the \"streets-v7\" tileset needs to be a part of the Vector data source" + }; + + FeaturesSubLayerPropertiesDrawer _vectorSublayerDrawer = new FeaturesSubLayerPropertiesDrawer(); + PointsOfInterestSubLayerPropertiesDrawer _poiSublayerDrawer = new PointsOfInterestSubLayerPropertiesDrawer(); + + void ShowSepartor() + { + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + EditorGUILayout.Space(); + } + + public void DrawUI(SerializedProperty property) + { + objectId = property.serializedObject.targetObject.GetInstanceID().ToString(); + var layerSourceProperty = property.FindPropertyRelative("sourceOptions"); + var sourceTypeProperty = property.FindPropertyRelative("_sourceType"); + + var names = sourceTypeProperty.enumNames; + VectorSourceType sourceTypeValue = ((VectorSourceType) Enum.Parse(typeof(VectorSourceType), names[sourceTypeProperty.enumValueIndex])); + //VectorSourceType sourceTypeValue = (VectorSourceType)sourceTypeProperty.enumValueIndex; + string streets_v7 = MapboxDefaultVector.GetParameters(VectorSourceType.MapboxStreets).Id; + var layerSourceId = layerSourceProperty.FindPropertyRelative("layerSource.Id"); + string layerString = layerSourceId.stringValue; + + //Draw POI Section + if (sourceTypeValue == VectorSourceType.None) + { + return; + } + + ShowLocationPrefabs = EditorGUILayout.Foldout(ShowLocationPrefabs, "POINTS OF INTEREST"); + if (ShowLocationPrefabs) + { + if (sourceTypeValue != VectorSourceType.None && layerString.Contains(streets_v7)) + { + GUI.enabled = false; + EditorGUILayout.TextField(_requiredTilesetIdGui, streets_v7); + GUI.enabled = true; + _poiSublayerDrawer.DrawUI(property); + } + else + { + EditorGUILayout.HelpBox("In order to place points of interest please add \"mapbox.mapbox-streets-v7\" to the data source.", MessageType.Error); + } + } + + ShowSepartor(); + + //Draw Feature section. + ShowFeatures = EditorGUILayout.Foldout(ShowFeatures, "FEATURES"); + if (ShowFeatures) + { + _vectorSublayerDrawer.DrawUI(property); + } + } + + public void PostProcessLayerProperties(SerializedProperty property) + { + + var layerSourceProperty = property.FindPropertyRelative("sourceOptions"); + var sourceTypeProperty = property.FindPropertyRelative("_sourceType"); + VectorSourceType sourceTypeValue = (VectorSourceType)sourceTypeProperty.enumValueIndex; + string streets_v7 = MapboxDefaultVector.GetParameters(VectorSourceType.MapboxStreets).Id; + var layerSourceId = layerSourceProperty.FindPropertyRelative("layerSource.Id"); + string layerString = layerSourceId.stringValue; + + if (ShowLocationPrefabs) + { + if (_poiSublayerDrawer.isLayerAdded == true && sourceTypeValue != VectorSourceType.None && layerString.Contains(streets_v7)) + { + var prefabItemArray = property.FindPropertyRelative("locationPrefabList"); + var prefabItem = prefabItemArray.GetArrayElementAtIndex(prefabItemArray.arraySize - 1); + PrefabItemOptions prefabItemOptionToAdd = (PrefabItemOptions)EditorHelper.GetTargetObjectOfProperty(prefabItem) as PrefabItemOptions; + ((VectorLayerProperties)EditorHelper.GetTargetObjectOfProperty(property)).OnSubLayerPropertyAdded(new VectorLayerUpdateArgs { property = prefabItemOptionToAdd }); + _poiSublayerDrawer.isLayerAdded = false; + } + } + if (ShowFeatures) + { + if (_vectorSublayerDrawer.isLayerAdded == true) + { + var subLayerArray = property.FindPropertyRelative("vectorSubLayers"); + var subLayer = subLayerArray.GetArrayElementAtIndex(subLayerArray.arraySize - 1); + ((VectorLayerProperties)EditorHelper.GetTargetObjectOfProperty(property)).OnSubLayerPropertyAdded(new VectorLayerUpdateArgs { property = EditorHelper.GetTargetObjectOfProperty(subLayer) as MapboxDataProperty }); + _vectorSublayerDrawer.isLayerAdded = false; + } + } + + } + + } +} diff --git a/Unity/Editor/PropertyDrawers/VectorLayerPropertiesDrawer.cs.meta b/Unity/Editor/PropertyDrawers/VectorLayerPropertiesDrawer.cs.meta new file mode 100644 index 0000000..03be0a3 --- /dev/null +++ b/Unity/Editor/PropertyDrawers/VectorLayerPropertiesDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a944f887beada4bb2966cd531f64ffe5 +timeCreated: 1518043937 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/ScenesListEditor.cs b/Unity/Editor/ScenesListEditor.cs new file mode 100644 index 0000000..54b4546 --- /dev/null +++ b/Unity/Editor/ScenesListEditor.cs @@ -0,0 +1,20 @@ +namespace Mapbox.Unity.Utilities.DebugTools +{ + using UnityEngine; + using UnityEditor; + + [CustomEditor(typeof(ScenesList))] + public class ScenesListEditor : Editor + { + public override void OnInspectorGUI() + { + base.OnInspectorGUI(); + ScenesList e = target as ScenesList; + + if (GUILayout.Button("Link Listed Scenes")) + { + e.LinkScenes(); + } + } + } +} \ No newline at end of file diff --git a/Unity/Editor/ScenesListEditor.cs.meta b/Unity/Editor/ScenesListEditor.cs.meta new file mode 100644 index 0000000..eb4d041 --- /dev/null +++ b/Unity/Editor/ScenesListEditor.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 20eb09b18012847c4a8c6108c22995a3 +timeCreated: 1521202168 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/ScriptableCreatorWindow.cs b/Unity/Editor/ScriptableCreatorWindow.cs new file mode 100644 index 0000000..b9faee7 --- /dev/null +++ b/Unity/Editor/ScriptableCreatorWindow.cs @@ -0,0 +1,192 @@ +namespace Mapbox.Editor +{ + using UnityEngine; + using UnityEditor; + using System.Collections.Generic; + using System; + using System.Linq; + using Mapbox.Unity.Map; + + public class ScriptableCreatorWindow : EditorWindow + { + Type _type; + SerializedProperty _finalize; + SerializedProperty _container; + const float width = 620f; + const float height = 600f; + List _assets; + bool[] _showElement; + Vector2 scrollPos; + int _index = -1; + private Action _act; + int activeIndex = 0; + + GUIStyle headerFoldout = new GUIStyle("Foldout"); + GUIStyle header; + + void OnEnable() + { + EditorApplication.playModeStateChanged += OnModeChanged; + } + + void OnDisable() + { + EditorApplication.playModeStateChanged -= OnModeChanged; + } + + void OnModeChanged(PlayModeStateChange state) + { + Close(); + } + + public static void Open(Type type, SerializedProperty p, int index = -1, Action act = null, SerializedProperty containerProperty = null) + { + var window = GetWindow(true, "Select a module"); + window._type = type; + window._finalize = p; + window._container = containerProperty; + window.position = new Rect(500, 200, width, height); + window._act = act; + if (index > -1) + { + window._index = index; + } + + window.header = new GUIStyle("ShurikenModuleTitle") + { + font = (new GUIStyle("Label")).font, + border = new RectOffset(15, 7, 4, 4), + fixedHeight = 22, + contentOffset = new Vector2(20f, -2f) + }; + } + + void OnGUI() + { + if (_assets == null || _assets.Count == 0) + { + var list = AssetDatabase.FindAssets("t:" + _type.Name); + _assets = new List(); + foreach (var item in list) + { + var ne = AssetDatabase.GUIDToAssetPath(item); + var asset = AssetDatabase.LoadAssetAtPath(ne, _type) as ScriptableObject; + _assets.Add(asset); + } + _assets = _assets.OrderBy(x => x.GetType().Name).ThenBy(x => x.name).ToList(); + } + + var st = new GUIStyle(); + st.padding = new RectOffset(15, 15, 15, 15); + scrollPos = EditorGUILayout.BeginScrollView(scrollPos, st); + for (int i = 0; i < _assets.Count; i++) + { + var asset = _assets[i]; + if (asset == null) //yea turns out this can happen + continue; + GUILayout.BeginHorizontal(); + + var b = Header(string.Format("{0,-40} - {1, -15}", asset.GetType().Name, asset.name), i == activeIndex); + + if (b) + activeIndex = i; + if (GUILayout.Button(new GUIContent("Select"), header, GUILayout.Width(80))) + { + if (_act != null) + { + _act(asset); + } + else + { + if (_index == -1) + { + _finalize.arraySize++; + _finalize.GetArrayElementAtIndex(_finalize.arraySize - 1).objectReferenceValue = asset; + _finalize.serializedObject.ApplyModifiedProperties(); + } + else + { + _finalize.GetArrayElementAtIndex(_index).objectReferenceValue = asset; + _finalize.serializedObject.ApplyModifiedProperties(); + } + } + + MapboxDataProperty mapboxDataProperty = (MapboxDataProperty)EditorHelper.GetTargetObjectOfProperty(_container); + if (mapboxDataProperty != null) + { + mapboxDataProperty.HasChanged = true; + } + + this.Close(); + } + + GUILayout.EndHorizontal(); + if (b) + { + EditorGUILayout.Space(); + EditorGUI.indentLevel += 4; + GUI.enabled = false; + var ed = UnityEditor.Editor.CreateEditor(asset); + ed.hideFlags = HideFlags.NotEditable; + ed.OnInspectorGUI(); + GUI.enabled = true; + EditorGUI.indentLevel -= 4; + EditorGUILayout.Space(); + } + EditorGUILayout.Space(); + } + EditorGUILayout.EndScrollView(); + } + + public static T CreateAsset() where T : ScriptableObject + { + T asset = ScriptableObject.CreateInstance(); + + string path = AssetDatabase.GetAssetPath(Selection.activeObject); + if (path == "") + { + path = "Assets"; + } + else if (System.IO.Path.GetExtension(path) != "") + { + path = path.Replace(System.IO.Path.GetFileName(AssetDatabase.GetAssetPath(Selection.activeObject)), ""); + } + + string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(path + "/" + Selection.activeObject.name + "_" + typeof(T).Name + ".asset"); + + AssetDatabase.CreateAsset(asset, assetPathAndName); + + AssetDatabase.SaveAssets(); + AssetDatabase.Refresh(); + EditorUtility.FocusProjectWindow(); + Selection.activeObject = asset; + + return asset; + } + + + public bool Header(string title, bool show) + { + var rect = GUILayoutUtility.GetRect(16f, 22f, header); + GUI.Box(rect, title, header); + + var foldoutRect = new Rect(rect.x + 4f, rect.y + 2f, 13f, 13f); + var e = Event.current; + + if (e.type == EventType.Repaint) + headerFoldout.Draw(foldoutRect, false, false, show, false); + + if (e.type == EventType.MouseDown) + { + if (rect.Contains(e.mousePosition)) + { + show = !show; + + e.Use(); + } + } + + return show; + } + } +} \ No newline at end of file diff --git a/Unity/Editor/ScriptableCreatorWindow.cs.meta b/Unity/Editor/ScriptableCreatorWindow.cs.meta new file mode 100644 index 0000000..ae396f5 --- /dev/null +++ b/Unity/Editor/ScriptableCreatorWindow.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 36de947caaca94e1f8985ccdf861ec08 +timeCreated: 1504124010 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/ScriptablePaletteEditor.cs b/Unity/Editor/ScriptablePaletteEditor.cs new file mode 100644 index 0000000..c005d60 --- /dev/null +++ b/Unity/Editor/ScriptablePaletteEditor.cs @@ -0,0 +1,108 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +[CustomEditor(typeof(ScriptablePalette))] +public class ScriptablePaletteEditor : Editor +{ + private const int _NUM_COLORS_MIN = 3; + private const int _NUM_COLORS_MAX = 10; + + private const float _HELPER_TEXT_COLOR_VAL = 0.7f; + + private const string _COLOR_FIELD_PREFIX = "Color {0}"; + + private const string _KEY_COLOR_INFO = "Color used as a seed for generating the color palette"; + private const string _NUM_COLOR_INFO = "Number of colors to generate in the palette"; + + private const string _HUE_RANGE_INFO = "Maximum range that randomly generated colors will deviate from the key color hue"; + private const string _SAT_RANGE_INFO = "Maximum range that randomly generated colors will deviate from the key color saturation"; + private const string _VAL_RANGE_INFO = "Maximum range that randomly generated colors will deviate from the key color value"; + + override public void OnInspectorGUI() + { + ScriptablePalette sp = (ScriptablePalette)target; + + EditorGUILayout.Space(); + + GUIStyle wrapTextStyle = new GUIStyle(); + wrapTextStyle.wordWrap = true; + wrapTextStyle.normal.textColor = new Color(_HELPER_TEXT_COLOR_VAL, _HELPER_TEXT_COLOR_VAL, _HELPER_TEXT_COLOR_VAL, 1.0f); + + EditorGUILayout.LabelField("Generate a palette for building colorization by defining a key color, palette size and hue/saturation/value range parameters.", wrapTextStyle); + + EditorGUILayout.Space(); + + EditorGUILayout.LabelField("Base and detail layer colors will be randomly set from the generated palette at runtime for each building.", wrapTextStyle); + + EditorGUILayout.Space(); + + GUIContent keyColorContent = new GUIContent("Key color", _KEY_COLOR_INFO); + sp.m_keyColor = EditorGUILayout.ColorField(keyColorContent, sp.m_keyColor); + + EditorGUILayout.Space(); + + GUIContent numColorContent = new GUIContent("Palette Size", _NUM_COLOR_INFO); + sp.m_numColors = EditorGUILayout.IntSlider(numColorContent, sp.m_numColors, _NUM_COLORS_MIN, _NUM_COLORS_MAX); + + GUIContent hueRangeContent = new GUIContent("Hue Range", _HUE_RANGE_INFO); + GUIContent satRangeContent = new GUIContent("Saturation Range", _SAT_RANGE_INFO); + GUIContent valRangeContent = new GUIContent("Value Range", _VAL_RANGE_INFO); + + sp.m_hueRange = EditorGUILayout.Slider(hueRangeContent, sp.m_hueRange, 0, 1); + sp.m_saturationRange = EditorGUILayout.Slider(satRangeContent, sp.m_saturationRange, 0, 1); + sp.m_valueRange = EditorGUILayout.Slider(valRangeContent, sp.m_valueRange, 0, 1); + + EditorGUILayout.Space(); + + if (GUILayout.Button("Generate Palette")) + { + sp.GeneratePalette(); + } + + GUILayout.Space(20); + + if(sp.m_colors == null || sp.m_colors.Length == 0) + { + EditorGUILayout.LabelField("No color palette defined!", EditorStyles.boldLabel); + } + else + { + for (int i = 0; i < sp.m_colors.Length; i++) + { + string fieldName = string.Format(_COLOR_FIELD_PREFIX, i); + sp.m_colors[i] = EditorGUILayout.ColorField(fieldName, sp.m_colors[i]); + } + } + + GUILayout.Space(20); + + EditorGUILayout.LabelField("Color Overrides", EditorStyles.boldLabel); + + EditorGUILayout.Space(); + + EditorGUILayout.LabelField("Layer colors can be overriden by enabling any of the overrides below.", wrapTextStyle); + EditorGUILayout.LabelField("If a layer's color is overridden, it will be set directly from the defined override color.", wrapTextStyle); + + EditorGUILayout.Space(); + + sp.m_setBaseColor_Override = EditorGUILayout.Toggle("Override base", sp.m_setBaseColor_Override); + if (sp.m_setBaseColor_Override) + { + sp.m_baseColor_Override = EditorGUILayout.ColorField("Base Color:", sp.m_baseColor_Override); + } + + sp.m_setDetailColor1_Override = EditorGUILayout.Toggle("Override detail 1", sp.m_setDetailColor1_Override); + if (sp.m_setDetailColor1_Override) + { + sp.m_detailColor1_Override = EditorGUILayout.ColorField("Detail 1 Color:", sp.m_detailColor1_Override); + } + + sp.m_setDetailColor2_Override = EditorGUILayout.Toggle("Override detail 2", sp.m_setDetailColor2_Override); + if (sp.m_setDetailColor2_Override) + { + sp.m_detailColor2_Override = EditorGUILayout.ColorField("Detail 2 Color:", sp.m_detailColor2_Override); + } + } +} diff --git a/Unity/Editor/ScriptablePaletteEditor.cs.meta b/Unity/Editor/ScriptablePaletteEditor.cs.meta new file mode 100644 index 0000000..33ef28a --- /dev/null +++ b/Unity/Editor/ScriptablePaletteEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 448d686d65d1d4da18fa38d21964da3e +timeCreated: 1520470837 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Editor/StyleSearchWindow.cs b/Unity/Editor/StyleSearchWindow.cs new file mode 100644 index 0000000..99a2f46 --- /dev/null +++ b/Unity/Editor/StyleSearchWindow.cs @@ -0,0 +1,213 @@ +namespace Mapbox.Editor +{ + using UnityEngine; + using UnityEditor; + using System.Collections.Generic; + using Mapbox.Unity; + using Mapbox.Json; + using Mapbox.Unity.Utilities; + using Mapbox.Unity.Map; + using System.Collections; + using UnityEngine.Networking; + + public class StyleSearchWindow : EditorWindow + { + SerializedProperty _property; + + string _username = ""; + string _errorString = ""; + + List