From a4919583727184f4fca459cfaa44751a568ca5de Mon Sep 17 00:00:00 2001 From: Fangh Date: Tue, 27 Feb 2024 23:45:30 +0100 Subject: [PATCH 01/13] feat(localization): add localisation package --- Assets/Localization.meta | 8 + .../Localization/AddressableAssetsData.meta | 8 + .../AddressableAssetSettings.asset | 116 ++++++++++ .../AddressableAssetSettings.asset.meta | 8 + .../AssetGroupTemplates.meta | 8 + .../AssetGroupTemplates/Packed Assets.asset | 76 +++++++ .../Packed Assets.asset.meta | 8 + .../AddressableAssetsData/AssetGroups.meta | 8 + .../AssetGroups/Built In Data.asset | 34 +++ .../AssetGroups/Built In Data.asset.meta | 8 + .../AssetGroups/Default Local Group.asset | 25 +++ .../Default Local Group.asset.meta | 8 + .../AssetGroups/Localization-Locales.asset | 37 ++++ .../Localization-Locales.asset.meta | 8 + .../AssetGroups/Schemas.meta | 8 + .../Built In Data_PlayerDataGroupSchema.asset | 17 ++ ...t In Data_PlayerDataGroupSchema.asset.meta | 8 + ... Local Group_BundledAssetGroupSchema.asset | 45 ++++ ...l Group_BundledAssetGroupSchema.asset.meta | 8 + ...Local Group_ContentUpdateGroupSchema.asset | 16 ++ ... Group_ContentUpdateGroupSchema.asset.meta | 8 + ...tion-Locales_BundledAssetGroupSchema.asset | 45 ++++ ...Locales_BundledAssetGroupSchema.asset.meta | 8 + ...ion-Locales_ContentUpdateGroupSchema.asset | 16 ++ ...ocales_ContentUpdateGroupSchema.asset.meta | 8 + .../AddressableAssetsData/DataBuilders.meta | 8 + .../DataBuilders/BuildScriptFastMode.asset | 20 ++ .../BuildScriptFastMode.asset.meta | 8 + .../DataBuilders/BuildScriptPackedMode.asset | 20 ++ .../BuildScriptPackedMode.asset.meta | 8 + .../BuildScriptPackedPlayMode.asset | 20 ++ .../BuildScriptPackedPlayMode.asset.meta | 8 + .../DataBuilders/BuildScriptVirtualMode.asset | 20 ++ .../BuildScriptVirtualMode.asset.meta | 8 + .../AddressableAssetsData/DefaultObject.asset | 15 ++ .../DefaultObject.asset.meta | 8 + Assets/Localization/English (en).asset | 25 +++ Assets/Localization/English (en).asset.meta | 8 + Assets/Localization/French (fr).asset | 25 +++ Assets/Localization/French (fr).asset.meta | 8 + .../Localization/Localization Settings.asset | 205 ++++++++++++++++++ .../Localization Settings.asset.meta | 8 + .../UserInterface Shared Data.asset | 134 ++++++++++++ .../UserInterface Shared Data.asset.meta | 8 + Assets/Localization/UserInterface.asset | 23 ++ Assets/Localization/UserInterface.asset.meta | 8 + Assets/Localization/UserInterface_en.asset | 136 ++++++++++++ .../Localization/UserInterface_en.asset.meta | 8 + Assets/Localization/UserInterface_fr.asset | 132 +++++++++++ .../Localization/UserInterface_fr.asset.meta | 8 + Packages/manifest.json | 1 + Packages/packages-lock.json | 31 +++ ProjectSettings/LocalizationSettings.asset | 21 ++ 53 files changed, 1479 insertions(+) create mode 100644 Assets/Localization.meta create mode 100644 Assets/Localization/AddressableAssetsData.meta create mode 100644 Assets/Localization/AddressableAssetsData/AddressableAssetSettings.asset create mode 100644 Assets/Localization/AddressableAssetsData/AddressableAssetSettings.asset.meta create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroupTemplates.meta create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset.meta create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroups.meta create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroups/Built In Data.asset create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroups/Built In Data.asset.meta create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroups/Default Local Group.asset create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroups/Default Local Group.asset.meta create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroups/Localization-Locales.asset create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroups/Localization-Locales.asset.meta create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroups/Schemas.meta create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Built In Data_PlayerDataGroupSchema.asset create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Built In Data_PlayerDataGroupSchema.asset.meta create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset.meta create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset.meta create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_BundledAssetGroupSchema.asset create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_BundledAssetGroupSchema.asset.meta create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_ContentUpdateGroupSchema.asset create mode 100644 Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_ContentUpdateGroupSchema.asset.meta create mode 100644 Assets/Localization/AddressableAssetsData/DataBuilders.meta create mode 100644 Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset create mode 100644 Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset.meta create mode 100644 Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset create mode 100644 Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset.meta create mode 100644 Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset create mode 100644 Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset.meta create mode 100644 Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptVirtualMode.asset create mode 100644 Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptVirtualMode.asset.meta create mode 100644 Assets/Localization/AddressableAssetsData/DefaultObject.asset create mode 100644 Assets/Localization/AddressableAssetsData/DefaultObject.asset.meta create mode 100644 Assets/Localization/English (en).asset create mode 100644 Assets/Localization/English (en).asset.meta create mode 100644 Assets/Localization/French (fr).asset create mode 100644 Assets/Localization/French (fr).asset.meta create mode 100644 Assets/Localization/Localization Settings.asset create mode 100644 Assets/Localization/Localization Settings.asset.meta create mode 100644 Assets/Localization/UserInterface Shared Data.asset create mode 100644 Assets/Localization/UserInterface Shared Data.asset.meta create mode 100644 Assets/Localization/UserInterface.asset create mode 100644 Assets/Localization/UserInterface.asset.meta create mode 100644 Assets/Localization/UserInterface_en.asset create mode 100644 Assets/Localization/UserInterface_en.asset.meta create mode 100644 Assets/Localization/UserInterface_fr.asset create mode 100644 Assets/Localization/UserInterface_fr.asset.meta create mode 100644 ProjectSettings/LocalizationSettings.asset diff --git a/Assets/Localization.meta b/Assets/Localization.meta new file mode 100644 index 0000000..d53cf97 --- /dev/null +++ b/Assets/Localization.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6e20b32a2e4006c42ab3ae3ee15ffb21 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData.meta b/Assets/Localization/AddressableAssetsData.meta new file mode 100644 index 0000000..1946309 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9c09c0f1c3950ad4bb82cfd7ea81e613 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/AddressableAssetSettings.asset b/Assets/Localization/AddressableAssetsData/AddressableAssetSettings.asset new file mode 100644 index 0000000..2202ea6 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AddressableAssetSettings.asset @@ -0,0 +1,116 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 468a46d0ae32c3544b7d98094e6448a9, type: 3} + m_Name: AddressableAssetSettings + m_EditorClassIdentifier: + m_DefaultGroup: f8f78eecf4004b3469a3f0092a10cc87 + m_currentHash: + serializedVersion: 2 + Hash: 034933251d606be5557c58df7ef3ada1 + m_OptimizeCatalogSize: 0 + m_BuildRemoteCatalog: 0 + m_BundleLocalCatalog: 0 + m_CatalogRequestsTimeout: 0 + m_DisableCatalogUpdateOnStart: 0 + m_IgnoreUnsupportedFilesInBuild: 0 + m_UniqueBundleIds: 0 + m_NonRecursiveBuilding: 1 + m_CCDEnabled: 0 + m_maxConcurrentWebRequests: 3 + m_ContiguousBundles: 1 + m_StripUnityVersionFromBundleBuild: 0 + m_DisableVisibleSubAssetRepresentations: 0 + m_ShaderBundleNaming: 0 + m_ShaderBundleCustomNaming: + m_MonoScriptBundleNaming: 0 + m_CheckForContentUpdateRestrictionsOption: 0 + m_MonoScriptBundleCustomNaming: + m_RemoteCatalogBuildPath: + m_Id: 1a53e12e8146f6c4c8172ea073c05cb7 + m_RemoteCatalogLoadPath: + m_Id: + m_ContentStateBuildPathProfileVariableName: + m_CustomContentStateBuildPath: + m_ContentStateBuildPath: + m_BuildAddressablesWithPlayerBuild: 0 + m_overridePlayerVersion: '[UnityEditor.PlayerSettings.bundleVersion]' + m_GroupAssets: + - {fileID: 11400000, guid: 39e0381f5bc729f459dafa0bf1720ff7, type: 2} + - {fileID: 11400000, guid: f0d1a34cb8a9d474f9a99e916cb5b1dc, type: 2} + - {fileID: 11400000, guid: ec8da4bf6038fdf4ea7413fb9dd6ffcb, type: 2} + - {fileID: 11400000, guid: 7f1011374c444a7419dbbb4441f674a7, type: 2} + - {fileID: 11400000, guid: 4d1ea22595cc1954b88630c373b16bca, type: 2} + - {fileID: 11400000, guid: 0caa1f41c04a47a4ab9a1ee4ecc74020, type: 2} + m_BuildSettings: + m_CompileScriptsInVirtualMode: 0 + m_CleanupStreamingAssetsAfterBuilds: 1 + m_LogResourceManagerExceptions: 1 + m_BundleBuildPath: Temp/com.unity.addressables/AssetBundles + m_ProfileSettings: + m_Profiles: + - m_InheritedParent: + m_Id: 73df57c4e4c524d489eb2e94c2d338d9 + m_ProfileName: Default + m_Values: + - m_Id: c2b9fb9152d88b348937ebde31a81af0 + m_Value: '[UnityEditor.EditorUserBuildSettings.activeBuildTarget]' + - m_Id: 827805ccee015c24ea0f1f5c5d1e74ed + m_Value: '[UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget]' + - m_Id: e15c2a04e113f8f47a28b249e7f67125 + m_Value: '{UnityEngine.AddressableAssets.Addressables.RuntimePath}/[BuildTarget]' + - m_Id: 1a53e12e8146f6c4c8172ea073c05cb7 + m_Value: ServerData/[BuildTarget] + - m_Id: ecd01562c10820640b7edce73eee70f8 + m_Value: http://[PrivateIpAddress]:[HostingServicePort] + m_ProfileEntryNames: + - m_Id: c2b9fb9152d88b348937ebde31a81af0 + m_Name: BuildTarget + m_InlineUsage: 0 + - m_Id: 827805ccee015c24ea0f1f5c5d1e74ed + m_Name: Local.BuildPath + m_InlineUsage: 0 + - m_Id: e15c2a04e113f8f47a28b249e7f67125 + m_Name: Local.LoadPath + m_InlineUsage: 0 + - m_Id: 1a53e12e8146f6c4c8172ea073c05cb7 + m_Name: Remote.BuildPath + m_InlineUsage: 0 + - m_Id: ecd01562c10820640b7edce73eee70f8 + m_Name: Remote.LoadPath + m_InlineUsage: 0 + m_ProfileVersion: 1 + m_LabelTable: + m_LabelNames: + - default + - Locale + - Locale-en + - Locale-fr + m_SchemaTemplates: [] + m_GroupTemplateObjects: + - {fileID: 11400000, guid: c0ddd4b1b864ca04da68914a70695496, type: 2} + m_InitializationObjects: [] + m_CertificateHandlerType: + m_AssemblyName: + m_ClassName: + m_ActivePlayerDataBuilderIndex: 3 + m_DataBuilders: + - {fileID: 11400000, guid: f9d877d3e384df3448e4de40545146bf, type: 2} + - {fileID: 11400000, guid: 8715d6509f854e34090110a35f7bf1fa, type: 2} + - {fileID: 11400000, guid: 341d1c4e57607b84da7d731bfb7fa382, type: 2} + - {fileID: 11400000, guid: 0c7c33b95596c6b488a52f120ad1bac7, type: 2} + m_ActiveProfileId: 73df57c4e4c524d489eb2e94c2d338d9 + m_HostingServicesManager: + m_HostingServiceInfos: [] + m_Settings: {fileID: 11400000} + m_NextInstanceId: 0 + m_RegisteredServiceTypeRefs: [] + m_PingTimeoutInMilliseconds: 5000 diff --git a/Assets/Localization/AddressableAssetsData/AddressableAssetSettings.asset.meta b/Assets/Localization/AddressableAssetsData/AddressableAssetSettings.asset.meta new file mode 100644 index 0000000..b9c438b --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AddressableAssetSettings.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 775bae2e50e14b2448bd83120de993bb +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/AssetGroupTemplates.meta b/Assets/Localization/AddressableAssetsData/AssetGroupTemplates.meta new file mode 100644 index 0000000..bddd1c6 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroupTemplates.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1eca924a24cd6a446966cfbce30c37dd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset b/Assets/Localization/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset new file mode 100644 index 0000000..5967bc7 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-7692904901723997003 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3} + m_Name: BundledAssetGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 0} + m_InternalBundleIdMode: 1 + m_Compression: 1 + m_IncludeAddressInCatalog: 1 + m_IncludeGUIDInCatalog: 1 + m_IncludeLabelsInCatalog: 1 + m_InternalIdNamingMode: 0 + m_CacheClearBehavior: 0 + m_IncludeInBuild: 1 + m_BundledAssetProviderType: + m_AssemblyName: + m_ClassName: + m_ForceUniqueProvider: 0 + m_UseAssetBundleCache: 1 + m_UseAssetBundleCrc: 1 + m_UseAssetBundleCrcForCachedBundles: 1 + m_UseUWRForLocalBundles: 0 + m_Timeout: 0 + m_ChunkedTransfer: 0 + m_RedirectLimit: -1 + m_RetryCount: 0 + m_BuildPath: + m_Id: + m_LoadPath: + m_Id: + m_BundleMode: 0 + m_AssetBundleProviderType: + m_AssemblyName: + m_ClassName: + m_BundleNaming: 0 + m_AssetLoadMode: 0 +--- !u!114 &-4732320076032270122 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3} + m_Name: ContentUpdateGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 0} + m_StaticContent: 0 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1a3c5d64ac83548c09dd1678b9f6f1cd, type: 3} + m_Name: Packed Assets + m_EditorClassIdentifier: + m_SchemaObjects: + - {fileID: -7692904901723997003} + - {fileID: -4732320076032270122} + m_Description: Pack assets into asset bundles. + m_Settings: {fileID: 11400000, guid: 775bae2e50e14b2448bd83120de993bb, type: 2} diff --git a/Assets/Localization/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset.meta b/Assets/Localization/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset.meta new file mode 100644 index 0000000..af0d42c --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c0ddd4b1b864ca04da68914a70695496 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups.meta b/Assets/Localization/AddressableAssetsData/AssetGroups.meta new file mode 100644 index 0000000..7be9d1e --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroups.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e49e5a1913544a44f8f4a406def111a6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups/Built In Data.asset b/Assets/Localization/AddressableAssetsData/AssetGroups/Built In Data.asset new file mode 100644 index 0000000..32aea13 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroups/Built In Data.asset @@ -0,0 +1,34 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3} + m_Name: Built In Data + m_EditorClassIdentifier: + m_GroupName: Built In Data + m_Data: + m_SerializedData: [] + m_GUID: 10b1276b2203f16438be90ba229c9e56 + m_SerializeEntries: + - m_GUID: Resources + m_Address: Resources + m_ReadOnly: 1 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: EditorSceneList + m_Address: EditorSceneList + m_ReadOnly: 1 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + m_ReadOnly: 1 + m_Settings: {fileID: 11400000, guid: 775bae2e50e14b2448bd83120de993bb, type: 2} + m_SchemaSet: + m_Schemas: + - {fileID: 11400000, guid: 809c52f5a2a25304d9afd6049c8e0050, type: 2} diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups/Built In Data.asset.meta b/Assets/Localization/AddressableAssetsData/AssetGroups/Built In Data.asset.meta new file mode 100644 index 0000000..a8f0531 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroups/Built In Data.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 39e0381f5bc729f459dafa0bf1720ff7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups/Default Local Group.asset b/Assets/Localization/AddressableAssetsData/AssetGroups/Default Local Group.asset new file mode 100644 index 0000000..25205a5 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroups/Default Local Group.asset @@ -0,0 +1,25 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3} + m_Name: Default Local Group + m_EditorClassIdentifier: + m_GroupName: Default Local Group + m_Data: + m_SerializedData: [] + m_GUID: f8f78eecf4004b3469a3f0092a10cc87 + m_SerializeEntries: [] + m_ReadOnly: 0 + m_Settings: {fileID: 11400000, guid: 775bae2e50e14b2448bd83120de993bb, type: 2} + m_SchemaSet: + m_Schemas: + - {fileID: 11400000, guid: a94f7052fa227394ba4002fe4d7022fa, type: 2} + - {fileID: 11400000, guid: 8731cc49772686d448935c8d25422d43, type: 2} diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups/Default Local Group.asset.meta b/Assets/Localization/AddressableAssetsData/AssetGroups/Default Local Group.asset.meta new file mode 100644 index 0000000..97f929a --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroups/Default Local Group.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f0d1a34cb8a9d474f9a99e916cb5b1dc +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups/Localization-Locales.asset b/Assets/Localization/AddressableAssetsData/AssetGroups/Localization-Locales.asset new file mode 100644 index 0000000..e0ae1fd --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroups/Localization-Locales.asset @@ -0,0 +1,37 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3} + m_Name: Localization-Locales + m_EditorClassIdentifier: + m_GroupName: Localization-Locales + m_Data: + m_SerializedData: [] + m_GUID: 3638895c7d697af48853e75ae2426f52 + m_SerializeEntries: + - m_GUID: b687ef6015830a84a91ae1c741f420fc + m_Address: English (en) + m_ReadOnly: 1 + m_SerializedLabels: + - Locale + FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: db738e9bed1d4da4fa372aa455bfa440 + m_Address: French (fr) + m_ReadOnly: 1 + m_SerializedLabels: + - Locale + FlaggedDuringContentUpdateRestriction: 0 + m_ReadOnly: 1 + m_Settings: {fileID: 11400000, guid: 775bae2e50e14b2448bd83120de993bb, type: 2} + m_SchemaSet: + m_Schemas: + - {fileID: 11400000, guid: d9cbf4e069abd764a92412bb0af785e6, type: 2} + - {fileID: 11400000, guid: 53fd03a25fa1b7840a96983975d95683, type: 2} diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups/Localization-Locales.asset.meta b/Assets/Localization/AddressableAssetsData/AssetGroups/Localization-Locales.asset.meta new file mode 100644 index 0000000..be8fba9 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroups/Localization-Locales.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ec8da4bf6038fdf4ea7413fb9dd6ffcb +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas.meta b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas.meta new file mode 100644 index 0000000..098a261 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b5a91feee99b4f5498e5163fae30a87f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Built In Data_PlayerDataGroupSchema.asset b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Built In Data_PlayerDataGroupSchema.asset new file mode 100644 index 0000000..0059764 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Built In Data_PlayerDataGroupSchema.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b1487f5d688e4f94f828f879d599dbdc, type: 3} + m_Name: Built In Data_PlayerDataGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: 39e0381f5bc729f459dafa0bf1720ff7, type: 2} + m_IncludeResourcesFolders: 1 + m_IncludeBuildSettingsScenes: 1 diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Built In Data_PlayerDataGroupSchema.asset.meta b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Built In Data_PlayerDataGroupSchema.asset.meta new file mode 100644 index 0000000..f396358 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Built In Data_PlayerDataGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 809c52f5a2a25304d9afd6049c8e0050 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset new file mode 100644 index 0000000..5c8912d --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset @@ -0,0 +1,45 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3} + m_Name: Default Local Group_BundledAssetGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: f0d1a34cb8a9d474f9a99e916cb5b1dc, type: 2} + m_InternalBundleIdMode: 1 + m_Compression: 1 + m_IncludeAddressInCatalog: 1 + m_IncludeGUIDInCatalog: 1 + m_IncludeLabelsInCatalog: 1 + m_InternalIdNamingMode: 0 + m_CacheClearBehavior: 0 + m_IncludeInBuild: 1 + m_BundledAssetProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider + m_ForceUniqueProvider: 0 + m_UseAssetBundleCache: 1 + m_UseAssetBundleCrc: 1 + m_UseAssetBundleCrcForCachedBundles: 1 + m_UseUWRForLocalBundles: 0 + m_Timeout: 0 + m_ChunkedTransfer: 0 + m_RedirectLimit: -1 + m_RetryCount: 0 + m_BuildPath: + m_Id: 827805ccee015c24ea0f1f5c5d1e74ed + m_LoadPath: + m_Id: e15c2a04e113f8f47a28b249e7f67125 + m_BundleMode: 0 + m_AssetBundleProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider + m_BundleNaming: 0 + m_AssetLoadMode: 0 diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset.meta b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset.meta new file mode 100644 index 0000000..cad98b0 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8731cc49772686d448935c8d25422d43 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset new file mode 100644 index 0000000..2a7c5b6 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3} + m_Name: Default Local Group_ContentUpdateGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: f0d1a34cb8a9d474f9a99e916cb5b1dc, type: 2} + m_StaticContent: 0 diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset.meta b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset.meta new file mode 100644 index 0000000..98d47e2 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a94f7052fa227394ba4002fe4d7022fa +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_BundledAssetGroupSchema.asset b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_BundledAssetGroupSchema.asset new file mode 100644 index 0000000..48f9e7b --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_BundledAssetGroupSchema.asset @@ -0,0 +1,45 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3} + m_Name: Localization-Locales_BundledAssetGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: ec8da4bf6038fdf4ea7413fb9dd6ffcb, type: 2} + m_InternalBundleIdMode: 1 + m_Compression: 1 + m_IncludeAddressInCatalog: 1 + m_IncludeGUIDInCatalog: 1 + m_IncludeLabelsInCatalog: 1 + m_InternalIdNamingMode: 0 + m_CacheClearBehavior: 0 + m_IncludeInBuild: 1 + m_BundledAssetProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider + m_ForceUniqueProvider: 0 + m_UseAssetBundleCache: 1 + m_UseAssetBundleCrc: 1 + m_UseAssetBundleCrcForCachedBundles: 1 + m_UseUWRForLocalBundles: 0 + m_Timeout: 0 + m_ChunkedTransfer: 0 + m_RedirectLimit: -1 + m_RetryCount: 0 + m_BuildPath: + m_Id: 827805ccee015c24ea0f1f5c5d1e74ed + m_LoadPath: + m_Id: e15c2a04e113f8f47a28b249e7f67125 + m_BundleMode: 0 + m_AssetBundleProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider + m_BundleNaming: 1 + m_AssetLoadMode: 0 diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_BundledAssetGroupSchema.asset.meta b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_BundledAssetGroupSchema.asset.meta new file mode 100644 index 0000000..b472ebf --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_BundledAssetGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d9cbf4e069abd764a92412bb0af785e6 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_ContentUpdateGroupSchema.asset b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_ContentUpdateGroupSchema.asset new file mode 100644 index 0000000..ed11bbc --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_ContentUpdateGroupSchema.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3} + m_Name: Localization-Locales_ContentUpdateGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: ec8da4bf6038fdf4ea7413fb9dd6ffcb, type: 2} + m_StaticContent: 0 diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_ContentUpdateGroupSchema.asset.meta b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_ContentUpdateGroupSchema.asset.meta new file mode 100644 index 0000000..693df95 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/AssetGroups/Schemas/Localization-Locales_ContentUpdateGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 53fd03a25fa1b7840a96983975d95683 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/DataBuilders.meta b/Assets/Localization/AddressableAssetsData/DataBuilders.meta new file mode 100644 index 0000000..1df5f79 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/DataBuilders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7a327cac732b0c1459297f14a7daae49 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset b/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset new file mode 100644 index 0000000..50d30dc --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 88d21199f5d473f4db36845f2318f180, type: 3} + m_Name: BuildScriptFastMode + m_EditorClassIdentifier: + instanceProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider + sceneProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider diff --git a/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset.meta b/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset.meta new file mode 100644 index 0000000..83c3767 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f9d877d3e384df3448e4de40545146bf +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset b/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset new file mode 100644 index 0000000..ec875f9 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3e2e0ffa088c91d41a086d0b8cb16bdc, type: 3} + m_Name: BuildScriptPackedMode + m_EditorClassIdentifier: + instanceProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider + sceneProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider diff --git a/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset.meta b/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset.meta new file mode 100644 index 0000000..ffb7830 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0c7c33b95596c6b488a52f120ad1bac7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset b/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset new file mode 100644 index 0000000..7628845 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ad8c280d42ee0ed41a27db23b43dd2bf, type: 3} + m_Name: BuildScriptPackedPlayMode + m_EditorClassIdentifier: + instanceProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider + sceneProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider diff --git a/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset.meta b/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset.meta new file mode 100644 index 0000000..0860d02 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 341d1c4e57607b84da7d731bfb7fa382 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptVirtualMode.asset b/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptVirtualMode.asset new file mode 100644 index 0000000..dfb2d58 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptVirtualMode.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bb0e4994b34add1409fd8ccaf4a82de5, type: 3} + m_Name: BuildScriptVirtualMode + m_EditorClassIdentifier: + instanceProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider + sceneProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider diff --git a/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptVirtualMode.asset.meta b/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptVirtualMode.asset.meta new file mode 100644 index 0000000..592248e --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/DataBuilders/BuildScriptVirtualMode.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8715d6509f854e34090110a35f7bf1fa +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/AddressableAssetsData/DefaultObject.asset b/Assets/Localization/AddressableAssetsData/DefaultObject.asset new file mode 100644 index 0000000..f09fc28 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/DefaultObject.asset @@ -0,0 +1,15 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3a189bb168d8d90478a09ea08c2f3d72, type: 3} + m_Name: DefaultObject + m_EditorClassIdentifier: + m_AddressableAssetSettingsGuid: 775bae2e50e14b2448bd83120de993bb diff --git a/Assets/Localization/AddressableAssetsData/DefaultObject.asset.meta b/Assets/Localization/AddressableAssetsData/DefaultObject.asset.meta new file mode 100644 index 0000000..00e5d33 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/DefaultObject.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3e9962365718b6b48842e3874e77f101 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/English (en).asset b/Assets/Localization/English (en).asset new file mode 100644 index 0000000..b6e54c4 --- /dev/null +++ b/Assets/Localization/English (en).asset @@ -0,0 +1,25 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1bb1838fe8befb0429646b938e757ff3, type: 3} + m_Name: English (en) + m_EditorClassIdentifier: + m_Identifier: + m_Code: en + m_Metadata: + m_Items: [] + m_LocaleName: English (en) + m_CustomFormatCultureCode: + m_UseCustomFormatter: 0 + m_SortOrder: 0 + references: + version: 2 + RefIds: [] diff --git a/Assets/Localization/English (en).asset.meta b/Assets/Localization/English (en).asset.meta new file mode 100644 index 0000000..d8d942e --- /dev/null +++ b/Assets/Localization/English (en).asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b687ef6015830a84a91ae1c741f420fc +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/French (fr).asset b/Assets/Localization/French (fr).asset new file mode 100644 index 0000000..01a54f4 --- /dev/null +++ b/Assets/Localization/French (fr).asset @@ -0,0 +1,25 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1bb1838fe8befb0429646b938e757ff3, type: 3} + m_Name: French (fr) + m_EditorClassIdentifier: + m_Identifier: + m_Code: fr + m_Metadata: + m_Items: [] + m_LocaleName: French (fr) + m_CustomFormatCultureCode: + m_UseCustomFormatter: 0 + m_SortOrder: 1 + references: + version: 2 + RefIds: [] diff --git a/Assets/Localization/French (fr).asset.meta b/Assets/Localization/French (fr).asset.meta new file mode 100644 index 0000000..7e46bd0 --- /dev/null +++ b/Assets/Localization/French (fr).asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: db738e9bed1d4da4fa372aa455bfa440 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/Localization Settings.asset b/Assets/Localization/Localization Settings.asset new file mode 100644 index 0000000..a1c1947 --- /dev/null +++ b/Assets/Localization/Localization Settings.asset @@ -0,0 +1,205 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a07b5cd0b1b829245bc8c4b6978793e8, type: 3} + m_Name: Localization Settings + m_EditorClassIdentifier: + m_StartupSelectors: + - rid: 8151037669503139840 + - rid: 8151037669503139841 + - rid: 8151037669503139842 + m_AvailableLocales: + rid: 8151037669503139843 + m_AssetDatabase: + rid: 8151037669503139844 + m_StringDatabase: + rid: 8151037669503139845 + m_Metadata: + m_Items: [] + m_ProjectLocaleIdentifier: + m_Code: en + m_PreloadBehavior: 1 + m_InitializeSynchronously: 0 + references: + version: 2 + RefIds: + - rid: -2 + type: {class: , ns: , asm: } + - rid: 8151037669503139840 + type: {class: CommandLineLocaleSelector, ns: UnityEngine.Localization.Settings, asm: Unity.Localization} + data: + m_CommandLineArgument: -language= + - rid: 8151037669503139841 + type: {class: SystemLocaleSelector, ns: UnityEngine.Localization.Settings, asm: Unity.Localization} + data: + - rid: 8151037669503139842 + type: {class: SpecificLocaleSelector, ns: UnityEngine.Localization.Settings, asm: Unity.Localization} + data: + m_LocaleId: + m_Code: en + - rid: 8151037669503139843 + type: {class: LocalesProvider, ns: UnityEngine.Localization.Settings, asm: Unity.Localization} + data: + - rid: 8151037669503139844 + type: {class: LocalizedAssetDatabase, ns: UnityEngine.Localization.Settings, asm: Unity.Localization} + data: + m_DefaultTableReference: + m_TableCollectionName: + m_CustomTableProvider: + rid: -2 + m_CustomTablePostprocessor: + rid: -2 + m_UseFallback: 0 + - rid: 8151037669503139845 + type: {class: LocalizedStringDatabase, ns: UnityEngine.Localization.Settings, asm: Unity.Localization} + data: + m_DefaultTableReference: + m_TableCollectionName: + m_CustomTableProvider: + rid: -2 + m_CustomTablePostprocessor: + rid: -2 + m_UseFallback: 0 + m_MissingTranslationState: 1 + m_NoTranslationFoundMessage: No translation found for '{key}' in {table.TableCollectionName} + m_SmartFormat: + rid: 8151037669503139846 + - rid: 8151037669503139846 + type: {class: SmartFormatter, ns: UnityEngine.Localization.SmartFormat, asm: Unity.Localization} + data: + m_Settings: + rid: 8151037669503139847 + m_Parser: + rid: 8151037669503139848 + m_Sources: + - rid: 8151037669503139849 + - rid: 8151037669503139850 + - rid: 8151037669503139851 + - rid: 8151037669503139852 + - rid: 8151037669503139853 + - rid: 8151037669503139854 + - rid: 8151037669503139855 + m_Formatters: + - rid: 8151037669503139849 + - rid: 8151037669503139856 + - rid: 8151037669503139857 + - rid: 8151037669503139858 + - rid: 8151037669503139859 + - rid: 8151037669503139860 + - rid: 8151037669503139861 + - rid: 8151037669503139862 + - rid: 8151037669503139863 + - rid: 8151037669503139847 + type: {class: SmartSettings, ns: UnityEngine.Localization.SmartFormat.Core.Settings, asm: Unity.Localization} + data: + m_FormatErrorAction: 0 + m_ParseErrorAction: 0 + m_CaseSensitivity: 0 + m_ConvertCharacterStringLiterals: 1 + - rid: 8151037669503139848 + type: {class: Parser, ns: UnityEngine.Localization.SmartFormat.Core.Parsing, asm: Unity.Localization} + data: + m_OpeningBrace: 123 + m_ClosingBrace: 125 + m_Settings: + rid: 8151037669503139847 + m_AlphanumericSelectors: 1 + m_AllowedSelectorChars: _- + m_Operators: '[]().,' + m_AlternativeEscaping: 0 + m_AlternativeEscapeChar: 92 + - rid: 8151037669503139849 + type: {class: ListFormatter, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Names: + - list + - l + - + m_SmartSettings: + rid: 8151037669503139847 + - rid: 8151037669503139850 + type: {class: PersistentVariablesSource, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Groups: [] + - rid: 8151037669503139851 + type: {class: DictionarySource, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + - rid: 8151037669503139852 + type: {class: ValueTupleSource, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + - rid: 8151037669503139853 + type: {class: XmlSource, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + - rid: 8151037669503139854 + type: {class: ReflectionSource, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + - rid: 8151037669503139855 + type: {class: DefaultSource, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + - rid: 8151037669503139856 + type: {class: PluralLocalizationFormatter, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Names: + - plural + - p + - + m_DefaultTwoLetterISOLanguageName: en + - rid: 8151037669503139857 + type: {class: ConditionalFormatter, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Names: + - conditional + - cond + - + - rid: 8151037669503139858 + type: {class: TimeFormatter, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Names: + - timespan + - time + - t + - + m_DefaultFormatOptions: 4646 + - rid: 8151037669503139859 + type: {class: XElementFormatter, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Names: + - xelement + - xml + - x + - + - rid: 8151037669503139860 + type: {class: ChooseFormatter, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Names: + - choose + - c + m_SplitChar: 124 + - rid: 8151037669503139861 + type: {class: SubStringFormatter, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Names: + - substr + m_ParameterDelimiter: 44 + m_NullDisplayString: (null) + m_OutOfRangeBehavior: 0 + - rid: 8151037669503139862 + type: {class: IsMatchFormatter, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Names: + - ismatch + - rid: 8151037669503139863 + type: {class: DefaultFormatter, ns: UnityEngine.Localization.SmartFormat.Extensions, asm: Unity.Localization} + data: + m_Names: + - default + - d + - diff --git a/Assets/Localization/Localization Settings.asset.meta b/Assets/Localization/Localization Settings.asset.meta new file mode 100644 index 0000000..49970c1 --- /dev/null +++ b/Assets/Localization/Localization Settings.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 69c3f2d9d933f834aa38ecbda69289ca +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/UserInterface Shared Data.asset b/Assets/Localization/UserInterface Shared Data.asset new file mode 100644 index 0000000..1817ace --- /dev/null +++ b/Assets/Localization/UserInterface Shared Data.asset @@ -0,0 +1,134 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5b11a58205ec3474ca216360e9fa74a8, type: 3} + m_Name: UserInterface Shared Data + m_EditorClassIdentifier: + m_TableCollectionName: UserInterface + m_TableCollectionNameGuidString: 9a6eec81bdcf2bb48b63d1f03a258bde + m_Entries: + - m_Id: 509297696768 + m_Key: ComputerView/Canvas/VotingPage/Title + m_Metadata: + m_Items: [] + - m_Id: 1749217845248 + m_Key: ComputerView/Canvas/WaitingForPlayersPage/RoomCodeHeader + m_Metadata: + m_Items: [] + - m_Id: 1816846802944 + m_Key: ComputerView/Canvas/WaitingForPlayersPage/Credits/TextCredits + m_Metadata: + m_Items: [] + - m_Id: 2357626806272 + m_Key: ComputerView/Canvas/ExplanationPage/Explanation + m_Metadata: + m_Items: [] + - m_Id: 2532051132416 + m_Key: ComputerView/Canvas/WaitingForPropositionPage/WaitingText + m_Metadata: + m_Items: [] + - m_Id: 2629430288384 + m_Key: ComputerView/Canvas/WaitingForPropositionPage/RemindText + m_Metadata: + m_Items: [] + - m_Id: 2830983372800 + m_Key: ComputerView/Canvas/ScoringPage/Title2 + m_Metadata: + m_Items: [] + - m_Id: 3130414735360 + m_Key: PhoneView/Canvas/Background/HomeState/SubmitBtnSignIn + m_Metadata: + m_Items: [] + - m_Id: 3236539015168 + m_Key: PhoneView/Canvas/Background/HomeState/RoomCodeField/Text Area/Placeholder + m_Metadata: + m_Items: [] + - m_Id: 3285734006784 + m_Key: PhoneView/Canvas/Background/HomeState/NameField/Text Area/Placeholder + m_Metadata: + m_Items: [] + - m_Id: 3428315176960 + m_Key: PhoneView/Canvas/Background/HomeState/NameField/MaxLengthName + m_Metadata: + m_Items: [] + - m_Id: 3648696492032 + m_Key: PhoneView/Canvas/Background/WaitingRoomState/waitingText + m_Metadata: + m_Items: [] + - m_Id: 3716627439616 + m_Key: PhoneView/Canvas/Background/BeforeStartState/ExplainText1 + m_Metadata: + m_Items: [] + - m_Id: 3784638078976 + m_Key: PhoneView/Canvas/Background/BeforeStartState/ExplainText2 + m_Metadata: + m_Items: [] + - m_Id: 3837364674560 + m_Key: PhoneView/Canvas/Background/BeforeStartState/ExplainText3 + m_Metadata: + m_Items: [] + - m_Id: 4018642493440 + m_Key: PhoneView/Canvas/Background/TakePictureState/SubmitBtn + m_Metadata: + m_Items: [] + - m_Id: 4068001062912 + m_Key: PhoneView/Canvas/Background/VotePicturesState/Title + m_Metadata: + m_Items: [] + - m_Id: 4139262287872 + m_Key: PhoneView/Canvas/Background/WaitingOtherPlayersState/WaitingText + m_Metadata: + m_Items: [] + - m_Id: 4209818869760 + m_Key: PhoneView/Canvas/Background/EndGameState/For First Player/Restart + m_Metadata: + m_Items: [] + - m_Id: 4231604084736 + m_Key: PhoneView/Canvas/Background/EndGameState/For First Player/SamePlayersBtn/Text + (TMP) + m_Metadata: + m_Items: [] + - m_Id: 4287325413376 + m_Key: PhoneView/Canvas/Background/EndGameState/For First Player/NewPlayersBtn/Text + (TMP) + m_Metadata: + m_Items: [] + - m_Id: 4731950997504 + m_Key: PhoneView/Canvas/Background/EndGameState/For Others/Restart + m_Metadata: + m_Items: [] + - m_Id: 11195591565312 + m_Key: ComputerView/Canvas/WaitingForPlayersPage/WaitingForP + m_Metadata: + m_Items: [] + - m_Id: 21791745646592 + m_Key: PhoneView/Canvas/Background/HomeState/NameField/ErrorNameLabel + m_Metadata: + m_Items: [] + - m_Id: 22232382447616 + m_Key: PhoneView/Canvas/Background/HomeState/NameField/EmptyRoom + m_Metadata: + m_Items: [] + - m_Id: 22493150715904 + m_Key: PhoneView/Canvas/Background/HomeState/NameField/ErrorRoom + m_Metadata: + m_Items: [] + m_Metadata: + m_Items: [] + m_KeyGenerator: + rid: 8151037669503139864 + references: + version: 2 + RefIds: + - rid: 8151037669503139864 + type: {class: DistributedUIDGenerator, ns: UnityEngine.Localization.Tables, asm: Unity.Localization} + data: + m_CustomEpoch: 1709068471525 diff --git a/Assets/Localization/UserInterface Shared Data.asset.meta b/Assets/Localization/UserInterface Shared Data.asset.meta new file mode 100644 index 0000000..78b6faa --- /dev/null +++ b/Assets/Localization/UserInterface Shared Data.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9a6eec81bdcf2bb48b63d1f03a258bde +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/UserInterface.asset b/Assets/Localization/UserInterface.asset new file mode 100644 index 0000000..9a39bf7 --- /dev/null +++ b/Assets/Localization/UserInterface.asset @@ -0,0 +1,23 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5be51871efa6c3e4eae1703925c8f5ac, type: 3} + m_Name: UserInterface + m_EditorClassIdentifier: + m_SharedTableData: {fileID: 11400000, guid: 9a6eec81bdcf2bb48b63d1f03a258bde, type: 2} + m_Tables: + - {fileID: 11400000, guid: 90195f789375a614db94093b0019300a, type: 2} + - {fileID: 11400000, guid: 9ef94db177b1b804385b7afc5e215096, type: 2} + m_Extensions: [] + m_Group: String Table + references: + version: 2 + RefIds: [] diff --git a/Assets/Localization/UserInterface.asset.meta b/Assets/Localization/UserInterface.asset.meta new file mode 100644 index 0000000..475667b --- /dev/null +++ b/Assets/Localization/UserInterface.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3d4b6573839c0274ca08f4bf9dedeca2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/UserInterface_en.asset b/Assets/Localization/UserInterface_en.asset new file mode 100644 index 0000000..d747996 --- /dev/null +++ b/Assets/Localization/UserInterface_en.asset @@ -0,0 +1,136 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e9620f8c34305754d8cc9a7e49e852d9, type: 3} + m_Name: UserInterface_en + m_EditorClassIdentifier: + m_LocaleId: + m_Code: en + m_SharedData: {fileID: 11400000, guid: 9a6eec81bdcf2bb48b63d1f03a258bde, type: 2} + m_Metadata: + m_Items: [] + m_TableData: + - m_Id: 509297696768 + m_Localized: Vote for best picture! + m_Metadata: + m_Items: [] + - m_Id: 1749217845248 + m_Localized: 'Room Code :' + m_Metadata: + m_Items: [] + - m_Id: 1816846802944 + m_Localized: 'Made in 48h during the + + Global Game Jam 2024. + + Developers + :' + m_Metadata: + m_Items: [] + - m_Id: 2357626806272 + m_Localized: "You will have some prompts \nand you will have to take pictures + of what is asked.\n\n Are you Ready ?" + m_Metadata: + m_Items: [] + - m_Id: 2532051132416 + m_Localized: waiting for players pictures... + m_Metadata: + m_Items: [] + - m_Id: 2629430288384 + m_Localized: Don't forget that one sentence can be interpreted in many different + ways! + m_Metadata: + m_Items: [] + - m_Id: 2830983372800 + m_Localized: Who's the best + m_Metadata: + m_Items: [] + - m_Id: 3130414735360 + m_Localized: Submit + m_Metadata: + m_Items: [] + - m_Id: 3236539015168 + m_Localized: Enter the room code... + m_Metadata: + m_Items: [] + - m_Id: 3285734006784 + m_Localized: Enter your name... + m_Metadata: + m_Items: [] + - m_Id: 3428315176960 + m_Localized: 16 characters maximum + m_Metadata: + m_Items: [] + - m_Id: 3648696492032 + m_Localized: Waiting for players + m_Metadata: + m_Items: [] + - m_Id: 3716627439616 + m_Localized: You will have some Prompts + m_Metadata: + m_Items: [] + - m_Id: 3784638078976 + m_Localized: 'and you will have to take pictures of what is asked. + +' + m_Metadata: + m_Items: [] + - m_Id: 3837364674560 + m_Localized: 'Are you ready ? ' + m_Metadata: + m_Items: [] + - m_Id: 4018642493440 + m_Localized: Submit + m_Metadata: + m_Items: [] + - m_Id: 4068001062912 + m_Localized: vote for the funiest picture! + m_Metadata: + m_Items: [] + - m_Id: 4139262287872 + m_Localized: WAiting for others players + m_Metadata: + m_Items: [] + - m_Id: 4209818869760 + m_Localized: 'Restart ? ' + m_Metadata: + m_Items: [] + - m_Id: 4231604084736 + m_Localized: Same Players + m_Metadata: + m_Items: [] + - m_Id: 4287325413376 + m_Localized: New Players + m_Metadata: + m_Items: [] + - m_Id: 4731950997504 + m_Localized: Wait for first player to restart the game + m_Metadata: + m_Items: [] + - m_Id: 11195591565312 + m_Localized: Waiting for P + m_Metadata: + m_Items: [] + - m_Id: 21791745646592 + m_Localized: 'Error: You have to put a valid name' + m_Metadata: + m_Items: [] + - m_Id: 22232382447616 + m_Localized: You have to put a room code + m_Metadata: + m_Items: [] + - m_Id: 22493150715904 + m_Localized: 'Error: the room doesn''t exists' + m_Metadata: + m_Items: [] + references: + version: 2 + RefIds: [] diff --git a/Assets/Localization/UserInterface_en.asset.meta b/Assets/Localization/UserInterface_en.asset.meta new file mode 100644 index 0000000..8543e3e --- /dev/null +++ b/Assets/Localization/UserInterface_en.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 90195f789375a614db94093b0019300a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/UserInterface_fr.asset b/Assets/Localization/UserInterface_fr.asset new file mode 100644 index 0000000..80ed08d --- /dev/null +++ b/Assets/Localization/UserInterface_fr.asset @@ -0,0 +1,132 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e9620f8c34305754d8cc9a7e49e852d9, type: 3} + m_Name: UserInterface_fr + m_EditorClassIdentifier: + m_LocaleId: + m_Code: fr + m_SharedData: {fileID: 11400000, guid: 9a6eec81bdcf2bb48b63d1f03a258bde, type: 2} + m_Metadata: + m_Items: [] + m_TableData: + - m_Id: 509297696768 + m_Localized: Votez pour la meilleure image ! + m_Metadata: + m_Items: [] + - m_Id: 1749217845248 + m_Localized: 'Code de la salle :' + m_Metadata: + m_Items: [] + - m_Id: 1816846802944 + m_Localized: "Fait en 48h pendant la\nGlobal Game Jam 2024.\nD\xE9veloppeur\xB7euses + :" + m_Metadata: + m_Items: [] + - m_Id: 2357626806272 + m_Localized: "Vous allez recevoir des phrases\nEt vous devrez prendre des photos + de ce qui est d\xE9cris.\n\n\xCAtes vous pr\xEAt ?" + m_Metadata: + m_Items: [] + - m_Id: 2532051132416 + m_Localized: En attente des autres joueur.euses... + m_Metadata: + m_Items: [] + - m_Id: 2629430288384 + m_Localized: "N'oubliez pas qu'une phrase peut \xEAtre intepr\xE9t\xE9 de diff\xE9rentes + fa\xE7ons." + m_Metadata: + m_Items: [] + - m_Id: 2830983372800 + m_Localized: "Qui est le\xB7a meilleur.e" + m_Metadata: + m_Items: [] + - m_Id: 3130414735360 + m_Localized: 'Valider + +' + m_Metadata: + m_Items: [] + - m_Id: 3236539015168 + m_Localized: Entrez le code de la salle... + m_Metadata: + m_Items: [] + - m_Id: 3285734006784 + m_Localized: Entrez votre nom... + m_Metadata: + m_Items: [] + - m_Id: 3428315176960 + m_Localized: "16 caract\xE8res maximum" + m_Metadata: + m_Items: [] + - m_Id: 3648696492032 + m_Localized: "En attente des joueur\xB7euses" + m_Metadata: + m_Items: [] + - m_Id: 3716627439616 + m_Localized: Vous allez voir des phrases + m_Metadata: + m_Items: [] + - m_Id: 3784638078976 + m_Localized: "Et vous devrez prendre une photo de ce qui est d\xE9cris" + m_Metadata: + m_Items: [] + - m_Id: 3837364674560 + m_Localized: "\xCAtes vous pr\xEAt\xB7e ?" + m_Metadata: + m_Items: [] + - m_Id: 4018642493440 + m_Localized: Valider + m_Metadata: + m_Items: [] + - m_Id: 4068001062912 + m_Localized: Votez pour la photo la plus marrante ! + m_Metadata: + m_Items: [] + - m_Id: 4139262287872 + m_Localized: "En attente des autres joueur\xB7euses" + m_Metadata: + m_Items: [] + - m_Id: 4209818869760 + m_Localized: "Red\xE9marrer ?" + m_Metadata: + m_Items: [] + - m_Id: 4231604084736 + m_Localized: "M\xEAmes joueur\xB7euses" + m_Metadata: + m_Items: [] + - m_Id: 4287325413376 + m_Localized: "nouvelles\xB7aux joueur\xB7euses" + m_Metadata: + m_Items: [] + - m_Id: 4731950997504 + m_Localized: "En attente de le\xB7a premier\xB7\xE8re joueur.euse..." + m_Metadata: + m_Items: [] + - m_Id: 11195591565312 + m_Localized: En attente de J + m_Metadata: + m_Items: [] + - m_Id: 21791745646592 + m_Localized: 'Erreur: Vous devez rentrer un nom valide' + m_Metadata: + m_Items: [] + - m_Id: 22232382447616 + m_Localized: Vous devez rentrer un code de salle + m_Metadata: + m_Items: [] + - m_Id: 22493150715904 + m_Localized: 'Erreur: cette salle n''existe pas' + m_Metadata: + m_Items: [] + references: + version: 2 + RefIds: [] diff --git a/Assets/Localization/UserInterface_fr.asset.meta b/Assets/Localization/UserInterface_fr.asset.meta new file mode 100644 index 0000000..2d336e8 --- /dev/null +++ b/Assets/Localization/UserInterface_fr.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9ef94db177b1b804385b7afc5e215096 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/manifest.json b/Packages/manifest.json index 204d7ab..0525e50 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -3,6 +3,7 @@ "com.unity.2d.sprite": "1.0.0", "com.unity.collab-proxy": "2.2.0", "com.unity.feature.development": "1.0.1", + "com.unity.localization": "1.4.5", "com.unity.memoryprofiler": "1.1.0", "com.unity.nuget.newtonsoft-json": "3.2.1", "com.unity.recorder": "4.0.2", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 383cf91..48d0ad4 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -6,6 +6,20 @@ "source": "builtin", "dependencies": {} }, + "com.unity.addressables": { + "version": "1.21.19", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.scriptablebuildpipeline": "1.21.21", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0" + }, + "url": "https://packages.unity.com" + }, "com.unity.collab-proxy": { "version": "2.2.0", "depth": 0, @@ -66,6 +80,16 @@ "dependencies": {}, "url": "https://packages.unity.com" }, + "com.unity.localization": { + "version": "1.4.5", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.addressables": "1.21.8", + "com.unity.nuget.newtonsoft-json": "3.0.2" + }, + "url": "https://packages.unity.com" + }, "com.unity.memoryprofiler": { "version": "1.1.0", "depth": 0, @@ -98,6 +122,13 @@ }, "url": "https://packages.unity.com" }, + "com.unity.scriptablebuildpipeline": { + "version": "1.21.21", + "depth": 2, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, "com.unity.settings-manager": { "version": "2.0.1", "depth": 2, diff --git a/ProjectSettings/LocalizationSettings.asset b/ProjectSettings/LocalizationSettings.asset new file mode 100644 index 0000000..95eca8a --- /dev/null +++ b/ProjectSettings/LocalizationSettings.asset @@ -0,0 +1,21 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: aa32dd7bcb4d749abb23199c1f0f51af, type: 3} + m_Name: + m_EditorClassIdentifier: + m_StringTable: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_AssetTable: + m_TableReference: + m_TableCollectionName: + m_TrackingChanges: 1 -- 2.45.2 From 83a2979bc9c93f5632b9c195802b1640c267de1c Mon Sep 17 00:00:00 2001 From: Fangh Date: Tue, 27 Feb 2024 23:45:51 +0100 Subject: [PATCH 02/13] feat(localization): build adressables for string tables --- Assets/AddressableAssetsData.meta | 8 ++++ Assets/AddressableAssetsData/Android.meta | 8 ++++ Assets/AddressableAssetsData/AssetGroups.meta | 8 ++++ .../Localization-Assets-Shared.asset | 30 +++++++++++++ .../Localization-Assets-Shared.asset.meta | 8 ++++ ...alization-String-Tables-English (en).asset | 31 +++++++++++++ ...tion-String-Tables-English (en).asset.meta | 8 ++++ ...calization-String-Tables-French (fr).asset | 31 +++++++++++++ ...ation-String-Tables-French (fr).asset.meta | 8 ++++ .../AssetGroups/Schemas.meta | 8 ++++ ...ssets-Shared_BundledAssetGroupSchema.asset | 45 +++++++++++++++++++ ...-Shared_BundledAssetGroupSchema.asset.meta | 8 ++++ ...sets-Shared_ContentUpdateGroupSchema.asset | 16 +++++++ ...Shared_ContentUpdateGroupSchema.asset.meta | 8 ++++ ...English (en)_BundledAssetGroupSchema.asset | 45 +++++++++++++++++++ ...sh (en)_BundledAssetGroupSchema.asset.meta | 8 ++++ ...nglish (en)_ContentUpdateGroupSchema.asset | 16 +++++++ ...h (en)_ContentUpdateGroupSchema.asset.meta | 8 ++++ ...-French (fr)_BundledAssetGroupSchema.asset | 45 +++++++++++++++++++ ...ch (fr)_BundledAssetGroupSchema.asset.meta | 8 ++++ ...French (fr)_ContentUpdateGroupSchema.asset | 16 +++++++ ...h (fr)_ContentUpdateGroupSchema.asset.meta | 8 ++++ 22 files changed, 379 insertions(+) create mode 100644 Assets/AddressableAssetsData.meta create mode 100644 Assets/AddressableAssetsData/Android.meta create mode 100644 Assets/AddressableAssetsData/AssetGroups.meta create mode 100644 Assets/AddressableAssetsData/AssetGroups/Localization-Assets-Shared.asset create mode 100644 Assets/AddressableAssetsData/AssetGroups/Localization-Assets-Shared.asset.meta create mode 100644 Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset create mode 100644 Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset.meta create mode 100644 Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-French (fr).asset create mode 100644 Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-French (fr).asset.meta create mode 100644 Assets/AddressableAssetsData/AssetGroups/Schemas.meta create mode 100644 Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_BundledAssetGroupSchema.asset create mode 100644 Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_BundledAssetGroupSchema.asset.meta create mode 100644 Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_ContentUpdateGroupSchema.asset create mode 100644 Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_ContentUpdateGroupSchema.asset.meta create mode 100644 Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_BundledAssetGroupSchema.asset create mode 100644 Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_BundledAssetGroupSchema.asset.meta create mode 100644 Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_ContentUpdateGroupSchema.asset create mode 100644 Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_ContentUpdateGroupSchema.asset.meta create mode 100644 Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-French (fr)_BundledAssetGroupSchema.asset create mode 100644 Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-French (fr)_BundledAssetGroupSchema.asset.meta create mode 100644 Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-French (fr)_ContentUpdateGroupSchema.asset create mode 100644 Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-French (fr)_ContentUpdateGroupSchema.asset.meta diff --git a/Assets/AddressableAssetsData.meta b/Assets/AddressableAssetsData.meta new file mode 100644 index 0000000..d34aef8 --- /dev/null +++ b/Assets/AddressableAssetsData.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 17cff2a5715ff614f8c5c7a19a32fc12 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/Android.meta b/Assets/AddressableAssetsData/Android.meta new file mode 100644 index 0000000..a3ef5bd --- /dev/null +++ b/Assets/AddressableAssetsData/Android.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6a79af3b08c82cc4e85fc78eb447c2b1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups.meta b/Assets/AddressableAssetsData/AssetGroups.meta new file mode 100644 index 0000000..4222890 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1594e55ee45b17649a54aa360cf6511f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Localization-Assets-Shared.asset b/Assets/AddressableAssetsData/AssetGroups/Localization-Assets-Shared.asset new file mode 100644 index 0000000..9a5c533 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Localization-Assets-Shared.asset @@ -0,0 +1,30 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3} + m_Name: Localization-Assets-Shared + m_EditorClassIdentifier: + m_GroupName: Localization-Assets-Shared + m_Data: + m_SerializedData: [] + m_GUID: 63ce0d6f3a357b24fafa22e6c5f4aa28 + m_SerializeEntries: + - m_GUID: 9a6eec81bdcf2bb48b63d1f03a258bde + m_Address: Assets/Localization/UserInterface Shared Data.asset + m_ReadOnly: 1 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 + m_ReadOnly: 1 + m_Settings: {fileID: 11400000, guid: 775bae2e50e14b2448bd83120de993bb, type: 2} + m_SchemaSet: + m_Schemas: + - {fileID: 11400000, guid: 39e36f41cdda3004c9bf8e5f344322ea, type: 2} + - {fileID: 11400000, guid: 7e5843cd57c4d834e826ec9f4b25be6e, type: 2} diff --git a/Assets/AddressableAssetsData/AssetGroups/Localization-Assets-Shared.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Localization-Assets-Shared.asset.meta new file mode 100644 index 0000000..620e161 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Localization-Assets-Shared.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7f1011374c444a7419dbbb4441f674a7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset new file mode 100644 index 0000000..a127a59 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset @@ -0,0 +1,31 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3} + m_Name: Localization-String-Tables-English (en) + m_EditorClassIdentifier: + m_GroupName: Localization-String-Tables-English (en) + m_Data: + m_SerializedData: [] + m_GUID: dd6b376b3326abb4cbc17bebc96358d3 + m_SerializeEntries: + - m_GUID: 90195f789375a614db94093b0019300a + m_Address: UserInterface_en + m_ReadOnly: 1 + m_SerializedLabels: + - Locale-en + FlaggedDuringContentUpdateRestriction: 0 + m_ReadOnly: 1 + m_Settings: {fileID: 11400000, guid: 775bae2e50e14b2448bd83120de993bb, type: 2} + m_SchemaSet: + m_Schemas: + - {fileID: 11400000, guid: 121b4ac9cf690a34fbcad095e9ef1284, type: 2} + - {fileID: 11400000, guid: c68ba18124c5ece4283a63cebf076066, type: 2} diff --git a/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset.meta b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset.meta new file mode 100644 index 0000000..db549d6 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4d1ea22595cc1954b88630c373b16bca +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-French (fr).asset b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-French (fr).asset new file mode 100644 index 0000000..34f3c21 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-French (fr).asset @@ -0,0 +1,31 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3} + m_Name: Localization-String-Tables-French (fr) + m_EditorClassIdentifier: + m_GroupName: Localization-String-Tables-French (fr) + m_Data: + m_SerializedData: [] + m_GUID: 969d1b9365326af4193dcd17947310c3 + m_SerializeEntries: + - m_GUID: 9ef94db177b1b804385b7afc5e215096 + m_Address: UserInterface_fr + m_ReadOnly: 1 + m_SerializedLabels: + - Locale-fr + FlaggedDuringContentUpdateRestriction: 0 + m_ReadOnly: 1 + m_Settings: {fileID: 11400000, guid: 775bae2e50e14b2448bd83120de993bb, type: 2} + m_SchemaSet: + m_Schemas: + - {fileID: 11400000, guid: 9d3447b8294ef6f4e912e7ef31a3791c, type: 2} + - {fileID: 11400000, guid: 233944ccf74d40243be2f6084a744132, type: 2} diff --git a/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-French (fr).asset.meta b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-French (fr).asset.meta new file mode 100644 index 0000000..de0c3a0 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-French (fr).asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0caa1f41c04a47a4ab9a1ee4ecc74020 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas.meta new file mode 100644 index 0000000..841fab6 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5687d1c870ab7cb43961e9e2a6b476dd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_BundledAssetGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_BundledAssetGroupSchema.asset new file mode 100644 index 0000000..f5c7ab4 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_BundledAssetGroupSchema.asset @@ -0,0 +1,45 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3} + m_Name: Localization-Assets-Shared_BundledAssetGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: 7f1011374c444a7419dbbb4441f674a7, type: 2} + m_InternalBundleIdMode: 1 + m_Compression: 1 + m_IncludeAddressInCatalog: 1 + m_IncludeGUIDInCatalog: 1 + m_IncludeLabelsInCatalog: 1 + m_InternalIdNamingMode: 0 + m_CacheClearBehavior: 0 + m_IncludeInBuild: 1 + m_BundledAssetProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider + m_ForceUniqueProvider: 0 + m_UseAssetBundleCache: 1 + m_UseAssetBundleCrc: 1 + m_UseAssetBundleCrcForCachedBundles: 1 + m_UseUWRForLocalBundles: 0 + m_Timeout: 0 + m_ChunkedTransfer: 0 + m_RedirectLimit: -1 + m_RetryCount: 0 + m_BuildPath: + m_Id: 827805ccee015c24ea0f1f5c5d1e74ed + m_LoadPath: + m_Id: e15c2a04e113f8f47a28b249e7f67125 + m_BundleMode: 0 + m_AssetBundleProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider + m_BundleNaming: 1 + m_AssetLoadMode: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_BundledAssetGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_BundledAssetGroupSchema.asset.meta new file mode 100644 index 0000000..c96fc3b --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_BundledAssetGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 39e36f41cdda3004c9bf8e5f344322ea +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_ContentUpdateGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_ContentUpdateGroupSchema.asset new file mode 100644 index 0000000..a044c9e --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_ContentUpdateGroupSchema.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3} + m_Name: Localization-Assets-Shared_ContentUpdateGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: 7f1011374c444a7419dbbb4441f674a7, type: 2} + m_StaticContent: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_ContentUpdateGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_ContentUpdateGroupSchema.asset.meta new file mode 100644 index 0000000..f65409b --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-Assets-Shared_ContentUpdateGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7e5843cd57c4d834e826ec9f4b25be6e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_BundledAssetGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_BundledAssetGroupSchema.asset new file mode 100644 index 0000000..0216c8d --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_BundledAssetGroupSchema.asset @@ -0,0 +1,45 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3} + m_Name: Localization-String-Tables-English (en)_BundledAssetGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: 4d1ea22595cc1954b88630c373b16bca, type: 2} + m_InternalBundleIdMode: 1 + m_Compression: 1 + m_IncludeAddressInCatalog: 1 + m_IncludeGUIDInCatalog: 1 + m_IncludeLabelsInCatalog: 1 + m_InternalIdNamingMode: 0 + m_CacheClearBehavior: 0 + m_IncludeInBuild: 1 + m_BundledAssetProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider + m_ForceUniqueProvider: 0 + m_UseAssetBundleCache: 1 + m_UseAssetBundleCrc: 1 + m_UseAssetBundleCrcForCachedBundles: 1 + m_UseUWRForLocalBundles: 0 + m_Timeout: 0 + m_ChunkedTransfer: 0 + m_RedirectLimit: -1 + m_RetryCount: 0 + m_BuildPath: + m_Id: 827805ccee015c24ea0f1f5c5d1e74ed + m_LoadPath: + m_Id: e15c2a04e113f8f47a28b249e7f67125 + m_BundleMode: 0 + m_AssetBundleProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider + m_BundleNaming: 1 + m_AssetLoadMode: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_BundledAssetGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_BundledAssetGroupSchema.asset.meta new file mode 100644 index 0000000..f745ed9 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_BundledAssetGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 121b4ac9cf690a34fbcad095e9ef1284 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_ContentUpdateGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_ContentUpdateGroupSchema.asset new file mode 100644 index 0000000..e111b8c --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_ContentUpdateGroupSchema.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3} + m_Name: Localization-String-Tables-English (en)_ContentUpdateGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: 4d1ea22595cc1954b88630c373b16bca, type: 2} + m_StaticContent: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_ContentUpdateGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_ContentUpdateGroupSchema.asset.meta new file mode 100644 index 0000000..67b4bc2 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-English (en)_ContentUpdateGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c68ba18124c5ece4283a63cebf076066 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-French (fr)_BundledAssetGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-French (fr)_BundledAssetGroupSchema.asset new file mode 100644 index 0000000..4e7fe1f --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-French (fr)_BundledAssetGroupSchema.asset @@ -0,0 +1,45 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3} + m_Name: Localization-String-Tables-French (fr)_BundledAssetGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: 0caa1f41c04a47a4ab9a1ee4ecc74020, type: 2} + m_InternalBundleIdMode: 1 + m_Compression: 1 + m_IncludeAddressInCatalog: 1 + m_IncludeGUIDInCatalog: 1 + m_IncludeLabelsInCatalog: 1 + m_InternalIdNamingMode: 0 + m_CacheClearBehavior: 0 + m_IncludeInBuild: 1 + m_BundledAssetProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider + m_ForceUniqueProvider: 0 + m_UseAssetBundleCache: 1 + m_UseAssetBundleCrc: 1 + m_UseAssetBundleCrcForCachedBundles: 1 + m_UseUWRForLocalBundles: 0 + m_Timeout: 0 + m_ChunkedTransfer: 0 + m_RedirectLimit: -1 + m_RetryCount: 0 + m_BuildPath: + m_Id: 827805ccee015c24ea0f1f5c5d1e74ed + m_LoadPath: + m_Id: e15c2a04e113f8f47a28b249e7f67125 + m_BundleMode: 0 + m_AssetBundleProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider + m_BundleNaming: 1 + m_AssetLoadMode: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-French (fr)_BundledAssetGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-French (fr)_BundledAssetGroupSchema.asset.meta new file mode 100644 index 0000000..376becd --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-French (fr)_BundledAssetGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9d3447b8294ef6f4e912e7ef31a3791c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-French (fr)_ContentUpdateGroupSchema.asset b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-French (fr)_ContentUpdateGroupSchema.asset new file mode 100644 index 0000000..d815c95 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-French (fr)_ContentUpdateGroupSchema.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3} + m_Name: Localization-String-Tables-French (fr)_ContentUpdateGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: 0caa1f41c04a47a4ab9a1ee4ecc74020, type: 2} + m_StaticContent: 0 diff --git a/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-French (fr)_ContentUpdateGroupSchema.asset.meta b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-French (fr)_ContentUpdateGroupSchema.asset.meta new file mode 100644 index 0000000..b8aaeb4 --- /dev/null +++ b/Assets/AddressableAssetsData/AssetGroups/Schemas/Localization-String-Tables-French (fr)_ContentUpdateGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 233944ccf74d40243be2f6084a744132 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: -- 2.45.2 From ad12dd2cdfe9441eccd54165d948ca7512eff80f Mon Sep 17 00:00:00 2001 From: Fangh Date: Tue, 27 Feb 2024 23:46:10 +0100 Subject: [PATCH 03/13] feat(localization): addressables settings --- ProjectSettings/EditorBuildSettings.asset | 4 +++- ProjectSettings/ScriptableBuildPipeline.json | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 ProjectSettings/ScriptableBuildPipeline.json diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index 8b6d891..352dd8e 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -11,4 +11,6 @@ EditorBuildSettings: - enabled: 0 path: Assets/Scenes/ComputerView.unity guid: 9fc0d4010bbf28b4594072e72b8655ab - m_configObjects: {} + m_configObjects: + com.unity.addressableassets: {fileID: 11400000, guid: 3e9962365718b6b48842e3874e77f101, type: 2} + com.unity.localization.settings: {fileID: 11400000, guid: 69c3f2d9d933f834aa38ecbda69289ca, type: 2} diff --git a/ProjectSettings/ScriptableBuildPipeline.json b/ProjectSettings/ScriptableBuildPipeline.json new file mode 100644 index 0000000..e6738dc --- /dev/null +++ b/ProjectSettings/ScriptableBuildPipeline.json @@ -0,0 +1,13 @@ +{ + "useBuildCacheServer": false, + "cacheServerHost": "", + "cacheServerPort": 8126, + "threadedArchiving": true, + "logCacheMiss": false, + "slimWriteResults": true, + "maximumCacheSize": 20, + "useDetailedBuildLog": false, + "useV2Hasher": true, + "fileIDHashSeed": 0, + "prefabPackedHeaderSize": 2 +} \ No newline at end of file -- 2.45.2 From 350109262dbbc5fe5cecccc8825d49075caf1da4 Mon Sep 17 00:00:00 2001 From: Fangh Date: Tue, 27 Feb 2024 23:46:29 +0100 Subject: [PATCH 04/13] feat(localization): add localization for scripted texts --- Assets/Scenes/ComputerView.unity | 2036 ++++++++++++++++++++++++++++-- Assets/Scenes/PhoneView.unity | 906 ++++++++++++- Assets/Scripts/GameManager.cs | 23 +- Assets/Scripts/RoomManager.cs | 16 +- 4 files changed, 2861 insertions(+), 120 deletions(-) diff --git a/Assets/Scenes/ComputerView.unity b/Assets/Scenes/ComputerView.unity index ab80515..28cb2b9 100644 --- a/Assets/Scenes/ComputerView.unity +++ b/Assets/Scenes/ComputerView.unity @@ -191,6 +191,11 @@ MonoBehaviour: m_Spacing: {x: 50, y: 50} m_Constraint: 0 m_ConstraintCount: 2 +--- !u!1 &40780158 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} + m_PrefabInstance: {fileID: 2004328312} + m_PrefabAsset: {fileID: 0} --- !u!1 &45150984 GameObject: m_ObjectHideFlags: 0 @@ -617,15 +622,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_AnchoredPosition.x @@ -687,6 +692,7 @@ GameObject: - component: {fileID: 130058894} - component: {fileID: 130058896} - component: {fileID: 130058895} + - component: {fileID: 130058897} m_Layer: 5 m_Name: J4 m_TagString: Untagged @@ -708,10 +714,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 987875882} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 1200, y: -200} - m_SizeDelta: {x: 400, y: 400} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0.5} --- !u!114 &130058895 MonoBehaviour: @@ -810,6 +816,101 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 130058893} m_CullTransparentMesh: 0 +--- !u!114 &130058897 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 130058893} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503139977 + references: + version: 2 + RefIds: + - rid: 8151037669503139977 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 130058894} + m_TrackedProperties: + items: + - rid: 8151037669503139978 + - rid: 8151037669503139979 + - rid: 8151037669503139980 + - rid: 8151037669503139981 + - rid: 8151037669503139982 + - rid: 8151037669503139983 + - rid: 8151037669503139978 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503139979 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503139980 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1200 + - localeIdentifier: + m_Code: fr + value: 1200 + - rid: 8151037669503139981 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: -200 + - localeIdentifier: + m_Code: fr + value: -200 + - rid: 8151037669503139982 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 400 + - localeIdentifier: + m_Code: fr + value: 400 + - rid: 8151037669503139983 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 400 + - localeIdentifier: + m_Code: fr + value: 400 --- !u!1 &157938955 GameObject: m_ObjectHideFlags: 0 @@ -1390,15 +1491,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_AnchoredPosition.x @@ -1525,6 +1626,16 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 233024602} m_CullTransparentMesh: 1 +--- !u!1 &270606794 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} + m_PrefabInstance: {fileID: 943114024} + m_PrefabAsset: {fileID: 0} +--- !u!1 &326436494 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} + m_PrefabInstance: {fileID: 2038769039} + m_PrefabAsset: {fileID: 0} --- !u!1 &351375051 GameObject: m_ObjectHideFlags: 0 @@ -1536,6 +1647,7 @@ GameObject: - component: {fileID: 351375052} - component: {fileID: 351375055} - component: {fileID: 351375054} + - component: {fileID: 351375056} m_Layer: 5 m_Name: Title2 m_TagString: Untagged @@ -1660,6 +1772,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 351375051} m_CullTransparentMesh: 1 +--- !u!114 &351375056 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 351375051} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140071 + references: + version: 2 + RefIds: + - rid: 8151037669503140071 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 351375054} + m_TrackedProperties: + items: + - rid: 8151037669503140072 + m_UpdateType: 0 + - rid: 8151037669503140072 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 2830983372800 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1001 &370177060 PrefabInstance: m_ObjectHideFlags: 0 @@ -1718,15 +1868,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_AnchoredPosition.x @@ -1830,6 +1980,7 @@ MonoBehaviour: votingPage: {fileID: 1660260835} scoringPage: {fileID: 581333955} promptList: {fileID: 11400000, guid: 21907abc84e40403ca34c4fb9ab30b06, type: 2} + stringTableCollection: {fileID: 11400000, guid: 3d4b6573839c0274ca08f4bf9dedeca2, type: 2} --- !u!114 &375256413 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2597,6 +2748,7 @@ GameObject: - component: {fileID: 619055281} - component: {fileID: 619055283} - component: {fileID: 619055282} + - component: {fileID: 619055284} m_Layer: 5 m_Name: Explanation m_TagString: Untagged @@ -2721,6 +2873,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 619055280} m_CullTransparentMesh: 1 +--- !u!114 &619055284 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 619055280} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503139955 + references: + version: 2 + RefIds: + - rid: 8151037669503139955 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 619055282} + m_TrackedProperties: + items: + - rid: 8151037669503139956 + m_UpdateType: 0 + - rid: 8151037669503139956 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 2357626806272 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1001 &621353234 PrefabInstance: m_ObjectHideFlags: 0 @@ -2779,15 +2969,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_AnchoredPosition.x @@ -2849,6 +3039,7 @@ GameObject: - component: {fileID: 680005430} - component: {fileID: 680005432} - component: {fileID: 680005431} + - component: {fileID: 680005433} m_Layer: 5 m_Name: J5 m_TagString: Untagged @@ -2870,10 +3061,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 987875882} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 0, y: -600} - m_SizeDelta: {x: 400, y: 400} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0.5} --- !u!114 &680005431 MonoBehaviour: @@ -2972,6 +3163,94 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 680005429} m_CullTransparentMesh: 0 +--- !u!114 &680005433 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 680005429} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503139984 + references: + version: 2 + RefIds: + - rid: 8151037669503139984 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 680005430} + m_TrackedProperties: + items: + - rid: 8151037669503139985 + - rid: 8151037669503139986 + - rid: 8151037669503139987 + - rid: 8151037669503139988 + - rid: 8151037669503139989 + - rid: 8151037669503139985 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503139986 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503139987 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: -600 + - localeIdentifier: + m_Code: fr + value: -600 + - rid: 8151037669503139988 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 400 + - localeIdentifier: + m_Code: fr + value: 400 + - rid: 8151037669503139989 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 400 + - localeIdentifier: + m_Code: fr + value: 400 +--- !u!1 &696773642 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} + m_PrefabInstance: {fileID: 710475181} + m_PrefabAsset: {fileID: 0} --- !u!1001 &701751214 PrefabInstance: m_ObjectHideFlags: 0 @@ -3030,15 +3309,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_AnchoredPosition.x @@ -3307,15 +3586,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_AnchoredPosition.x @@ -3351,7 +3630,10 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} insertIndex: -1 addedObject: {fileID: 516717323} - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} + insertIndex: -1 + addedObject: {fileID: 1610615898} m_SourcePrefab: {fileID: 100100000, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} --- !u!224 &710475182 stripped RectTransform: @@ -3474,6 +3756,11 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 741267591} m_CullTransparentMesh: 1 +--- !u!1 &811611822 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} + m_PrefabInstance: {fileID: 1595592696} + m_PrefabAsset: {fileID: 0} --- !u!1 &839691310 GameObject: m_ObjectHideFlags: 0 @@ -3666,15 +3953,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_AnchoredPosition.x @@ -3710,7 +3997,10 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} insertIndex: -1 addedObject: {fileID: 864922252} - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} + insertIndex: -1 + addedObject: {fileID: 1602600782} m_SourcePrefab: {fileID: 100100000, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} --- !u!224 &851638681 stripped RectTransform: @@ -3851,15 +4141,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_AnchoredPosition.x @@ -3895,7 +4185,10 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} insertIndex: -1 addedObject: {fileID: 200832186} - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} + insertIndex: -1 + addedObject: {fileID: 1230545933} m_SourcePrefab: {fileID: 100100000, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} --- !u!224 &943114025 stripped RectTransform: @@ -3960,15 +4253,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_AnchoredPosition.x @@ -4122,6 +4415,7 @@ GameObject: - component: {fileID: 972471161} - component: {fileID: 972471163} - component: {fileID: 972471162} + - component: {fileID: 972471164} m_Layer: 5 m_Name: J1 m_TagString: Untagged @@ -4143,10 +4437,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 987875882} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 0, y: -200} - m_SizeDelta: {x: 400, y: 400} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0.5} --- !u!114 &972471162 MonoBehaviour: @@ -4245,6 +4539,89 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 972471160} m_CullTransparentMesh: 0 +--- !u!114 &972471164 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 972471160} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503139957 + references: + version: 2 + RefIds: + - rid: 8151037669503139957 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 972471161} + m_TrackedProperties: + items: + - rid: 8151037669503139958 + - rid: 8151037669503139959 + - rid: 8151037669503139960 + - rid: 8151037669503139961 + - rid: 8151037669503139962 + - rid: 8151037669503139958 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503139959 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503139960 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: -200 + - localeIdentifier: + m_Code: fr + value: -200 + - rid: 8151037669503139961 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 400 + - localeIdentifier: + m_Code: fr + value: 400 + - rid: 8151037669503139962 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 400 + - localeIdentifier: + m_Code: fr + value: 400 --- !u!1001 &987647256 PrefabInstance: m_ObjectHideFlags: 0 @@ -4303,15 +4680,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_AnchoredPosition.x @@ -4488,15 +4865,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_AnchoredPosition.x @@ -4532,7 +4909,10 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} insertIndex: -1 addedObject: {fileID: 2038490650} - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} + insertIndex: -1 + addedObject: {fileID: 1782183234} m_SourcePrefab: {fileID: 100100000, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} --- !u!224 &1059129457 stripped RectTransform: @@ -4544,7 +4924,7 @@ MonoBehaviour: m_CorrespondingSourceObject: {fileID: 9117562908589005100, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} m_PrefabInstance: {fileID: 1059129456} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} + m_GameObject: {fileID: 1782183233} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 63ba002d2116d4c54a8d55e905869d8f, type: 3} @@ -4674,6 +5054,7 @@ GameObject: - component: {fileID: 1102286562} - component: {fileID: 1102286564} - component: {fileID: 1102286563} + - component: {fileID: 1102286565} m_Layer: 5 m_Name: TextCredits m_TagString: Untagged @@ -4797,6 +5178,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1102286561} m_CullTransparentMesh: 1 +--- !u!114 &1102286565 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1102286561} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503139869 + references: + version: 2 + RefIds: + - rid: 8151037669503139869 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1102286563} + m_TrackedProperties: + items: + - rid: 8151037669503139870 + m_UpdateType: 0 + - rid: 8151037669503139870 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 1816846802944 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1 &1117928114 GameObject: m_ObjectHideFlags: 0 @@ -4853,6 +5272,7 @@ GameObject: - component: {fileID: 1141337196} - component: {fileID: 1141337198} - component: {fileID: 1141337197} + - component: {fileID: 1141337199} m_Layer: 5 m_Name: J3 m_TagString: Untagged @@ -4874,10 +5294,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 987875882} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 800, y: -200} - m_SizeDelta: {x: 400, y: 400} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0.5} --- !u!114 &1141337197 MonoBehaviour: @@ -4976,6 +5396,101 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1141337195} m_CullTransparentMesh: 0 +--- !u!114 &1141337199 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1141337195} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503139970 + references: + version: 2 + RefIds: + - rid: 8151037669503139970 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1141337196} + m_TrackedProperties: + items: + - rid: 8151037669503139971 + - rid: 8151037669503139972 + - rid: 8151037669503139973 + - rid: 8151037669503139974 + - rid: 8151037669503139975 + - rid: 8151037669503139976 + - rid: 8151037669503139971 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503139972 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503139973 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 800 + - localeIdentifier: + m_Code: fr + value: 800 + - rid: 8151037669503139974 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: -200 + - localeIdentifier: + m_Code: fr + value: -200 + - rid: 8151037669503139975 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 400 + - localeIdentifier: + m_Code: fr + value: 400 + - rid: 8151037669503139976 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 400 + - localeIdentifier: + m_Code: fr + value: 400 --- !u!1 &1165659434 GameObject: m_ObjectHideFlags: 0 @@ -4987,6 +5502,7 @@ GameObject: - component: {fileID: 1165659435} - component: {fileID: 1165659437} - component: {fileID: 1165659436} + - component: {fileID: 1165659438} m_Layer: 5 m_Name: WaitingText m_TagString: Untagged @@ -5110,6 +5626,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1165659434} m_CullTransparentMesh: 1 +--- !u!114 &1165659438 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1165659434} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140011 + references: + version: 2 + RefIds: + - rid: 8151037669503140011 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1165659436} + m_TrackedProperties: + items: + - rid: 8151037669503140012 + m_UpdateType: 0 + - rid: 8151037669503140012 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 2532051132416 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1 &1197279070 GameObject: m_ObjectHideFlags: 0 @@ -5121,6 +5675,7 @@ GameObject: - component: {fileID: 1197279071} - component: {fileID: 1197279073} - component: {fileID: 1197279072} + - component: {fileID: 1197279074} m_Layer: 5 m_Name: J8 m_TagString: Untagged @@ -5142,10 +5697,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 987875882} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 1200, y: -600} - m_SizeDelta: {x: 400, y: 400} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0.5} --- !u!114 &1197279072 MonoBehaviour: @@ -5244,17 +5799,207 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1197279070} m_CullTransparentMesh: 0 +--- !u!114 &1197279074 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1197279070} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140004 + references: + version: 2 + RefIds: + - rid: 8151037669503140004 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1197279071} + m_TrackedProperties: + items: + - rid: 8151037669503140005 + - rid: 8151037669503140006 + - rid: 8151037669503140007 + - rid: 8151037669503140008 + - rid: 8151037669503140009 + - rid: 8151037669503140010 + - rid: 8151037669503140005 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140006 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140007 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1200 + - localeIdentifier: + m_Code: fr + value: 1200 + - rid: 8151037669503140008 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: -600 + - localeIdentifier: + m_Code: fr + value: -600 + - rid: 8151037669503140009 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 400 + - localeIdentifier: + m_Code: fr + value: 400 + - rid: 8151037669503140010 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 400 + - localeIdentifier: + m_Code: fr + value: 400 --- !u!114 &1230545932 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 9117562908589005100, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} m_PrefabInstance: {fileID: 943114024} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} + m_GameObject: {fileID: 270606794} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 63ba002d2116d4c54a8d55e905869d8f, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &1230545933 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 270606794} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140015 + references: + version: 2 + RefIds: + - rid: 8151037669503140015 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 943114025} + m_TrackedProperties: + items: + - rid: 8151037669503140016 + - rid: 8151037669503140017 + - rid: 8151037669503140018 + - rid: 8151037669503140019 + - rid: 8151037669503140020 + - rid: 8151037669503140021 + - rid: 8151037669503140016 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140017 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140018 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 150 + - localeIdentifier: + m_Code: fr + value: 150 + - rid: 8151037669503140019 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: -171.33594 + - localeIdentifier: + m_Code: fr + value: -171.33594 + - rid: 8151037669503140020 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 300 + - localeIdentifier: + m_Code: fr + value: 300 + - rid: 8151037669503140021 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 200 + - localeIdentifier: + m_Code: fr + value: 200 --- !u!1 &1236996026 GameObject: m_ObjectHideFlags: 0 @@ -6081,6 +6826,7 @@ GameObject: - component: {fileID: 1351333135} - component: {fileID: 1351333137} - component: {fileID: 1351333136} + - component: {fileID: 1351333138} m_Layer: 5 m_Name: Title m_TagString: Untagged @@ -6127,7 +6873,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: Vote for best picture! + m_text: Votez pour la meilleure image ! m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 72af27804d5aa49408430b4b2500f877, type: 2} m_sharedMaterial: {fileID: 2100000, guid: 9fb4d071241c54841ab116886c83b585, type: 2} @@ -6204,6 +6950,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1351333134} m_CullTransparentMesh: 1 +--- !u!114 &1351333138 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1351333134} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503139865 + references: + version: 2 + RefIds: + - rid: 8151037669503139865 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1351333136} + m_TrackedProperties: + items: + - rid: 8151037669503139866 + m_UpdateType: 0 + - rid: 8151037669503139866 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 509297696768 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1 &1365258163 GameObject: m_ObjectHideFlags: 0 @@ -6349,6 +7133,7 @@ GameObject: - component: {fileID: 1374681048} - component: {fileID: 1374681050} - component: {fileID: 1374681049} + - component: {fileID: 1374681051} m_Layer: 5 m_Name: J2 m_TagString: Untagged @@ -6370,10 +7155,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 987875882} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 400, y: -200} - m_SizeDelta: {x: 400, y: 400} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0.5} --- !u!114 &1374681049 MonoBehaviour: @@ -6472,6 +7257,101 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1374681047} m_CullTransparentMesh: 0 +--- !u!114 &1374681051 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1374681047} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503139963 + references: + version: 2 + RefIds: + - rid: 8151037669503139963 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1374681048} + m_TrackedProperties: + items: + - rid: 8151037669503139964 + - rid: 8151037669503139965 + - rid: 8151037669503139966 + - rid: 8151037669503139967 + - rid: 8151037669503139968 + - rid: 8151037669503139969 + - rid: 8151037669503139964 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503139965 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503139966 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 400 + - localeIdentifier: + m_Code: fr + value: 400 + - rid: 8151037669503139967 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: -200 + - localeIdentifier: + m_Code: fr + value: -200 + - rid: 8151037669503139968 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 400 + - localeIdentifier: + m_Code: fr + value: 400 + - rid: 8151037669503139969 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 400 + - localeIdentifier: + m_Code: fr + value: 400 --- !u!1 &1399098703 GameObject: m_ObjectHideFlags: 0 @@ -6606,6 +7486,11 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1399098703} m_CullTransparentMesh: 1 +--- !u!1 &1428838455 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} + m_PrefabInstance: {fileID: 851638680} + m_PrefabAsset: {fileID: 0} --- !u!1 &1482548351 GameObject: m_ObjectHideFlags: 0 @@ -7270,15 +8155,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_AnchoredPosition.x @@ -7314,7 +8199,10 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} insertIndex: -1 addedObject: {fileID: 127646518} - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} + insertIndex: -1 + addedObject: {fileID: 1721928060} m_SourcePrefab: {fileID: 100100000, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} --- !u!224 &1595592697 stripped RectTransform: @@ -7326,23 +8214,213 @@ MonoBehaviour: m_CorrespondingSourceObject: {fileID: 9117562908589005100, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} m_PrefabInstance: {fileID: 851638680} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} + m_GameObject: {fileID: 1428838455} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 63ba002d2116d4c54a8d55e905869d8f, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &1602600782 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1428838455} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140036 + references: + version: 2 + RefIds: + - rid: 8151037669503140036 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 851638681} + m_TrackedProperties: + items: + - rid: 8151037669503140037 + - rid: 8151037669503140038 + - rid: 8151037669503140039 + - rid: 8151037669503140040 + - rid: 8151037669503140041 + - rid: 8151037669503140042 + - rid: 8151037669503140037 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140038 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140039 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1500 + - localeIdentifier: + m_Code: fr + value: 1500 + - rid: 8151037669503140040 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: -171.33594 + - localeIdentifier: + m_Code: fr + value: -171.33594 + - rid: 8151037669503140041 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 300 + - localeIdentifier: + m_Code: fr + value: 300 + - rid: 8151037669503140042 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 200 + - localeIdentifier: + m_Code: fr + value: 200 --- !u!114 &1610615897 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 9117562908589005100, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} m_PrefabInstance: {fileID: 710475181} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} + m_GameObject: {fileID: 696773642} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 63ba002d2116d4c54a8d55e905869d8f, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &1610615898 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 696773642} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140057 + references: + version: 2 + RefIds: + - rid: 8151037669503140057 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 710475182} + m_TrackedProperties: + items: + - rid: 8151037669503140058 + - rid: 8151037669503140059 + - rid: 8151037669503140060 + - rid: 8151037669503140061 + - rid: 8151037669503140062 + - rid: 8151037669503140063 + - rid: 8151037669503140058 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140059 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140060 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1050 + - localeIdentifier: + m_Code: fr + value: 1050 + - rid: 8151037669503140061 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: -471.33594 + - localeIdentifier: + m_Code: fr + value: -471.33594 + - rid: 8151037669503140062 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 300 + - localeIdentifier: + m_Code: fr + value: 300 + - rid: 8151037669503140063 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 200 + - localeIdentifier: + m_Code: fr + value: 200 --- !u!1 &1660260833 GameObject: m_ObjectHideFlags: 0 @@ -7413,6 +8491,7 @@ GameObject: - component: {fileID: 1677433386} - component: {fileID: 1677433388} - component: {fileID: 1677433387} + - component: {fileID: 1677433389} m_Layer: 5 m_Name: RoomCodeHeader m_TagString: Untagged @@ -7536,6 +8615,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1677433385} m_CullTransparentMesh: 1 +--- !u!114 &1677433389 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1677433385} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503139867 + references: + version: 2 + RefIds: + - rid: 8151037669503139867 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1677433387} + m_TrackedProperties: + items: + - rid: 8151037669503139868 + m_UpdateType: 0 + - rid: 8151037669503139868 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 1749217845248 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1 &1681333512 GameObject: m_ObjectHideFlags: 0 @@ -7675,12 +8792,107 @@ MonoBehaviour: m_CorrespondingSourceObject: {fileID: 9117562908589005100, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} m_PrefabInstance: {fileID: 1595592696} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} + m_GameObject: {fileID: 811611822} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 63ba002d2116d4c54a8d55e905869d8f, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &1721928060 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 811611822} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140029 + references: + version: 2 + RefIds: + - rid: 8151037669503140029 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1595592697} + m_TrackedProperties: + items: + - rid: 8151037669503140030 + - rid: 8151037669503140031 + - rid: 8151037669503140032 + - rid: 8151037669503140033 + - rid: 8151037669503140034 + - rid: 8151037669503140035 + - rid: 8151037669503140030 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140031 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140032 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1050 + - localeIdentifier: + m_Code: fr + value: 1050 + - rid: 8151037669503140033 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: -171.33594 + - localeIdentifier: + m_Code: fr + value: -171.33594 + - rid: 8151037669503140034 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 300 + - localeIdentifier: + m_Code: fr + value: 300 + - rid: 8151037669503140035 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 200 + - localeIdentifier: + m_Code: fr + value: 200 --- !u!1 &1730465902 GameObject: m_ObjectHideFlags: 0 @@ -7755,6 +8967,7 @@ GameObject: - component: {fileID: 1730898851} - component: {fileID: 1730898853} - component: {fileID: 1730898852} + - component: {fileID: 1730898854} m_Layer: 5 m_Name: RemindText m_TagString: Untagged @@ -7878,6 +9091,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1730898850} m_CullTransparentMesh: 1 +--- !u!114 &1730898854 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1730898850} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140013 + references: + version: 2 + RefIds: + - rid: 8151037669503140013 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1730898852} + m_TrackedProperties: + items: + - rid: 8151037669503140014 + m_UpdateType: 0 + - rid: 8151037669503140014 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 2629430288384 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1001 &1758412515 PrefabInstance: m_ObjectHideFlags: 0 @@ -7936,15 +9187,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_AnchoredPosition.x @@ -7976,13 +9227,116 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} insertIndex: -1 addedObject: {fileID: 233024603} - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} + insertIndex: -1 + addedObject: {fileID: 2120840641} m_SourcePrefab: {fileID: 100100000, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} --- !u!224 &1758412516 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} m_PrefabInstance: {fileID: 1758412515} m_PrefabAsset: {fileID: 0} +--- !u!1 &1782183233 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} + m_PrefabInstance: {fileID: 1059129456} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1782183234 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1782183233} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140050 + references: + version: 2 + RefIds: + - rid: 8151037669503140050 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1059129457} + m_TrackedProperties: + items: + - rid: 8151037669503140051 + - rid: 8151037669503140052 + - rid: 8151037669503140053 + - rid: 8151037669503140054 + - rid: 8151037669503140055 + - rid: 8151037669503140056 + - rid: 8151037669503140051 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140052 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140053 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 600 + - localeIdentifier: + m_Code: fr + value: 600 + - rid: 8151037669503140054 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: -471.33594 + - localeIdentifier: + m_Code: fr + value: -471.33594 + - rid: 8151037669503140055 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 300 + - localeIdentifier: + m_Code: fr + value: 300 + - rid: 8151037669503140056 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 200 + - localeIdentifier: + m_Code: fr + value: 200 --- !u!1 &1798182257 GameObject: m_ObjectHideFlags: 0 @@ -8412,6 +9766,7 @@ GameObject: - component: {fileID: 1854893635} - component: {fileID: 1854893637} - component: {fileID: 1854893636} + - component: {fileID: 1854893638} m_Layer: 5 m_Name: J6 m_TagString: Untagged @@ -8433,10 +9788,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 987875882} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 400, y: -600} - m_SizeDelta: {x: 400, y: 400} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0.5} --- !u!114 &1854893636 MonoBehaviour: @@ -8535,6 +9890,101 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1854893634} m_CullTransparentMesh: 0 +--- !u!114 &1854893638 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1854893634} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503139990 + references: + version: 2 + RefIds: + - rid: 8151037669503139990 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1854893635} + m_TrackedProperties: + items: + - rid: 8151037669503139991 + - rid: 8151037669503139992 + - rid: 8151037669503139993 + - rid: 8151037669503139994 + - rid: 8151037669503139995 + - rid: 8151037669503139996 + - rid: 8151037669503139991 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503139992 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503139993 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 400 + - localeIdentifier: + m_Code: fr + value: 400 + - rid: 8151037669503139994 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: -600 + - localeIdentifier: + m_Code: fr + value: -600 + - rid: 8151037669503139995 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 400 + - localeIdentifier: + m_Code: fr + value: 400 + - rid: 8151037669503139996 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 400 + - localeIdentifier: + m_Code: fr + value: 400 --- !u!1 &1888088771 GameObject: m_ObjectHideFlags: 0 @@ -8847,15 +10297,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_AnchoredPosition.x @@ -9513,15 +10963,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_AnchoredPosition.x @@ -9557,7 +11007,10 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} insertIndex: -1 addedObject: {fileID: 1482548352} - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} + insertIndex: -1 + addedObject: {fileID: 2004328315} m_SourcePrefab: {fileID: 100100000, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} --- !u!224 &2004328313 stripped RectTransform: @@ -9569,12 +11022,107 @@ MonoBehaviour: m_CorrespondingSourceObject: {fileID: 9117562908589005100, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} m_PrefabInstance: {fileID: 2004328312} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} + m_GameObject: {fileID: 40780158} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 63ba002d2116d4c54a8d55e905869d8f, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &2004328315 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 40780158} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140064 + references: + version: 2 + RefIds: + - rid: 8151037669503140064 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 2004328313} + m_TrackedProperties: + items: + - rid: 8151037669503140065 + - rid: 8151037669503140066 + - rid: 8151037669503140067 + - rid: 8151037669503140068 + - rid: 8151037669503140069 + - rid: 8151037669503140070 + - rid: 8151037669503140065 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140066 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140067 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1500 + - localeIdentifier: + m_Code: fr + value: 1500 + - rid: 8151037669503140068 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: -471.33594 + - localeIdentifier: + m_Code: fr + value: -471.33594 + - rid: 8151037669503140069 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 300 + - localeIdentifier: + m_Code: fr + value: 300 + - rid: 8151037669503140070 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 200 + - localeIdentifier: + m_Code: fr + value: 200 --- !u!1 &2038490649 GameObject: m_ObjectHideFlags: 0 @@ -9709,15 +11257,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} propertyPath: m_AnchoredPosition.x @@ -9753,7 +11301,10 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 943229596838791819, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} insertIndex: -1 addedObject: {fileID: 1332053327} - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} + insertIndex: -1 + addedObject: {fileID: 2038769042} m_SourcePrefab: {fileID: 100100000, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} --- !u!224 &2038769040 stripped RectTransform: @@ -9765,12 +11316,112 @@ MonoBehaviour: m_CorrespondingSourceObject: {fileID: 9117562908589005100, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} m_PrefabInstance: {fileID: 2038769039} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} + m_GameObject: {fileID: 326436494} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 63ba002d2116d4c54a8d55e905869d8f, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &2038769042 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 326436494} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140043 + references: + version: 2 + RefIds: + - rid: 8151037669503140043 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 2038769040} + m_TrackedProperties: + items: + - rid: 8151037669503140044 + - rid: 8151037669503140045 + - rid: 8151037669503140046 + - rid: 8151037669503140047 + - rid: 8151037669503140048 + - rid: 8151037669503140049 + - rid: 8151037669503140044 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140045 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140046 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 150 + - localeIdentifier: + m_Code: fr + value: 150 + - rid: 8151037669503140047 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: -471.33594 + - localeIdentifier: + m_Code: fr + value: -471.33594 + - rid: 8151037669503140048 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 300 + - localeIdentifier: + m_Code: fr + value: 300 + - rid: 8151037669503140049 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 200 + - localeIdentifier: + m_Code: fr + value: 200 +--- !u!1 &2060278973 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} + m_PrefabInstance: {fileID: 1758412515} + m_PrefabAsset: {fileID: 0} --- !u!1 &2065109612 GameObject: m_ObjectHideFlags: 0 @@ -9782,6 +11433,7 @@ GameObject: - component: {fileID: 2065109613} - component: {fileID: 2065109615} - component: {fileID: 2065109614} + - component: {fileID: 2065109616} m_Layer: 5 m_Name: J7 m_TagString: Untagged @@ -9803,10 +11455,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 987875882} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 800, y: -600} - m_SizeDelta: {x: 400, y: 400} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0.5} --- !u!114 &2065109614 MonoBehaviour: @@ -9905,6 +11557,101 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2065109612} m_CullTransparentMesh: 0 +--- !u!114 &2065109616 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2065109612} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503139997 + references: + version: 2 + RefIds: + - rid: 8151037669503139997 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 2065109613} + m_TrackedProperties: + items: + - rid: 8151037669503139998 + - rid: 8151037669503139999 + - rid: 8151037669503140000 + - rid: 8151037669503140001 + - rid: 8151037669503140002 + - rid: 8151037669503140003 + - rid: 8151037669503139998 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503139999 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140000 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 800 + - localeIdentifier: + m_Code: fr + value: 800 + - rid: 8151037669503140001 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: -600 + - localeIdentifier: + m_Code: fr + value: -600 + - rid: 8151037669503140002 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 400 + - localeIdentifier: + m_Code: fr + value: 400 + - rid: 8151037669503140003 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 400 + - localeIdentifier: + m_Code: fr + value: 400 --- !u!1 &2078353087 GameObject: m_ObjectHideFlags: 0 @@ -10119,12 +11866,107 @@ MonoBehaviour: m_CorrespondingSourceObject: {fileID: 9117562908589005100, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} m_PrefabInstance: {fileID: 1758412515} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} + m_GameObject: {fileID: 2060278973} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 63ba002d2116d4c54a8d55e905869d8f, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &2120840641 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2060278973} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140022 + references: + version: 2 + RefIds: + - rid: 8151037669503140022 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1758412516} + m_TrackedProperties: + items: + - rid: 8151037669503140023 + - rid: 8151037669503140024 + - rid: 8151037669503140025 + - rid: 8151037669503140026 + - rid: 8151037669503140027 + - rid: 8151037669503140028 + - rid: 8151037669503140023 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140024 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140025 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 600 + - localeIdentifier: + m_Code: fr + value: 600 + - rid: 8151037669503140026 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: -171.33594 + - localeIdentifier: + m_Code: fr + value: -171.33594 + - rid: 8151037669503140027 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 300 + - localeIdentifier: + m_Code: fr + value: 300 + - rid: 8151037669503140028 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 200 + - localeIdentifier: + m_Code: fr + value: 200 --- !u!1001 &2214187228236614840 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/PhoneView.unity b/Assets/Scenes/PhoneView.unity index 116bf43..845766b 100644 --- a/Assets/Scenes/PhoneView.unity +++ b/Assets/Scenes/PhoneView.unity @@ -628,6 +628,7 @@ GameObject: - component: {fileID: 339389580} - component: {fileID: 339389582} - component: {fileID: 339389581} + - component: {fileID: 339389583} m_Layer: 5 m_Name: ExplainText3 m_TagString: Untagged @@ -751,6 +752,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 339389579} m_CullTransparentMesh: 1 +--- !u!114 &339389583 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 339389579} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140089 + references: + version: 2 + RefIds: + - rid: 8151037669503140089 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 339389581} + m_TrackedProperties: + items: + - rid: 8151037669503140090 + m_UpdateType: 0 + - rid: 8151037669503140090 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 3837364674560 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1 &428468130 GameObject: m_ObjectHideFlags: 0 @@ -964,6 +1003,7 @@ MonoBehaviour: id: creationDate: 0 explanationTime: 4 + stringTableCollection: {fileID: 0} roomCodeField: {fileID: 2023851070} roomError: {fileID: 991600093} playerNameField: {fileID: 1163479463} @@ -983,11 +1023,6 @@ MonoBehaviour: VotePicture: {fileID: 531335861} WaitingOtherPlayers: {fileID: 2095389711} EndGame: {fileID: 1850164816} - myRoom: - code: - currentQuestionId: 0 - creationDate: 0 - currentState: 0 --- !u!114 &429358654 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1079,6 +1114,7 @@ GameObject: - component: {fileID: 456700977} - component: {fileID: 456700976} - component: {fileID: 456700975} + - component: {fileID: 456700978} m_Layer: 5 m_Name: BtnPicturePlayer1 m_TagString: Untagged @@ -1100,9 +1136,9 @@ RectTransform: m_Children: [] m_Father: {fileID: 1611495324} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 540, y: -475} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 700, y: 700} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &456700975 @@ -1199,6 +1235,77 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 456700973} m_CullTransparentMesh: 1 +--- !u!114 &456700978 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 456700973} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140097 + references: + version: 2 + RefIds: + - rid: 8151037669503140097 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 456700974} + m_TrackedProperties: + items: + - rid: 8151037669503140098 + - rid: 8151037669503140099 + - rid: 8151037669503140100 + - rid: 8151037669503140101 + - rid: 8151037669503140098 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140099 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140100 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 540 + - localeIdentifier: + m_Code: fr + value: 540 + - rid: 8151037669503140101 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: -475 + - localeIdentifier: + m_Code: fr + value: -614.9967 --- !u!1 &475172432 GameObject: m_ObjectHideFlags: 0 @@ -1210,6 +1317,7 @@ GameObject: - component: {fileID: 475172433} - component: {fileID: 475172435} - component: {fileID: 475172434} + - component: {fileID: 475172436} m_Layer: 5 m_Name: Text (TMP) m_TagString: Untagged @@ -1224,7 +1332,7 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 475172432} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 @@ -1333,6 +1441,63 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 475172432} m_CullTransparentMesh: 1 +--- !u!114 &475172436 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 475172432} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140114 + - rid: 8151037669503140116 + references: + version: 2 + RefIds: + - rid: 8151037669503140114 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 475172434} + m_TrackedProperties: + items: + - rid: 8151037669503140115 + m_UpdateType: 0 + - rid: 8151037669503140115 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 4231604084736 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text + - rid: 8151037669503140116 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 475172433} + m_TrackedProperties: + items: + - rid: 8151037669503140117 + - rid: 8151037669503140117 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 0 + - localeIdentifier: + m_Code: fr + value: 20.175 --- !u!1 &531335861 GameObject: m_ObjectHideFlags: 0 @@ -1445,6 +1610,7 @@ GameObject: - component: {fileID: 589915592} - component: {fileID: 589915591} - component: {fileID: 589915590} + - component: {fileID: 589915593} m_Layer: 5 m_Name: BtnPicturePlayer2 m_TagString: Untagged @@ -1466,9 +1632,9 @@ RectTransform: m_Children: [] m_Father: {fileID: 1611495324} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 540, y: -1550} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 700, y: 700} m_Pivot: {x: 0.5, y: 0} --- !u!114 &589915590 @@ -1565,6 +1731,77 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 589915588} m_CullTransparentMesh: 1 +--- !u!114 &589915593 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 589915588} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140102 + references: + version: 2 + RefIds: + - rid: 8151037669503140102 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 589915589} + m_TrackedProperties: + items: + - rid: 8151037669503140103 + - rid: 8151037669503140104 + - rid: 8151037669503140105 + - rid: 8151037669503140106 + - rid: 8151037669503140103 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140104 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140105 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 540 + - localeIdentifier: + m_Code: fr + value: 540 + - rid: 8151037669503140106 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: -1550 + - localeIdentifier: + m_Code: fr + value: -1759.9951 --- !u!1 &638947073 GameObject: m_ObjectHideFlags: 0 @@ -1912,6 +2149,7 @@ GameObject: - component: {fileID: 668577474} - component: {fileID: 668577476} - component: {fileID: 668577475} + - component: {fileID: 668577477} m_Layer: 5 m_Name: ExplainText1 m_TagString: Untagged @@ -2035,6 +2273,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 668577473} m_CullTransparentMesh: 1 +--- !u!114 &668577477 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 668577473} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140085 + references: + version: 2 + RefIds: + - rid: 8151037669503140085 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 668577475} + m_TrackedProperties: + items: + - rid: 8151037669503140086 + m_UpdateType: 0 + - rid: 8151037669503140086 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 3716627439616 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1 &677717663 GameObject: m_ObjectHideFlags: 0 @@ -2464,6 +2740,7 @@ GameObject: - component: {fileID: 806171032} - component: {fileID: 806171034} - component: {fileID: 806171033} + - component: {fileID: 806171035} m_Layer: 5 m_Name: Restart m_TagString: Untagged @@ -2587,6 +2864,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 806171031} m_CullTransparentMesh: 1 +--- !u!114 &806171035 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 806171031} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140112 + references: + version: 2 + RefIds: + - rid: 8151037669503140112 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 806171033} + m_TrackedProperties: + items: + - rid: 8151037669503140113 + m_UpdateType: 0 + - rid: 8151037669503140113 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 4209818869760 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1 &842211725 GameObject: m_ObjectHideFlags: 0 @@ -2838,6 +3153,7 @@ GameObject: - component: {fileID: 885941124} - component: {fileID: 885941123} - component: {fileID: 885941125} + - component: {fileID: 885941126} m_Layer: 5 m_Name: SubmitBtn m_TagString: Untagged @@ -3029,6 +3345,44 @@ MonoBehaviour: m_StringArgument: m_BoolArgument: 0 m_CallState: 2 +--- !u!114 &885941126 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 885941121} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140091 + references: + version: 2 + RefIds: + - rid: 8151037669503140091 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 885941123} + m_TrackedProperties: + items: + - rid: 8151037669503140092 + m_UpdateType: 0 + - rid: 8151037669503140092 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 4018642493440 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1 &903645288 GameObject: m_ObjectHideFlags: 0 @@ -3040,6 +3394,7 @@ GameObject: - component: {fileID: 903645289} - component: {fileID: 903645291} - component: {fileID: 903645290} + - component: {fileID: 903645292} m_Layer: 5 m_Name: ExplainText2 m_TagString: Untagged @@ -3165,6 +3520,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 903645288} m_CullTransparentMesh: 1 +--- !u!114 &903645292 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 903645288} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140087 + references: + version: 2 + RefIds: + - rid: 8151037669503140087 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 903645290} + m_TrackedProperties: + items: + - rid: 8151037669503140088 + m_UpdateType: 0 + - rid: 8151037669503140088 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 3784638078976 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1 &916979484 GameObject: m_ObjectHideFlags: 0 @@ -3531,6 +3924,7 @@ GameObject: - component: {fileID: 1034781737} - component: {fileID: 1034781736} - component: {fileID: 1034781735} + - component: {fileID: 1034781738} m_Layer: 5 m_Name: Placeholder m_TagString: Untagged @@ -3674,6 +4068,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1034781733} m_CullTransparentMesh: 1 +--- !u!114 &1034781738 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1034781733} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140077 + references: + version: 2 + RefIds: + - rid: 8151037669503140077 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1034781736} + m_TrackedProperties: + items: + - rid: 8151037669503140078 + m_UpdateType: 0 + - rid: 8151037669503140078 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 3236539015168 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1 &1042761245 GameObject: m_ObjectHideFlags: 0 @@ -4577,6 +5009,7 @@ GameObject: - component: {fileID: 1224049645} - component: {fileID: 1224049647} - component: {fileID: 1224049646} + - component: {fileID: 1224049648} m_Layer: 5 m_Name: ErrorNameLabel m_TagString: Untagged @@ -4700,6 +5133,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1224049644} m_CullTransparentMesh: 1 +--- !u!114 &1224049648 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1224049644} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037670677282836 + references: + version: 2 + RefIds: + - rid: 8151037670677282836 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1224049646} + m_TrackedProperties: + items: + - rid: 8151037670677282837 + m_UpdateType: 0 + - rid: 8151037670677282837 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 21791745646592 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1 &1266773203 GameObject: m_ObjectHideFlags: 0 @@ -4914,6 +5385,7 @@ GameObject: - component: {fileID: 1360529141} - component: {fileID: 1360529143} - component: {fileID: 1360529142} + - component: {fileID: 1360529144} m_Layer: 5 m_Name: waitingText m_TagString: Untagged @@ -5037,6 +5509,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1360529140} m_CullTransparentMesh: 1 +--- !u!114 &1360529144 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1360529140} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140083 + references: + version: 2 + RefIds: + - rid: 8151037669503140083 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1360529142} + m_TrackedProperties: + items: + - rid: 8151037669503140084 + m_UpdateType: 0 + - rid: 8151037669503140084 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 3648696492032 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1 &1371739070 GameObject: m_ObjectHideFlags: 0 @@ -5049,6 +5559,7 @@ GameObject: - component: {fileID: 1371739074} - component: {fileID: 1371739073} - component: {fileID: 1371739072} + - component: {fileID: 1371739075} m_Layer: 5 m_Name: SubmitBtnSignIn m_TagString: Untagged @@ -5063,7 +5574,7 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1371739070} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 3.0376, y: 3.0376, z: 3.0376} m_ConstrainProportionsScale: 1 @@ -5228,6 +5739,63 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1371739070} m_CullTransparentMesh: 1 +--- !u!114 &1371739075 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1371739070} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140073 + - rid: 8151037669503140075 + references: + version: 2 + RefIds: + - rid: 8151037669503140073 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1371739073} + m_TrackedProperties: + items: + - rid: 8151037669503140074 + m_UpdateType: 0 + - rid: 8151037669503140074 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 3130414735360 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text + - rid: 8151037669503140075 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1371739071} + m_TrackedProperties: + items: + - rid: 8151037669503140076 + - rid: 8151037669503140076 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_SizeDelta.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 160 + - localeIdentifier: + m_Code: fr + value: 251.7926 --- !u!1 &1383251889 GameObject: m_ObjectHideFlags: 0 @@ -5608,6 +6176,7 @@ GameObject: - component: {fileID: 1545657112} - component: {fileID: 1545657114} - component: {fileID: 1545657113} + - component: {fileID: 1545657115} m_Layer: 5 m_Name: PromptLabel m_TagString: Untagged @@ -5629,9 +6198,9 @@ RectTransform: m_Children: [] m_Father: {fileID: 1611495324} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 540, y: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 340, y: 100} m_Pivot: {x: 0.5, y: 1} --- !u!114 &1545657113 @@ -5731,6 +6300,77 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1545657111} m_CullTransparentMesh: 1 +--- !u!114 &1545657115 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1545657111} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140093 + references: + version: 2 + RefIds: + - rid: 8151037669503140093 + type: {class: TrackedRectTransform, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1545657112} + m_TrackedProperties: + items: + - rid: 8151037669503140094 + - rid: 8151037669503140095 + - rid: 8151037669503140096 + - rid: 8151037669503140109 + - rid: 8151037669503140094 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMin.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140095 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchorMax.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 1 + - localeIdentifier: + m_Code: fr + value: 1 + - rid: 8151037669503140096 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.x + m_VariantData: + - localeIdentifier: + m_Code: en + value: 540 + - localeIdentifier: + m_Code: fr + value: 540 + - rid: 8151037669503140109 + type: {class: FloatTrackedProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_PropertyPath: m_AnchoredPosition.y + m_VariantData: + - localeIdentifier: + m_Code: en + value: 0 + - localeIdentifier: + m_Code: fr + value: -69.99838 --- !u!1 &1557427662 GameObject: m_ObjectHideFlags: 0 @@ -5743,6 +6383,7 @@ GameObject: - component: {fileID: 1557427666} - component: {fileID: 1557427665} - component: {fileID: 1557427664} + - component: {fileID: 1557427667} m_Layer: 5 m_Name: Placeholder m_TagString: Untagged @@ -5886,6 +6527,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1557427662} m_CullTransparentMesh: 1 +--- !u!114 &1557427667 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1557427662} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140079 + references: + version: 2 + RefIds: + - rid: 8151037669503140079 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1557427665} + m_TrackedProperties: + items: + - rid: 8151037669503140080 + m_UpdateType: 0 + - rid: 8151037669503140080 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 3285734006784 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1 &1572824445 GameObject: m_ObjectHideFlags: 0 @@ -5897,6 +6576,7 @@ GameObject: - component: {fileID: 1572824446} - component: {fileID: 1572824448} - component: {fileID: 1572824447} + - component: {fileID: 1572824449} m_Layer: 5 m_Name: Restart m_TagString: Untagged @@ -6020,6 +6700,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1572824445} m_CullTransparentMesh: 1 +--- !u!114 &1572824449 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1572824445} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140120 + references: + version: 2 + RefIds: + - rid: 8151037669503140120 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1572824447} + m_TrackedProperties: + items: + - rid: 8151037669503140121 + m_UpdateType: 0 + - rid: 8151037669503140121 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 4731950997504 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1 &1575113403 GameObject: m_ObjectHideFlags: 0 @@ -6031,6 +6749,7 @@ GameObject: - component: {fileID: 1575113404} - component: {fileID: 1575113406} - component: {fileID: 1575113405} + - component: {fileID: 1575113407} m_Layer: 5 m_Name: Title m_TagString: Untagged @@ -6154,6 +6873,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1575113403} m_CullTransparentMesh: 1 +--- !u!114 &1575113407 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1575113403} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140107 + references: + version: 2 + RefIds: + - rid: 8151037669503140107 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1575113405} + m_TrackedProperties: + items: + - rid: 8151037669503140108 + m_UpdateType: 0 + - rid: 8151037669503140108 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 4068001062912 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1 &1590939977 GameObject: m_ObjectHideFlags: 0 @@ -6306,6 +7063,7 @@ GameObject: - component: {fileID: 1770783105} - component: {fileID: 1770783107} - component: {fileID: 1770783106} + - component: {fileID: 1770783108} m_Layer: 5 m_Name: MaxLengthName m_TagString: Untagged @@ -6429,6 +7187,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1770783104} m_CullTransparentMesh: 1 +--- !u!114 &1770783108 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1770783104} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140081 + references: + version: 2 + RefIds: + - rid: 8151037669503140081 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1770783106} + m_TrackedProperties: + items: + - rid: 8151037669503140082 + m_UpdateType: 0 + - rid: 8151037669503140082 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 3428315176960 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1 &1839320054 GameObject: m_ObjectHideFlags: 0 @@ -6440,6 +7236,7 @@ GameObject: - component: {fileID: 1839320055} - component: {fileID: 1839320057} - component: {fileID: 1839320056} + - component: {fileID: 1839320058} m_Layer: 5 m_Name: WaitingText m_TagString: Untagged @@ -6563,6 +7360,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1839320054} m_CullTransparentMesh: 1 +--- !u!114 &1839320058 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1839320054} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140110 + references: + version: 2 + RefIds: + - rid: 8151037669503140110 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 1839320056} + m_TrackedProperties: + items: + - rid: 8151037669503140111 + m_UpdateType: 0 + - rid: 8151037669503140111 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 4139262287872 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1 &1844634805 GameObject: m_ObjectHideFlags: 0 @@ -7462,6 +8297,7 @@ GameObject: - component: {fileID: 2054097511} - component: {fileID: 2054097513} - component: {fileID: 2054097512} + - component: {fileID: 2054097514} m_Layer: 5 m_Name: Text (TMP) m_TagString: Untagged @@ -7585,6 +8421,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2054097510} m_CullTransparentMesh: 1 +--- !u!114 &2054097514 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054097510} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 69beb381e244f92449b8c4cf954630e9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackedObjects: + - rid: 8151037669503140118 + references: + version: 2 + RefIds: + - rid: 8151037669503140118 + type: {class: TrackedUGuiGraphic, ns: UnityEngine.Localization.PropertyVariants.TrackedObjects, asm: Unity.Localization} + data: + m_Target: {fileID: 2054097512} + m_TrackedProperties: + items: + - rid: 8151037669503140119 + m_UpdateType: 0 + - rid: 8151037669503140119 + type: {class: LocalizedStringProperty, ns: UnityEngine.Localization.PropertyVariants.TrackedProperties, asm: Unity.Localization} + data: + m_Localized: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 4287325413376 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_PropertyPath: m_text --- !u!1 &2095389711 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index c6abf53..24a7e66 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -7,7 +7,10 @@ using Newtonsoft.Json; using TMPro; using Unity.VisualScripting; +using UnityEditor.Localization; using UnityEngine; +using UnityEngine.Localization.Settings; +using UnityEngine.Localization.Tables; using UnityEngine.UI; /// @@ -20,6 +23,7 @@ public class GameManager : MonoBehaviour [Header("Other component")] public float explanationTime = 4f; + public StringTableCollection stringTableCollection; [Header("Home Connection Component")] public TMP_InputField roomCodeField; @@ -54,11 +58,17 @@ public class GameManager : MonoBehaviour public GameObject WaitingOtherPlayers; public GameObject EndGame; + internal Room myRoom; + private DatabaseReference realtimeDB; - public Room myRoom; private DatabaseReference myOnlineRoom; private DateTime endOfViewDate = DateTime.MinValue; + /// + /// Contains all the translated string for the UI + /// + private StringTable stringTable; + private void Awake() { submitNewPlayer.interactable = false; @@ -68,6 +78,7 @@ private void Awake() private void Start() { InitializeHomePage(); + stringTable = stringTableCollection.GetTable(LocalizationSettings.SelectedLocale.Identifier) as StringTable; } private void InitializeHomePage() @@ -162,7 +173,8 @@ public void PlayerValidateNameAndServerRoom(string _name, string _code) { Debug.LogError("Player name is empty", this); - nameError.text = "You have to put a valid name"; + string errorText = stringTable.GetEntry("PhoneView/Canvas/Background/HomeState/NameField/ErrorNameLabel").LocalizedValue; + nameError.text = errorText; nameError.gameObject.SetActive(true); submitNewPlayer.interactable = true; @@ -172,7 +184,9 @@ public void PlayerValidateNameAndServerRoom(string _name, string _code) if (string.IsNullOrEmpty(_code)) { Debug.LogError("Room code is empty", this); - roomError.text = "You have to put a room code"; + + string errorText = stringTable.GetEntry("PhoneView/Canvas/Background/HomeState/NameField/EmptyRoom").LocalizedValue; + roomError.text = errorText; roomError.gameObject.SetActive(true); submitNewPlayer.interactable = true; @@ -189,7 +203,8 @@ public void PlayerValidateNameAndServerRoom(string _name, string _code) if (room == null) { Debug.LogError("The room doesn't exists"); - roomError.text = "Error: the room doesn't exists"; + string errorText = stringTable.GetEntry("PhoneView/Canvas/Background/HomeState/NameField/ErrorRoom").LocalizedValue; + roomError.text = errorText; roomError.gameObject.SetActive(true); submitNewPlayer.interactable = true; } diff --git a/Assets/Scripts/RoomManager.cs b/Assets/Scripts/RoomManager.cs index a1482d5..61060e4 100644 --- a/Assets/Scripts/RoomManager.cs +++ b/Assets/Scripts/RoomManager.cs @@ -6,9 +6,11 @@ using UnityEngine; using Newtonsoft.Json; using System.Linq; -using Firebase.Storage; -using System.Threading.Tasks; using System.Collections; +using UnityEditor.Localization; +using UnityEngine.Localization.Settings; +using UnityEngine.Localization; +using UnityEngine.Localization.Tables; public class RoomManager : MonoBehaviour { @@ -41,6 +43,12 @@ public class RoomManager : MonoBehaviour [Header("Other")] public PromptList promptList; + public StringTableCollection stringTableCollection; + + /// + /// Contains all the translated string for the UI + /// + private StringTable stringTable; public Room myRoom { get; private set; } = null; @@ -50,6 +58,7 @@ private void Awake() { Instance = this; FirebaseInitializer.Instance.onFirebaseReady += Initialize; + stringTable = stringTableCollection.GetTable(LocalizationSettings.SelectedLocale.Identifier) as StringTable; } private void Start() @@ -96,9 +105,10 @@ private void SendRoomState(GameState _newState) private void ResetAllPlayerLabels() { + string label = stringTable.GetEntry("ComputerView/Canvas/WaitingForPlayersPage/WaitingForP").LocalizedValue; for (int i = 0; i < playerStickers.Count; i++) { - playerStickers[i].Initialize($"Waiting for P{i + 1}", i); + playerStickers[i].Initialize($"{label}{i + 1}", i); } } -- 2.45.2 From 39bfa4b2e76a08a67ea50616c921e3df3309e340 Mon Sep 17 00:00:00 2001 From: Fangh Date: Thu, 29 Feb 2024 20:52:54 +0100 Subject: [PATCH 05/13] feat(localization): all UI should be now localized --- .../AssetGroups/Localization-Locales.asset | 8 +- .../Localization/Localization Settings.asset | 4 +- Assets/Scenes/PhoneView.unity | 96 +++++++++---------- Assets/Scripts/GameManager.cs | 3 + 4 files changed, 57 insertions(+), 54 deletions(-) diff --git a/Assets/Localization/AddressableAssetsData/AssetGroups/Localization-Locales.asset b/Assets/Localization/AddressableAssetsData/AssetGroups/Localization-Locales.asset index e0ae1fd..396ba8f 100644 --- a/Assets/Localization/AddressableAssetsData/AssetGroups/Localization-Locales.asset +++ b/Assets/Localization/AddressableAssetsData/AssetGroups/Localization-Locales.asset @@ -17,14 +17,14 @@ MonoBehaviour: m_SerializedData: [] m_GUID: 3638895c7d697af48853e75ae2426f52 m_SerializeEntries: - - m_GUID: b687ef6015830a84a91ae1c741f420fc - m_Address: English (en) + - m_GUID: db738e9bed1d4da4fa372aa455bfa440 + m_Address: French (fr) m_ReadOnly: 1 m_SerializedLabels: - Locale FlaggedDuringContentUpdateRestriction: 0 - - m_GUID: db738e9bed1d4da4fa372aa455bfa440 - m_Address: French (fr) + - m_GUID: b687ef6015830a84a91ae1c741f420fc + m_Address: English (en) m_ReadOnly: 1 m_SerializedLabels: - Locale diff --git a/Assets/Localization/Localization Settings.asset b/Assets/Localization/Localization Settings.asset index a1c1947..98185bc 100644 --- a/Assets/Localization/Localization Settings.asset +++ b/Assets/Localization/Localization Settings.asset @@ -25,7 +25,7 @@ MonoBehaviour: m_Metadata: m_Items: [] m_ProjectLocaleIdentifier: - m_Code: en + m_Code: fr m_PreloadBehavior: 1 m_InitializeSynchronously: 0 references: @@ -44,7 +44,7 @@ MonoBehaviour: type: {class: SpecificLocaleSelector, ns: UnityEngine.Localization.Settings, asm: Unity.Localization} data: m_LocaleId: - m_Code: en + m_Code: fr - rid: 8151037669503139843 type: {class: LocalesProvider, ns: UnityEngine.Localization.Settings, asm: Unity.Localization} data: diff --git a/Assets/Scenes/PhoneView.unity b/Assets/Scenes/PhoneView.unity index 845766b..dac4e22 100644 --- a/Assets/Scenes/PhoneView.unity +++ b/Assets/Scenes/PhoneView.unity @@ -1003,7 +1003,7 @@ MonoBehaviour: id: creationDate: 0 explanationTime: 4 - stringTableCollection: {fileID: 0} + stringTableCollection: {fileID: 11400000, guid: 3d4b6573839c0274ca08f4bf9dedeca2, type: 2} roomCodeField: {fileID: 2023851070} roomError: {fileID: 991600093} playerNameField: {fileID: 1163479463} @@ -3682,11 +3682,11 @@ RectTransform: m_Children: [] m_Father: {fileID: 2023851069} 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: 2.9758, y: 20.4609} - m_SizeDelta: {x: 154.05, y: 13.5401} - m_Pivot: {x: 0.5, y: 0.5} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: -14} + m_SizeDelta: {x: 0, y: 12} + m_Pivot: {x: 0.5, y: 0} --- !u!114 &991600093 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3734,12 +3734,12 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 11.43 + m_fontSize: 11.25 m_fontSizeBase: 11.43 m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 + m_enableAutoSizing: 1 + m_fontSizeMin: 8 + m_fontSizeMax: 12 m_fontStyle: 0 m_HorizontalAlignment: 1 m_VerticalAlignment: 256 @@ -3770,7 +3770,7 @@ MonoBehaviour: m_VertexBufferAutoSizeReduction: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 - m_margin: {x: 0, y: 0, z: -0.000000025251643, w: 0} + m_margin: {x: 5, y: 0, z: 5, w: 0} m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 m_hasFontAssetChanged: 0 @@ -4586,9 +4586,9 @@ RectTransform: - {fileID: 1224049645} m_Father: {fileID: 2027556832} 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: -97.527} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: -1178.527} m_SizeDelta: {x: 160, y: 30} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1163479463 @@ -5026,16 +5026,16 @@ RectTransform: m_GameObject: {fileID: 1224049644} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.0029413, y: 1.0029413, z: 0.8627451} + m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1163479462} 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: 2.9845557, y: 18.5} - m_SizeDelta: {x: 154.05, y: 13.5401} - m_Pivot: {x: 0.5, y: 0.5} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 14} + m_SizeDelta: {x: 0, y: 12} + m_Pivot: {x: 0.5, y: 1} --- !u!114 &1224049646 MonoBehaviour: m_ObjectHideFlags: 0 @@ -5083,12 +5083,12 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 11.43 + m_fontSize: 10.1 m_fontSizeBase: 11.43 m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 + m_enableAutoSizing: 1 + m_fontSizeMin: 8 + m_fontSizeMax: 12 m_fontStyle: 0 m_HorizontalAlignment: 1 m_VerticalAlignment: 256 @@ -5119,7 +5119,7 @@ MonoBehaviour: m_VertexBufferAutoSizeReduction: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 - m_margin: {x: 0, y: 0, z: -0.000000025251643, w: 0} + m_margin: {x: 5, y: 0, z: 5, w: 0} m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 m_hasFontAssetChanged: 0 @@ -5581,9 +5581,9 @@ RectTransform: m_Children: [] m_Father: {fileID: 2027556832} 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: -409} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: -1490} m_SizeDelta: {x: 160, y: 30} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1371739072 @@ -7085,11 +7085,11 @@ RectTransform: m_Children: [] m_Father: {fileID: 1163479462} 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: 2.8591, y: -36.5711} - m_SizeDelta: {x: 194.2818, y: 45.5423} - m_Pivot: {x: 0.5, y: 0.5} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: -14} + m_SizeDelta: {x: 0, y: 14} + m_Pivot: {x: 0.5, y: 0} --- !u!114 &1770783106 MonoBehaviour: m_ObjectHideFlags: 0 @@ -7137,15 +7137,15 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 9.9 + m_fontSize: 10 m_fontSizeBase: 9.9 m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 + m_enableAutoSizing: 1 + m_fontSizeMin: 8 + m_fontSizeMax: 10 m_fontStyle: 0 m_HorizontalAlignment: 2 - m_VerticalAlignment: 256 + m_VerticalAlignment: 512 m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 @@ -7173,7 +7173,7 @@ MonoBehaviour: m_VertexBufferAutoSizeReduction: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 - m_margin: {x: 20.1389, y: 0, z: 21.198944, w: 30.573076} + m_margin: {x: 5, y: 0, z: 5, w: 0} m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 m_hasFontAssetChanged: 0 @@ -8104,9 +8104,9 @@ RectTransform: - {fileID: 991600092} m_Father: {fileID: 2027556832} 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: 272} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: -809} m_SizeDelta: {x: 160, y: 30} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &2023851070 @@ -8583,15 +8583,15 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 102 + m_fontSize: 80 m_fontSizeBase: 102 m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 + m_enableAutoSizing: 1 + m_fontSizeMin: 50 + m_fontSizeMax: 80 m_fontStyle: 0 m_HorizontalAlignment: 2 - m_VerticalAlignment: 512 + m_VerticalAlignment: 1024 m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 @@ -8619,7 +8619,7 @@ MonoBehaviour: m_VertexBufferAutoSizeReduction: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 - m_margin: {x: 0, y: 0, z: 0, w: 0} + m_margin: {x: 0, y: 0, z: 0, w: 25} m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 m_hasFontAssetChanged: 0 diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 24a7e66..af705d7 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -114,6 +114,9 @@ private void OnApplicationQuit() private void Update() { + if (myRoom == null) + return; + if (myRoom.currentState == (int)GameState.Explanation && endOfViewDate != DateTime.MinValue) { TimeSpan duration = endOfViewDate - DateTime.Now; -- 2.45.2 From 9d3dfb8c0ffccf4812c837fb030e42555ff4198d Mon Sep 17 00:00:00 2001 From: Fangh Date: Thu, 29 Feb 2024 21:33:27 +0100 Subject: [PATCH 06/13] feat(localization): add MPUIKit plugin --- Assets/MPUIKit.meta | 8 + Assets/MPUIKit/Editor.meta | 8 + Assets/MPUIKit/Editor/Images.meta | 8 + Assets/MPUIKit/Editor/Images/background.png | 3 + .../MPUIKit/Editor/Images/background.png.meta | 112 +++ Assets/MPUIKit/Editor/Images/flip_h_0.png | 3 + .../MPUIKit/Editor/Images/flip_h_0.png.meta | 139 ++++ Assets/MPUIKit/Editor/Images/flip_h_1.png | 3 + .../MPUIKit/Editor/Images/flip_h_1.png.meta | 139 ++++ Assets/MPUIKit/Editor/Images/flip_h_2.png | 3 + .../MPUIKit/Editor/Images/flip_h_2.png.meta | 139 ++++ Assets/MPUIKit/Editor/Images/flip_h_3.png | 3 + .../MPUIKit/Editor/Images/flip_h_3.png.meta | 139 ++++ Assets/MPUIKit/Editor/Images/flip_v_0.png | 3 + .../MPUIKit/Editor/Images/flip_v_0.png.meta | 139 ++++ Assets/MPUIKit/Editor/Images/flip_v_1.png | 3 + .../MPUIKit/Editor/Images/flip_v_1.png.meta | 139 ++++ Assets/MPUIKit/Editor/Images/flip_v_2.png | 3 + .../MPUIKit/Editor/Images/flip_v_2.png.meta | 139 ++++ Assets/MPUIKit/Editor/Images/flip_v_3.png | 3 + .../MPUIKit/Editor/Images/flip_v_3.png.meta | 139 ++++ Assets/MPUIKit/Editor/Images/logo.png | 3 + Assets/MPUIKit/Editor/Images/logo.png.meta | 112 +++ .../MPUIKit/Editor/Images/rotate_left_0.png | 3 + .../Editor/Images/rotate_left_0.png.meta | 139 ++++ .../MPUIKit/Editor/Images/rotate_left_1.png | 3 + .../Editor/Images/rotate_left_1.png.meta | 139 ++++ .../MPUIKit/Editor/Images/rotate_left_2.png | 3 + .../Editor/Images/rotate_left_2.png.meta | 139 ++++ .../MPUIKit/Editor/Images/rotate_left_3.png | 3 + .../Editor/Images/rotate_left_3.png.meta | 139 ++++ .../MPUIKit/Editor/Images/rotate_right_0.png | 3 + .../Editor/Images/rotate_right_0.png.meta | 139 ++++ .../MPUIKit/Editor/Images/rotate_right_1.png | 3 + .../Editor/Images/rotate_right_1.png.meta | 139 ++++ .../MPUIKit/Editor/Images/rotate_right_2.png | 3 + .../Editor/Images/rotate_right_2.png.meta | 139 ++++ .../MPUIKit/Editor/Images/rotate_right_3.png | 3 + .../Editor/Images/rotate_right_3.png.meta | 139 ++++ Assets/MPUIKit/Editor/Images/title.png | 3 + Assets/MPUIKit/Editor/Images/title.png.meta | 112 +++ Assets/MPUIKit/Editor/MPUIKit.Editor.asmdef | 17 + .../MPUIKit/Editor/MPUIKit.Editor.asmdef.meta | 7 + Assets/MPUIKit/Editor/Scripts.meta | 8 + .../Editor/Scripts/EditorGUILayoutExtended.cs | 70 ++ .../Scripts/EditorGUILayoutExtended.cs.meta | 11 + .../MPUIKit/Editor/Scripts/EffectDrawers.meta | 8 + .../GradeintEffectPropertyDrawer.cs | 89 +++ .../GradeintEffectPropertyDrawer.cs.meta | 11 + .../Editor/Scripts/MPEditorContents.cs | 129 ++++ .../Editor/Scripts/MPEditorContents.cs.meta | 11 + .../MPUIKit/Editor/Scripts/MPEditorUtility.cs | 171 +++++ .../Editor/Scripts/MPEditorUtility.cs.meta | 11 + .../Editor/Scripts/MPImageBasicEditor.cs | 528 ++++++++++++++ .../Editor/Scripts/MPImageBasicEditor.cs.meta | 11 + .../MPUIKit/Editor/Scripts/MPImageEditor.cs | 506 +++++++++++++ .../Editor/Scripts/MPImageEditor.cs.meta | 11 + .../Editor/Scripts/MPUIKitShaderGUI.cs | 26 + .../Editor/Scripts/MPUIKitShaderGUI.cs.meta | 3 + .../Editor/Scripts/MPUIKitUtilityWindow.cs | 134 ++++ .../Scripts/MPUIKitUtilityWindow.cs.meta | 11 + .../MPUIKit/Editor/Scripts/ShapeDrawers.meta | 8 + .../ShapeDrawers/CirclePropertyDrawer.cs | 51 ++ .../ShapeDrawers/CirclePropertyDrawer.cs.meta | 3 + .../ShapeDrawers/HexagonPropertyDrawer.cs | 106 +++ .../HexagonPropertyDrawer.cs.meta | 3 + .../NStarPolygonPropertyDrawer.cs | 33 + .../NStarPolygonPropertyDrawer.cs.meta | 3 + .../ShapeDrawers/PentagonPropertyDrawer.cs | 63 ++ .../PentagonPropertyDrawer.cs.meta | 3 + .../ShapeDrawers/RectanglePropertyDrawer.cs | 60 ++ .../RectanglePropertyDrawer.cs.meta | 3 + .../ShapeDrawers/TrianglePropertyDrawer.cs | 43 ++ .../TrianglePropertyDrawer.cs.meta | 3 + Assets/MPUIKit/Runtime.meta | 8 + Assets/MPUIKit/Runtime/MPUIKit.asmdef | 3 + Assets/MPUIKit/Runtime/MPUIKit.asmdef.meta | 7 + Assets/MPUIKit/Runtime/Resources.meta | 8 + Assets/MPUIKit/Runtime/Resources/Shaders.meta | 8 + .../Runtime/Resources/Shaders/2D_SDF.cginc | 79 ++ .../Resources/Shaders/2D_SDF.cginc.meta | 9 + .../Runtime/Resources/Shaders/MPImage.shader | 686 +++++++++++++++++ .../Resources/Shaders/MPImage.shader.meta | 9 + .../Resources/Shaders/MPImageBasic.shader | 410 +++++++++++ .../Shaders/MPImageBasic.shader.meta | 3 + .../Resources/mpui_default_empty_sprite.png | 3 + .../mpui_default_empty_sprite.png.meta | 92 +++ Assets/MPUIKit/Runtime/Scripts.meta | 8 + Assets/MPUIKit/Runtime/Scripts/Effects.meta | 8 + .../Runtime/Scripts/Effects/GradientEffect.cs | 264 +++++++ .../Scripts/Effects/GradientEffect.cs.meta | 11 + Assets/MPUIKit/Runtime/Scripts/Enums.cs | 27 + Assets/MPUIKit/Runtime/Scripts/Enums.cs.meta | 11 + .../MPUIKit/Runtime/Scripts/IMPUIComponent.cs | 16 + .../Runtime/Scripts/IMPUIComponent.cs.meta | 11 + Assets/MPUIKit/Runtime/Scripts/MPImage.cs | 688 ++++++++++++++++++ .../MPUIKit/Runtime/Scripts/MPImage.cs.meta | 11 + .../MPUIKit/Runtime/Scripts/MPImageBasic.cs | 421 +++++++++++ .../Runtime/Scripts/MPImageBasic.cs.meta | 11 + Assets/MPUIKit/Runtime/Scripts/Shapes.meta | 8 + .../MPUIKit/Runtime/Scripts/Shapes/Circle.cs | 79 ++ .../Runtime/Scripts/Shapes/Circle.cs.meta | 11 + .../MPUIKit/Runtime/Scripts/Shapes/Hexagon.cs | 105 +++ .../Runtime/Scripts/Shapes/Hexagon.cs.meta | 11 + .../Runtime/Scripts/Shapes/NStarPolygon.cs | 121 +++ .../Scripts/Shapes/NStarPolygon.cs.meta | 11 + .../Runtime/Scripts/Shapes/Pentagon.cs | 99 +++ .../Runtime/Scripts/Shapes/Pentagon.cs.meta | 11 + .../Runtime/Scripts/Shapes/Rectangle.cs | 77 ++ .../Runtime/Scripts/Shapes/Rectangle.cs.meta | 11 + .../Runtime/Scripts/Shapes/Triangle.cs | 59 ++ .../Runtime/Scripts/Shapes/Triangle.cs.meta | 11 + Assets/MPUIKit/Runtime/Scripts/Utility.meta | 3 + .../Runtime/Scripts/Utility/MPImageHelper.cs | 398 ++++++++++ .../Scripts/Utility/MPImageHelper.cs.meta | 3 + .../Runtime/Scripts/Utility/MPImageUtility.cs | 41 ++ .../Scripts/Utility/MPImageUtility.cs.meta | 3 + .../Runtime/Scripts/Utility/MPMaterials.cs | 43 ++ .../Scripts/Utility/MPMaterials.cs.meta | 3 + .../Runtime/Scripts/Utility/MPVertexStream.cs | 10 + .../Scripts/Utility/MPVertexStream.cs.meta | 3 + Assets/MPUIKit/readme.txt | 2 + Assets/MPUIKit/readme.txt.meta | 7 + 123 files changed, 8738 insertions(+) create mode 100644 Assets/MPUIKit.meta create mode 100644 Assets/MPUIKit/Editor.meta create mode 100644 Assets/MPUIKit/Editor/Images.meta create mode 100644 Assets/MPUIKit/Editor/Images/background.png create mode 100644 Assets/MPUIKit/Editor/Images/background.png.meta create mode 100644 Assets/MPUIKit/Editor/Images/flip_h_0.png create mode 100644 Assets/MPUIKit/Editor/Images/flip_h_0.png.meta create mode 100644 Assets/MPUIKit/Editor/Images/flip_h_1.png create mode 100644 Assets/MPUIKit/Editor/Images/flip_h_1.png.meta create mode 100644 Assets/MPUIKit/Editor/Images/flip_h_2.png create mode 100644 Assets/MPUIKit/Editor/Images/flip_h_2.png.meta create mode 100644 Assets/MPUIKit/Editor/Images/flip_h_3.png create mode 100644 Assets/MPUIKit/Editor/Images/flip_h_3.png.meta create mode 100644 Assets/MPUIKit/Editor/Images/flip_v_0.png create mode 100644 Assets/MPUIKit/Editor/Images/flip_v_0.png.meta create mode 100644 Assets/MPUIKit/Editor/Images/flip_v_1.png create mode 100644 Assets/MPUIKit/Editor/Images/flip_v_1.png.meta create mode 100644 Assets/MPUIKit/Editor/Images/flip_v_2.png create mode 100644 Assets/MPUIKit/Editor/Images/flip_v_2.png.meta create mode 100644 Assets/MPUIKit/Editor/Images/flip_v_3.png create mode 100644 Assets/MPUIKit/Editor/Images/flip_v_3.png.meta create mode 100644 Assets/MPUIKit/Editor/Images/logo.png create mode 100644 Assets/MPUIKit/Editor/Images/logo.png.meta create mode 100644 Assets/MPUIKit/Editor/Images/rotate_left_0.png create mode 100644 Assets/MPUIKit/Editor/Images/rotate_left_0.png.meta create mode 100644 Assets/MPUIKit/Editor/Images/rotate_left_1.png create mode 100644 Assets/MPUIKit/Editor/Images/rotate_left_1.png.meta create mode 100644 Assets/MPUIKit/Editor/Images/rotate_left_2.png create mode 100644 Assets/MPUIKit/Editor/Images/rotate_left_2.png.meta create mode 100644 Assets/MPUIKit/Editor/Images/rotate_left_3.png create mode 100644 Assets/MPUIKit/Editor/Images/rotate_left_3.png.meta create mode 100644 Assets/MPUIKit/Editor/Images/rotate_right_0.png create mode 100644 Assets/MPUIKit/Editor/Images/rotate_right_0.png.meta create mode 100644 Assets/MPUIKit/Editor/Images/rotate_right_1.png create mode 100644 Assets/MPUIKit/Editor/Images/rotate_right_1.png.meta create mode 100644 Assets/MPUIKit/Editor/Images/rotate_right_2.png create mode 100644 Assets/MPUIKit/Editor/Images/rotate_right_2.png.meta create mode 100644 Assets/MPUIKit/Editor/Images/rotate_right_3.png create mode 100644 Assets/MPUIKit/Editor/Images/rotate_right_3.png.meta create mode 100644 Assets/MPUIKit/Editor/Images/title.png create mode 100644 Assets/MPUIKit/Editor/Images/title.png.meta create mode 100644 Assets/MPUIKit/Editor/MPUIKit.Editor.asmdef create mode 100644 Assets/MPUIKit/Editor/MPUIKit.Editor.asmdef.meta create mode 100644 Assets/MPUIKit/Editor/Scripts.meta create mode 100644 Assets/MPUIKit/Editor/Scripts/EditorGUILayoutExtended.cs create mode 100644 Assets/MPUIKit/Editor/Scripts/EditorGUILayoutExtended.cs.meta create mode 100644 Assets/MPUIKit/Editor/Scripts/EffectDrawers.meta create mode 100644 Assets/MPUIKit/Editor/Scripts/EffectDrawers/GradeintEffectPropertyDrawer.cs create mode 100644 Assets/MPUIKit/Editor/Scripts/EffectDrawers/GradeintEffectPropertyDrawer.cs.meta create mode 100644 Assets/MPUIKit/Editor/Scripts/MPEditorContents.cs create mode 100644 Assets/MPUIKit/Editor/Scripts/MPEditorContents.cs.meta create mode 100644 Assets/MPUIKit/Editor/Scripts/MPEditorUtility.cs create mode 100644 Assets/MPUIKit/Editor/Scripts/MPEditorUtility.cs.meta create mode 100644 Assets/MPUIKit/Editor/Scripts/MPImageBasicEditor.cs create mode 100644 Assets/MPUIKit/Editor/Scripts/MPImageBasicEditor.cs.meta create mode 100644 Assets/MPUIKit/Editor/Scripts/MPImageEditor.cs create mode 100644 Assets/MPUIKit/Editor/Scripts/MPImageEditor.cs.meta create mode 100644 Assets/MPUIKit/Editor/Scripts/MPUIKitShaderGUI.cs create mode 100644 Assets/MPUIKit/Editor/Scripts/MPUIKitShaderGUI.cs.meta create mode 100644 Assets/MPUIKit/Editor/Scripts/MPUIKitUtilityWindow.cs create mode 100644 Assets/MPUIKit/Editor/Scripts/MPUIKitUtilityWindow.cs.meta create mode 100644 Assets/MPUIKit/Editor/Scripts/ShapeDrawers.meta create mode 100644 Assets/MPUIKit/Editor/Scripts/ShapeDrawers/CirclePropertyDrawer.cs create mode 100644 Assets/MPUIKit/Editor/Scripts/ShapeDrawers/CirclePropertyDrawer.cs.meta create mode 100644 Assets/MPUIKit/Editor/Scripts/ShapeDrawers/HexagonPropertyDrawer.cs create mode 100644 Assets/MPUIKit/Editor/Scripts/ShapeDrawers/HexagonPropertyDrawer.cs.meta create mode 100644 Assets/MPUIKit/Editor/Scripts/ShapeDrawers/NStarPolygonPropertyDrawer.cs create mode 100644 Assets/MPUIKit/Editor/Scripts/ShapeDrawers/NStarPolygonPropertyDrawer.cs.meta create mode 100644 Assets/MPUIKit/Editor/Scripts/ShapeDrawers/PentagonPropertyDrawer.cs create mode 100644 Assets/MPUIKit/Editor/Scripts/ShapeDrawers/PentagonPropertyDrawer.cs.meta create mode 100644 Assets/MPUIKit/Editor/Scripts/ShapeDrawers/RectanglePropertyDrawer.cs create mode 100644 Assets/MPUIKit/Editor/Scripts/ShapeDrawers/RectanglePropertyDrawer.cs.meta create mode 100644 Assets/MPUIKit/Editor/Scripts/ShapeDrawers/TrianglePropertyDrawer.cs create mode 100644 Assets/MPUIKit/Editor/Scripts/ShapeDrawers/TrianglePropertyDrawer.cs.meta create mode 100644 Assets/MPUIKit/Runtime.meta create mode 100644 Assets/MPUIKit/Runtime/MPUIKit.asmdef create mode 100644 Assets/MPUIKit/Runtime/MPUIKit.asmdef.meta create mode 100644 Assets/MPUIKit/Runtime/Resources.meta create mode 100644 Assets/MPUIKit/Runtime/Resources/Shaders.meta create mode 100644 Assets/MPUIKit/Runtime/Resources/Shaders/2D_SDF.cginc create mode 100644 Assets/MPUIKit/Runtime/Resources/Shaders/2D_SDF.cginc.meta create mode 100644 Assets/MPUIKit/Runtime/Resources/Shaders/MPImage.shader create mode 100644 Assets/MPUIKit/Runtime/Resources/Shaders/MPImage.shader.meta create mode 100644 Assets/MPUIKit/Runtime/Resources/Shaders/MPImageBasic.shader create mode 100644 Assets/MPUIKit/Runtime/Resources/Shaders/MPImageBasic.shader.meta create mode 100644 Assets/MPUIKit/Runtime/Resources/mpui_default_empty_sprite.png create mode 100644 Assets/MPUIKit/Runtime/Resources/mpui_default_empty_sprite.png.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts/Effects.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts/Effects/GradientEffect.cs create mode 100644 Assets/MPUIKit/Runtime/Scripts/Effects/GradientEffect.cs.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts/Enums.cs create mode 100644 Assets/MPUIKit/Runtime/Scripts/Enums.cs.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts/IMPUIComponent.cs create mode 100644 Assets/MPUIKit/Runtime/Scripts/IMPUIComponent.cs.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts/MPImage.cs create mode 100644 Assets/MPUIKit/Runtime/Scripts/MPImage.cs.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts/MPImageBasic.cs create mode 100644 Assets/MPUIKit/Runtime/Scripts/MPImageBasic.cs.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts/Shapes.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts/Shapes/Circle.cs create mode 100644 Assets/MPUIKit/Runtime/Scripts/Shapes/Circle.cs.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts/Shapes/Hexagon.cs create mode 100644 Assets/MPUIKit/Runtime/Scripts/Shapes/Hexagon.cs.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts/Shapes/NStarPolygon.cs create mode 100644 Assets/MPUIKit/Runtime/Scripts/Shapes/NStarPolygon.cs.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts/Shapes/Pentagon.cs create mode 100644 Assets/MPUIKit/Runtime/Scripts/Shapes/Pentagon.cs.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts/Shapes/Rectangle.cs create mode 100644 Assets/MPUIKit/Runtime/Scripts/Shapes/Rectangle.cs.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts/Shapes/Triangle.cs create mode 100644 Assets/MPUIKit/Runtime/Scripts/Shapes/Triangle.cs.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts/Utility.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts/Utility/MPImageHelper.cs create mode 100644 Assets/MPUIKit/Runtime/Scripts/Utility/MPImageHelper.cs.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts/Utility/MPImageUtility.cs create mode 100644 Assets/MPUIKit/Runtime/Scripts/Utility/MPImageUtility.cs.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts/Utility/MPMaterials.cs create mode 100644 Assets/MPUIKit/Runtime/Scripts/Utility/MPMaterials.cs.meta create mode 100644 Assets/MPUIKit/Runtime/Scripts/Utility/MPVertexStream.cs create mode 100644 Assets/MPUIKit/Runtime/Scripts/Utility/MPVertexStream.cs.meta create mode 100644 Assets/MPUIKit/readme.txt create mode 100644 Assets/MPUIKit/readme.txt.meta diff --git a/Assets/MPUIKit.meta b/Assets/MPUIKit.meta new file mode 100644 index 0000000..df1611e --- /dev/null +++ b/Assets/MPUIKit.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f2b1f7fc7f3ee4097bdc8a214a25adb5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor.meta b/Assets/MPUIKit/Editor.meta new file mode 100644 index 0000000..f8ae436 --- /dev/null +++ b/Assets/MPUIKit/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3be96de8ad725594daed36f170ebc783 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images.meta b/Assets/MPUIKit/Editor/Images.meta new file mode 100644 index 0000000..9cc3100 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6dd8df1b756a60749afb0e7b5f235a9a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/background.png b/Assets/MPUIKit/Editor/Images/background.png new file mode 100644 index 0000000..036fd2e --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/background.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:63e1fe7d9e32f5ce12132c131c970c3f358229bf306b732bfa2550c0a2272414 +size 47779 diff --git a/Assets/MPUIKit/Editor/Images/background.png.meta b/Assets/MPUIKit/Editor/Images/background.png.meta new file mode 100644 index 0000000..0f53cf1 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/background.png.meta @@ -0,0 +1,112 @@ +fileFormatVersion: 2 +guid: fc2679c53c135d6439749bc914f017c7 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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: 1 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 1024 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 1024 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 1024 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 28e13a84bec69524f83ef82d190512b7 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/flip_h_0.png b/Assets/MPUIKit/Editor/Images/flip_h_0.png new file mode 100644 index 0000000..bfd69ba --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/flip_h_0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad858fa246391204e9112573dc67ce66b4fa1c301a115d36809a153e2617e5de +size 1280 diff --git a/Assets/MPUIKit/Editor/Images/flip_h_0.png.meta b/Assets/MPUIKit/Editor/Images/flip_h_0.png.meta new file mode 100644 index 0000000..5312eef --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/flip_h_0.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 2b75b377ce173b342846139114db41c0 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + 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: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/flip_h_1.png b/Assets/MPUIKit/Editor/Images/flip_h_1.png new file mode 100644 index 0000000..afb6cac --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/flip_h_1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:622ddbc33cd0903ceb47048ef591d227e97ae1c3c2316ccdfb28d02f61b82b1d +size 1338 diff --git a/Assets/MPUIKit/Editor/Images/flip_h_1.png.meta b/Assets/MPUIKit/Editor/Images/flip_h_1.png.meta new file mode 100644 index 0000000..ae47486 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/flip_h_1.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 909ed2453e96f58469413d872d9514f2 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + 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: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/flip_h_2.png b/Assets/MPUIKit/Editor/Images/flip_h_2.png new file mode 100644 index 0000000..c15f51e --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/flip_h_2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bdaad2ceeba0d7a16f5f27d7217290f57040da6bf68522004f0d155e7b0c55f3 +size 1495 diff --git a/Assets/MPUIKit/Editor/Images/flip_h_2.png.meta b/Assets/MPUIKit/Editor/Images/flip_h_2.png.meta new file mode 100644 index 0000000..e47ad61 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/flip_h_2.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: f5ba0cbf55aa907498bc5d9ff5e444fe +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + 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: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/flip_h_3.png b/Assets/MPUIKit/Editor/Images/flip_h_3.png new file mode 100644 index 0000000..5fdb452 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/flip_h_3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5cc5a09e01cab3540122fb50308e64792950a6c60a15b3dd575a95b3ab8915e +size 1321 diff --git a/Assets/MPUIKit/Editor/Images/flip_h_3.png.meta b/Assets/MPUIKit/Editor/Images/flip_h_3.png.meta new file mode 100644 index 0000000..1c4b217 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/flip_h_3.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 30771270a2bd2f4409feadba3a9fc9e9 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + 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: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/flip_v_0.png b/Assets/MPUIKit/Editor/Images/flip_v_0.png new file mode 100644 index 0000000..2d1e9ed --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/flip_v_0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5903fd1e4162e980c4b3c7eec48b5ba14af00e4f73b91e6323b2e5195873ac22 +size 1196 diff --git a/Assets/MPUIKit/Editor/Images/flip_v_0.png.meta b/Assets/MPUIKit/Editor/Images/flip_v_0.png.meta new file mode 100644 index 0000000..aba7ad3 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/flip_v_0.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 433dc7f6ca55dda4aaed66f61ded97e0 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + 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: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/flip_v_1.png b/Assets/MPUIKit/Editor/Images/flip_v_1.png new file mode 100644 index 0000000..0b7df9c --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/flip_v_1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9418f47980d1875feb0399046a3eb2c67966e6b57b1c397434db2cbb0d5ca963 +size 1194 diff --git a/Assets/MPUIKit/Editor/Images/flip_v_1.png.meta b/Assets/MPUIKit/Editor/Images/flip_v_1.png.meta new file mode 100644 index 0000000..c6c7e59 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/flip_v_1.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 55d0889b3d34fd643bddd75020104564 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + 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: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/flip_v_2.png b/Assets/MPUIKit/Editor/Images/flip_v_2.png new file mode 100644 index 0000000..7ba8346 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/flip_v_2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:885b8f4bfbdcc39ee0c70955d17a3c0f5039394a0372752adeabc76d95374593 +size 1497 diff --git a/Assets/MPUIKit/Editor/Images/flip_v_2.png.meta b/Assets/MPUIKit/Editor/Images/flip_v_2.png.meta new file mode 100644 index 0000000..7f299b3 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/flip_v_2.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 4df45fbb9245e5d41bc81708f0e99416 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + 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: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/flip_v_3.png b/Assets/MPUIKit/Editor/Images/flip_v_3.png new file mode 100644 index 0000000..16752ef --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/flip_v_3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d50b746f32c3eafaf527472874d15e1d04264988a84d7f11fbd201042369395 +size 1129 diff --git a/Assets/MPUIKit/Editor/Images/flip_v_3.png.meta b/Assets/MPUIKit/Editor/Images/flip_v_3.png.meta new file mode 100644 index 0000000..2a20600 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/flip_v_3.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 7179a1b48ada8c44b9223fdcbf5b672c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + 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: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/logo.png b/Assets/MPUIKit/Editor/Images/logo.png new file mode 100644 index 0000000..435cef5 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/logo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a63ae7cffcf6fb396df0d9937885241585ddc17b800cf1b35203116c1d58860 +size 9823 diff --git a/Assets/MPUIKit/Editor/Images/logo.png.meta b/Assets/MPUIKit/Editor/Images/logo.png.meta new file mode 100644 index 0000000..a4993f2 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/logo.png.meta @@ -0,0 +1,112 @@ +fileFormatVersion: 2 +guid: ed7c0349ea442c7468846ed9a15d6767 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + 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: 2 + 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: 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: [] + bones: [] + spriteID: 5de6378f08e8b374dbe5fa7e4a3e4308 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/rotate_left_0.png b/Assets/MPUIKit/Editor/Images/rotate_left_0.png new file mode 100644 index 0000000..5eeaa2b --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/rotate_left_0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f55574aed937639da9491a32bfd64810e75a2a1d94c595996e75bc15b6f292c6 +size 815 diff --git a/Assets/MPUIKit/Editor/Images/rotate_left_0.png.meta b/Assets/MPUIKit/Editor/Images/rotate_left_0.png.meta new file mode 100644 index 0000000..41e89f1 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/rotate_left_0.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 2d1f072a775a3ce4091efc83457078c1 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + 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: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/rotate_left_1.png b/Assets/MPUIKit/Editor/Images/rotate_left_1.png new file mode 100644 index 0000000..2fc5228 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/rotate_left_1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d270220ab79743b65686ac8a5e926dec8425671bdd1303443a87be090eb11485 +size 814 diff --git a/Assets/MPUIKit/Editor/Images/rotate_left_1.png.meta b/Assets/MPUIKit/Editor/Images/rotate_left_1.png.meta new file mode 100644 index 0000000..19d8be6 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/rotate_left_1.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: b8059e7446805dd40b70642e58f171db +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + 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: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/rotate_left_2.png b/Assets/MPUIKit/Editor/Images/rotate_left_2.png new file mode 100644 index 0000000..c6075ca --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/rotate_left_2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84d6f55647d3642e2837d945f1b58f7b564d1aea415669dbc5acdfbc48f313f8 +size 819 diff --git a/Assets/MPUIKit/Editor/Images/rotate_left_2.png.meta b/Assets/MPUIKit/Editor/Images/rotate_left_2.png.meta new file mode 100644 index 0000000..5ad853c --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/rotate_left_2.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 0d26fbf225e256240bb774a29d43c174 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + 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: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/rotate_left_3.png b/Assets/MPUIKit/Editor/Images/rotate_left_3.png new file mode 100644 index 0000000..bb7d3a2 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/rotate_left_3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb6af7d896c84bf46450df594be0dcd2e1cb758510354c7dec81700ac5ebd026 +size 804 diff --git a/Assets/MPUIKit/Editor/Images/rotate_left_3.png.meta b/Assets/MPUIKit/Editor/Images/rotate_left_3.png.meta new file mode 100644 index 0000000..061fbfb --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/rotate_left_3.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 3d59d8c1ca0ebeb4ba5322f57f3a1cbf +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + 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: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/rotate_right_0.png b/Assets/MPUIKit/Editor/Images/rotate_right_0.png new file mode 100644 index 0000000..624776b --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/rotate_right_0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a322dfba34129dfc7f6dd554c8aee4c998c0cff44e3064f99e0beeb3f28f0ae7 +size 818 diff --git a/Assets/MPUIKit/Editor/Images/rotate_right_0.png.meta b/Assets/MPUIKit/Editor/Images/rotate_right_0.png.meta new file mode 100644 index 0000000..6befbb3 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/rotate_right_0.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 5b159abd08591a44da0189ddd60f268c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + 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: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/rotate_right_1.png b/Assets/MPUIKit/Editor/Images/rotate_right_1.png new file mode 100644 index 0000000..3749544 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/rotate_right_1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8605d8cac11e7576b1636b52502002962046d1c74501b928f9cc935128bd0fc5 +size 814 diff --git a/Assets/MPUIKit/Editor/Images/rotate_right_1.png.meta b/Assets/MPUIKit/Editor/Images/rotate_right_1.png.meta new file mode 100644 index 0000000..1a3681a --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/rotate_right_1.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 8c982da53e6cb914388752101293948a +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + 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: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/rotate_right_2.png b/Assets/MPUIKit/Editor/Images/rotate_right_2.png new file mode 100644 index 0000000..dde33ae --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/rotate_right_2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:625eecc52a76fa823c9878277db155d24cacd4ff153841e99e52d6f43ebd11b3 +size 821 diff --git a/Assets/MPUIKit/Editor/Images/rotate_right_2.png.meta b/Assets/MPUIKit/Editor/Images/rotate_right_2.png.meta new file mode 100644 index 0000000..efe8173 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/rotate_right_2.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 691588d46541ae24fb0e81b16fdee53a +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + 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: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/rotate_right_3.png b/Assets/MPUIKit/Editor/Images/rotate_right_3.png new file mode 100644 index 0000000..a50ea47 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/rotate_right_3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d80c8af5554adfff8b7b43e1eae8610301bea6cc6ea5ac45c4f90ca365b05def +size 796 diff --git a/Assets/MPUIKit/Editor/Images/rotate_right_3.png.meta b/Assets/MPUIKit/Editor/Images/rotate_right_3.png.meta new file mode 100644 index 0000000..fd38eeb --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/rotate_right_3.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 68519222aeac862479f7ef5cc8c995cd +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + 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: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Images/title.png b/Assets/MPUIKit/Editor/Images/title.png new file mode 100644 index 0000000..1fceae0 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/title.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28d119b2c716524a914a377820f50f45b040c2da9aa8705b447821dfacdaa0e2 +size 32072 diff --git a/Assets/MPUIKit/Editor/Images/title.png.meta b/Assets/MPUIKit/Editor/Images/title.png.meta new file mode 100644 index 0000000..af602b1 --- /dev/null +++ b/Assets/MPUIKit/Editor/Images/title.png.meta @@ -0,0 +1,112 @@ +fileFormatVersion: 2 +guid: a2dcf70d1c4d4c4428dfb453aadfc4dc +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + 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: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 1024 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 1024 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 1024 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: c5805dcd91ec2754381bd5945014a5ef + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/MPUIKit.Editor.asmdef b/Assets/MPUIKit/Editor/MPUIKit.Editor.asmdef new file mode 100644 index 0000000..6321ca6 --- /dev/null +++ b/Assets/MPUIKit/Editor/MPUIKit.Editor.asmdef @@ -0,0 +1,17 @@ +{ + "name": "MPUIKit.Editor", + "references": [ + "GUID:5b70f83da6937434491f26e0fd0cd099" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/MPUIKit.Editor.asmdef.meta b/Assets/MPUIKit/Editor/MPUIKit.Editor.asmdef.meta new file mode 100644 index 0000000..2dca663 --- /dev/null +++ b/Assets/MPUIKit/Editor/MPUIKit.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 64c50969ba90b4463bb322f2967096a1 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Scripts.meta b/Assets/MPUIKit/Editor/Scripts.meta new file mode 100644 index 0000000..222290d --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: da5bb45cfcea53d46a0e1d8eadb2dec3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Scripts/EditorGUILayoutExtended.cs b/Assets/MPUIKit/Editor/Scripts/EditorGUILayoutExtended.cs new file mode 100644 index 0000000..430a12a --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/EditorGUILayoutExtended.cs @@ -0,0 +1,70 @@ +using System; +using System.Reflection; +using UnityEditor; +using UnityEngine; + +namespace MPUIKIT.Editor +{ + public class EditorGUILayoutExtended : UnityEditor.Editor + { + private static readonly Type editorGUIType = typeof(EditorGUI); + + private static readonly Type RecycledTextEditorType = + Assembly.GetAssembly(editorGUIType).GetType("UnityEditor.EditorGUI+RecycledTextEditor"); + + private static readonly Type[] argumentTypes = + { + RecycledTextEditorType, typeof(Rect), typeof(Rect), typeof(int), typeof(float), typeof(string), + typeof(GUIStyle), typeof(bool) + }; + + private static readonly MethodInfo doFloatFieldMethod = editorGUIType.GetMethod("DoFloatField", + BindingFlags.NonPublic | BindingFlags.Static, null, argumentTypes, null); + + private static readonly FieldInfo fieldInfo = + editorGUIType.GetField("s_RecycledEditor", BindingFlags.NonPublic | BindingFlags.Static); + + private static readonly object recycledEditor = fieldInfo.GetValue(null); + private static readonly GUIStyle style = EditorStyles.numberField; + + public static float FloatFieldExtended(Rect _position, float _value, Rect _dragHotZone) + { + int controlId = GUIUtility.GetControlID("EditorTextField".GetHashCode(), FocusType.Keyboard, _position); + object[] parameters = {recycledEditor, _position, _dragHotZone, controlId, _value, "g7", style, true}; + return (float) doFloatFieldMethod.Invoke(null, parameters); + } + +// public static float FloatField(GUIContent _content, float _value, float _inputBoxWidth, params GUILayoutOption[] _options) +// { +// Rect totalRect = EditorGUILayout.GetControlRect(_options); +// float width; +// if (_inputBoxWidth < 1) width = totalRect.width * Mathf.Clamp(_inputBoxWidth, 0.2f, 0.8f); +// else width = Mathf.Clamp(_inputBoxWidth, totalRect.width * 0.2f, totalRect.width * 0.8f); +// Rect labelRect = new Rect(totalRect.x, totalRect.y, totalRect.width - width - 8, totalRect.height); +// Rect inputRect = new Rect(totalRect.x + totalRect.width - width, totalRect.y, width, totalRect.height); +// +// EditorGUI.LabelField(labelRect, _content); +// return FloatFieldExtended(inputRect, _value, labelRect); +// } + + public static float FloatField(GUIContent _content, float _value, float _labelwidth, + params GUILayoutOption[] _options) + { + Rect totalRect = EditorGUILayout.GetControlRect(_options); +// float width; +// if (_labelwidth < 1) width = totalRect.width * Mathf.Clamp(_labelwidth, 0.2f, 0.8f); +// else width = Mathf.Clamp(_labelwidth, totalRect.width * 0.2f, totalRect.width * 0.8f); + + Rect labelRect = new Rect(totalRect.x, totalRect.y, _labelwidth, totalRect.height); + Rect inputRect = new Rect(totalRect.x + _labelwidth, totalRect.y, totalRect.width - _labelwidth, + totalRect.height); + +// Rect labelRect = new Rect(totalRect.x, totalRect.y, totalRect.width - width - 8, totalRect.height); +// Rect inputRect = new Rect(totalRect.x + totalRect.width - width, totalRect.y, width, totalRect.height); + + EditorGUI.LabelField(labelRect, _content); + return FloatFieldExtended(inputRect, _value, labelRect); + } + + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/EditorGUILayoutExtended.cs.meta b/Assets/MPUIKit/Editor/Scripts/EditorGUILayoutExtended.cs.meta new file mode 100644 index 0000000..80a6974 --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/EditorGUILayoutExtended.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6578e090f4183b34f8420ebe855dce58 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Scripts/EffectDrawers.meta b/Assets/MPUIKit/Editor/Scripts/EffectDrawers.meta new file mode 100644 index 0000000..4ac6466 --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/EffectDrawers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2954915c9a2e49da8fba55e1a2a62a89 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Scripts/EffectDrawers/GradeintEffectPropertyDrawer.cs b/Assets/MPUIKit/Editor/Scripts/EffectDrawers/GradeintEffectPropertyDrawer.cs new file mode 100644 index 0000000..34ec6d2 --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/EffectDrawers/GradeintEffectPropertyDrawer.cs @@ -0,0 +1,89 @@ +using UnityEditor; +using UnityEngine; + +namespace MPUIKIT.Editor { + [CustomPropertyDrawer(typeof(GradientEffect))] + public class GradeintEffectPropertyDrawer : PropertyDrawer { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { + EditorGUI.BeginProperty(position, label, property); + { + SerializedProperty Enabled = property.FindPropertyRelative("m_Enabled"); + bool enabled = Enabled.boolValue; + SerializedProperty gradientType = property.FindPropertyRelative("m_GradientType"); + GradientType gradType = (GradientType) gradientType.enumValueIndex; + SerializedProperty gradient = property.FindPropertyRelative("m_Gradient"); + SerializedProperty rotation = property.FindPropertyRelative("m_Rotation"); + SerializedProperty cornerColors = property.FindPropertyRelative("m_CornerGradientColors"); + + Rect line = position; + line.height = EditorGUIUtility.singleLineHeight; + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = Enabled.hasMultipleDifferentValues; + enabled = EditorGUI.Toggle(line, "Gradient", enabled); + EditorGUI.showMixedValue = false; + + if (enabled) { + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + + EditorGUI.showMixedValue = gradientType.hasMultipleDifferentValues; + gradType = (GradientType) EditorGUI.EnumPopup(line, "Type", gradType); + EditorGUI.showMixedValue = false; + } + } + if (EditorGUI.EndChangeCheck()) { + Enabled.boolValue = enabled; + gradientType.enumValueIndex = (int) gradType; + } + + if (enabled) { + if (gradType == GradientType.Corner) { + + if (cornerColors.arraySize != 4) + cornerColors.arraySize = 4; + + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + float colFieldWidth = line.width / 2f - 5f; + line.width = colFieldWidth; + EditorGUI.PropertyField(line, cornerColors.GetArrayElementAtIndex(0), GUIContent.none); + line.x += colFieldWidth + 10; + EditorGUI.PropertyField(line, cornerColors.GetArrayElementAtIndex(1), GUIContent.none); + line.x -= colFieldWidth + 10; + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + EditorGUI.PropertyField(line, cornerColors.GetArrayElementAtIndex(2), GUIContent.none); + line.x += colFieldWidth + 10; + EditorGUI.PropertyField(line, cornerColors.GetArrayElementAtIndex(3), GUIContent.none); + line.x -= colFieldWidth + 10; + line.width = colFieldWidth * 2 + 10; + } + else { + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + EditorGUI.showMixedValue = gradient.hasMultipleDifferentValues; + EditorGUI.PropertyField(line, gradient, false); + + if (gradType == GradientType.Linear) { + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + EditorGUI.showMixedValue = rotation.hasMultipleDifferentValues; + EditorGUI.PropertyField(line, rotation, new GUIContent("Rotation")); + } + + EditorGUI.showMixedValue = false; + } + } + } + EditorGUI.EndProperty(); + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { + SerializedProperty enabled = property.FindPropertyRelative("m_Enabled"); + if (enabled.boolValue) { + SerializedProperty gradientMode = property.FindPropertyRelative("m_GradientType"); + if (gradientMode.enumValueIndex == (int) GradientType.Radial) { + return EditorGUIUtility.singleLineHeight * 3 + EditorGUIUtility.standardVerticalSpacing * 2; + } + return EditorGUIUtility.singleLineHeight * 4 + EditorGUIUtility.standardVerticalSpacing * 3; + } + return EditorGUIUtility.singleLineHeight; + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/EffectDrawers/GradeintEffectPropertyDrawer.cs.meta b/Assets/MPUIKit/Editor/Scripts/EffectDrawers/GradeintEffectPropertyDrawer.cs.meta new file mode 100644 index 0000000..c273ca2 --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/EffectDrawers/GradeintEffectPropertyDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 242b08f96b7b1b549b6a19a05267d72d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Scripts/MPEditorContents.cs b/Assets/MPUIKit/Editor/Scripts/MPEditorContents.cs new file mode 100644 index 0000000..0b20207 --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/MPEditorContents.cs @@ -0,0 +1,129 @@ +using System.IO; +using UnityEditor; +using UnityEngine; + +namespace MPUIKIT.Editor { + [InitializeOnLoad] + internal static class MPEditorContents { + private static string _mpuiKitImagesDirectory = string.Empty; + + private static GUIContent _flipHorizontalNormal, _flipHorizontalActive; + private static GUIContent _flipVerticalNormal, _flipVerticalActive; + + private static GUIContent _rotateLeftNormal, _rotateLeftActive; + private static GUIContent _rotateRightNormal, _rotateRightActive; + + private static Texture2D _logo, _background, _title; + + public static GUIContent FlipHorizontalNormal { + get { + if (_flipHorizontalNormal != null) return _flipHorizontalNormal; + _flipHorizontalNormal = new GUIContent(LoadImage("flip_h", false)); + return _flipHorizontalNormal; + } + } + + public static GUIContent FlipHorizontalActive { + get { + if (_flipHorizontalActive != null) return _flipHorizontalActive; + _flipHorizontalActive = new GUIContent(LoadImage("flip_h", true)); + return _flipHorizontalActive; + } + } + + public static GUIContent FlipVerticalNormal { + get { + if (_flipVerticalNormal != null) return _flipVerticalNormal; + _flipVerticalNormal = new GUIContent(LoadImage("flip_v", false)); + return _flipVerticalNormal; + } + } + + public static GUIContent FlipVerticalActive { + get { + if (_flipVerticalActive != null) return _flipVerticalActive; + _flipVerticalActive = new GUIContent(LoadImage("flip_v", true)); + return _flipVerticalActive; + } + } + + public static GUIContent RotateLeftNormal { + get { + if (_rotateLeftNormal != null) return _rotateLeftNormal; + _rotateLeftNormal = new GUIContent(LoadImage("rotate_left", false)); + return _rotateLeftNormal; + } + } + + public static GUIContent RotateLeftActive { + get { + if (_rotateLeftActive != null) return _rotateLeftActive; + _rotateLeftActive = new GUIContent(LoadImage("rotate_left", true)); + return _rotateLeftActive; + } + } + + public static GUIContent RotateRightNormal { + get { + if (_rotateRightNormal != null) return _rotateRightNormal; + _rotateRightNormal = new GUIContent(LoadImage("rotate_right", false)); + return _rotateRightNormal; + } + } + + public static GUIContent RotateRightActive { + get { + if (_rotateRightActive != null) return _rotateRightActive; + _rotateRightActive = new GUIContent(LoadImage("rotate_right", true)); + return _rotateRightActive; + } + } + + public static Texture Logo { + get { + if (_logo != null) return _logo; + _logo = LoadImage("logo", false, true); + return _logo; + } + } + + public static Texture Background { + get { + if (_background != null) return _background; + _background = LoadImage("background", false, true); + return _background; + } + } + + public static Texture Title { + get { + if (_title != null) return _title; + _title = LoadImage("title", false, true); + return _title; + } + } + + static MPEditorContents() { + FindMpuiKitIconsDirectory(); + } + + private static void FindMpuiKitIconsDirectory() + { + string rootDir = MPEditorUtility.FindMPUIKitRootDirectory(); + _mpuiKitImagesDirectory = string.IsNullOrEmpty(rootDir) ? string.Empty : Path.Combine(rootDir, "Editor", "Images"); + } + + private static Texture2D LoadImage(string name, bool activeState, bool ignoreState = false) { + int colorLevel = 0; + if (!ignoreState) { + if (activeState) colorLevel = 3; + else colorLevel = EditorGUIUtility.isProSkin ? 2 : 1; + } + + if (_mpuiKitImagesDirectory == string.Empty) FindMpuiKitIconsDirectory(); + + string assetPath = $"{_mpuiKitImagesDirectory}{Path.DirectorySeparatorChar}{name}{(ignoreState ? string.Empty : $"_{colorLevel}")}.png"; + return AssetDatabase.LoadAssetAtPath(assetPath, typeof(Texture2D)) as Texture2D; + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/MPEditorContents.cs.meta b/Assets/MPUIKit/Editor/Scripts/MPEditorContents.cs.meta new file mode 100644 index 0000000..cfd59b5 --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/MPEditorContents.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a6f9388f4adce440beef499dd64fba1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Scripts/MPEditorUtility.cs b/Assets/MPUIKit/Editor/Scripts/MPEditorUtility.cs new file mode 100644 index 0000000..f7e9731 --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/MPEditorUtility.cs @@ -0,0 +1,171 @@ +using System; +using System.IO; +using System.Linq; +using System.Text; +using UnityEditor; +using UnityEditor.SceneManagement; +using UnityEngine; +using UnityEngine.UI; +using Object = UnityEngine.Object; + +namespace MPUIKIT.Editor { + public static class MPEditorUtility { + [MenuItem("GameObject/UI/MPImage")] + public static void AddMPImageObject() { + GameObject g = new GameObject {name = "MPImage"}; + + Transform parent = GetParentTransform(); + g.transform.SetParent(parent, false); + g.AddComponent(); + Selection.activeGameObject = g; + + Undo.RegisterCreatedObjectUndo(g, "MPImage Created"); + EditorUtility.SetDirty(g); + } + + [MenuItem("GameObject/UI/MPImage Basic")] + public static void AddMPImageBasicObject() { + GameObject g = new GameObject {name = "MPImageBasic"}; + Transform parent = GetParentTransform(); + g.transform.SetParent(parent, false); + g.AddComponent(); + Selection.activeGameObject = g; + + Undo.RegisterCreatedObjectUndo(g, "MPImage Basic Created"); + EditorUtility.SetDirty(g); + } + + private static Transform GetParentTransform() + { + Transform parent; + if (Selection.activeGameObject != null && + Selection.activeGameObject.GetComponentInParent() != null) + { + parent = Selection.activeGameObject.transform; + } + else + { + Canvas c = GetCanvas(); + AddAdditionalShaderChannelsToCanvas(c); + parent = c.transform; + } + + return parent; + } + + private static Canvas GetCanvas() + { + StageHandle handle = StageUtility.GetCurrentStageHandle(); + if (!handle.FindComponentOfType()) + { + EditorApplication.ExecuteMenuItem("GameObject/UI/Canvas"); + } + + Canvas c = handle.FindComponentOfType(); + return c; + } + + [MenuItem("CONTEXT/Image/Replace with MPImage")] + public static void ReplaceWithMPImage(MenuCommand command) { + if(command.context is MPImage) return; + if (command.context is MPImageBasic) { + // Convert MPImageBasic to MPImage + MPImageBasic img = (MPImageBasic) command.context; + GameObject obj = img.gameObject; + Object.DestroyImmediate(img); + obj.AddComponent(); + EditorUtility.SetDirty(obj); + } + else { + Image img = (Image) command.context; + GameObject obj = img.gameObject; + Object.DestroyImmediate(img); + obj.AddComponent(); + EditorUtility.SetDirty(obj); + } + + } + + [MenuItem("CONTEXT/Image/Replace with MPImage Basic")] + public static void ReplaceWithMPImageBasic(MenuCommand command) { + if(command.context is MPImageBasic) return; + if (command.context is MPImage) { + // Convert MPImage to MPImageBasic + MPImage img = (MPImage) command.context; + GameObject obj = img.gameObject; + Object.DestroyImmediate(img); + obj.AddComponent(); + EditorUtility.SetDirty(obj); + } + else { + Image img = (Image) command.context; + GameObject obj = img.gameObject; + Object.DestroyImmediate(img); + obj.AddComponent(); + EditorUtility.SetDirty(obj); + } + } + + internal static void AddAdditionalShaderChannelsToCanvas(Canvas c) { + AdditionalCanvasShaderChannels additionalShaderChannels = c.additionalShaderChannels; + additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord1; + additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord2; + c.additionalShaderChannels = additionalShaderChannels; + } + + internal static bool HasAdditionalShaderChannels(Canvas c) { + AdditionalCanvasShaderChannels asc = c.additionalShaderChannels; + return (asc & AdditionalCanvasShaderChannels.TexCoord1) != 0 && + (asc & AdditionalCanvasShaderChannels.TexCoord2) != 0; + } + + public static void CornerRadiusModeGUI(Rect rect, ref SerializedProperty property, string[] toolBarHeading, + string label = "Corner Radius") { + bool boolVal = property.boolValue; + Rect labelRect = new Rect(rect.x, rect.y, EditorGUIUtility.labelWidth, rect.height); + Rect toolBarRect = new Rect(rect.x + EditorGUIUtility.labelWidth, rect.y, + rect.width - EditorGUIUtility.labelWidth, rect.height); + + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = property.hasMultipleDifferentValues; + EditorGUI.LabelField(labelRect, label); + + boolVal = GUI.Toolbar(toolBarRect, boolVal ? 1 : 0, toolBarHeading) == 1; + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) { + property.boolValue = boolVal; + } + } + + private static Sprite _emptySprite; + + internal static Sprite EmptySprite { + get { + if (_emptySprite == null) { + _emptySprite = Resources.Load("mpui_default_empty_sprite"); + } + + return _emptySprite; + } + } + + internal static string FindMPUIKitRootDirectory() + { + string guid = AssetDatabase.FindAssets("MPImage t:Shader").FirstOrDefault(); + string path = AssetDatabase.GUIDToAssetPath(guid); + if(string.IsNullOrEmpty(path)) return String.Empty; + string[] directories = path.Split(new[] {Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar}); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < directories.Length; i++) + { + sb.Append(directories[i]); + sb.Append(Path.DirectorySeparatorChar); + if(directories[i].Equals("MPUIKit", StringComparison.OrdinalIgnoreCase)) + break; + } + return sb.ToString(); + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/MPEditorUtility.cs.meta b/Assets/MPUIKit/Editor/Scripts/MPEditorUtility.cs.meta new file mode 100644 index 0000000..2f8350f --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/MPEditorUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e892ccdb916743d79dc89600b5d4ce61 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Scripts/MPImageBasicEditor.cs b/Assets/MPUIKit/Editor/Scripts/MPImageBasicEditor.cs new file mode 100644 index 0000000..3a5e707 --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/MPImageBasicEditor.cs @@ -0,0 +1,528 @@ +using System; +using UnityEngine; +using UnityEditor; +using UnityEngine.UI; +using UnityEditor.UI; + + +namespace MPUIKIT.Editor { + [CustomEditor(typeof(MPImageBasic))] + public class MPImageBasicEditor : ImageEditor { + private SerializedProperty spSprite; + + private SerializedProperty spCircleRadius, spCircleFitToRect; + private SerializedProperty spTriangleCornerRadius, spTriangleUniformCornerRadius; + private SerializedProperty spRectangleCornerRadius, spRectangleUniformCornerRadius; + private SerializedProperty spNStarPolygonSideCount, spNStarPolygonInset, spNStarPolygonCornerRadius; + + private SerializedProperty spPreserveAspect; + private SerializedProperty spFillMethod, spFillOrigin, spFillAmount, spFillClockwise; + private SerializedProperty spShape; + private SerializedProperty spStrokeWidth, spOutlineWidth, spOutlineColor, spFalloffDistance; + private SerializedProperty spConstrainRotation, spShapeRotation, spFlipHorizontal, spFlipVertical; + private SerializedProperty spImageType; + + protected override void OnEnable() { + base.OnEnable(); + + spSprite = serializedObject.FindProperty("m_Sprite"); + + spShape = serializedObject.FindProperty("m_DrawShape"); + + spStrokeWidth = serializedObject.FindProperty("m_StrokeWidth"); + spOutlineWidth = serializedObject.FindProperty("m_OutlineWidth"); + spOutlineColor = serializedObject.FindProperty("m_OutlineColor"); + spFalloffDistance = serializedObject.FindProperty("m_FalloffDistance"); + + spImageType = serializedObject.FindProperty("m_ImageType"); + + spFillMethod = serializedObject.FindProperty("m_FillMethod"); + spFillOrigin = serializedObject.FindProperty("m_FillOrigin"); + spFillAmount = serializedObject.FindProperty("m_FillAmount"); + spFillClockwise = serializedObject.FindProperty("m_FillClockwise"); + + spConstrainRotation = serializedObject.FindProperty("m_ConstrainRotation"); + spShapeRotation = serializedObject.FindProperty("m_ShapeRotation"); + spFlipHorizontal = serializedObject.FindProperty("m_FlipHorizontal"); + spFlipVertical = serializedObject.FindProperty("m_FlipVertical"); + + + spCircleRadius = serializedObject.FindProperty("m_CircleRadius"); + spCircleFitToRect = serializedObject.FindProperty("m_CircleFitToRect"); + spTriangleCornerRadius = serializedObject.FindProperty("m_TriangleCornerRadius"); + spTriangleUniformCornerRadius = serializedObject.FindProperty("m_TriangleUniformCornerRadius"); + spRectangleCornerRadius = serializedObject.FindProperty("m_RectangleCornerRadius"); + spRectangleUniformCornerRadius = serializedObject.FindProperty("m_TriangleUniformCornerRadius"); + spNStarPolygonSideCount = serializedObject.FindProperty("m_NStarPolygonSideCount"); + spNStarPolygonInset = serializedObject.FindProperty("m_NStarPolygonInset"); + spNStarPolygonCornerRadius = serializedObject.FindProperty("m_NStarPolygonCornerRadius"); + + spPreserveAspect = serializedObject.FindProperty("m_PreserveAspect"); + } + + public override void OnInspectorGUI() { + serializedObject.Update(); + + RaycastControlsGUI(); + EditorGUILayout.PropertyField(m_Color); + EditorGUILayout.Space(); + Rect shapePopupRect = EditorGUILayout.GetControlRect(); + DrawShapeBasic selectedIndex = (DrawShapeBasic) spShape.enumValueIndex; + if (selectedIndex == (DrawShapeBasic) DrawShape.Pentagon || selectedIndex == (DrawShapeBasic) DrawShape.Hexagon) + { + selectedIndex = (DrawShapeBasic) DrawShape.None; + spShape.enumValueIndex = (int) selectedIndex; + } + + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = spShape.hasMultipleDifferentValues; + selectedIndex = (DrawShapeBasic) EditorGUI.EnumPopup(shapePopupRect, "Draw Shape", selectedIndex); + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) + { + spShape.enumValueIndex = (int) selectedIndex; + } + + if (spShape.enumValueIndex != (int) DrawShape.None && !spShape.hasMultipleDifferentValues) { + EditorGUILayout.BeginVertical("Box"); + if (!spShape.hasMultipleDifferentValues) { + switch ((DrawShape) spShape.enumValueIndex) { + case DrawShape.Circle: + CircleGUI(); + break; + case DrawShape.Rectangle: + RectangleGUI(); + break; + case DrawShape.Triangle: + TriangleGUI(); + break; + case DrawShape.NStarPolygon: + NStarPolygonGUI(); + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + + EditorGUILayout.Space(); + + if (spShape.enumValueIndex != (int) DrawShape.None) { + AdditionalShapeDataGUI(); + } + + EditorGUILayout.EndVertical(); + } + + + + EditorGUILayout.Space(); + ImageTypeGUI(); + + SpriteGUI(); + + if (!spSprite.hasMultipleDifferentValues && spSprite.objectReferenceValue != null) { + EditorGUILayout.PropertyField(spPreserveAspect); + } + + SetShowNativeSize(spSprite.objectReferenceValue != null, true); + NativeSizeButtonGUI(); + + EditorGUILayout.Space(); + + serializedObject.ApplyModifiedProperties(); + } + + private void NStarPolygonGUI() { + spNStarPolygonSideCount.intValue = + EditorGUILayout.IntSlider("Side Count", spNStarPolygonSideCount.intValue, 3, 10); + spNStarPolygonInset.floatValue = + EditorGUILayout.Slider("Inset", spNStarPolygonInset.floatValue, 2f, + spNStarPolygonSideCount.intValue - 0.1f); + spNStarPolygonCornerRadius.floatValue = + EditorGUILayout.FloatField("Corner Radius", spNStarPolygonCornerRadius.floatValue); + + } + + private void CircleGUI() { + EditorGUI.BeginDisabledGroup(spCircleFitToRect.boolValue); + EditorGUILayout.PropertyField(spCircleRadius, new GUIContent("Radius")); + EditorGUI.EndDisabledGroup(); + Rect rect = EditorGUILayout.GetControlRect(); + MPEditorUtility.CornerRadiusModeGUI(rect, ref spCircleFitToRect, new[] {"Free", "Fit"}, String.Empty); + } + + private void RectangleGUI() { + Rect rect = EditorGUILayout.GetControlRect(true, EditorGUIUtility.singleLineHeight); + MPEditorUtility.CornerRadiusModeGUI(rect, ref spRectangleUniformCornerRadius, new[] {"Free", "Uniform"}); + + Vector4 vectorValue = spRectangleCornerRadius.vector4Value; + float floatVal = vectorValue.x; + + float[] zw = new[] {vectorValue.w, vectorValue.z}; + float[] xy = new[] {vectorValue.x, vectorValue.y}; + + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = spRectangleCornerRadius.hasMultipleDifferentValues; + if (spRectangleUniformCornerRadius.boolValue) { + floatVal = EditorGUILayout.FloatField("Uniform Radius", floatVal); + } + else { + rect = EditorGUILayout.GetControlRect(true, + EditorGUIUtility.standardVerticalSpacing + EditorGUIUtility.singleLineHeight * 2); + Rect RadiusVectorRect = new Rect(rect.x, rect.y, + rect.width, EditorGUIUtility.singleLineHeight); + + EditorGUI.MultiFloatField(RadiusVectorRect, new[] { + new GUIContent("W"), new GUIContent("Z") + }, zw); + RadiusVectorRect.y += + EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + EditorGUI.MultiFloatField(RadiusVectorRect, new[] { + new GUIContent("X "), new GUIContent("Y") + }, xy); + } + + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) { + spRectangleCornerRadius.vector4Value = spRectangleUniformCornerRadius.boolValue + ? new Vector4(floatVal, floatVal, floatVal, floatVal) + : new Vector4(xy[0], xy[1], zw[1], zw[0]); + } + } + + private void TriangleGUI() { + Rect rect = EditorGUILayout.GetControlRect(true, EditorGUIUtility.singleLineHeight); + MPEditorUtility.CornerRadiusModeGUI(rect, ref spTriangleUniformCornerRadius, new[] {"Free", "Uniform"}); + + Vector3 vectorValue = spTriangleCornerRadius.vector3Value; + float floatVal = vectorValue.x; + + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = spTriangleCornerRadius.hasMultipleDifferentValues; + if (spTriangleUniformCornerRadius.boolValue) { + floatVal = EditorGUILayout.FloatField("Uniform Radius", floatVal); + } + else { + vectorValue = EditorGUILayout.Vector3Field("", vectorValue); + } + + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) { + spTriangleCornerRadius.vector3Value = spTriangleUniformCornerRadius.boolValue + ? new Vector3(floatVal, floatVal, floatVal) + : vectorValue; + } + } + + private void AdditionalShapeDataGUI() { + EditorGUILayout.Space(); + + float strokeWidth = spStrokeWidth.floatValue; + float outlineWidth = spOutlineWidth.floatValue; + float falloff = spFalloffDistance.floatValue; + Color outlineColor = spOutlineColor.colorValue; + + Rect r = EditorGUILayout.GetControlRect(true, + EditorGUIUtility.singleLineHeight * 2 + EditorGUIUtility.standardVerticalSpacing); + Rect line = r; + line.height = EditorGUIUtility.singleLineHeight; + float x = (line.width - 10f) / 2; + + float fieldWidth = x / 2 - 10f; + float labelWidth = x - fieldWidth; + + line.width = labelWidth; + EditorGUI.LabelField(line, "Stroke"); + Rect dragZone = line; + line.x += labelWidth; + line.width = fieldWidth; + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = spStrokeWidth.hasMultipleDifferentValues; + strokeWidth = + EditorGUILayoutExtended.FloatFieldExtended(line, spStrokeWidth.floatValue, dragZone); + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) { + spStrokeWidth.floatValue = strokeWidth; + } + + line.x += fieldWidth + 10; + line.width = labelWidth; + EditorGUI.LabelField(line, "Falloff"); + dragZone = line; + line.x += labelWidth; + line.width = fieldWidth; + + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = spFalloffDistance.hasMultipleDifferentValues; + falloff = + EditorGUILayoutExtended.FloatFieldExtended(line, spFalloffDistance.floatValue, dragZone); + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) { + spFalloffDistance.floatValue = falloff; + } + + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + line.x = r.x; + line.width = labelWidth; + EditorGUI.LabelField(line, "Outline Width"); + dragZone = line; + line.x += labelWidth; + line.width = fieldWidth; + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = spOutlineWidth.hasMultipleDifferentValues; + outlineWidth = + EditorGUILayoutExtended.FloatFieldExtended(line, spOutlineWidth.floatValue, dragZone); + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) { + spOutlineWidth.floatValue = outlineWidth; + } + + line.x += fieldWidth + 10; + line.width = labelWidth; + EditorGUI.LabelField(line, "Outline Color"); + dragZone = line; + line.width = fieldWidth; + line.x += labelWidth; + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = spOutlineColor.hasMultipleDifferentValues; + outlineColor = EditorGUI.ColorField(line, spOutlineColor.colorValue); + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) { + spOutlineColor.colorValue = outlineColor; + } + + EditorGUILayout.Space(); + + RotationGUI(); + } + + private void RotationGUI() { + Rect r = EditorGUILayout.GetControlRect(true, + EditorGUIUtility.singleLineHeight + 24 + EditorGUIUtility.standardVerticalSpacing); + Rect line = r; + line.height = EditorGUIUtility.singleLineHeight; + float x = (line.width - 10f) / 2; + + float fieldWidth = x / 2 - 10f; + float labelWidth = x - fieldWidth; + + line.width = labelWidth; + EditorGUI.LabelField(line, "Rotation"); + line.x += labelWidth; + line.width = r.width - labelWidth - 78; + + string[] options = spConstrainRotation.hasMultipleDifferentValues + ? new[] {"---", "---"} + : new[] {"Free", "Constrained"}; + bool boolVal = spConstrainRotation.boolValue; + EditorGUI.BeginChangeCheck(); + { + boolVal = GUI.Toolbar(line, boolVal ? 1 : 0, options) == 1; + } + if (EditorGUI.EndChangeCheck()) { + spConstrainRotation.boolValue = boolVal; + GUI.FocusControl(null); + } + + line.x += line.width + 14; + line.width = 64; + EditorGUI.LabelField(line, "Flip"); + + line.y += EditorGUIUtility.standardVerticalSpacing + EditorGUIUtility.singleLineHeight; + line.x = r.x + 10; + line.height = EditorGUIUtility.singleLineHeight; + line.width = labelWidth - 10; + EditorGUI.BeginDisabledGroup(spConstrainRotation.boolValue); + { + Rect dragZone = line; + EditorGUI.LabelField(line, "Angle"); + line.x = r.x + labelWidth; + line.width = r.width - labelWidth - 148; + + float rotationValue = spShapeRotation.floatValue; + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = spShapeRotation.hasMultipleDifferentValues; + rotationValue = + EditorGUILayoutExtended.FloatFieldExtended(line, spShapeRotation.floatValue, dragZone); + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) { + spShapeRotation.floatValue = rotationValue; + } + } + EditorGUI.EndDisabledGroup(); + + EditorGUI.BeginDisabledGroup(!spConstrainRotation.boolValue); + { + line.x += line.width + 4; + line.width = 30; + line.height = 24; + if (GUI.Button(line, MPEditorContents.RotateLeftNormal)) { + float rotation = spShapeRotation.floatValue; + float remainder = rotation % 90; + if (Mathf.Abs(remainder) <= 0) { + rotation += 90; + } + else { + rotation = rotation - remainder + 90; + } + + if (Math.Abs(rotation) >= 360) rotation = 0; + spShapeRotation.floatValue = rotation; + } + + line.x += 34; + if (GUI.Button(line, MPEditorContents.RotateRightNormal)) { + float rotation = spShapeRotation.floatValue; + float remainder = rotation % 90; + if (Mathf.Abs(remainder) <= 0) { + rotation -= 90; + } + else { + rotation -= remainder; + } + + if (Math.Abs(rotation) >= 360) rotation = 0; + spShapeRotation.floatValue = rotation; + } + } + EditorGUI.EndDisabledGroup(); + + line.x += 46; + bool flipH = spFlipHorizontal.boolValue; + bool flipV = spFlipVertical.boolValue; + EditorGUI.BeginChangeCheck(); + { + EditorGUI.BeginDisabledGroup(spFlipHorizontal.hasMultipleDifferentValues || + spFlipVertical.hasMultipleDifferentValues); + flipH = GUI.Toggle(line, spFlipHorizontal.boolValue, + spFlipHorizontal.boolValue + ? MPEditorContents.FlipHorizontalActive + : MPEditorContents.FlipHorizontalNormal, "button"); + line.x += 34; + flipV = GUI.Toggle(line, spFlipVertical.boolValue, + spFlipVertical.boolValue + ? MPEditorContents.FlipVerticalActive + : MPEditorContents.FlipVerticalNormal, "button"); + EditorGUI.EndDisabledGroup(); + } + if (EditorGUI.EndChangeCheck()) { + spFlipHorizontal.boolValue = flipH; + spFlipVertical.boolValue = flipV; + } + + } + + private new void SpriteGUI() { + Sprite spriteRef = spSprite.objectReferenceValue as Sprite; + Sprite sprite = MPEditorUtility.EmptySprite.Equals(spriteRef) ? null : spriteRef; + + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = spSprite.hasMultipleDifferentValues; + sprite = EditorGUILayout.ObjectField("Sprite", sprite, typeof(Sprite), false, GUILayout.Height(EditorGUIUtility.singleLineHeight)) as Sprite; + + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) { + Sprite newSprite = sprite == null? MPEditorUtility.EmptySprite : sprite; + if (newSprite != null) { + Image.Type oldType = (Image.Type) spImageType.enumValueIndex; + if (newSprite.border.SqrMagnitude() > 0) { + spImageType.enumValueIndex = (int) Image.Type.Sliced; + } + else if (oldType == Image.Type.Sliced) { + spImageType.enumValueIndex = (int) Image.Type.Simple; + } + } + + spSprite.objectReferenceValue = newSprite; + (serializedObject.targetObject as Image)?.DisableSpriteOptimizations(); + } + EditorGUI.EndDisabledGroup(); + } + + private void ImageTypeGUI() { + int selectedIndex = spImageType.enumValueIndex == (int) Image.Type.Simple ? 0 : 1; + Rect imageTypeRect = EditorGUILayout.GetControlRect(); + EditorGUI.BeginChangeCheck(); + { + EditorGUI.LabelField( + new Rect(imageTypeRect.x, imageTypeRect.y, EditorGUIUtility.labelWidth, imageTypeRect.height), + "Type"); + imageTypeRect.x += EditorGUIUtility.labelWidth + 2; + imageTypeRect.width -= EditorGUIUtility.labelWidth + 2; + selectedIndex = EditorGUI.Popup(imageTypeRect, selectedIndex, new[] {"Simple", "Filled"}); + } + if (EditorGUI.EndChangeCheck()) { + spImageType.enumValueIndex = (int) (selectedIndex == 0 ? Image.Type.Simple : Image.Type.Filled); + } + + if (!spImageType.hasMultipleDifferentValues && spImageType.enumValueIndex == (int) Image.Type.Filled) { + ++EditorGUI.indentLevel; + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(spFillMethod); + if (EditorGUI.EndChangeCheck()) { + spFillOrigin.intValue = 0; + } + + switch ((Image.FillMethod) spFillMethod.enumValueIndex) { + case Image.FillMethod.Horizontal: + spFillOrigin.intValue = (int) (Image.OriginHorizontal) EditorGUILayout.EnumPopup("Fill Origin", + (Image.OriginHorizontal) spFillOrigin.intValue); + break; + case Image.FillMethod.Vertical: + spFillOrigin.intValue = (int) (Image.OriginVertical) EditorGUILayout.EnumPopup("Fill Origin", + (Image.OriginVertical) spFillOrigin.intValue); + break; + case Image.FillMethod.Radial90: + spFillOrigin.intValue = + (int) (Image.Origin90) EditorGUILayout.EnumPopup("Fill Origin", + (Image.Origin90) spFillOrigin.intValue); + break; + case Image.FillMethod.Radial180: + spFillOrigin.intValue = + (int) (Image.Origin180) EditorGUILayout.EnumPopup("Fill Origin", + (Image.Origin180) spFillOrigin.intValue); + break; + case Image.FillMethod.Radial360: + spFillOrigin.intValue = + (int) (Image.Origin360) EditorGUILayout.EnumPopup("Fill Origin", + (Image.Origin360) spFillOrigin.intValue); + break; + } + + EditorGUILayout.PropertyField(spFillAmount); + if ((Image.FillMethod) spFillMethod.enumValueIndex > Image.FillMethod.Vertical) { + EditorGUILayout.PropertyField(spFillClockwise, new GUIContent("Clockwise")); + } + + --EditorGUI.indentLevel; + } + } + private enum DrawShapeBasic + { + None = 0, + Circle = 1, + Triangle = 2, + Rectangle = 3, + NStarPolygon = 6 + } + } + +} \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/MPImageBasicEditor.cs.meta b/Assets/MPUIKit/Editor/Scripts/MPImageBasicEditor.cs.meta new file mode 100644 index 0000000..fff9633 --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/MPImageBasicEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f33e7dc5ed3a5604f86b7d66c008e468 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Scripts/MPImageEditor.cs b/Assets/MPUIKit/Editor/Scripts/MPImageEditor.cs new file mode 100644 index 0000000..5d25a20 --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/MPImageEditor.cs @@ -0,0 +1,506 @@ +using System; +using UnityEditor; +using UnityEditor.UI; +using UnityEngine; +using UnityEngine.UI; +using Object = UnityEngine.Object; + +namespace MPUIKIT.Editor { + [CustomEditor(typeof(MPImage), true)] + [CanEditMultipleObjects] + public class MPImageEditor : ImageEditor { + private SerializedProperty spSprite; + private SerializedProperty spCircle, spTriangle, spRectangle, spPentagon, spHexagon, spNStarPolygon; + private SerializedProperty spPreserveAspect; + private SerializedProperty spFillMethod, spFillOrigin, spFillAmount, spFillClockwise; + private SerializedProperty spShape; + private SerializedProperty spStrokeWidth, spOutlineWidth, spOutlineColor, spFalloffDistance; + private SerializedProperty spConstrainRotation, spShapeRotation, spFlipHorizontal, spFlipVertical; + private SerializedProperty spMaterialSettings, spMaterial, spImageType; + + private SerializedProperty spGradient; + + private bool gsInitialized, shaderChannelsNeedUpdate; + + protected override void OnEnable() { + foreach (Object obj in serializedObject.targetObjects) { + ((MPImage) obj).UpdateSerializedValuesFromSharedMaterial(); + } + + base.OnEnable(); + + spSprite = serializedObject.FindProperty("m_Sprite"); + + spShape = serializedObject.FindProperty("m_DrawShape"); + + spStrokeWidth = serializedObject.FindProperty("m_StrokeWidth"); + spOutlineWidth = serializedObject.FindProperty("m_OutlineWidth"); + spOutlineColor = serializedObject.FindProperty("m_OutlineColor"); + spFalloffDistance = serializedObject.FindProperty("m_FalloffDistance"); + + spMaterialSettings = serializedObject.FindProperty("m_MaterialMode"); + spMaterial = serializedObject.FindProperty("m_Material"); + spImageType = serializedObject.FindProperty("m_ImageType"); + + spFillMethod = serializedObject.FindProperty("m_FillMethod"); + spFillOrigin = serializedObject.FindProperty("m_FillOrigin"); + spFillAmount = serializedObject.FindProperty("m_FillAmount"); + spFillClockwise = serializedObject.FindProperty("m_FillClockwise"); + + spConstrainRotation = serializedObject.FindProperty("m_ConstrainRotation"); + spShapeRotation = serializedObject.FindProperty("m_ShapeRotation"); + spFlipHorizontal = serializedObject.FindProperty("m_FlipHorizontal"); + spFlipVertical = serializedObject.FindProperty("m_FlipVertical"); + + + spCircle = serializedObject.FindProperty("m_Circle"); + spRectangle = serializedObject.FindProperty("m_Rectangle"); + spTriangle = serializedObject.FindProperty("m_Triangle"); + spPentagon = serializedObject.FindProperty("m_Pentagon"); + spHexagon = serializedObject.FindProperty("m_Hexagon"); + spNStarPolygon = serializedObject.FindProperty("m_NStarPolygon"); + + spPreserveAspect = serializedObject.FindProperty("m_PreserveAspect"); + + spGradient = serializedObject.FindProperty("m_GradientEffect"); + } + + + + public override void OnInspectorGUI() { + serializedObject.Update(); + + FixShaderChannelGUI(); + + RaycastControlsGUI(); + EditorGUILayout.PropertyField(m_Color); + EditorGUILayout.Space(); + EditorGUILayout.PropertyField(spShape); + + if (spShape.enumValueIndex != (int) DrawShape.None) { + EditorGUILayout.BeginVertical("Box"); + if (!spShape.hasMultipleDifferentValues) { + switch ((DrawShape) spShape.enumValueIndex) { + case DrawShape.Circle: + EditorGUILayout.PropertyField(spCircle); + break; + case DrawShape.Rectangle: + EditorGUILayout.PropertyField(spRectangle); + break; + case DrawShape.Pentagon: + EditorGUILayout.PropertyField(spPentagon); + break; + case DrawShape.Triangle: + EditorGUILayout.PropertyField(spTriangle); + break; + case DrawShape.Hexagon: + EditorGUILayout.PropertyField(spHexagon); + break; + case DrawShape.NStarPolygon: + EditorGUILayout.PropertyField(spNStarPolygon); + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + + EditorGUILayout.Space(); + + if (spShape.enumValueIndex != (int) DrawShape.None) { + AdditionalShapeDataGUI(); + } + EditorGUILayout.EndVertical(); + } + + + + EditorGUILayout.Space(); + ImageTypeGUI(); + + SpriteGUI(); + + if (!spSprite.hasMultipleDifferentValues && spSprite.objectReferenceValue != null) { + EditorGUILayout.PropertyField(spPreserveAspect); + } + + SetShowNativeSize(spSprite.objectReferenceValue != null, true); + NativeSizeButtonGUI(); + + EditorGUILayout.Space(); + SharedMaterialGUI(); + + EditorGUILayout.Space(); + EditorGUILayout.BeginVertical("Box"); + { + EditorGUILayout.PropertyField(spGradient); + } + EditorGUILayout.EndVertical(); + + serializedObject.ApplyModifiedProperties(); + serializedObject.Update(); + Repaint(); + } + + private void AdditionalShapeDataGUI() { + EditorGUILayout.Space(); + + float strokeWidth = spStrokeWidth.floatValue; + float outlineWidth = spOutlineWidth.floatValue; + float falloff = spFalloffDistance.floatValue; + Color outlineColor = spOutlineColor.colorValue; + + Rect r = EditorGUILayout.GetControlRect(true, + EditorGUIUtility.singleLineHeight * 2 + EditorGUIUtility.standardVerticalSpacing); + Rect line = r; + line.height = EditorGUIUtility.singleLineHeight; + float x = (line.width - 10f) / 2; + + float fieldWidth = x / 2 - 10f; + float labelWidth = x - fieldWidth; + + line.width = labelWidth; + EditorGUI.LabelField(line, "Stroke"); + Rect dragZone = line; + line.x += labelWidth; + line.width = fieldWidth; + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = spStrokeWidth.hasMultipleDifferentValues; + strokeWidth = + EditorGUILayoutExtended.FloatFieldExtended(line, spStrokeWidth.floatValue, dragZone); + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) + { + spStrokeWidth.floatValue = strokeWidth; + } + line.x += fieldWidth + 10; + line.width = labelWidth; + EditorGUI.LabelField(line, "Falloff"); + dragZone = line; + line.x += labelWidth; + line.width = fieldWidth; + + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = spFalloffDistance.hasMultipleDifferentValues; + falloff = + EditorGUILayoutExtended.FloatFieldExtended(line, spFalloffDistance.floatValue, dragZone); + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) + { + spFalloffDistance.floatValue = falloff; + } + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + line.x = r.x; + line.width = labelWidth; + EditorGUI.LabelField(line, "Outline Width"); + dragZone = line; + line.x += labelWidth; + line.width = fieldWidth; + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = spOutlineWidth.hasMultipleDifferentValues; + outlineWidth = + EditorGUILayoutExtended.FloatFieldExtended(line, spOutlineWidth.floatValue, dragZone); + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) + { + spOutlineWidth.floatValue = outlineWidth; + } + line.x += fieldWidth + 10; + line.width = labelWidth; + EditorGUI.LabelField(line, "Outline Color"); + dragZone = line; + line.width = fieldWidth; + line.x += labelWidth; + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = spOutlineColor.hasMultipleDifferentValues; + outlineColor = EditorGUI.ColorField(line, spOutlineColor.colorValue); + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) + { + spOutlineColor.colorValue = outlineColor; + } + + EditorGUILayout.Space(); + + RotationGUI(); + } + + private void RotationGUI() { + Rect r =EditorGUILayout.GetControlRect(true, + EditorGUIUtility.singleLineHeight + 24 + EditorGUIUtility.standardVerticalSpacing); + Rect line = r; + line.height = EditorGUIUtility.singleLineHeight; + float x = (line.width - 10f) / 2; + + float fieldWidth = x / 2 - 10f; + float labelWidth = x - fieldWidth; + + line.width = labelWidth; + EditorGUI.LabelField(line, "Rotation"); + line.x += labelWidth; + line.width = r.width - labelWidth - 78; + + string[] options = spConstrainRotation.hasMultipleDifferentValues? new []{ "---", "---" } : new []{"Free", "Constrained"}; + bool boolVal = spConstrainRotation.boolValue; + EditorGUI.BeginChangeCheck(); + { + boolVal = GUI.Toolbar(line, boolVal ? 1 : 0, options) == 1; + } + if (EditorGUI.EndChangeCheck()) { + spConstrainRotation.boolValue = boolVal; + GUI.FocusControl(null); + } + + line.x += line.width + 14; + line.width = 64; + EditorGUI.LabelField(line, "Flip"); + + line.y += EditorGUIUtility.standardVerticalSpacing + EditorGUIUtility.singleLineHeight; + line.x = r.x + 10; + line.height = EditorGUIUtility.singleLineHeight; + line.width = labelWidth - 10; + EditorGUI.BeginDisabledGroup(spConstrainRotation.boolValue); + { + Rect dragZone = line; + EditorGUI.LabelField(line, "Angle"); + line.x = r.x + labelWidth; + line.width = r.width - labelWidth - 148; + + float rotationValue = spShapeRotation.floatValue; + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = spShapeRotation.hasMultipleDifferentValues; + rotationValue = EditorGUILayoutExtended.FloatFieldExtended(line, spShapeRotation.floatValue, dragZone); + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) { + spShapeRotation.floatValue = rotationValue; + } + } + EditorGUI.EndDisabledGroup(); + + EditorGUI.BeginDisabledGroup(!spConstrainRotation.boolValue); + { + line.x += line.width + 4; + line.width = 30; + line.height = 24; + if (GUI.Button(line, MPEditorContents.RotateLeftNormal)) { + float rotation = spShapeRotation.floatValue; + float remainder = rotation % 90; + if (Mathf.Abs(remainder) <= 0) { + rotation += 90; + } + else { + rotation = rotation - remainder + 90; + } + if (Math.Abs(rotation) >= 360) rotation = 0; + spShapeRotation.floatValue = rotation; + } + + line.x += 34; + if (GUI.Button(line, MPEditorContents.RotateRightNormal)) { + float rotation = spShapeRotation.floatValue; + float remainder = rotation % 90; + if (Mathf.Abs(remainder) <= 0) { + rotation -= 90; + } + else { + rotation -= remainder; + } + + if (Math.Abs(rotation) >= 360) rotation = 0; + spShapeRotation.floatValue = rotation; + } + } + EditorGUI.EndDisabledGroup(); + + line.x += 46; + bool flipH = spFlipHorizontal.boolValue; + bool flipV = spFlipVertical.boolValue; + EditorGUI.BeginChangeCheck(); + { + EditorGUI.BeginDisabledGroup(spFlipHorizontal.hasMultipleDifferentValues || spFlipVertical.hasMultipleDifferentValues); + flipH = GUI.Toggle(line, spFlipHorizontal.boolValue, spFlipHorizontal.boolValue ? MPEditorContents.FlipHorizontalActive:MPEditorContents.FlipHorizontalNormal, "button"); + line.x += 34; + flipV = GUI.Toggle(line, spFlipVertical.boolValue, spFlipVertical.boolValue?MPEditorContents.FlipVerticalActive:MPEditorContents.FlipVerticalNormal, "button"); + EditorGUI.EndDisabledGroup(); + } + if (EditorGUI.EndChangeCheck()) { + spFlipHorizontal.boolValue = flipH; + spFlipVertical.boolValue = flipV; + } + + } + + private void FixShaderChannelGUI() { + if (!shaderChannelsNeedUpdate) return; + EditorGUILayout.HelpBox( + "Parent Canvas needs to have these additional shader channels : Texcoord1, Texcoord2", + MessageType.Error); + EditorGUILayout.BeginHorizontal(); + { + GUILayout.FlexibleSpace(); + if (GUILayout.Button("Fix", GUILayout.Width(100))) { + Canvas canvas = (target as MPImage)?.GetComponentInParent(); + if (canvas != null) { + MPEditorUtility.AddAdditionalShaderChannelsToCanvas(canvas); + shaderChannelsNeedUpdate = false; + } + } + } + EditorGUILayout.EndHorizontal(); + } + + private new void SpriteGUI() { + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(spSprite, new GUIContent("Sprite")); + if (EditorGUI.EndChangeCheck()) { + Sprite newSprite = spSprite.objectReferenceValue as Sprite; + if (newSprite) { + Image.Type oldType = (Image.Type) spImageType.enumValueIndex; + if (newSprite.border.SqrMagnitude() > 0) { + spImageType.enumValueIndex = (int) Image.Type.Sliced; + } + else if (oldType == Image.Type.Sliced) { + spImageType.enumValueIndex = (int) Image.Type.Simple; + } + } + + (serializedObject.targetObject as Image)?.DisableSpriteOptimizations(); + } + } + + private void ImageTypeGUI() { + int selectedIndex = spImageType.enumValueIndex == (int) Image.Type.Simple ? 0 : 1; + Rect imageTypeRect = EditorGUILayout.GetControlRect(); + EditorGUI.BeginChangeCheck(); + { + EditorGUI.LabelField( + new Rect(imageTypeRect.x, imageTypeRect.y, EditorGUIUtility.labelWidth, imageTypeRect.height), + "Type"); + imageTypeRect.x += EditorGUIUtility.labelWidth + 2; + imageTypeRect.width -= EditorGUIUtility.labelWidth + 2; + selectedIndex = EditorGUI.Popup(imageTypeRect, selectedIndex, new[] {"Simple", "Filled"}); + } + if (EditorGUI.EndChangeCheck()) { + spImageType.enumValueIndex = (int) (selectedIndex == 0 ? Image.Type.Simple : Image.Type.Filled); + } + + if (!spImageType.hasMultipleDifferentValues && spImageType.enumValueIndex == (int) Image.Type.Filled) { + ++EditorGUI.indentLevel; + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(spFillMethod); + if (EditorGUI.EndChangeCheck()) { + spFillOrigin.intValue = 0; + } + + switch ((Image.FillMethod) spFillMethod.enumValueIndex) { + case Image.FillMethod.Horizontal: + spFillOrigin.intValue = (int) (Image.OriginHorizontal) EditorGUILayout.EnumPopup("Fill Origin", + (Image.OriginHorizontal) spFillOrigin.intValue); + break; + case Image.FillMethod.Vertical: + spFillOrigin.intValue = (int) (Image.OriginVertical) EditorGUILayout.EnumPopup("Fill Origin", + (Image.OriginVertical) spFillOrigin.intValue); + break; + case Image.FillMethod.Radial90: + spFillOrigin.intValue = + (int) (Image.Origin90) EditorGUILayout.EnumPopup("Fill Origin", + (Image.Origin90) spFillOrigin.intValue); + break; + case Image.FillMethod.Radial180: + spFillOrigin.intValue = + (int) (Image.Origin180) EditorGUILayout.EnumPopup("Fill Origin", + (Image.Origin180) spFillOrigin.intValue); + break; + case Image.FillMethod.Radial360: + spFillOrigin.intValue = + (int) (Image.Origin360) EditorGUILayout.EnumPopup("Fill Origin", + (Image.Origin360) spFillOrigin.intValue); + break; + } + + EditorGUILayout.PropertyField(spFillAmount); + if ((Image.FillMethod) spFillMethod.enumValueIndex > Image.FillMethod.Vertical) { + EditorGUILayout.PropertyField(spFillClockwise, new GUIContent("Clockwise")); + } + + --EditorGUI.indentLevel; + } + } + + private void SharedMaterialGUI() { + Rect rect = EditorGUILayout.GetControlRect(true, + EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing); + int matSett = spMaterialSettings.enumValueIndex; + Rect labelRect = rect; + labelRect.width = EditorGUIUtility.labelWidth; + EditorGUI.LabelField(labelRect, "Material Mode"); + rect.x += labelRect.width; + rect.width -= labelRect.width; + + EditorGUI.BeginChangeCheck(); + EditorGUI.showMixedValue = spMaterialSettings.hasMultipleDifferentValues; + string[] options = new[] {"Dynamic", "Shared"}; + if (EditorGUI.showMixedValue) options = new[] {"---", "---"}; + matSett = GUI.Toolbar(rect, matSett, options); + + if (EditorGUI.EndChangeCheck()) { + spMaterialSettings.enumValueIndex = matSett; + foreach (Object obj in targets) { + ((MPImage) obj).MaterialMode = (MaterialMode) matSett; + EditorUtility.SetDirty(obj); + } + } + + EditorGUI.showMixedValue = false; + + + EditorGUI.BeginDisabledGroup(spMaterialSettings.enumValueIndex == (int) MaterialMode.Dynamic); + { + rect = EditorGUILayout.GetControlRect(true, + EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing); + + Object matObj = spMaterial.objectReferenceValue; + + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = spMaterialSettings.hasMultipleDifferentValues; + matObj = (Material) EditorGUI.ObjectField( + new Rect(rect.x, rect.y, rect.width - 60, EditorGUIUtility.singleLineHeight), + matObj, typeof(Material), false); + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) { + spMaterial.objectReferenceValue = matObj; + foreach (Object obj in targets) { + ((MPImage) obj).material = (Material) matObj; + EditorUtility.SetDirty(obj); + } + } + + EditorGUI.BeginDisabledGroup(spMaterial.objectReferenceValue != null); + { + if (GUI.Button(new Rect(rect.x + rect.width - 55, rect.y, 55, EditorGUIUtility.singleLineHeight), + "Create")) { + Material mat = ((MPImage) target).CreateMaterialAssetFromComponentSettings(); + spMaterial.objectReferenceValue = mat; + foreach (Object obj in targets) { + ((MPImage) obj).material = mat; + EditorUtility.SetDirty(obj); + } + } + } + EditorGUI.EndDisabledGroup(); + } + EditorGUI.EndDisabledGroup(); + } + } +} diff --git a/Assets/MPUIKit/Editor/Scripts/MPImageEditor.cs.meta b/Assets/MPUIKit/Editor/Scripts/MPImageEditor.cs.meta new file mode 100644 index 0000000..cac2dd1 --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/MPImageEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c7639e6809ad59f4bb65a8948d16b305 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Scripts/MPUIKitShaderGUI.cs b/Assets/MPUIKit/Editor/Scripts/MPUIKitShaderGUI.cs new file mode 100644 index 0000000..fe2e7c4 --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/MPUIKitShaderGUI.cs @@ -0,0 +1,26 @@ +using UnityEditor; +using UnityEngine; + +namespace MPUIKIT.Editor +{ + public class MPImageShaderGUI : ShaderGUI + { + private bool _showValues; + + public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties) + { + EditorGUILayout.HelpBox( + "Nothing to modify here. Select an MPImage component in the hierarchy and modify the values in the inspector.", + MessageType.Info); + + if (GUILayout.Button(_showValues ? "Hide Debug Values" : "Show Debug Values", EditorStyles.miniLabel)) _showValues = !_showValues; + + if (_showValues) + { + EditorGUI.BeginDisabledGroup(true); + base.OnGUI(materialEditor, properties); + EditorGUI.EndDisabledGroup(); + } + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/MPUIKitShaderGUI.cs.meta b/Assets/MPUIKit/Editor/Scripts/MPUIKitShaderGUI.cs.meta new file mode 100644 index 0000000..24023a1 --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/MPUIKitShaderGUI.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3baee42b106f43cd8eb1edfa21a94ae5 +timeCreated: 1590741710 \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/MPUIKitUtilityWindow.cs b/Assets/MPUIKit/Editor/Scripts/MPUIKitUtilityWindow.cs new file mode 100644 index 0000000..60919ed --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/MPUIKitUtilityWindow.cs @@ -0,0 +1,134 @@ +using System.IO; +using UnityEditor; +using UnityEngine; + +namespace MPUIKIT.Editor +{ + public class MPUIKitUtilityWindow : EditorWindow + { + private static SerializedObject _graphicsSettingsObj; + private static bool _setup; + private static bool _alreadyShownOnStartup; + private bool _initialized; + private string _version = "Version: 1.2.0"; + private static bool _setupIsRequired; + private static UnityEditor.Editor _settingsEditor; + + + [MenuItem("Window/MPUIKit/Utility Panel")] + public static void ShowWindow() + { + EditorWindow window = GetWindow(true, "MPUIKit Utility Panel", true); + window.minSize = new Vector2(400, 400); + window.maxSize = new Vector2(400, 400); + } + + + private void OnGUI() + { + TopBannerGUI(); + WelcomeGUI(); + UtilButtonsGUI(); + BottomBarGUI(); + } + + private static void TopBannerGUI() + { + Rect headingRect = new Rect(0, 0, EditorGUIUtility.currentViewWidth, EditorGUIUtility.singleLineHeight * 5); + Rect backgroundTexCoords = new Rect(0, 0, headingRect.width / headingRect.height, 1); + Texture background = MPEditorContents.Background; + background.wrapMode = TextureWrapMode.Repeat; + GUI.DrawTextureWithTexCoords(headingRect, background, backgroundTexCoords); + + float height = headingRect.height; + float width = headingRect.width - height - 30; + Rect titleRect = new Rect(headingRect.width - width - 5, 20, width, height - 30); + GUI.DrawTexture(titleRect, MPEditorContents.Title, ScaleMode.ScaleToFit); + + + Rect textureRect = headingRect; + textureRect.x = 0; + textureRect.width = textureRect.height - 7; + textureRect.height -= 7; + GUI.DrawTexture(textureRect, MPEditorContents.Logo, ScaleMode.ScaleToFit); + GUILayout.Space(headingRect.height + 20); + } + + private static void WelcomeGUI() + { + var style = new GUIStyle(GUI.skin.label) {alignment = TextAnchor.MiddleCenter}; + EditorGUILayout.LabelField("Thank you for using", style, GUILayout.ExpandWidth(true)); + EditorGUILayout.LabelField("Modern Procedural UI Kit", style, GUILayout.ExpandWidth(true)); + GUILayout.Space(20); + } + + private static void UtilButtonsGUI() + { + GUILayout.Space(6); + Rect buttonRect = EditorGUILayout.GetControlRect(false, 40 * 3 + 4); + buttonRect.width = (buttonRect.width / 2) - 1; + buttonRect.height = 40; + + if (GUI.Button(buttonRect, "Documentation")) + { + Application.OpenURL("https://scrollbie.com/documentations/mpuikit-docs/"); + } + + buttonRect.x += buttonRect.width + 2; + if (GUI.Button(buttonRect, "Website")) + { + Application.OpenURL("https://scrollbie.com/mpuikit/"); + } + + buttonRect.y += 42; + buttonRect.x -= buttonRect.width + 2; + if (GUI.Button(buttonRect, "Email")) + { + Application.OpenURL("mailto:support@scrollbie.com"); + } + + buttonRect.x += buttonRect.width + 2; + if (GUI.Button(buttonRect, "Forum")) + { + Application.OpenURL( + "https://forum.unity.com/threads/an-advanced-procedural-ui-generation-tool-create-modify-animate-spriteless-ui-even-at-runtime.846772"); + } + + buttonRect.y += 42; + buttonRect.x -= buttonRect.width + 2; + if (GUI.Button(buttonRect, "Changelog")) + { + Application.OpenURL("https://scrollbie.com/mpuikit/changelog.html"); + } + + buttonRect.x += buttonRect.width + 2; + if (GUI.Button(buttonRect, "Other Assets")) + { + Application.OpenURL("https://assetstore.unity.com/publishers/29536"); + } + + if (GUILayout.Button("★ Rate/Review MPUIKit", GUILayout.ExpandWidth(true), GUILayout.Height(40))) + { + Application.OpenURL("https://assetstore.unity.com/packages/slug/163041"); + } + } + + private void BottomBarGUI() + { + EditorGUILayout.BeginVertical(); + { + GUILayout.FlexibleSpace(); + EditorGUILayout.BeginHorizontal(); + { + EditorGUILayout.LabelField("© Copyright 2020 Scrollbie Studio", EditorStyles.miniLabel); + GUIStyle style = new GUIStyle(EditorStyles.miniLabel); + style.alignment = TextAnchor.MiddleRight; + GUILayout.FlexibleSpace(); + EditorGUILayout.LabelField(_version, style, GUILayout.Width(120)); + } + EditorGUILayout.EndHorizontal(); + } + EditorGUILayout.EndVertical(); + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/MPUIKitUtilityWindow.cs.meta b/Assets/MPUIKit/Editor/Scripts/MPUIKitUtilityWindow.cs.meta new file mode 100644 index 0000000..8f575a9 --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/MPUIKitUtilityWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9cd4e467557d59f48822fd363721ec89 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Scripts/ShapeDrawers.meta b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers.meta new file mode 100644 index 0000000..6f1128a --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6137a2ba9e274726810f9f0b17addea6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/CirclePropertyDrawer.cs b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/CirclePropertyDrawer.cs new file mode 100644 index 0000000..b5da373 --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/CirclePropertyDrawer.cs @@ -0,0 +1,51 @@ +using UnityEditor; +using UnityEngine; + +namespace MPUIKIT.Editor { + [CustomPropertyDrawer(typeof(Circle))] + public class CirclePropertyDrawer : PropertyDrawer{ + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { + EditorGUI.BeginProperty(position, label, property); + { + Rect radiusRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight); + Rect toolBarRect = new Rect(position.x + EditorGUIUtility.labelWidth, + position.y + EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing, + position.width - EditorGUIUtility.labelWidth, EditorGUIUtility.singleLineHeight); + + SerializedProperty spFitCircleRadius = property.FindPropertyRelative("m_FitRadius"); + bool FitCirlce = spFitCircleRadius.boolValue; + EditorGUI.BeginDisabledGroup(FitCirlce); + { + EditorGUI.PropertyField(radiusRect, property.FindPropertyRelative("m_Radius"), + new GUIContent("Radius")); + } + EditorGUI.EndDisabledGroup(); + + + EditorGUI.BeginChangeCheck(); + EditorGUI.showMixedValue = spFitCircleRadius.hasMultipleDifferentValues; + { + EditorGUILayout.BeginHorizontal(); + { + GUILayout.Space(EditorGUIUtility.labelWidth); + + FitCirlce = GUI.Toolbar(toolBarRect, FitCirlce ? 1 : 0, new[] {"Free", "Fit"}) == 1; + } + EditorGUILayout.EndHorizontal(); + } + EditorGUI.showMixedValue = false; + + if (EditorGUI.EndChangeCheck()) { + spFitCircleRadius.boolValue = FitCirlce; + } + + } + EditorGUI.EndProperty(); + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { + return EditorGUIUtility.singleLineHeight * 2 + EditorGUIUtility.standardVerticalSpacing * 2; + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/CirclePropertyDrawer.cs.meta b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/CirclePropertyDrawer.cs.meta new file mode 100644 index 0000000..47fb58c --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/CirclePropertyDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b2a76e1f0ab8461190ccc8f5beaa70e9 +timeCreated: 1586464240 \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/HexagonPropertyDrawer.cs b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/HexagonPropertyDrawer.cs new file mode 100644 index 0000000..3ad4f10 --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/HexagonPropertyDrawer.cs @@ -0,0 +1,106 @@ +using UnityEditor; +using UnityEngine; + +namespace MPUIKIT.Editor { + [CustomPropertyDrawer(typeof(Hexagon))] + public class HexagonPropertyDrawer : PropertyDrawer { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { + EditorGUI.BeginProperty(position, label, property); + { + SerializedProperty rectRadius = property.FindPropertyRelative("m_CornerRadius"); + SerializedProperty uniformRect = property.FindPropertyRelative("m_UniformCornerRadius"); + SerializedProperty triSizes = property.FindPropertyRelative("m_TipSize"); + SerializedProperty uniformTriS = property.FindPropertyRelative("m_UniformTipSize"); + SerializedProperty triRadius = property.FindPropertyRelative("m_TipRadius"); + SerializedProperty uniformTriR = property.FindPropertyRelative("m_UniformTipRadius"); + + Vector4 radiusVectorValue = rectRadius.vector4Value; + float radiusFloatValue = radiusVectorValue.x; + bool rectBoolVal = uniformRect.boolValue; + float[] zw = new[] {radiusVectorValue.w, radiusVectorValue.z}; + float[] xy = new[] {radiusVectorValue.x, radiusVectorValue.y}; + Vector2 triSizesVectorValue = triSizes.vector2Value; + float triSizesFloatValue = triSizesVectorValue.x; + Vector2 triRadiusVectorValue = triRadius.vector2Value; + float triRadiusFloatValue = triRadiusVectorValue.x; + + Rect line = position; + line.height = EditorGUIUtility.singleLineHeight; + string[] toolbarLabel = new[] {"Free", "Uniform"}; + MPEditorUtility.CornerRadiusModeGUI(line, ref uniformRect, toolbarLabel); + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = rectRadius.hasMultipleDifferentValues; + if (rectBoolVal) { + radiusFloatValue = EditorGUI.FloatField(line, "Uniform Radius", radiusFloatValue); + } + else { + EditorGUI.MultiFloatField(line, new []{new GUIContent("W"), new GUIContent("Z")}, zw); + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + EditorGUI.MultiFloatField(line, new []{new GUIContent("X"), new GUIContent("Y")}, xy); + } + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) { + rectRadius.vector4Value = rectBoolVal + ? new Vector4(radiusFloatValue, radiusFloatValue, radiusFloatValue, radiusFloatValue) + : new Vector4(xy[0], xy[1], zw[1], zw[0]); + } + + + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + MPEditorUtility.CornerRadiusModeGUI(line, ref uniformTriS, toolbarLabel, "Tip Size"); + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = triSizes.hasMultipleDifferentValues; + if (uniformTriS.boolValue) { + triSizesFloatValue = EditorGUI.FloatField(line, "Uniform Size", triSizesFloatValue); + } + else { + triSizesVectorValue = EditorGUI.Vector2Field(line, string.Empty, triSizesVectorValue); + } + + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) { + triSizes.vector2Value = uniformTriS.boolValue + ? new Vector2(triSizesFloatValue, triSizesFloatValue) + : triSizesVectorValue; + } + + + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + MPEditorUtility.CornerRadiusModeGUI(line, ref uniformTriR, toolbarLabel, "Tip Radius"); + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = triRadius.hasMultipleDifferentValues; + if (uniformTriR.boolValue) { + triRadiusFloatValue = EditorGUI.FloatField(line, "Uniform Radius", triRadiusFloatValue); + } + else { + triRadiusVectorValue = EditorGUI.Vector2Field(line, string.Empty, triRadiusVectorValue); + } + + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) { + triRadius.vector2Value = uniformTriR.boolValue + ? new Vector2(triRadiusFloatValue, triRadiusFloatValue) + : triRadiusVectorValue; + } + + } + EditorGUI.EndProperty(); + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { + if (property.FindPropertyRelative("m_UniformCornerRadius").boolValue) { + return EditorGUIUtility.singleLineHeight * 6 + EditorGUIUtility.standardVerticalSpacing * 5; + } + return EditorGUIUtility.singleLineHeight * 7 + EditorGUIUtility.standardVerticalSpacing * 6; + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/HexagonPropertyDrawer.cs.meta b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/HexagonPropertyDrawer.cs.meta new file mode 100644 index 0000000..0916ffa --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/HexagonPropertyDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e3e33a21b8af4566a49e820424dc26e2 +timeCreated: 1586503332 \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/NStarPolygonPropertyDrawer.cs b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/NStarPolygonPropertyDrawer.cs new file mode 100644 index 0000000..febde7f --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/NStarPolygonPropertyDrawer.cs @@ -0,0 +1,33 @@ +using UnityEditor; +using UnityEngine; + +namespace MPUIKIT.Editor { + [CustomPropertyDrawer(typeof(NStarPolygon))] + public class NStarPolygonPropertyDrawer : PropertyDrawer { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { + EditorGUI.BeginProperty(position, label, property); + { + SerializedProperty sideCount = property.FindPropertyRelative("m_SideCount"); + SerializedProperty inset = property.FindPropertyRelative("m_Inset"); + SerializedProperty cornerRadius = property.FindPropertyRelative("m_CornerRadius"); + SerializedProperty offset = property.FindPropertyRelative("m_Offset"); + + Rect line = position; + line.height = EditorGUIUtility.singleLineHeight; + + EditorGUI.Slider(line, sideCount, 3f, 10f); + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + EditorGUI.Slider(line, inset, 2f, sideCount.floatValue - 0.01f); + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + EditorGUI.PropertyField(line, cornerRadius); + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + EditorGUI.PropertyField(line, offset); + } + EditorGUI.EndProperty(); + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { + return EditorGUIUtility.singleLineHeight * 4.5f + EditorGUIUtility.standardVerticalSpacing * 4; + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/NStarPolygonPropertyDrawer.cs.meta b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/NStarPolygonPropertyDrawer.cs.meta new file mode 100644 index 0000000..bc23b7c --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/NStarPolygonPropertyDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 0e141ee519724007b787256b6fdb8782 +timeCreated: 1586505239 \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/PentagonPropertyDrawer.cs b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/PentagonPropertyDrawer.cs new file mode 100644 index 0000000..e0ac0ad --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/PentagonPropertyDrawer.cs @@ -0,0 +1,63 @@ +using UnityEditor; +using UnityEngine; + +namespace MPUIKIT.Editor { + [CustomPropertyDrawer(typeof(Pentagon))] + public class PentagonPropertyDrawer : PropertyDrawer { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { + EditorGUI.BeginProperty(position, label, property); + { + SerializedProperty RectRadius = property.FindPropertyRelative("m_CornerRadius"); + SerializedProperty uniform = property.FindPropertyRelative("m_UniformCornerRadius"); + SerializedProperty triSize = property.FindPropertyRelative("m_TipSize"); + SerializedProperty triRadius = property.FindPropertyRelative("m_TipRadius"); + + Vector4 radiusVectorValue = RectRadius.vector4Value; + float radiusFloatValue = radiusVectorValue.x; + bool boolVal = uniform.boolValue; + + float[] zw = new[] {radiusVectorValue.w, radiusVectorValue.z}; + float[] xy = new[] {radiusVectorValue.x, radiusVectorValue.y}; + + Rect line = position; + line.height = EditorGUIUtility.singleLineHeight; + MPEditorUtility.CornerRadiusModeGUI(line, ref uniform, new []{"Free", "Uniform"}); + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = RectRadius.hasMultipleDifferentValues; + if (boolVal) { + radiusFloatValue = EditorGUI.FloatField(line," Uniform Radius", radiusFloatValue); + } + else { + line.x += 10; + line.width -= 10; + EditorGUI.MultiFloatField(line, new []{new GUIContent("W"), new GUIContent("Z"), }, zw); + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + EditorGUI.MultiFloatField(line, new []{new GUIContent("X "), new GUIContent("Y"), }, xy); + line.x -= 10; + line.width += 10; + } + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) { + RectRadius.vector4Value = boolVal ? new Vector4(radiusFloatValue, radiusFloatValue, radiusFloatValue, radiusFloatValue) : new Vector4(xy[0], xy[1], zw[1], zw[0]); + } + + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + EditorGUI.PropertyField(line, triSize, new GUIContent("Tip size")); + line.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + EditorGUI.PropertyField(line, triRadius, new GUIContent("Tip Radius")); + } + EditorGUI.EndProperty(); + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { + if (property.FindPropertyRelative("m_UniformCornerRadius").boolValue) { + return EditorGUIUtility.singleLineHeight * 4 + EditorGUIUtility.standardVerticalSpacing * 3; + } + return EditorGUIUtility.singleLineHeight * 5 + EditorGUIUtility.standardVerticalSpacing * 4; + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/PentagonPropertyDrawer.cs.meta b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/PentagonPropertyDrawer.cs.meta new file mode 100644 index 0000000..204892e --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/PentagonPropertyDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b3117b92bdcb4b69a32f19a16ef9e482 +timeCreated: 1586501835 \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/RectanglePropertyDrawer.cs b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/RectanglePropertyDrawer.cs new file mode 100644 index 0000000..2e3203c --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/RectanglePropertyDrawer.cs @@ -0,0 +1,60 @@ +using UnityEditor; +using UnityEngine; + +namespace MPUIKIT.Editor { + [CustomPropertyDrawer(typeof(Rectangle))] + public class RectanglePropertyDrawer : PropertyDrawer{ + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { + EditorGUI.BeginProperty(position, label, property); + { + Rect LabelRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight); + Rect RadiusVectorRect = new Rect(position.x, + position.y + EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing, + position.width, EditorGUIUtility.singleLineHeight); + + SerializedProperty uniform = property.FindPropertyRelative("m_UniformCornerRadius"); + SerializedProperty radius = property.FindPropertyRelative("m_CornerRadius"); + + MPEditorUtility.CornerRadiusModeGUI(LabelRect, ref uniform, new []{"Free", "Uniform"}); + + float floatVal = radius.vector4Value.x; + Vector4 vectorValue = radius.vector4Value; + float[] zw = new[] {vectorValue.w, vectorValue.z}; + float[] xy = new[] {vectorValue.x, vectorValue.y}; + + EditorGUI.BeginChangeCheck(); + { + EditorGUI.showMixedValue = radius.hasMultipleDifferentValues; + if (uniform.boolValue) { + floatVal = EditorGUI.FloatField(RadiusVectorRect, "Uniform Radius", floatVal); + } + else { + + + EditorGUI.MultiFloatField(RadiusVectorRect, new [] { + new GUIContent("W"), new GUIContent("Z")}, zw ); + RadiusVectorRect.y += + EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + EditorGUI.MultiFloatField(RadiusVectorRect, new [] { + new GUIContent("X "), new GUIContent("Y")}, xy ); + + } + EditorGUI.showMixedValue = false; + } + if (EditorGUI.EndChangeCheck()) { + radius.vector4Value = uniform.boolValue + ? new Vector4(floatVal, floatVal, floatVal, floatVal) + : new Vector4(xy[0], xy[1], zw[1], zw[0]); + } + } + EditorGUI.EndProperty(); + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { + if (property.FindPropertyRelative("m_UniformCornerRadius").boolValue) { + return EditorGUIUtility.singleLineHeight * 2 + EditorGUIUtility.standardVerticalSpacing; + } + return EditorGUIUtility.singleLineHeight * 3 + EditorGUIUtility.standardVerticalSpacing * 2; + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/RectanglePropertyDrawer.cs.meta b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/RectanglePropertyDrawer.cs.meta new file mode 100644 index 0000000..b9d9388 --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/RectanglePropertyDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d7068ffa19a9492ea7028dbaa23890b3 +timeCreated: 1586499570 \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/TrianglePropertyDrawer.cs b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/TrianglePropertyDrawer.cs new file mode 100644 index 0000000..b5da32b --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/TrianglePropertyDrawer.cs @@ -0,0 +1,43 @@ +using UnityEditor; +using UnityEngine; + +namespace MPUIKIT.Editor { + [CustomPropertyDrawer(typeof(Triangle))] + public class TrianglePropertyDrawer : PropertyDrawer{ + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { + EditorGUI.BeginProperty(position, label, property); + { + Rect LabelRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight); + Rect RadiusVectorRect = new Rect(position.x, + position.y + EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing, + position.width, EditorGUIUtility.singleLineHeight); + + SerializedProperty uniform = property.FindPropertyRelative("m_UniformCornerRadius"); + SerializedProperty radius = property.FindPropertyRelative("m_CornerRadius"); + + MPEditorUtility.CornerRadiusModeGUI(LabelRect, ref uniform, new []{"Free", "Uniform"}); + + float floatVal = radius.vector3Value.x; + Vector3 vectorValue = radius.vector3Value; + + EditorGUI.BeginChangeCheck(); + { + if (uniform.boolValue) { + floatVal = EditorGUI.FloatField(RadiusVectorRect, "Uniform Radius", floatVal); + } + else { + vectorValue = EditorGUI.Vector3Field(RadiusVectorRect, string.Empty, vectorValue); + } + } + if (EditorGUI.EndChangeCheck()) { + radius.vector3Value = uniform.boolValue ? new Vector3(floatVal, floatVal, floatVal) : vectorValue; + } + } + EditorGUI.EndProperty(); + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { + return EditorGUIUtility.singleLineHeight * 2 + EditorGUIUtility.standardVerticalSpacing * 2; + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/TrianglePropertyDrawer.cs.meta b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/TrianglePropertyDrawer.cs.meta new file mode 100644 index 0000000..ce49601 --- /dev/null +++ b/Assets/MPUIKit/Editor/Scripts/ShapeDrawers/TrianglePropertyDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ef3050eb698744e890c498947ee39173 +timeCreated: 1586497240 \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime.meta b/Assets/MPUIKit/Runtime.meta new file mode 100644 index 0000000..dbe454e --- /dev/null +++ b/Assets/MPUIKit/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 71a347ea230e702488b787c090488261 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/MPUIKit.asmdef b/Assets/MPUIKit/Runtime/MPUIKit.asmdef new file mode 100644 index 0000000..606e98d --- /dev/null +++ b/Assets/MPUIKit/Runtime/MPUIKit.asmdef @@ -0,0 +1,3 @@ +{ + "name": "MPUIKit" +} diff --git a/Assets/MPUIKit/Runtime/MPUIKit.asmdef.meta b/Assets/MPUIKit/Runtime/MPUIKit.asmdef.meta new file mode 100644 index 0000000..e699c4b --- /dev/null +++ b/Assets/MPUIKit/Runtime/MPUIKit.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5b70f83da6937434491f26e0fd0cd099 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Resources.meta b/Assets/MPUIKit/Runtime/Resources.meta new file mode 100644 index 0000000..c2b0952 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d7143df56a13a7343a4b063f89644fef +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Resources/Shaders.meta b/Assets/MPUIKit/Runtime/Resources/Shaders.meta new file mode 100644 index 0000000..1bbd161 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Resources/Shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ad8edb96550859f46802907d97aaaff8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Resources/Shaders/2D_SDF.cginc b/Assets/MPUIKit/Runtime/Resources/Shaders/2D_SDF.cginc new file mode 100644 index 0000000..a25f82f --- /dev/null +++ b/Assets/MPUIKit/Runtime/Resources/Shaders/2D_SDF.cginc @@ -0,0 +1,79 @@ +#ifndef SDF_2D +#define SDF_2D + +float circle(float2 _samplePosition, float _radius){ + return length(_samplePosition) - _radius; +} + +float rectanlge(float2 _samplePosition, float _width, float _height){ + float2 d = abs(_samplePosition) - float2(_width, _height) / 2.0; + float sdf = min(max(d.x, d.y), 0.0) + length(max(d, 0.0)); + return sdf; +} + +//Credit: https://www.shadertoy.com/view/XdXcRB | MIT License +float ndot(float2 a, float2 b ) { return a.x*b.x - a.y*b.y; } +float sdRhombus(float2 p, float2 b) { + float2 q = abs(p); + float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0); + float d = length( q - 0.5*b*float2(1.0-h,1.0+h) ); + return d * sign( q.x*b.y + q.y*b.x - b.x*b.y ); +} +//EndCredit + +//Credit: https://www.shadertoy.com/view/MldcD7 | MIT License +float sdTriangleIsosceles(float2 p, float2 q ) +{ + p.x = abs(p.x); + float2 a = p - q*clamp( dot(p,q)/dot(q,q), 0.0, 1.0 ); + float2 b = p - q*float2( clamp( p.x/q.x, 0.0, 1.0 ), 1.0 ); + float s = -sign( q.y ); + float2 d = min( float2( dot(a,a), s*(p.x*q.y-p.y*q.x) ), float2( dot(b,b), s*(p.y-q.y) )); + return -sqrt(d.x)*sign(d.y); +} +//EndCredit + +//Credit: https://www.shadertoy.com/view/3tSGDy | MIT License +float sdNStarPolygon(in float2 p, in float r, in float n, in float m) // m=[2,n] +{ + float an = 3.141593/float(n); + float en = 3.141593/m; + float2 acs = float2(cos(an),sin(an)); + float2 ecs = float2(cos(en),sin(en)); + float bn = abs(atan2(p.x, p.y)) % (2.0*an) - an; + p = length(p)*float2(cos(bn),abs(sin(bn))); + p -= r*acs; + p += ecs*clamp( -dot(p,ecs), 0.0, r*acs.y/ecs.y); + return length(p)*sign(p.x); +} +//EndCredit + +float sampleSdf(float _sdf, float _offset){ + float sdf = saturate(-_sdf * _offset); + return sdf; +} + +float sampleSdfStrip(float _sdf, float _stripWidth, float _offset){ + + float l = (_stripWidth+1.0/_offset)/2.0; + return saturate((l-distance(-_sdf,l))*_offset); +} + +float sdfUnion(float _a, float _b){ + return max(_a, _b); +} + +float sdfIntersection(float _a, float _b){ + return min(_a, _b); +} + +float sdfDifference(float _a, float _b) +{ + return max(_a, -_b); +} + +float map(float val, float low1, float high1, float low2, float high2){ + return low2 + (val - low1) * (high2 - low2) / (high1 - low1); +} + +#endif \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Resources/Shaders/2D_SDF.cginc.meta b/Assets/MPUIKit/Runtime/Resources/Shaders/2D_SDF.cginc.meta new file mode 100644 index 0000000..0f17735 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Resources/Shaders/2D_SDF.cginc.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ffbce863d4e97d04db0d9865e9f72902 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Resources/Shaders/MPImage.shader b/Assets/MPUIKit/Runtime/Resources/Shaders/MPImage.shader new file mode 100644 index 0000000..f161f2c --- /dev/null +++ b/Assets/MPUIKit/Runtime/Resources/Shaders/MPImage.shader @@ -0,0 +1,686 @@ +Shader "MPUI/Procedural Image" +{ + Properties + { + [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" { } + _Color ("Tint", Color) = (1, 1, 1, 1) + _TextureSize ("Texture Size", Vector) = (1, 1, 1, 1) + + _DrawShape ("Draw Shape", int) = 2 + + _StrokeWidth ("Stroke Width", float) = 0 + _FalloffDistance ("Falloff Distance", float) = 0.5 + _PixelWorldScale ("Pixel world scale", Range(0.01, 5)) = 1 + _ShapeRotation ("shape Rotation", float) = 0 + _ConstrainRotation("Constrained Rotation", int) = 0 + _FlipHorizontal ("Flip Horizontal", int) = 0 + _FlipVertical ("Flip Vertical", int) = 0 + + _RectangleCornerRadius ("Rectangle Corner Radius", Vector) = (0, 0, 0, 0) + _CircleRadius ("Circle Radius", float) = 0 + _CircleFitRadius ("Fit Circle Radius", float) = 0 + _PentagonCornerRadius ("Pentagon Corner Radius", Vector) = (0, 0, 0, 0) + _PentagonTipRadius ("Pentagon Triangle Radius", float) = 0 + _PentagonTipSize ("Pentagon Triangle Size", float) = 0 + _TriangleCornerRadius ("Triangle Radius", Vector) = (0, 0, 0, 0) + _HexagonTipSize ("Hexagon Tip Size", Vector) = (0, 0, 0, 0) + _HexagonTipRadius ("Hexagon Tip Radius", Vector) = (0, 0, 0, 0) + _HexagonCornerRadius ("Hexagon Corner Radius", Vector) = (0, 0, 0, 0) + _NStarPolygonSideCount ("NStar Polygon Side Count", float) = 3 + _NStarPolygonInset ("Nstar Polygon Inset", float) = 2 + _NStarPolygonCornerRadius ("Nstar Polygon Corner Radius", float) = 0 + _NStarPolygonOffset ("Nstar Polygon Offset", Vector) = (0, 0, 0, 0) + + _EnableGradient ("Enable GradientEffect", int) = 0 + _GradientType ("GradientEffect Type", int) = 0 + _GradientInterpolationType ("GradientEffect Interpolation Type", int) = 0 + _GradientRotation ("_GradientRotation", float) = 0 + _GradientColor0 ("GradientColor0", Vector) = (0, 0, 0, 0) + _GradientColor1 ("GradientColor1", Vector) = (1, 1, 1, 1) + _GradientColor2 ("GradientColor2", Vector) = (0, 0, 0, 0) + _GradientColor3 ("GradientColor3", Vector) = (0, 0, 0, 0) + _GradientColor4 ("GradientColor4", Vector) = (0, 0, 0, 0) + _GradientColor5 ("GradientColor5", Vector) = (0, 0, 0, 0) + _GradientColor6 ("GradientColor6", Vector) = (0, 0, 0, 0) + _GradientColor7 ("GradientColor7", Vector) = (0, 0, 0, 0) + _GradientColorLength ("GradientColorLength", int) = 0 + _GradientAlpha0 ("GradientAlpha0", Vector) = (1, 0, 0, 0) + _GradientAlpha1 ("GradientAlpha1", Vector) = (1, 1, 0, 0) + _GradientAlpha2 ("GradientAlpha2", Vector) = (0, 0, 0, 0) + _GradientAlpha3 ("GradientAlpha3", Vector) = (0, 0, 0, 0) + _GradientAlpha4 ("GradientAlpha4", Vector) = (0, 0, 0, 0) + _GradientAlpha5 ("GradientAlpha5", Vector) = (0, 0, 0, 0) + _GradientAlpha6 ("GradientAlpha6", Vector) = (0, 0, 0, 0) + _GradientAlpha7 ("GradientAlpha7", Vector) = (0, 0, 0, 0) + _GradientAlphaLength ("GradientAlphaLength", int) = 0 + _CornerGradientColor0 ("CornerGradientColor0", Color) = (1, 0, 0, 1) + _CornerGradientColor1 ("CornerGradientColor1", Color) = (0, 1, 0, 1) + _CornerGradientColor2 ("CornerGradientColor2", Color) = (0, 0, 1, 1) + _CornerGradientColor3 ("CornerGradientColor3", Color) = (0, 0, 0, 1) + + _OutlineWidth ("Outline Width", float) = 0 + _OutlineColor ("Outline Color", Color) = (0, 0, 0, 1) + + _StencilComp ("Stencil Comparison", Float) = 8 + _Stencil ("Stencil ID", Float) = 0 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + + _ColorMask ("Color Mask", Float) = 15 + + /* //SOFTMASK_HANDLE_START + [PerRendererData] _SoftMask ("Mask", 2D) = "white" {} + */ //SOFTMASK_HANDLE_END + + [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 + } + + SubShader + { + Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" "PreviewType" = "Plane" "CanUseSpriteAtlas" = "True" } + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Cull Off + Lighting Off + ZWrite Off + ZTest [unity_GUIZTestMode] + Blend SrcAlpha OneMinusSrcAlpha + ColorMask [_ColorMask] + + Pass + { + Name "Default" + CGPROGRAM + + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + #include "UnityUI.cginc" + #include "2D_SDF.cginc" + /* //SOFTMASK_HANDLE_START + #include "Assets/SoftMask/Shaders/SoftMask.cginc" //SOFTMASK_INCLUDE_HANDLE + */ //SOFTMASK_HANDLE_END + + + #pragma multi_compile_local _ UNITY_UI_CLIP_RECT + #pragma multi_compile_local _ UNITY_UI_ALPHACLIP + + #pragma multi_compile_local _ CIRCLE TRIANGLE RECTANGLE PENTAGON HEXAGON NSTAR_POLYGON + + #pragma multi_compile_local _ STROKE OUTLINED OUTLINED_STROKE + #pragma multi_compile_local _ GRADIENT_LINEAR GRADIENT_RADIAL GRADIENT_CORNER + + /* //SOFTMASK_HANDLE_START + #pragma multi_compile _ SOFTMASK_SIMPLE + */ //SOFTMASK_HANDLE_END + + struct appdata_t + { + float4 vertex: POSITION; + float4 color: COLOR; + float2 texcoord: TEXCOORD0; + float2 uv1: TEXCOORD1; + float2 size: TEXCOORD2; + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float4 vertex: SV_POSITION; + fixed4 color: COLOR; + float2 texcoord: TEXCOORD0; + float4 shapeData: TEXCOORD1; + float2 effectsUv: TEXCOORD2; + float4 worldPosition : TEXCOORD3; + + + /* //SOFTMASK_HANDLE_START + SOFTMASK_COORDS(4) + */ //SOFTMASK_HANDLE_END + + UNITY_VERTEX_OUTPUT_STEREO + }; + + sampler2D _MainTex; float4 _MainTex_ST; + fixed4 _Color; + fixed4 _TextureSize; + fixed4 _TextureSampleAdd; + float4 _ClipRect; + half _PixelWorldScale; + half _StrokeWidth; + half _OutlineWidth; + half4 _OutlineColor; + half _FalloffDistance; + half _ShapeRotation; + half _ConstrainRotation; + half _FlipHorizontal; + half _FlipVertical; + + #if RECTANGLE + float4 _RectangleCornerRadius; + #endif + + #if CIRCLE + float _CircleRadius; + float _CircleFitRadius; + #endif + + #if PENTAGON + float4 _PentagonCornerRadius; + float _PentagonTipRadius; + float _PentagonTipSize; + #endif + + #if TRIANGLE + float3 _TriangleCornerRadius; + #endif + + #if HEXAGON + half2 _HexagonTipSize; + half2 _HexagonTipRadius; + half4 _HexagonCornerRadius; + #endif + + #if NSTAR_POLYGON + float _NStarPolygonSideCount; + float _NStarPolygonCornerRadius; + float _NStarPolygonInset; + float2 _NStarPolygonOffset; + #endif + + #if GRADIENT_LINEAR || GRADIENT_RADIAL + half4 colors[8]; + half4 alphas[8]; + half _GradientInterpolationType; + half _GradientColorLength; + half _GradientAlphaLength; + half _GradientRotation; + + half4 _GradientColor0; + half4 _GradientColor1; + half4 _GradientColor2; + half4 _GradientColor3; + half4 _GradientColor4; + half4 _GradientColor5; + half4 _GradientColor6; + half4 _GradientColor7; + + half4 _GradientAlpha0; + half4 _GradientAlpha1; + half4 _GradientAlpha2; + half4 _GradientAlpha3; + half4 _GradientAlpha4; + half4 _GradientAlpha5; + half4 _GradientAlpha6; + half4 _GradientAlpha7; + #endif + + #if GRADIENT_CORNER + half4 _CornerGradientColor0; + half4 _CornerGradientColor1; + half4 _CornerGradientColor2; + half4 _CornerGradientColor3; + #endif + + + + + + #if GRADIENT_LINEAR || GRADIENT_RADIAL + float4 SampleGradient(float Time) + { + float3 color = colors[0].rgb; + [unroll] + for (int c = 1; c < 8; c ++) + { + float colorPos = saturate((Time - colors[c - 1].w) / (colors[c].w - colors[c - 1].w)) * step(c, _GradientColorLength - 1); + color = lerp(color, colors[c].rgb, lerp(colorPos, step(0.01, colorPos), _GradientInterpolationType)); + } + + float alpha = alphas[0].x; + [unroll] + for (int a = 1; a < 8; a ++) + { + float alphaPos = saturate((Time - alphas[a - 1].y) / (alphas[a].y - alphas[a - 1].y)) * step(a, _GradientAlphaLength - 1); + alpha = lerp(alpha, alphas[a].x, lerp(alphaPos, step(0.01, alphaPos), _GradientInterpolationType)); + } + return float4(color, alpha); + } + #endif + + #if RECTANGLE + half rectangleScene(float4 _additionalData) + { + + float2 _texcoord = _additionalData.xy; + float2 _size = float2(_additionalData.z, _additionalData.w); + float4 radius = _RectangleCornerRadius; + half4 c = half4(_texcoord, _size - _texcoord); + half rect = min(min(min(c.x, c.y), c.z), c.w); + + bool4 cornerRects; + cornerRects.x = _texcoord.x < radius.x && _texcoord.y < radius.x; + cornerRects.y = _texcoord.x > _size.x - radius.y && _texcoord.y < radius.y; + cornerRects.z = _texcoord.x > _size.x - radius.z && _texcoord.y > _size.y - radius.z; + cornerRects.w = _texcoord.x < radius.w && _texcoord.y > _size.y - radius.w; + + half cornerMask = any(cornerRects); + + half4 cornerCircles; + cornerCircles.x = radius.x - length(_texcoord - radius.xx); + cornerCircles.y = radius.y - length(_texcoord - half2(_size.x - radius.y, radius.y)); + cornerCircles.z = radius.z - length(_texcoord - (half2(_size.x, _size.y) - radius.zz)); + cornerCircles.w = radius.w - length(_texcoord - half2(radius.w, _size.y - radius.w)); + + cornerCircles = min(max(cornerCircles, 0) * cornerRects, rect); + half corners = max(max(max(cornerCircles.x, cornerCircles.y), cornerCircles.z), cornerCircles.w); + corners = max(corners, 0.0) * cornerMask; + + return rect*(cornerMask-1) - corners; + /* + float2 _texcoord = _additionalData.xy; + float2 _size = float2(_additionalData.z, _additionalData.w); + float4 radius = _RectangleCornerRadius; + + + half rect = rectanlge(_texcoord - half2(_size.x / 2.0, _size.y / 2.0), _size.x, _size.y); + half cornerCircle = circle(_texcoord - radius.xx, radius.x); + rect = _texcoord.x < radius.x && _texcoord.y < radius.x ? cornerCircle: rect; + cornerCircle = circle(_texcoord - half2(_size.x - radius.y, radius.y), radius.y); + rect = _texcoord.x > _size.x - radius.y && _texcoord.y < radius.y ? cornerCircle: rect; + cornerCircle = circle(_texcoord - (half2(_size.x, _size.y) - radius.zz), radius.z); + rect = _texcoord.x > _size.x - radius.z && _texcoord.y > _size.y - radius.z ? cornerCircle: rect; + cornerCircle = circle(_texcoord - half2(radius.w, _size.y - radius.w), radius.w); + rect = _texcoord.x < radius.w && _texcoord.y > _size.y - radius.w ? cornerCircle: rect; + + return rect; + */ + } + #endif + + #if CIRCLE + float circleScene(float4 _additionalData) + { + float2 _texcoord = _additionalData.xy; + float2 _size = float2(_additionalData.z, _additionalData.w); + float width = _size.x; + float height = _size.y; + float radius = lerp(_CircleRadius, min(width, height) / 2.0, _CircleFitRadius); + half sdf = circle(_texcoord - float2(width / 2.0, height / 2.0), radius); + return sdf; + } + #endif + + #if TRIANGLE + half triangleScene(float4 _additionalData) + { + float2 _texcoord = _additionalData.xy; + float2 _size = float2(_additionalData.z, _additionalData.w); + float width = _size.x;//_additionalData.z; + float height = _size.y;//_additionalData.w; + + half sdf = sdTriangleIsosceles(_texcoord - half2(width / 2.0, height), half2(width / 2.0, -height)); + + //return sdf; + + _TriangleCornerRadius = max(_TriangleCornerRadius, half3(0.001, 0.001, 0.001)); + // Left Corner + half halfWidth = width / 2.0; + half m = height / halfWidth; + half d = sqrt(1.0 + m * m); + half c = 0.0; + half k = -_TriangleCornerRadius.x * d + c; + half x = (_TriangleCornerRadius.x - k) / m; + half2 circlePivot = half2(x, _TriangleCornerRadius.x); + half cornerCircle = circle(_texcoord - circlePivot, _TriangleCornerRadius.x); + //sdf = sdfDifference(sdf, cornerCircle); + //return sdf; + x = (circlePivot.y + circlePivot.x / m - c) / (m + 1.0 / m); + half y = m * x + c; + half fy = map(_texcoord.x, x, circlePivot.x, y, circlePivot.y); + sdf = _texcoord.y < fy && _texcoord.x < circlePivot.x ? cornerCircle: sdf; + //return sdf; + // Right Corner + m = -m; c = 2.0 * height; + k = -_TriangleCornerRadius.y * d + c; + x = (_TriangleCornerRadius.y - k) / m; + circlePivot = half2(x, _TriangleCornerRadius.y); + cornerCircle = circle(_texcoord - circlePivot, _TriangleCornerRadius.y); + x = (circlePivot.y + circlePivot.x / m - c) / (m + 1.0 / m); y = m * x + c; + fy = map(_texcoord.x, circlePivot.x, x, circlePivot.y, y); + sdf = _texcoord.x > circlePivot.x && _texcoord.y < fy ? cornerCircle: sdf; + + //Top Corner + k = -_TriangleCornerRadius.z * sqrt(1.0 + m * m) + c; + y = m * (width / 2.0) + k; + circlePivot = half2(halfWidth, y); + cornerCircle = circle(_texcoord - circlePivot, _TriangleCornerRadius.z); + x = (circlePivot.y + circlePivot.x / m - c) / (m + 1.0 / m); y = m * x + c; + fy = map(_texcoord.x, width - x, x, -1.0, 1.0); + fy = lerp(circlePivot.y, y, abs(fy)); + sdf = _texcoord.y > fy ? cornerCircle: sdf; + + return sdf; + } + #endif + + #if PENTAGON + half pentagonScene(float4 _additionalData) + { + + float2 _texcoord = _additionalData.xy; + float2 _size = float2(_additionalData.z, _additionalData.w); + float width = _size.x; + float height = _size.y; + + // solid pentagon + half baseRect = rectanlge(_texcoord - half2(width / 2.0, height / 2.0), width, height); + half scale = height / _PentagonTipSize; + half rhombus = sdRhombus(_texcoord - float2(width / 2, _PentagonTipSize * scale), float2(width / 2, _PentagonTipSize) * scale); + half sdfPentagon = sdfDifference(baseRect, sdfDifference(baseRect, rhombus)); + + // Bottom rounded corner + _PentagonTipRadius = max(_PentagonTipRadius, 0.001); + float halfWidth = width / 2; + float m = -_PentagonTipSize / halfWidth; + float d = sqrt(1 + m * m); + float c = _PentagonTipSize; + float k = _PentagonTipRadius * d + _PentagonTipSize; + + half2 circlePivot = half2(halfWidth, m * halfWidth + k); + half cornerCircle = circle(_texcoord - circlePivot, _PentagonTipRadius); + half x = (circlePivot.y + circlePivot.x / m - c) / (m + 1 / m); + half y = m * x + c; + half fy = map(_texcoord.x, x, width - x, -1, 1); + fy = lerp(_PentagonTipRadius, y, abs(fy)); + sdfPentagon = _texcoord.y < fy ? cornerCircle: sdfPentagon; + + // Mid Left rounded corner + k = _PentagonCornerRadius.w * d + _PentagonTipSize; + circlePivot = half2(_PentagonCornerRadius.w, m * _PentagonCornerRadius.w + k); + cornerCircle = circle(_texcoord - circlePivot, _PentagonCornerRadius.w); + x = (circlePivot.y + circlePivot.x / m - c) / (m + 1 / m); y = m * x + c; + fy = map(_texcoord.x, x, circlePivot.x, y, circlePivot.y); + sdfPentagon = _texcoord.y > fy && _texcoord.y < circlePivot.y ? cornerCircle: sdfPentagon; + + // Mid Right rounded corner + m = -m; k = _PentagonCornerRadius.z * d - _PentagonTipSize; + circlePivot = half2(width - _PentagonCornerRadius.z, m * (width - _PentagonCornerRadius.z) + k); + cornerCircle = circle(_texcoord - circlePivot, _PentagonCornerRadius.z); + x = (circlePivot.y + circlePivot.x / m - c) / (m + 1 / m); y = m * x + c; + fy = map(_texcoord.x, circlePivot.x, x, circlePivot.y, y); + sdfPentagon = _texcoord.y > fy && _texcoord.y < circlePivot.y ? cornerCircle: sdfPentagon; + + // Top rounded corners + cornerCircle = circle(_texcoord - half2(_PentagonCornerRadius.x, height - _PentagonCornerRadius.x), _PentagonCornerRadius.x); + bool mask = _texcoord.x < _PentagonCornerRadius.x && _texcoord.y > height - _PentagonCornerRadius.x; + sdfPentagon = mask ? cornerCircle: sdfPentagon; + cornerCircle = circle(_texcoord - half2(width - _PentagonCornerRadius.y, height - _PentagonCornerRadius.y), _PentagonCornerRadius.y); + mask = _texcoord.x > width - _PentagonCornerRadius.y && _texcoord.y > height - _PentagonCornerRadius.y; + sdfPentagon = mask ? cornerCircle: sdfPentagon; + + return sdfPentagon; + } + #endif + + #if HEXAGON + half hexagonScene(float4 _additionalData) + { + float2 _texcoord = _additionalData.xy; + float2 _size = float2(_additionalData.z, _additionalData.w); + float width = _size.x;//_additionalData.z; + float height = _size.y;//_additionalData.w; + + half baseRect = rectanlge(_texcoord - half2(width / 2.0, height / 2.0), width, height); + half scale = width / _HexagonTipSize.x; + half rhombus1 = sdRhombus(_texcoord - float2(_HexagonTipSize.x * scale, height / 2.0), float2(_HexagonTipSize.x, height / 2.0) * scale); + scale = width / _HexagonTipSize.y; + half rhombus2 = sdRhombus(_texcoord - float2(width - _HexagonTipSize.y * scale, height / 2.0), float2(_HexagonTipSize.y, height / 2.0) * scale); + half sdfHexagon = sdfDifference(sdfDifference(baseRect, -rhombus1), -rhombus2); + + + + //Left Rounded Corners + float halfHeight = height / 2.0; + float m = -halfHeight / _HexagonTipSize.x; + float c = halfHeight; + float d = sqrt(1.0 + m * m); + float k = _HexagonTipRadius.x * d + c; + //middle + half2 circlePivot = half2((halfHeight - k) / m, halfHeight); + half cornerCircle = circle(_texcoord - circlePivot, _HexagonTipRadius.x); + half x = (circlePivot.y + circlePivot.x / m - c) / (m + 1.0 / m); + half y = m * x + c; + half fy = map(_texcoord.x, x, circlePivot.x, y, circlePivot.y); + sdfHexagon = _texcoord.y > fy && _texcoord.y < height - fy ? cornerCircle: sdfHexagon; + + //return sdfHexagon; + + //bottom + k = _HexagonCornerRadius.x * d + c; + circlePivot = half2((_HexagonCornerRadius.x - k) / m, _HexagonCornerRadius.x); + cornerCircle = circle(_texcoord - circlePivot, _HexagonCornerRadius.x); + x = (circlePivot.y + circlePivot.x / m - c) / (m + 1.0 / m); y = m * x + c; + fy = map(_texcoord.x, x, circlePivot.x, y, circlePivot.y); + sdfHexagon = _texcoord.y < fy && _texcoord.x < circlePivot.x ? cornerCircle: sdfHexagon; + + //return sdfHexagon; + //top + k = _HexagonCornerRadius.w * d + c; + circlePivot = half2((_HexagonCornerRadius.w - k) / m, height - _HexagonCornerRadius.w); + cornerCircle = circle(_texcoord - circlePivot, _HexagonCornerRadius.w); + x = (_HexagonCornerRadius.w + circlePivot.x / m - c) / (m + 1.0 / m); y = m * x + c; + fy = map(_texcoord.x, x, circlePivot.x, height - y, circlePivot.y); + sdfHexagon = _texcoord.y > fy && _texcoord.x < circlePivot.x ? cornerCircle: sdfHexagon; + //return sdfHexagon; + //Right Rounded Corners + m = halfHeight / _HexagonTipSize.y; + d = sqrt(1.0 + m * m); + c = halfHeight - m * width; + k = _HexagonTipRadius.y * d + c; + + //middle + circlePivot = half2((halfHeight - k) / m, halfHeight); + cornerCircle = circle(_texcoord - circlePivot, _HexagonTipRadius.y); + x = (circlePivot.y + circlePivot.x / m - c) / (m + 1.0 / m); y = m * x + c; + fy = map(_texcoord.x, circlePivot.x, x, circlePivot.y, y); + sdfHexagon = _texcoord.y > fy && _texcoord.y < height - fy ? cornerCircle: sdfHexagon; + //return sdfHexagon; + //bottom + k = _HexagonCornerRadius.y * d + c; + circlePivot = half2((_HexagonCornerRadius.y - k) / m, _HexagonCornerRadius.y); + cornerCircle = circle(_texcoord - circlePivot, _HexagonCornerRadius.y); + x = (circlePivot.y + circlePivot.x / m - c) / (m + 1.0 / m); y = m * x + c; + fy = map(_texcoord.x, circlePivot.x, x, circlePivot.y, y); + sdfHexagon = _texcoord.y < fy && _texcoord.x > circlePivot.x ? cornerCircle: sdfHexagon; + //return sdfHexagon; + //top + k = _HexagonCornerRadius.z * d + c; + circlePivot = half2((_HexagonCornerRadius.z - k) / m, height - _HexagonCornerRadius.z); + cornerCircle = circle(_texcoord - circlePivot, _HexagonCornerRadius.z); + x = (_HexagonCornerRadius.z + circlePivot.x / m - c) / (m + 1.0 / m); y = m * x + c; + fy = map(_texcoord.x, circlePivot.x, x, circlePivot.y, height - y); + sdfHexagon = _texcoord.y > fy && _texcoord.x > circlePivot.x ? cornerCircle: sdfHexagon; + + return sdfHexagon; + } + + #endif + + + #if NSTAR_POLYGON + half nStarPolygonScene(float4 _additionalData) + { + float2 _texcoord = _additionalData.xy; + float width = _additionalData.z; + float height = _additionalData.w; + float size = height / 2 - _NStarPolygonCornerRadius; + half str = sdNStarPolygon(_texcoord - half2(width / 2, height / 2) - _NStarPolygonOffset, size, _NStarPolygonSideCount, _NStarPolygonInset) - _NStarPolygonCornerRadius; + return str; + } + #endif + + float2 rotateUV(float2 uv, float rotation, float2 mid) + { + return float2( + cos(rotation) * (uv.x - mid.x) + sin(rotation) * (uv.y - mid.y) + mid.x, + cos(rotation) * (uv.y - mid.y) - sin(rotation) * (uv.x - mid.x) + mid.y + ); + } + + v2f vert(appdata_t v) + { + v2f OUT; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); + OUT.worldPosition = v.vertex; + OUT.vertex = UnityObjectToClipPos(v.vertex); + OUT.texcoord = v.texcoord; + OUT.effectsUv = v.uv1; + + float2 size = float2(v.size.x + _FalloffDistance, v.size.y + _FalloffDistance); + float shapeRotation = radians(_ShapeRotation); + size = _ConstrainRotation > 0.0 && frac(abs(shapeRotation) / 3.14159) > 0.1? float2(size.y, size.x) : size; + + float2 shapeUv = _ConstrainRotation > 0 ? v.uv1 : v.uv1 * size; + shapeUv = rotateUV(shapeUv, shapeRotation, _ConstrainRotation > 0? float2(0.5, 0.5) : size * 0.5); + shapeUv*= _ConstrainRotation > 0.0? size : 1.0; + + shapeUv.x = lerp(shapeUv.x, abs(size.x - shapeUv.x), _FlipHorizontal); + shapeUv.y = lerp(shapeUv.y, abs(size.y - shapeUv.y), _FlipVertical); + + OUT.shapeData = float4(shapeUv.x, shapeUv.y, size.x, size.y); + + #ifdef UNITY_HALF_TEXEL_OFFSET + OUT.vertex.xy += (_ScreenParams.zw - 1.0) * float2(-1.0, 1.0); + #endif + OUT.color = v.color * _Color; + + + /* //SOFTMASK_HANDLE_START + SOFTMASK_CALCULATE_COORDS(OUT, v.vertex); + */ //SOFTMASK_HANDLE_END + return OUT; + } + + fixed4 frag(v2f IN): SV_Target + { + half4 color = IN.color; + half2 texcoord = IN.texcoord; + color = (tex2D(_MainTex, texcoord) + _TextureSampleAdd) * color; + + + #if GRADIENT_LINEAR || GRADIENT_RADIAL + colors[0] = _GradientColor0; + colors[1] = _GradientColor1; + colors[2] = _GradientColor2; + colors[3] = _GradientColor3; + colors[4] = _GradientColor4; + colors[5] = _GradientColor5; + colors[6] = _GradientColor6; + colors[7] = _GradientColor7; + + alphas[0] = _GradientAlpha0; + alphas[1] = _GradientAlpha1; + alphas[2] = _GradientAlpha2; + alphas[3] = _GradientAlpha3; + alphas[4] = _GradientAlpha4; + alphas[5] = _GradientAlpha5; + alphas[6] = _GradientAlpha6; + alphas[7] = _GradientAlpha7; + #endif + + #if GRADIENT_LINEAR + half gradientRotation = radians(_GradientRotation); + half t = cos(gradientRotation) * (IN.effectsUv.x - 0.5) + + sin(gradientRotation) * (IN.effectsUv.y - 0.5) + 0.5; + half4 grad = SampleGradient(t); + color *= grad; + #endif + #if GRADIENT_RADIAL + half fac = saturate(length(IN.effectsUv - float2(.5, .5)) * 2); + half4 grad = SampleGradient(clamp(fac, 0, 1)); + color *= grad; + #endif + + #if GRADIENT_CORNER + half4 topCol = lerp(_CornerGradientColor2, _CornerGradientColor3, IN.effectsUv.x); + half4 bottomCol = lerp(_CornerGradientColor0, _CornerGradientColor1, IN.effectsUv.x); + half4 finalCol = lerp(topCol, bottomCol, IN.effectsUv.y); + + color *= finalCol; + #endif + + #if RECTANGLE || CIRCLE || PENTAGON || TRIANGLE || HEXAGON || NSTAR_POLYGON + float sdfData = 0; + float pixelScale = clamp(1.0/_FalloffDistance, 1.0/2048.0, 2048.0); + #if RECTANGLE + sdfData = rectangleScene(IN.shapeData); + #elif CIRCLE + sdfData = circleScene(IN.shapeData); + #elif PENTAGON + sdfData = pentagonScene(IN.shapeData); + #elif TRIANGLE + sdfData = triangleScene(IN.shapeData); + #elif HEXAGON + sdfData = hexagonScene(IN.shapeData); + #elif NSTAR_POLYGON + sdfData = nStarPolygonScene(IN.shapeData); + #endif + + #if !OUTLINED && !STROKE && !OUTLINED_STROKE + float sdf = sampleSdf(sdfData, pixelScale); + color.a *= sdf; + #endif + #if STROKE + float sdf = sampleSdfStrip(sdfData, _StrokeWidth + _OutlineWidth, pixelScale); + color.a *= sdf; + #endif + + #if OUTLINED + float alpha = sampleSdf(sdfData, pixelScale); + float lerpFac = sampleSdf(sdfData + _OutlineWidth, pixelScale); + color = half4(lerp(_OutlineColor.rgb, color.rgb, lerpFac), lerp(_OutlineColor.a * color.a, color.a, lerpFac)); + color.a *= alpha; + #endif + + #if OUTLINED_STROKE + float alpha = sampleSdfStrip(sdfData, _OutlineWidth + _StrokeWidth, pixelScale); + float lerpFac = sampleSdfStrip(sdfData + _OutlineWidth, _StrokeWidth + _FalloffDistance, pixelScale); + lerpFac = clamp(lerpFac, 0, 1); + color = half4(lerp(_OutlineColor.rgb, color.rgb, lerpFac), lerp(_OutlineColor.a * color.a, color.a, lerpFac)); + color.a *= alpha; + #endif + #endif + + /* //SOFTMASK_HANDLE_START + color.a *= SOFTMASK_GET_MASK(IN); + */ //SOFTMASK_HANDLE_END + + #ifdef UNITY_UI_CLIP_RECT + color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect); + #endif + + #ifdef UNITY_UI_ALPHACLIP + clip(color.a - 0.001); + #endif + + return fixed4(color); + } + ENDCG + + } + } + CustomEditor "MPUIKIT.Editor.MPImageShaderGUI" +} diff --git a/Assets/MPUIKit/Runtime/Resources/Shaders/MPImage.shader.meta b/Assets/MPUIKit/Runtime/Resources/Shaders/MPImage.shader.meta new file mode 100644 index 0000000..90e2fae --- /dev/null +++ b/Assets/MPUIKit/Runtime/Resources/Shaders/MPImage.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0162a17359546d3479ae73858a9226ab +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Resources/Shaders/MPImageBasic.shader b/Assets/MPUIKit/Runtime/Resources/Shaders/MPImageBasic.shader new file mode 100644 index 0000000..93d8b30 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Resources/Shaders/MPImageBasic.shader @@ -0,0 +1,410 @@ +Shader "MPUI/Basic Procedural Image" +{ + Properties + { + [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" { } + _Color ("Tint", Color) = (1,1,1,1) + + _StencilComp ("Stencil Comparison", Float) = 8 + _Stencil ("Stencil ID", Float) = 0 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + _ColorMask ("Color Mask", Float) = 15 + + + /* //SOFTMASK_HANDLE_START + [PerRendererData] _SoftMask ("Mask", 2D) = "white" {} + */ //SOFTMASK_HANDLE_END + + [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 + } + + SubShader + { + Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" "PreviewType" = "Plane" "CanUseSpriteAtlas" = "True" } + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Cull Off + Lighting Off + ZWrite Off + ZTest [unity_GUIZTestMode] + Blend SrcAlpha OneMinusSrcAlpha + ColorMask [_ColorMask] + + Pass + { + Name "Default" + CGPROGRAM + + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + #include "UnityUI.cginc" + #include "2D_SDF.cginc" + /* //SOFTMASK_HANDLE_START + #include "Assets/SoftMask/Shaders/SoftMask.cginc" //SOFTMASK_INCLUDE_HANDLE + */ //SOFTMASK_HANDLE_END + + #pragma multi_compile_local _ UNITY_UI_CLIP_RECT + #pragma multi_compile_local _ UNITY_UI_ALPHACLIP + + #pragma multi_compile_local _ CIRCLE TRIANGLE RECTANGLE NSTAR_POLYGON + #pragma multi_compile_local _ STROKE OUTLINED OUTLINED_STROKE + + /* //SOFTMASK_HANDLE_START + #pragma multi_compile _ SOFTMASK_SIMPLE + */ //SOFTMASK_HANDLE_END + + + struct appdata_t + { + float4 vertex: POSITION; + float4 color: COLOR; + float2 uv0: TEXCOORD0; + float2 uv1: TEXCOORD1; + float2 uv2: TEXCOORD2; + float2 uv3: TEXCOORD3; + float3 normal: NORMAL; + float4 tangent: TANGENT; + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float4 vertex: SV_POSITION; + fixed4 color: COLOR; + float2 uv0: TEXCOORD0; + float4 sizeData: TEXCOORD1; + float4 strokeOutlineCornerData: TEXCOORD2; + fixed4 outlineColor: COLOR1; + float4 shapeData: TEXCOORD3; + float4 worldPosition: TEXCOORD4; + + + /* //SOFTMASK_HANDLE_START + SOFTMASK_COORDS(5) + */ //SOFTMASK_HANDLE_END + + UNITY_VERTEX_OUTPUT_STEREO + }; + + sampler2D _MainTex; + fixed4 _Color; + fixed4 _TextureSampleAdd; + float4 _ClipRect; + float4 _MainTex_ST; + + #if RECTANGLE + half rectangleScene(float4 _sizeData, float4 _shapeData, float _cornerStyle) + { + float2 _texcoord = _sizeData.xy; + float2 _size = float2(_sizeData.z, _sizeData.w); + float4 radius = _shapeData; + half4 c = half4(_texcoord, _size - _texcoord); + half rect = min(min(min(c.x, c.y), c.z), c.w); + + bool4 cornerRects; + cornerRects.x = _texcoord.x < radius.x && _texcoord.y < radius.x; + cornerRects.y = _texcoord.x > _size.x - radius.y && _texcoord.y < radius.y; + cornerRects.z = _texcoord.x > _size.x - radius.z && _texcoord.y > _size.y - radius.z; + cornerRects.w = _texcoord.x < radius.w && _texcoord.y > _size.y - radius.w; + + half cornerMask = any(cornerRects); + + half4 cornerCircles; + cornerCircles.x = radius.x - length(_texcoord - radius.xx);//circle(_texcoord - radius.xx, radius.x); + cornerCircles.y = radius.y - length(_texcoord - half2(_size.x - radius.y, radius.y));//circle(_texcoord - half2(_size.x - radius.y, radius.y), radius.y); + cornerCircles.z = radius.z - length(_texcoord - (half2(_size.x, _size.y) - radius.zz));//circle(_texcoord - (half2(_size.x, _size.y) - radius.zz), radius.z); + cornerCircles.w = radius.w - length(_texcoord - half2(radius.w, _size.y - radius.w)); //circle(_texcoord - half2(radius.w, _size.y - radius.w), radius.w); + + cornerCircles = min(max(cornerCircles, 0) * cornerRects, rect); + //cornerCircles = max(cornerCircles, 0) * cornerRects; + half corners = max(max(max(cornerCircles.x, cornerCircles.y), cornerCircles.z), cornerCircles.w); + corners = max(corners, 0.0) * cornerMask; + + //return rect; + return rect*(cornerMask-1) - corners; + + /* + half rect = rectanlge(_texcoord - half2(_size.x / 2.0, _size.y / 2.0), _size.x, _size.y); + half cornerCircle = circle(_texcoord - radius.xx, radius.x); + rect = _texcoord.x < radius.x && _texcoord.y < radius.x ? cornerCircle: rect; + cornerCircle = circle(_texcoord - half2(_size.x - radius.y, radius.y), radius.y); + rect = _texcoord.x > _size.x - radius.y && _texcoord.y < radius.y ? cornerCircle: rect; + cornerCircle = circle(_texcoord - (half2(_size.x, _size.y) - radius.zz), radius.z); + rect = _texcoord.x > _size.x - radius.z && _texcoord.y > _size.y - radius.z ? cornerCircle: rect; + cornerCircle = circle(_texcoord - half2(radius.w, _size.y - radius.w), radius.w); + rect = _texcoord.x < radius.w && _texcoord.y > _size.y - radius.w ? cornerCircle: rect; + */ + + //max(max(max(cornerCircles.x, cornerCircles.y), cornerCircles.z), cornerCircles.w); + } + #endif + + #if CIRCLE + float circleScene(float4 _sizeData, float4 _shapeData) + { + float2 _texcoord = _sizeData.xy; + float2 _size = _sizeData.zw; + float width = _size.x; + float height = _size.y; + float radius = lerp(_shapeData.x, min(width, height) / 2.0, _shapeData.y); + float sdf = circle(_texcoord - float2(width / 2.0, height / 2.0), radius); + return sdf; + } + #endif + + #if TRIANGLE + half triangleScene(float4 _sizeData, float4 _shapeData) + { + float2 _texcoord = _sizeData.xy; + float2 _size = _sizeData.zw; + float width = _size.x;//_additionalData.z; + float height = _size.y;//_additionalData.w; + + half sdf = sdTriangleIsosceles(_texcoord - half2(width / 2.0, height), half2(width / 2.0, -height)); + + //return sdf; + + float3 _TriangleCornerRadius = max(_shapeData.xyz, float3(0.001, 0.001, 0.001)); + // Left Corner + half halfWidth = width / 2.0; + half m = height / halfWidth; + half d = sqrt(1.0 + m * m); + half c = 0.0; + half k = -_TriangleCornerRadius.x * d + c; + half x = (_TriangleCornerRadius.x - k) / m; + half2 circlePivot = half2(x, _TriangleCornerRadius.x); + half cornerCircle = circle(_texcoord - circlePivot, _TriangleCornerRadius.x); + //sdf = sdfDifference(sdf, cornerCircle); + //return sdf; + x = (circlePivot.y + circlePivot.x / m - c) / (m + 1.0 / m); + half y = m * x + c; + half fy = map(_texcoord.x, x, circlePivot.x, y, circlePivot.y); + sdf = _texcoord.y < fy && _texcoord.x < circlePivot.x ? cornerCircle: sdf; + //return sdf; + // Right Corner + m = -m; c = 2.0 * height; + k = -_TriangleCornerRadius.y * d + c; + x = (_TriangleCornerRadius.y - k) / m; + circlePivot = half2(x, _TriangleCornerRadius.y); + cornerCircle = circle(_texcoord - circlePivot, _TriangleCornerRadius.y); + x = (circlePivot.y + circlePivot.x / m - c) / (m + 1.0 / m); y = m * x + c; + fy = map(_texcoord.x, circlePivot.x, x, circlePivot.y, y); + sdf = _texcoord.x > circlePivot.x && _texcoord.y < fy ? cornerCircle: sdf; + + //Top Corner + k = -_TriangleCornerRadius.z * sqrt(1.0 + m * m) + c; + y = m * (width / 2.0) + k; + circlePivot = half2(halfWidth, y); + cornerCircle = circle(_texcoord - circlePivot, _TriangleCornerRadius.z); + x = (circlePivot.y + circlePivot.x / m - c) / (m + 1.0 / m); y = m * x + c; + fy = map(_texcoord.x, width - x, x, -1.0, 1.0); + fy = lerp(circlePivot.y, y, abs(fy)); + sdf = _texcoord.y > fy ? cornerCircle: sdf; + + return sdf; + } + #endif + + #if NSTAR_POLYGON + half nStarPolygonScene(float4 _sizeData, float4 _shapeData) + { + float2 _texcoord = _sizeData.xy; + float width = _sizeData.z; + float height = _sizeData.w; + float size = height / 2 - _shapeData.y; + half str = sdNStarPolygon(_texcoord - half2(width / 2, height / 2), size, _shapeData.x, _shapeData.z) - _shapeData.y; + return str; + } + #endif + + float2 rotateUV(float2 uv, float rotation, float2 mid) + { + return float2( + cos(rotation) * (uv.x - mid.x) + sin(rotation) * (uv.y - mid.y) + mid.x, + cos(rotation) * (uv.y - mid.y) - sin(rotation) * (uv.x - mid.x) + mid.y + ); + } + + + float4 decode_0_1_16(float2 input){ + float m = 65535.0; + float e = 256.0 / 255.0; + float n = 1.0 / m; + + float4 c = float4(input.x, input.x, input.y, input.y); + c.yw *= m; + c = frac(c); + c -= float4(c.y, 0.0, c.w, 0.0) * n; + return clamp(c * e, 0.0, 1.0); + } + + + v2f vert(appdata_t v) + { + v2f OUT; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); + + OUT.vertex = UnityObjectToClipPos(v.vertex); + OUT.worldPosition = v.vertex; + OUT.color = v.color * _Color; + OUT.uv0 = v.uv0; + + + float2 size = v.uv1; + half strokeWidth = v.normal.y; + half falloff = v.normal.z; + + float rotationData = v.uv3.x; + half cornerStyle = v.uv3.y; + + half outlineWidth = v.normal.x; + half4 outlineColor = v.tangent; + + float4 shapeData; + #if CIRCLE + shapeData.xy = v.uv2.xy; + #else + shapeData = decode_0_1_16(v.uv2) * min(size.x, size.y); + #endif + + + OUT.strokeOutlineCornerData = float4(strokeWidth, falloff, outlineWidth, cornerStyle); + OUT.outlineColor = outlineColor; + OUT.shapeData = shapeData; + + // Rotation Values + half sign = rotationData > 0.0 ? 1 : -1; + float f = abs(rotationData); + float shapeRotation = frac(f) * 360.0 * sign; + + // r.xyz -> constrainRotation, flipHorizontal, flipVertical + + f = floor(f); + float p = f / 100.0; + float z = round(p); + p = frac(p) * 10.0; + float y = round(p); + p = frac(p) * 10.0; + float x = round(p); + + half constrainRotation = x; + half flipHorizontal = y; + half flipVertical = z; + + + shapeRotation = radians(shapeRotation); + size = constrainRotation > 0.0 && frac(abs(shapeRotation) / 3.14159) > 0.1? float2(size.y, size.x) : size; + + float2 shapeUv = constrainRotation > 0 ? v.uv0 : v.uv0 * size; + shapeUv = rotateUV(shapeUv, shapeRotation, constrainRotation > 0? float2(0.5, 0.5) : size * 0.5); + shapeUv*= constrainRotation > 0.0? size : 1.0; + + shapeUv.x = lerp(shapeUv.x, abs(size.x - shapeUv.x), flipHorizontal); + shapeUv.y = lerp(shapeUv.y, abs(size.y - shapeUv.y), flipVertical); + + OUT.sizeData = float4(shapeUv.x, shapeUv.y, size.x, size.y); + + #ifdef UNITY_HALF_TEXEL_OFFSET + OUT.vertex.xy += (_ScreenParams.zw - 1.0) * float2(-1.0, 1.0); + #endif + + /* //SOFTMASK_HANDLE_START + SOFTMASK_CALCULATE_COORDS(OUT, v.vertex); + */ //SOFTMASK_HANDLE_END + return OUT; + } + + fixed4 frag(v2f IN): SV_Target + { + half4 color = IN.color; + half2 texcoord = IN.uv0; + color = (tex2D(_MainTex, texcoord) + _TextureSampleAdd) * color; + + float4 sizeData = IN.sizeData; + float strokeWidth = IN.strokeOutlineCornerData.x; + float falloff = IN.strokeOutlineCornerData.y; + float outlineWidth = IN.strokeOutlineCornerData.z; + half4 outlineColor = IN.outlineColor; + float cornerStyle = IN.strokeOutlineCornerData.w; + + float4 shapeData = IN.shapeData; + half pixelScale = clamp(1.0/falloff, 1.0/2048.0, 2048.0); + + float sdfData = 0; + #if RECTANGLE + sdfData = rectangleScene(sizeData, shapeData, cornerStyle); + #endif + + #if CIRCLE + sdfData = circleScene(sizeData, shapeData); + #endif + + #if TRIANGLE + sdfData = triangleScene(sizeData, shapeData); + #endif + + #if NSTAR_POLYGON + sdfData = nStarPolygonScene(sizeData, shapeData); + #endif + + + #if !OUTLINED && !STROKE && !OUTLINED_STROKE + half shape = sampleSdf(sdfData, pixelScale); + color.a *= shape; + //color.a = sdfData; + #endif + #if STROKE + half shape = sampleSdfStrip(sdfData, strokeWidth, pixelScale); + color.a *= shape; + #endif + + #if OUTLINED + float alpha = sampleSdf(sdfData, pixelScale); + float lerpFac = sampleSdf(sdfData + outlineWidth, pixelScale); + color = half4(lerp(outlineColor.rgb, color.rgb, lerpFac), lerp(outlineColor.a * color.a, color.a, lerpFac)); + color.a *= alpha; + #endif + + #if OUTLINED_STROKE + float alpha = sampleSdfStrip(sdfData, outlineWidth + strokeWidth, pixelScale); + float lerpFac = sampleSdfStrip(sdfData + outlineWidth, strokeWidth + falloff, pixelScale); + lerpFac = clamp(lerpFac, 0, 1); + color = half4(lerp(outlineColor.rgb, color.rgb, lerpFac), lerp(outlineColor.a * color.a, color.a, lerpFac)); + color.a *= alpha; + #endif + + + /* //SOFTMASK_HANDLE_START + color.a *= SOFTMASK_GET_MASK(IN); + */ //SOFTMASK_HANDLE_END + + #ifdef UNITY_UI_CLIP_RECT + color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect); + #endif + + #ifdef UNITY_UI_ALPHACLIP + clip(color.a - 0.001); + #endif + + return fixed4(color); + } + ENDCG + + } + } + CustomEditor "MPUIKIT.Editor.MPImageShaderGUI" +} diff --git a/Assets/MPUIKit/Runtime/Resources/Shaders/MPImageBasic.shader.meta b/Assets/MPUIKit/Runtime/Resources/Shaders/MPImageBasic.shader.meta new file mode 100644 index 0000000..25a0eb4 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Resources/Shaders/MPImageBasic.shader.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5309a3f903204db8982ae4b1954c6db2 +timeCreated: 1606546667 \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Resources/mpui_default_empty_sprite.png b/Assets/MPUIKit/Runtime/Resources/mpui_default_empty_sprite.png new file mode 100644 index 0000000..fad18b7 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Resources/mpui_default_empty_sprite.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db10406556d3bdcd15084fa9e0601c9378bf810dad2e8d5e33c4208f77898d9a +size 195 diff --git a/Assets/MPUIKit/Runtime/Resources/mpui_default_empty_sprite.png.meta b/Assets/MPUIKit/Runtime/Resources/mpui_default_empty_sprite.png.meta new file mode 100644 index 0000000..12341bd --- /dev/null +++ b/Assets/MPUIKit/Runtime/Resources/mpui_default_empty_sprite.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: 6b96d6950a9c30743a2e826ee8684ac4 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + 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 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + 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: 2578ed92ef82c514e8bbd96fb1c68462 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Scripts.meta b/Assets/MPUIKit/Runtime/Scripts.meta new file mode 100644 index 0000000..ff8af0d --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d777f9201a672da4289932e37ec6ac34 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Scripts/Effects.meta b/Assets/MPUIKit/Runtime/Scripts/Effects.meta new file mode 100644 index 0000000..15fc0cf --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Effects.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7fa9108346022b448941984d96434457 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Scripts/Effects/GradientEffect.cs b/Assets/MPUIKit/Runtime/Scripts/Effects/GradientEffect.cs new file mode 100644 index 0000000..64ff7f0 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Effects/GradientEffect.cs @@ -0,0 +1,264 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace MPUIKIT { + /// + /// Gradient overlay of the image. + /// + [Serializable] + public struct GradientEffect : IMPUIComponent { + + [SerializeField] private bool m_Enabled; + [SerializeField] private GradientType m_GradientType; + [SerializeField] private Gradient m_Gradient; + [SerializeField] private Color[] m_CornerGradientColors; + [SerializeField] private float m_Rotation; + + /// + /// Enable/Disable Gradient overlay + /// + public bool Enabled { + get => m_Enabled; + set { + m_Enabled = value; + if (ShouldModifySharedMat) { + SharedMat.SetInt(SpEnableGradient, m_Enabled?1:0); + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + } + } + + /// + /// Type of the Gradient. There are three types: Linear, Radial, Corner + /// + public GradientType GradientType { + get => m_GradientType; + set { + m_GradientType = value; + if (ShouldModifySharedMat) { + SharedMat.SetInt(SpGradientType, (int)m_GradientType); + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + + } + } + + /// + /// Rotation of the gradient. Only applies for Linear Gradient. + /// + public float Rotation { + get => m_Rotation; + set { + m_Rotation = value; + if (ShouldModifySharedMat) { + SharedMat.SetFloat(SpGradientRotation, m_Rotation); + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + + } + } + + /// + /// Gradient that will be overlaid onto the image. + /// + public Gradient Gradient { + get => m_Gradient; + set { + m_Gradient = value; + if (ShouldModifySharedMat) { + List Colors = new List(8); + List Alphas = new List(8); + for (int i = 0; i < 8; i++) { + if (i < m_Gradient.colorKeys.Length) { + Color col = m_Gradient.colorKeys[i].color; + Vector4 data = new Vector4(col.r, col.g, col.b, + m_Gradient.colorKeys[i].time); + Colors.Add(data); + SharedMat.SetColor("_GradientColor"+i, data); + } + else { + SharedMat.SetColor("_GradientColor"+i, Vector4.zero); + } + if (i < m_Gradient.alphaKeys.Length) { + Vector4 data = new Vector4(m_Gradient.alphaKeys[i].alpha, m_Gradient.alphaKeys[i].time); + Alphas.Add(data); + SharedMat.SetColor("_GradientAlpha"+i, data); + } + else { + SharedMat.SetColor("_GradientAlpha"+i, Vector4.zero); + } + } + + SharedMat.SetInt(SpGradientColorsLength, m_Gradient.colorKeys.Length); + SharedMat.SetInt(SpGradientAlphasLength, m_Gradient.alphaKeys.Length); + + for (int i = Colors.Count; i < 8; i++) + { + Colors.Add(Vector4.zero); + } + + for (int i = Alphas.Count; i < 8; i++) + { + Alphas.Add(Vector4.zero); + } + + SharedMat.SetColorArray(SpGradientColors, Colors); + SharedMat.GetColorArray(SpGradientAlphas, Alphas); + SharedMat.SetInt(SpGradientInterpolationType, (int) m_Gradient.mode); + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + + } + } + + /// + /// 4 Colors for Corner Gradient overlay. + /// [0] => top-left, [1] => top-right + /// [2] => bottom-left, [3] => bottom-right + /// + public Color[] CornerGradientColors { + get => m_CornerGradientColors; + set { + + if (m_CornerGradientColors.Length != 4) { + m_CornerGradientColors = new Color[4]; + } + + for (int i = 0; i < value.Length && i < 4; i++) { + m_CornerGradientColors[i] = value[i]; + } + + if (ShouldModifySharedMat) { + for (int i = 0; i < m_CornerGradientColors.Length; i++) { + SharedMat.SetColor("_CornerGradientColor"+i, m_CornerGradientColors[i]); + } + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + + } + } + + + private static readonly int SpGradientType = Shader.PropertyToID("_GradientType"); + private static readonly int SpGradientColors = Shader.PropertyToID("colors"); + private static readonly int SpGradientAlphas = Shader.PropertyToID("alphas"); + private static readonly int SpGradientColorsLength = Shader.PropertyToID("_GradientColorLength"); + private static readonly int SpGradientAlphasLength = Shader.PropertyToID("_GradientAlphaLength"); + private static readonly int SpGradientInterpolationType = Shader.PropertyToID("_GradientInterpolationType"); + private static readonly int SpEnableGradient = Shader.PropertyToID("_EnableGradient"); + private static readonly int SpGradientRotation = Shader.PropertyToID("_GradientRotation"); + + public Material SharedMat { get; set; } + public bool ShouldModifySharedMat { get; set; } + public RectTransform RectTransform { get; set; } + + + public void Init(Material SharedMat, Material renderMat, RectTransform rectTransform) { + this.SharedMat = SharedMat; + this.ShouldModifySharedMat = SharedMat == renderMat; + this.RectTransform = rectTransform; + + if (m_CornerGradientColors == null || m_CornerGradientColors.Length != 4) { + m_CornerGradientColors = new Color[4]; + } + } + + public event EventHandler OnComponentSettingsChanged; + + public void OnValidate() { + Enabled = m_Enabled; + GradientType = m_GradientType; + Gradient = m_Gradient; + CornerGradientColors = m_CornerGradientColors; + Rotation = m_Rotation; + } + + public void InitValuesFromMaterial(ref Material material) { + m_Enabled = material.GetInt(SpEnableGradient) == 1; + m_GradientType = (GradientType) material.GetInt(SpGradientType); + m_Rotation = material.GetFloat(SpGradientRotation); + int colorLength = material.GetInt(SpGradientColorsLength); + int alphaLength = material.GetInt(SpGradientAlphasLength); + Gradient gradient = new Gradient(); + GradientColorKey[] colorKeys = new GradientColorKey[colorLength]; + GradientAlphaKey[] alphaKeys = new GradientAlphaKey[alphaLength]; + for (int i = 0; i < colorLength; i++) { + Color colorValue = material.GetColor("_GradientColor" + i); + colorKeys[i].color = new Color(colorValue.r, colorValue.g, colorValue.b); + colorKeys[i].time = colorValue.a; + } + + gradient.colorKeys = colorKeys; + for (int i = 0; i < alphaLength; i++) { + Color alphaValue = material.GetColor("_GradientAlpha" + i); + alphaKeys[i].alpha = alphaValue.r; + alphaKeys[i].time = alphaValue.g; + } + + gradient.alphaKeys = alphaKeys; + gradient.mode = (GradientMode) material.GetInt(SpGradientInterpolationType); + m_Gradient = gradient; + + m_CornerGradientColors = new Color[4]; + for (int i = 0; i < CornerGradientColors.Length; i++) { + CornerGradientColors[i] = material.GetColor("_CornerGradientColor" + i); + } + } + + public void ModifyMaterial(ref Material material, params object[] otherProperties) { + material.DisableKeyword("GRADIENT_LINEAR"); + material.DisableKeyword("GRADIENT_RADIAL"); + material.DisableKeyword("GRADIENT_CORNER"); + + + if (!m_Enabled) return; + material.SetInt(SpEnableGradient, m_Enabled?1:0); + material.SetInt(SpGradientType, (int)m_GradientType); + switch (m_GradientType) { + case GradientType.Linear: + material.EnableKeyword("GRADIENT_LINEAR"); + break; + case GradientType.Radial: + material.EnableKeyword("GRADIENT_RADIAL"); + break; + case GradientType.Corner: + material.EnableKeyword("GRADIENT_CORNER"); + break; + default: + throw new ArgumentOutOfRangeException(); + } + + + if (m_GradientType == GradientType.Corner) { + for (int i = 0; i < m_CornerGradientColors.Length; i++) { + material.SetColor("_CornerGradientColor"+i, m_CornerGradientColors[i]); + } + } + else { + Color[] colors = new Color[8]; + Color[] alphas = new Color[8]; + for (int i = 0; i < m_Gradient.colorKeys.Length; i++) { + Color col = m_Gradient.colorKeys[i].color; + colors[i] = new Color(col.r, col.g, col.b, m_Gradient.colorKeys[i].time); + } + for (int i = 0; i < m_Gradient.alphaKeys.Length; i++) { + alphas[i] = new Color(m_Gradient.alphaKeys[i].alpha, m_Gradient.alphaKeys[i].time, 0, 0); + } + + material.SetFloat(SpGradientColorsLength, m_Gradient.colorKeys.Length); + material.SetFloat(SpGradientAlphasLength, m_Gradient.alphaKeys.Length); + material.SetFloat(SpGradientInterpolationType, (int)m_Gradient.mode); + material.SetFloat(SpGradientRotation, m_Rotation); + + for (int i = 0; i < colors.Length; i++) { + material.SetColor("_GradientColor"+i, colors[i]); + } + + for (int i = 0; i < alphas.Length; i++) { + material.SetColor("_GradientAlpha"+i, alphas[i]); + } + } + } + } +} diff --git a/Assets/MPUIKit/Runtime/Scripts/Effects/GradientEffect.cs.meta b/Assets/MPUIKit/Runtime/Scripts/Effects/GradientEffect.cs.meta new file mode 100644 index 0000000..9c9a11b --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Effects/GradientEffect.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dc339dba02e2a204bb8fbf6bf949b948 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Scripts/Enums.cs b/Assets/MPUIKit/Runtime/Scripts/Enums.cs new file mode 100644 index 0000000..6a98821 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Enums.cs @@ -0,0 +1,27 @@ +namespace MPUIKIT +{ + public enum DrawShape { + None = 0, + Circle, + Triangle, + Rectangle, + Pentagon, + Hexagon, + NStarPolygon + } + + public enum GradientType { + Linear, + Corner, + Radial + } + + public enum MaterialMode { + Dynamic, + Shared + } + + public enum CornerStyleType { + Sharp, Rounded, Cropped, BoxCut, CircleCut + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Scripts/Enums.cs.meta b/Assets/MPUIKit/Runtime/Scripts/Enums.cs.meta new file mode 100644 index 0000000..23d9cb5 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Enums.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 546177621794a974cbee7e2628280bfa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Scripts/IMPUIComponent.cs b/Assets/MPUIKit/Runtime/Scripts/IMPUIComponent.cs new file mode 100644 index 0000000..339c25d --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/IMPUIComponent.cs @@ -0,0 +1,16 @@ +using System; +using UnityEngine; + +namespace MPUIKIT { + public interface IMPUIComponent{ + Material SharedMat { get; set; } + bool ShouldModifySharedMat { get; set; } + RectTransform RectTransform { get; set; } + + void Init(Material sharedMat, Material renderMat, RectTransform rectTransform); + event EventHandler OnComponentSettingsChanged; + void OnValidate(); + void InitValuesFromMaterial(ref Material material); + void ModifyMaterial(ref Material material, params object[] otherProperties); + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Scripts/IMPUIComponent.cs.meta b/Assets/MPUIKit/Runtime/Scripts/IMPUIComponent.cs.meta new file mode 100644 index 0000000..ae29386 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/IMPUIComponent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0b4b38c0ec8d16245b60f2f0f2320058 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Scripts/MPImage.cs b/Assets/MPUIKit/Runtime/Scripts/MPImage.cs new file mode 100644 index 0000000..6a9098d --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/MPImage.cs @@ -0,0 +1,688 @@ +using System; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.UI.MPUIKIT; +#if UNITY_EDITOR +using UnityEditor; +#endif + + +namespace MPUIKIT { + [AddComponentMenu("UI/MPUI/MPImage")] + public class MPImage : Image { + #region Constants + + public const string MpShaderName = "MPUI/Procedural Image"; + + #endregion + + #region SerializedFields + + [SerializeField] private DrawShape m_DrawShape = DrawShape.None; + [SerializeField] private Type m_ImageType = Type.Simple; + [SerializeField] private MaterialMode m_MaterialMode; + + [SerializeField] private float m_StrokeWidth; + [SerializeField] private float m_OutlineWidth; + [SerializeField] private Color m_OutlineColor = Color.black; + [SerializeField] private float m_FalloffDistance = 0.5f; + [SerializeField] private bool m_ConstrainRotation = true; + [SerializeField] private float m_ShapeRotation; + [SerializeField] private bool m_FlipHorizontal; + [SerializeField] private bool m_FlipVertical; + + [SerializeField] private Triangle m_Triangle = new Triangle(); + [SerializeField] private Rectangle m_Rectangle = new Rectangle(); + [SerializeField] private Circle m_Circle = new Circle(); + [SerializeField] private Pentagon m_Pentagon = new Pentagon(); + [SerializeField] private Hexagon m_Hexagon = new Hexagon(); + [SerializeField] private NStarPolygon m_NStarPolygon = new NStarPolygon(); + + [SerializeField] private GradientEffect m_GradientEffect = new GradientEffect(); + + #endregion + + #region Public Properties + + #region Draw Settings + + /// + /// Type of the shape to be drawn. ie: Rectangle, Circle + /// + public DrawShape DrawShape { + get => m_DrawShape; + set { + m_DrawShape = value; + if (material == m_Material) { + m_Material.SetInt(SpDrawShape, (int) m_DrawShape); + } + + base.SetMaterialDirty(); + } + } + + /// + /// Width of the stroke for the drawn shape. 0 is no stroke. + /// + public float StrokeWidth { + get => m_StrokeWidth; + set { + m_StrokeWidth = value; + m_StrokeWidth = m_StrokeWidth < 0 ? 0 : m_StrokeWidth; + if (material == m_Material) { + m_Material.SetFloat(SpStrokeWidth, m_StrokeWidth); + } + + base.SetMaterialDirty(); + } + } + + /// + /// Width of the outline for the drawn shape. 0 is no outline. + /// + public float OutlineWidth { + get => m_OutlineWidth; + set { + m_OutlineWidth = value; + m_OutlineWidth = m_OutlineWidth < 0 ? 0 : m_OutlineWidth; + if (m_Material == material) { + m_Material.SetFloat(SpOutlineWidth, m_OutlineWidth); + } + + base.SetMaterialDirty(); + } + } + + /// + /// Color of the Outline. Has no effect is teh value of the OutlineWidth is 0 + /// + public Color OutlineColor { + get => m_OutlineColor; + set { + m_OutlineColor = value; + if (m_Material == material) { + m_Material.SetColor(SpOutlineColor, m_OutlineColor); + } + + base.SetMaterialDirty(); + } + } + + /// + /// Edge falloff distance of the shape + /// + public float FalloffDistance { + get { return m_FalloffDistance; } + set { + m_FalloffDistance = Mathf.Max(value, 0f); + if (material == m_Material) { + m_Material.SetFloat(SpFalloffDistance, m_FalloffDistance); + } + + base.SetMaterialDirty(); + } + } + + /// + /// Constrains rotation to 0, 90, 270 degrees angle if set to true. But the width and height of the shape + /// is replaced as necessary to avoid clipping. + /// If set to false, any shapes can be rotated in any arbitrary angle but will often result in + /// clipping of the shape. + /// + public bool ConstrainRotation { + get { return m_ConstrainRotation; } + set { + m_ConstrainRotation = value; + + if (m_Material == material) { + m_Material.SetInt(SpConstrainedRotation, value?1:0); + } + if (value) { + m_ShapeRotation = ConstrainRotationValue(m_ShapeRotation); + } + + base.SetVerticesDirty(); + base.SetMaterialDirty(); + } + } + + private float ConstrainRotationValue(float val) { + float finalRotation = val - val % 90; + if (Mathf.Abs(finalRotation) >= 360) finalRotation = 0; + return finalRotation; + } + + /// + /// Rotation of the shape. + /// + public float ShapeRotation { + get { return m_ShapeRotation; } + set { + m_ShapeRotation = m_ConstrainRotation ? ConstrainRotationValue(value) : value; + if (m_Material == material) { + m_Material.SetFloat(SpShapeRotation, m_ShapeRotation); + } + + base.SetMaterialDirty(); + } + } + + /// + /// Flips the shape horizontally. + /// + public bool FlipHorizontal { + get { return m_FlipHorizontal; } + set { + m_FlipHorizontal = value; + if (m_Material == material) { + m_Material.SetInt(SpFlipHorizontal, m_FlipHorizontal ? 1 : 0); + } + + base.SetMaterialDirty(); + } + } + + /// + /// Flips the shape vertically + /// + public bool FlipVertical { + get { return m_FlipVertical; } + set { + m_FlipVertical = value; + if (m_Material == material) { + m_Material.SetInt(SpFlipVertical, m_FlipVertical ? 1 : 0); + } + + base.SetMaterialDirty(); + } + } + + /// + /// Defines what material type of use to render the shape. Dynamic or Shared. + /// Default is Dynamic and will issue one draw call per image object. If set to shared, assigned + /// material in the material slot will be used to render the image. It will fallback to dynamic + /// if no material in the material slot is assigned + /// + public MaterialMode MaterialMode { + get { return m_MaterialMode; } + set { + if (m_MaterialMode == value) return; + m_MaterialMode = value; + InitializeComponents(); + if (material == m_Material) { + InitValuesFromSharedMaterial(); +#if UNITY_EDITOR + _parseAgainOnValidate = true; +#endif + } + + base.SetMaterialDirty(); + } + } + + /// + /// Shared material to use to render the shape. the material must use the "MPUI/Procedural Sprite" shader + /// + public override Material material { + get { + if (m_Material && m_MaterialMode == MaterialMode.Shared) { + return m_Material; + } + + return DynamicMaterial; + } + set { + m_Material = value; + + if (m_Material && m_MaterialMode == MaterialMode.Shared && m_Material.shader.name == MpShaderName) { + InitValuesFromSharedMaterial(); +#if UNITY_EDITOR + _parseAgainOnValidate = true; +#endif + } + + InitializeComponents(); + base.SetMaterialDirty(); + } + } + + // ReSharper disable once InconsistentNaming + /// + /// Type of the image. Only two types are supported. Simple and Filled. + /// Default and fallback value is Simple. + /// + public new Type type { + get => m_ImageType; + set { + if (m_ImageType == value) return; + switch (value) { + case Type.Simple: + case Type.Filled: + m_ImageType = value; + break; + case Type.Tiled: + case Type.Sliced: + break; + default: + throw new ArgumentOutOfRangeException(value.ToString(), value, null); + } + + base.type = m_ImageType; + } + } + + #endregion + + public Triangle Triangle { + get => m_Triangle; + set { + m_Triangle = value; + SetMaterialDirty(); + } + } + + public Rectangle Rectangle { + get => m_Rectangle; + set { + m_Rectangle = value; + SetMaterialDirty(); + } + } + + public Circle Circle{ + get => m_Circle; + set { + m_Circle = value; + SetMaterialDirty(); + } + } + + public Pentagon Pentagon { + get => m_Pentagon; + set { + m_Pentagon = value; + SetMaterialDirty(); + } + } + + public Hexagon Hexagon { + get => m_Hexagon; + set { + m_Hexagon = value; + SetMaterialDirty(); + } + } + + public NStarPolygon NStarPolygon { + get => m_NStarPolygon; + set { + m_NStarPolygon = value; + SetMaterialDirty(); + } + } + + public GradientEffect GradientEffect { + get => m_GradientEffect; + set { + m_GradientEffect = value; + SetMaterialDirty(); + } + } + + #endregion + + #region Private Variables + + private Material _dynamicMaterial; + + private Material DynamicMaterial { + get { + if (_dynamicMaterial == null) { + _dynamicMaterial = new Material(Shader.Find(MpShaderName)); + _dynamicMaterial.name += " [Dynamic]"; + } + + return _dynamicMaterial; + } + } + +#if UNITY_EDITOR + private bool _parseAgainOnValidate; +#endif + + private Sprite ActiveSprite { + get { + Sprite overrideSprite1 = overrideSprite; + return overrideSprite1 != null ? overrideSprite1 : sprite; + } + } + + #endregion + + #region Material PropertyIds + + private static readonly int SpPixelWorldScale = Shader.PropertyToID("_PixelWorldScale"); + private static readonly int SpDrawShape = Shader.PropertyToID("_DrawShape"); + private static readonly int SpStrokeWidth = Shader.PropertyToID("_StrokeWidth"); + private static readonly int SpOutlineWidth = Shader.PropertyToID("_OutlineWidth"); + private static readonly int SpOutlineColor = Shader.PropertyToID("_OutlineColor"); + private static readonly int SpFalloffDistance = Shader.PropertyToID("_FalloffDistance"); + private static readonly int SpShapeRotation = Shader.PropertyToID("_ShapeRotation"); + private static readonly int SpConstrainedRotation = Shader.PropertyToID("_ConstrainRotation"); + private static readonly int SpFlipHorizontal = Shader.PropertyToID("_FlipHorizontal"); + private static readonly int SpFlipVertical = Shader.PropertyToID("_FlipVertical"); + + #endregion + + +#if UNITY_EDITOR + public void UpdateSerializedValuesFromSharedMaterial() { + if (m_Material && MaterialMode == MaterialMode.Shared) { + InitValuesFromSharedMaterial(); + base.SetMaterialDirty(); + } + } + + protected override void OnValidate() { + InitializeComponents(); + if (_parseAgainOnValidate) { + InitValuesFromSharedMaterial(); + _parseAgainOnValidate = false; + } + + DrawShape = m_DrawShape; + + StrokeWidth = m_StrokeWidth; + OutlineWidth = m_OutlineWidth; + OutlineColor = m_OutlineColor; + FalloffDistance = m_FalloffDistance; + ConstrainRotation = m_ConstrainRotation; + ShapeRotation = m_ShapeRotation; + FlipHorizontal = m_FlipHorizontal; + FlipVertical = m_FlipVertical; + + + m_Triangle.OnValidate(); + m_Circle.OnValidate(); + m_Rectangle.OnValidate(); + m_Pentagon.OnValidate(); + m_Hexagon.OnValidate(); + m_NStarPolygon.OnValidate(); + + m_GradientEffect.OnValidate(); + + base.OnValidate(); + base.SetMaterialDirty(); + } +#endif + + + private void InitializeComponents() { + m_Circle.Init(m_Material, material, rectTransform); + m_Triangle.Init(m_Material, material, rectTransform); + m_Rectangle.Init(m_Material, material, rectTransform); + m_Pentagon.Init(m_Material, material, rectTransform); + m_Hexagon.Init(m_Material, material, rectTransform); + m_NStarPolygon.Init(m_Material, material, rectTransform); + m_GradientEffect.Init(m_Material, material, rectTransform); + } + + void FixAdditionalShaderChannelsInCanvas() + { + Canvas c = canvas; + if(canvas == null) return; + AdditionalCanvasShaderChannels additionalShaderChannels = c.additionalShaderChannels; + additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord1; + additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord2; + c.additionalShaderChannels = additionalShaderChannels; + } + +#if UNITY_EDITOR + protected override void Reset() { + InitializeComponents(); + base.Reset(); + } +#else + void Reset() { + InitializeComponents(); + } +#endif + + protected override void Awake() + { + base.Awake(); + Init(); + } + + public void Init() + { + InitializeComponents(); + FixAdditionalShaderChannelsInCanvas(); + if (m_Material && MaterialMode == MaterialMode.Shared) { + InitValuesFromSharedMaterial(); + } + ListenToComponentChanges(true); + base.SetAllDirty(); + } + + protected override void OnDestroy() { + ListenToComponentChanges(false); + base.OnDestroy(); + } + + protected void ListenToComponentChanges(bool toggle) { + if (toggle) { + m_Circle.OnComponentSettingsChanged += OnComponentSettingsChanged; + m_Triangle.OnComponentSettingsChanged += OnComponentSettingsChanged; + m_Rectangle.OnComponentSettingsChanged += OnComponentSettingsChanged; + m_Pentagon.OnComponentSettingsChanged += OnComponentSettingsChanged; + m_Hexagon.OnComponentSettingsChanged += OnComponentSettingsChanged; + m_NStarPolygon.OnComponentSettingsChanged += OnComponentSettingsChanged; + m_GradientEffect.OnComponentSettingsChanged += OnComponentSettingsChanged; + } + else { + m_Circle.OnComponentSettingsChanged -= OnComponentSettingsChanged; + m_Triangle.OnComponentSettingsChanged -= OnComponentSettingsChanged; + m_Rectangle.OnComponentSettingsChanged -= OnComponentSettingsChanged; + m_Pentagon.OnComponentSettingsChanged -= OnComponentSettingsChanged; + m_Hexagon.OnComponentSettingsChanged -= OnComponentSettingsChanged; + m_NStarPolygon.OnComponentSettingsChanged -= OnComponentSettingsChanged; + m_GradientEffect.OnComponentSettingsChanged += OnComponentSettingsChanged; + } + } + + protected override void OnTransformParentChanged() + { + base.OnTransformParentChanged(); + FixAdditionalShaderChannelsInCanvas(); + } + + private void OnComponentSettingsChanged(object sender, EventArgs e) { + base.SetMaterialDirty(); + } + + + protected override void OnRectTransformDimensionsChange() { + base.OnRectTransformDimensionsChange(); + m_Circle.UpdateCircleRadius(rectTransform); + base.SetMaterialDirty(); + } + + protected override void OnPopulateMesh(VertexHelper vh) { + switch (type) { + case Type.Simple: + case Type.Sliced: + case Type.Tiled: + MPImageHelper.GenerateSimpleSprite(vh, preserveAspect, canvas, rectTransform, ActiveSprite, + color, m_FalloffDistance); + break; + case Type.Filled: + MPImageHelper.GenerateFilledSprite(vh, preserveAspect, canvas, rectTransform, ActiveSprite, + color, fillMethod, fillAmount, fillOrigin, fillClockwise, m_FalloffDistance); + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + + public override Material GetModifiedMaterial(Material baseMaterial) { + + Material mat = base.GetModifiedMaterial(baseMaterial); + + + if (m_Material && MaterialMode == MaterialMode.Shared) { + InitValuesFromSharedMaterial(); + } + + DisableAllMaterialKeywords(mat); + + + RectTransform rt = rectTransform; + if (DrawShape != DrawShape.None) { + mat.SetFloat(SpOutlineWidth, m_OutlineWidth); + mat.SetFloat(SpStrokeWidth, m_StrokeWidth); + + mat.SetColor(SpOutlineColor, OutlineColor); + mat.SetFloat(SpFalloffDistance, FalloffDistance); + + float pixelSize = 1/Mathf.Max(0, FalloffDistance); + mat.SetFloat(SpPixelWorldScale, Mathf.Clamp(pixelSize, 0f, 999999f)); + + + if (m_StrokeWidth > 0 && m_OutlineWidth > 0) { + mat.EnableKeyword("OUTLINED_STROKE"); + } + else { + if (m_StrokeWidth > 0) { + mat.EnableKeyword("STROKE"); + } + else if (m_OutlineWidth > 0) { + mat.EnableKeyword("OUTLINED"); + } + else { + mat.DisableKeyword("OUTLINED_STROKE"); + mat.DisableKeyword("STROKE"); + mat.DisableKeyword("OUTLINED"); + } + } + } + + + m_Triangle.ModifyMaterial(ref mat); + m_Circle.ModifyMaterial(ref mat, m_FalloffDistance); + m_Rectangle.ModifyMaterial(ref mat); + m_Pentagon.ModifyMaterial(ref mat); + m_Hexagon.ModifyMaterial(ref mat); + m_NStarPolygon.ModifyMaterial(ref mat); + + m_GradientEffect.ModifyMaterial(ref mat); + + + switch (DrawShape) { + case DrawShape.None: + mat.DisableKeyword("CIRCLE"); + mat.DisableKeyword("TRIANGLE"); + mat.DisableKeyword("RECTANGLE"); + mat.DisableKeyword("PENTAGON"); + mat.DisableKeyword("HEXAGON"); + mat.DisableKeyword("NSTAR_POLYGON"); + break; + case DrawShape.Circle: + mat.EnableKeyword("CIRCLE"); + break; + case DrawShape.Triangle: + mat.EnableKeyword("TRIANGLE"); + break; + case DrawShape.Rectangle: + mat.EnableKeyword("RECTANGLE"); + break; + case DrawShape.Pentagon: + mat.EnableKeyword("PENTAGON"); + break; + case DrawShape.NStarPolygon: + mat.EnableKeyword("NSTAR_POLYGON"); + break; + case DrawShape.Hexagon: + mat.EnableKeyword("HEXAGON"); + break; + default: + throw new ArgumentOutOfRangeException(); + } + + mat.SetInt(SpDrawShape, (int) DrawShape); + mat.SetInt(SpFlipHorizontal, m_FlipHorizontal ? 1 : 0); + mat.SetInt(SpFlipVertical, m_FlipVertical ? 1 : 0); + + mat.SetFloat(SpShapeRotation, m_ShapeRotation); + mat.SetInt(SpConstrainedRotation, m_ConstrainRotation?1:0); + + return mat; + } + + private void DisableAllMaterialKeywords(Material mat) { + mat.DisableKeyword("PROCEDURAL"); + mat.DisableKeyword("HYBRID"); + + mat.DisableKeyword("CIRCLE"); + mat.DisableKeyword("TRIANGLE"); + mat.DisableKeyword("RECTANGLE"); + mat.DisableKeyword("PENTAGON"); + mat.DisableKeyword("HEXAGON"); + mat.DisableKeyword("NSTAR_POLYGON"); + + mat.DisableKeyword("STROKE"); + mat.DisableKeyword("OUTLINED"); + mat.DisableKeyword("OUTLINED_STROKE"); + + mat.DisableKeyword("ROUNDED_CORNERS"); + + mat.DisableKeyword("GRADIENT_LINEAR"); + mat.DisableKeyword("GRADIENT_CORNER"); + mat.DisableKeyword("GRADIENT_RADIAL"); + } + + + public void InitValuesFromSharedMaterial() { + if (m_Material == null) return; + Material mat = m_Material; + + //Debug.Log("Parsing shared mat"); + //Basic Settings + m_DrawShape = (DrawShape) mat.GetInt(SpDrawShape); + + m_StrokeWidth = mat.GetFloat(SpStrokeWidth); + m_FalloffDistance = mat.GetFloat(SpFalloffDistance); + m_OutlineWidth = mat.GetFloat(SpOutlineWidth); + m_OutlineColor = mat.GetColor(SpOutlineColor); + m_FlipHorizontal = mat.GetInt(SpFlipHorizontal) == 1; + m_FlipVertical = mat.GetInt(SpFlipVertical) == 1; + m_ConstrainRotation = mat.GetInt(SpConstrainedRotation) == 1; + m_ShapeRotation = mat.GetFloat(SpShapeRotation); + //Debug.Log($"Parsed Falloff Distance: {m_FalloffDistance}"); + + m_Triangle.InitValuesFromMaterial(ref mat); + m_Circle.InitValuesFromMaterial(ref mat); + m_Rectangle.InitValuesFromMaterial(ref mat); + m_Pentagon.InitValuesFromMaterial(ref mat); + m_Hexagon.InitValuesFromMaterial(ref mat); + m_NStarPolygon.InitValuesFromMaterial(ref mat); + + //GradientEffect + + m_GradientEffect.InitValuesFromMaterial(ref mat); + } + +#if UNITY_EDITOR + public Material CreateMaterialAssetFromComponentSettings() { + Material matAsset = new Material(Shader.Find(MpShaderName)); + matAsset = GetModifiedMaterial(matAsset); + string path = EditorUtility.SaveFilePanelInProject("Create Material for MPImage", + "MPMaterial", "mat", "Choose location"); + AssetDatabase.CreateAsset(matAsset, path); + AssetDatabase.SaveAssets(); + AssetDatabase.Refresh(); + return matAsset; + } +#endif + } +} diff --git a/Assets/MPUIKit/Runtime/Scripts/MPImage.cs.meta b/Assets/MPUIKit/Runtime/Scripts/MPImage.cs.meta new file mode 100644 index 0000000..e1804ee --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/MPImage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 141109fb25f0083469e71ce8cb3e75c8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Scripts/MPImageBasic.cs b/Assets/MPUIKit/Runtime/Scripts/MPImageBasic.cs new file mode 100644 index 0000000..9f5c3c4 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/MPImageBasic.cs @@ -0,0 +1,421 @@ +using System; +using UnityEngine; +using UnityEngine.UI; + +namespace MPUIKIT { + [AddComponentMenu("UI/MPUI/MPImageBasic")] + public class MPImageBasic : Image { + + #region SerializedFields + + [SerializeField] private DrawShape m_DrawShape = DrawShape.None; + [SerializeField] private Type m_ImageType = Type.Simple; // Mapping in Vertex Stream + [SerializeField] private float m_StrokeWidth; // MapTo -> UV2.x + [SerializeField] private float m_FalloffDistance = 0.5f; // MapTo -> UV2.y + [SerializeField] private float m_OutlineWidth; // MapTo -> Normal.x + [SerializeField] private Color m_OutlineColor = Color.black; // MapTo -> Tangent.x, Tangent.y, Tangent.z, Tangent.w + [SerializeField] private float m_ShapeRotation; // MapTo -> UV3.x Compressed + [SerializeField] private bool m_ConstrainRotation = true; // MapTo -> UV3.x Compressed + [SerializeField] private bool m_FlipHorizontal; // MapTo -> UV3.x Compressed + [SerializeField] private bool m_FlipVertical; // MapTo -> UV3.x Compressed + [SerializeField] private CornerStyleType m_CornerStyle; // MapTo -> UV3.y + + [SerializeField] private Vector4 m_RectangleCornerRadius; // MapTo -> Normal.y, Normal.z compressed + [SerializeField] private Vector3 m_TriangleCornerRadius; // MapTo -> Normal.y, Normal.z compressed +#pragma warning disable + // ReSharper disable once NotAccessedField.Local + [SerializeField] private bool m_TriangleUniformCornerRadius = true; + // ReSharper disable once NotAccessedField.Local + [SerializeField] private bool m_RectangleUniformCornerRadius = true; +#pragma warning restore + + + [SerializeField] private float m_CircleRadius; // MapTo -> Normal.y + [SerializeField] private bool m_CircleFitToRect = true; // MapTo -> Normal.z + + [SerializeField] private int m_NStarPolygonSideCount = 3; // MapTo -> Normal.y compressed + [SerializeField] private float m_NStarPolygonInset = 2f; // MapTo -> Normal.y compressed + [SerializeField] private float m_NStarPolygonCornerRadius; // MapTo -> Normal.z + + #endregion + + #region Public Accessors + + public DrawShape Shape { get => m_DrawShape; + set { + m_DrawShape = value; + m_Material = null; + base.SetMaterialDirty(); + base.SetVerticesDirty(); + } + } + public float StrokeWidth { + get => m_StrokeWidth; + set { + Vector2 size = GetPixelAdjustedRect().size; + m_StrokeWidth = Mathf.Clamp(value, 0, Mathf.Min(size.x, size.y) * 0.5f); + base.SetVerticesDirty(); + } + } + public float FallOffDistance { + get => m_FalloffDistance; + set { + m_FalloffDistance = Mathf.Max(0, value); + base.SetVerticesDirty(); + } + } + public float OutlineWidth { + get => m_OutlineWidth; + set { + m_OutlineWidth = Mathf.Max(0,value); + base.SetVerticesDirty(); + } + } + public Color OutlineColor { + get => m_OutlineColor; + set { + m_OutlineColor = value; + base.SetVerticesDirty(); + } + } + + public float ShapeRotation { + get => m_ShapeRotation; + set { + m_ShapeRotation = value % 360; + ConstrainRotationValue(); + base.SetVerticesDirty(); + } + } + public bool ConstrainRotation { + get => m_ConstrainRotation; + set { + m_ConstrainRotation = value; + ConstrainRotationValue(); + base.SetVerticesDirty(); + } + } + public bool FlipHorizontal { + get => m_FlipHorizontal; + set { + m_FlipHorizontal = value; + base.SetVerticesDirty(); + } + } + public bool FlipVertical { + get => m_FlipVertical; + set { + m_FlipVertical = value; + base.SetVerticesDirty(); + } + } + + /// + /// Type of the image. Only two types are supported. Simple and Filled. + /// Default and fallback value is Simple. + /// + public new Type type { + get => m_ImageType; + set { + if (m_ImageType != value) { + switch (value) { + case Type.Simple: + case Type.Filled: + if (sprite) m_ImageType = value; + break; + case Type.Tiled: + case Type.Sliced: + break; + default: + throw new ArgumentOutOfRangeException(value.ToString(), value, null); + } + } + if(base.type != m_ImageType) base.type = m_ImageType; + base.SetAllDirty(); + } + } + + public CornerStyleType CornerStyle { + get => m_CornerStyle; + set { + m_CornerStyle = value; + base.SetVerticesDirty(); + } + } + public Vector3 TriangleCornerRadius { + get => m_TriangleCornerRadius; + set { + Vector2 size = GetPixelAdjustedRect().size; + + float zMax = size.x * 0.5f; + m_TriangleCornerRadius.z = Mathf.Clamp(value.z, 0, zMax); + float hMax = Mathf.Min(size.x, size.y) * 0.3f; + + m_TriangleCornerRadius.x = Mathf.Clamp(value.x, 0, hMax); + m_TriangleCornerRadius.y = Mathf.Clamp(value.y, 0, hMax); + + base.SetVerticesDirty(); + } + } + public Vector4 RectangleCornerRadius { + get => m_RectangleCornerRadius; + set + { + m_RectangleCornerRadius = value; + base.SetVerticesDirty(); + } + } + public float CircleRadius { + get => m_CircleRadius; + set { + m_CircleRadius = Mathf.Clamp(value, 0, GetMinSize()); + base.SetVerticesDirty(); + } + } + public bool CircleFitToRect { + get => m_CircleFitToRect; + set { + m_CircleFitToRect = value; + base.SetVerticesDirty(); + } + } + public float NStarPolygonCornerRadius { + get => m_NStarPolygonCornerRadius; + set { + float halfHeight = GetPixelAdjustedRect().height * 0.5f; + m_NStarPolygonCornerRadius = Mathf.Clamp(value, m_NStarPolygonSideCount == 2? 0.1f : 0f, halfHeight); + base.SetVerticesDirty(); + } + } + public float NStarPolygonInset { + get => m_NStarPolygonInset; + set { + m_NStarPolygonInset = Mathf.Clamp(value, 2f, m_NStarPolygonSideCount); + base.SetVerticesDirty(); + } + } + public int NStarPolygonSideCount { + get => m_NStarPolygonSideCount; + set { + m_NStarPolygonSideCount = Mathf.Clamp(value, 2, 10); + base.SetVerticesDirty(); + } + } + + #endregion + + public override Material material { + get + { + switch (m_DrawShape) + { + case DrawShape.None: + return Canvas.GetDefaultCanvasMaterial(); + case DrawShape.Circle: + case DrawShape.Triangle: + case DrawShape.Rectangle: + return MPMaterials.GetMaterial((int)m_DrawShape - 1, m_StrokeWidth > 0f, m_OutlineWidth > 0f); + case DrawShape.Pentagon: + case DrawShape.Hexagon: + case DrawShape.NStarPolygon: + return MPMaterials.GetMaterial(3, m_StrokeWidth > 0f, m_OutlineWidth > 0f); + default: + throw new ArgumentOutOfRangeException(); + } + } + set => Debug.LogWarning("Setting Material of MPImageBasic has no effect."); + } + + public override float preferredWidth => sprite == MPImageUtility.EmptySprite ? 0 : base.preferredWidth; + public override float preferredHeight => sprite == MPImageUtility.EmptySprite ? 0 : base.preferredHeight; + + + protected override void OnEnable() { + base.OnEnable(); + MPImageUtility.FixAdditionalShaderChannelsInCanvas(canvas); + if (sprite == null) sprite = MPImageUtility.EmptySprite; + } + + #if UNITY_EDITOR + protected override void OnValidate() { + base.OnValidate(); + Shape = m_DrawShape; + if (sprite == null) sprite = MPImageUtility.EmptySprite; + type = m_ImageType; + StrokeWidth = m_StrokeWidth; + FallOffDistance = m_FalloffDistance; + OutlineWidth = m_OutlineWidth; + OutlineColor = m_OutlineColor; + ShapeRotation = m_ShapeRotation; + ConstrainRotation = m_ConstrainRotation; + FlipHorizontal = m_FlipHorizontal; + FlipVertical = m_FlipVertical; + CornerStyle = m_CornerStyle; + } +#endif + + private float GetMinSizeHalf() { + return GetMinSize() * 0.5f; + } + + private float GetMinSize() { + Vector2 size = GetPixelAdjustedRect().size; + return Mathf.Min(size.x, size.y); + } + + private void ConstrainRotationValue() { + if (!m_ConstrainRotation) return; + float finalRotation = m_ShapeRotation - (m_ShapeRotation % 90); + if (Mathf.Abs(finalRotation) >= 360) finalRotation = 0; + m_ShapeRotation = finalRotation; + } + + protected override void OnTransformParentChanged() { + base.OnTransformParentChanged(); + MPImageUtility.FixAdditionalShaderChannelsInCanvas(canvas); + base.SetVerticesDirty(); + } + + private MPVertexStream CreateVertexStream() { + MPVertexStream stream = new MPVertexStream(); + RectTransform rectT = rectTransform; + stream.RectTransform = rectT; + Rect r = GetPixelAdjustedRect(); + stream.Uv1 = new Vector2(r.width + m_FalloffDistance, r.height + m_FalloffDistance); + float packedRotData = + PackRotationData(m_ShapeRotation, m_ConstrainRotation, m_FlipHorizontal, m_FlipVertical); + stream.Uv3 = new Vector2(packedRotData, (float)m_CornerStyle); + + stream.Tangent = QualitySettings.activeColorSpace == ColorSpace.Linear? m_OutlineColor.linear : m_OutlineColor; + Vector3 normal = new Vector3(); + normal.x = m_OutlineWidth; + normal.y = m_StrokeWidth; + normal.z = m_FalloffDistance; + + Vector4 data; + Vector2 shapeProps; + switch (m_DrawShape) { + case DrawShape.Circle: + shapeProps = new Vector2(m_CircleRadius, m_CircleFitToRect ? 1 : 0); + break; + case DrawShape.Triangle: + data = m_TriangleCornerRadius; + data = data / Mathf.Min(r.width, r.height); + shapeProps = MPImageUtility.Encode_0_1_16(data); + break; + case DrawShape.Rectangle: + data = FixRadius(m_RectangleCornerRadius); + data = data / Mathf.Min(r.width, r.height); + shapeProps = MPImageUtility.Encode_0_1_16(data); + break; + case DrawShape.NStarPolygon: + data = new Vector4(m_NStarPolygonSideCount, m_NStarPolygonCornerRadius, m_NStarPolygonInset); + data = data / Mathf.Min(r.width, r.height); + shapeProps = MPImageUtility.Encode_0_1_16(data); + break; + default: + shapeProps = Vector2.zero; + break; + } + + stream.Uv2 = shapeProps; + + stream.Normal = normal; + return stream; + } + + private float PackRotationData(float rotation, bool constrainRotation, bool flipH, bool flipV) { + int c = constrainRotation ? 1 : 0; + c += flipH ? 10 : 0; + c += flipV ? 100 : 0; + float cr = rotation % 360f; + float sign = cr >= 0 ? 1 : -1; + cr = Mathf.Abs(cr) / 360f; + cr = (cr + c) * sign; + return cr; + } + + + void UnPackRotation(float f) { + float r = 0, x = 0, y = 0, z = 0; + + float sign = f >= 0.0f ? 1 : -1; + f = Mathf.Abs(f); + r = fract(f) * 360f * sign; + + f = Mathf.Floor(f); + float p = f / 100f; + z = Mathf.Floor(p); + p = fract(p) * 10f; + y = Mathf.Floor(p); + p = fract(p) * 10f; + x = Mathf.Round(p); + + // Debug.Log($"Rotation: {r}, X: {x}, Y: {y}, Z: {z}"); + float fract(float val) { + val = Mathf.Abs(val); + float ret = val - Mathf.Floor(val); + return ret; + } + } + + protected override void OnRectTransformDimensionsChange() + { + base.OnRectTransformDimensionsChange(); + base.SetVerticesDirty(); + } + + private Vector4 FixRadius(Vector4 radius) + { + Rect rect = rectTransform.rect; + + radius = Vector4.Max(radius, Vector4.zero); + radius = Vector4.Min(radius, Vector4.one * Mathf.Min(rect.width, rect.height)); + float scaleFactor = + Mathf.Min ( + Mathf.Min ( + Mathf.Min ( + Mathf.Min ( + rect.width / (radius.x + radius.y), + rect.width / (radius.z + radius.w)), + rect.height / (radius.x + radius.w)), + rect.height / (radius.z + radius.y)), + 1f); + return radius * scaleFactor; + } + + + protected override void OnPopulateMesh(VertexHelper toFill) { + base.OnPopulateMesh(toFill); + + MPVertexStream stream = CreateVertexStream(); + + UIVertex uiVert = new UIVertex(); + + for (int i = 0; i < toFill.currentVertCount; i++) { + toFill.PopulateUIVertex(ref uiVert, i); + + //uiVert.position += ((Vector3)uiVert.uv0 - new Vector3(0.5f, 0.5f)) * m_FalloffDistance; + uiVert.uv1 = stream.Uv1; + uiVert.uv2 = stream.Uv2; + uiVert.uv3 = stream.Uv3; + uiVert.normal = stream.Normal; + uiVert.tangent = stream.Tangent; + + toFill.SetUIVertex(uiVert, i); + } + } + +#if UNITY_EDITOR + protected override void Reset() { + base.Reset(); + if (sprite == null) sprite = MPImageUtility.EmptySprite; + + } +#else + void Reset() { + if (sprite == null) sprite = MPImageUtility.EmptySprite; + } +#endif + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Scripts/MPImageBasic.cs.meta b/Assets/MPUIKit/Runtime/Scripts/MPImageBasic.cs.meta new file mode 100644 index 0000000..446ba61 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/MPImageBasic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fceb93b9d8bf04943b1dd4939eaf6284 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Scripts/Shapes.meta b/Assets/MPUIKit/Runtime/Scripts/Shapes.meta new file mode 100644 index 0000000..03d415d --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Shapes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 39276b906c650414984bc6e7d49b4e97 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Scripts/Shapes/Circle.cs b/Assets/MPUIKit/Runtime/Scripts/Shapes/Circle.cs new file mode 100644 index 0000000..7c5929a --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Shapes/Circle.cs @@ -0,0 +1,79 @@ +using System; +using UnityEngine; + +namespace MPUIKIT { + /// + /// Just a basic circle. + /// + [Serializable] + public struct Circle : IMPUIComponent { + [SerializeField] private float m_Radius; + [SerializeField] private bool m_FitRadius; + + private static readonly int SpRadius = Shader.PropertyToID("_CircleRadius"); + private static readonly int SpFitRadius = Shader.PropertyToID("_CircleFitRadius"); + + /// + /// Radius of the circle. This has no effect if FitToRect is set to true. + /// + public float Radius { + get => m_Radius; + set { + m_Radius = Mathf.Max(value, 0f); + if (ShouldModifySharedMat) { + SharedMat.SetFloat(SpRadius, m_Radius); + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + } + } + /// + /// Fit the circe to the rect-transform + /// + public bool FitToRect { + get => m_FitRadius; + set { + m_FitRadius = value; + if (ShouldModifySharedMat) { + SharedMat.SetInt(SpFitRadius, m_FitRadius?1:0); + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + } + } + + private float CircleFitRadius => Mathf.Min(RectTransform.rect.width, RectTransform.rect.height) / 2; + + public Material SharedMat { get; set; } + public bool ShouldModifySharedMat { get; set; } + public RectTransform RectTransform { get; set; } + + public void Init(Material sharedMat, Material renderMat, RectTransform rectTransform) { + this.SharedMat = sharedMat; + this.ShouldModifySharedMat = sharedMat == renderMat; + this.RectTransform = rectTransform; + } + + public event EventHandler OnComponentSettingsChanged; + + public void OnValidate() { + Radius = m_Radius; + FitToRect = m_FitRadius; + } + + public void InitValuesFromMaterial(ref Material material) { + m_Radius = material.GetFloat(SpRadius); + m_FitRadius = material.GetInt(SpFitRadius) == 1; + } + + public void ModifyMaterial(ref Material material, params object[] otherProperties) { + material.SetFloat(SpRadius, m_Radius); + material.SetInt(SpFitRadius, m_FitRadius?1:0); + } + + internal void UpdateCircleRadius(RectTransform rectT) { + this.RectTransform = rectT; + if (m_FitRadius) { + m_Radius = CircleFitRadius; + } + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Scripts/Shapes/Circle.cs.meta b/Assets/MPUIKit/Runtime/Scripts/Shapes/Circle.cs.meta new file mode 100644 index 0000000..099975e --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Shapes/Circle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8ace3ea082d13834c8cd482daf38afe2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Scripts/Shapes/Hexagon.cs b/Assets/MPUIKit/Runtime/Scripts/Shapes/Hexagon.cs new file mode 100644 index 0000000..149d25d --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Shapes/Hexagon.cs @@ -0,0 +1,105 @@ +using System; +using UnityEngine; + +namespace MPUIKIT { + /// + /// Hexagon shape with two opposite parallel equal sides. It is basically a rectangle where two + /// of it's sides are broken into halves and pulled out of the shape that creates two triangle tips + /// left and right of the shape. + /// + [Serializable] + public struct Hexagon: IMPUIComponent { + [SerializeField] private Vector4 m_CornerRadius; + [SerializeField] private bool m_UniformCornerRadius; + [SerializeField] private Vector2 m_TipSize; + [SerializeField] private bool m_UniformTipSize; + [SerializeField] private Vector2 m_TipRadius; + [SerializeField] private bool m_UniformTipRadius; + + /// + /// Sizes of the two tips (the triangular part sticking out of the rectangular part of the shape) + /// x => left tip, y => right tip + /// + public Vector2 TipSize { + get => m_TipSize; + set { + m_TipSize = Vector2.Max(value, Vector2.one); + if (ShouldModifySharedMat) { + SharedMat.SetVector(SpHexagonTipSizes, m_TipSize); + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + } + } + + /// + /// Radius of the corner of the tips. + /// x => left tip's corner, y => right tip's corner + /// + public Vector2 TipRadius { + get => m_TipRadius; + set { + m_TipRadius = Vector2.Max(value, Vector2.one); + if (ShouldModifySharedMat) { + SharedMat.SetVector(SpHexagonTipRadius, m_TipRadius); + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + } + } + + /// + /// Radius of the four corners of the rectangular part of the shape. + /// Counter-Clockwise from bottom-left + /// x => bottom-left, y => bottom-right + /// z => top-right, w => top-left + /// + public Vector4 CornerRadius { + get => m_CornerRadius; + set { + m_CornerRadius = Vector4.Max(value, Vector4.one); + if (ShouldModifySharedMat) { + SharedMat.SetVector(SpHexagonRectCornerRadius, m_CornerRadius); + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + } + } + + private static readonly int SpHexagonTipSizes = Shader.PropertyToID("_HexagonTipSize"); + private static readonly int SpHexagonTipRadius = Shader.PropertyToID("_HexagonTipRadius"); + private static readonly int SpHexagonRectCornerRadius = Shader.PropertyToID("_HexagonCornerRadius"); + + + public Material SharedMat { get; set; } + public bool ShouldModifySharedMat { get; set; } + public RectTransform RectTransform { get; set; } + + + public void Init(Material sharedMat, Material renderMat, RectTransform rectTransform) { + SharedMat = sharedMat; + ShouldModifySharedMat = sharedMat == renderMat; + RectTransform = rectTransform; + + TipRadius = m_TipRadius; + TipSize = m_TipSize; + } + + public event EventHandler OnComponentSettingsChanged; + + public void OnValidate() { + CornerRadius = m_CornerRadius; + TipSize = m_TipSize; + TipRadius = m_TipRadius; + } + + public void InitValuesFromMaterial(ref Material material) { + m_CornerRadius = material.GetVector(SpHexagonRectCornerRadius); + m_TipRadius = material.GetVector(SpHexagonTipRadius); + m_TipSize = material.GetVector(SpHexagonTipSizes); + } + + public void ModifyMaterial(ref Material material, params object[] otherProperties) { + material.SetVector(SpHexagonTipSizes, m_TipSize); + material.SetVector(SpHexagonTipRadius, m_TipRadius); + material.SetVector(SpHexagonRectCornerRadius, m_CornerRadius); + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Scripts/Shapes/Hexagon.cs.meta b/Assets/MPUIKit/Runtime/Scripts/Shapes/Hexagon.cs.meta new file mode 100644 index 0000000..e47eee7 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Shapes/Hexagon.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 10d0bd6c53038cc46a6a6724f311e8f0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Scripts/Shapes/NStarPolygon.cs b/Assets/MPUIKit/Runtime/Scripts/Shapes/NStarPolygon.cs new file mode 100644 index 0000000..4ff3926 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Shapes/NStarPolygon.cs @@ -0,0 +1,121 @@ +using System; +using UnityEngine; + +namespace MPUIKIT { + /// + /// N-star polygon shape is equal sided uniform polygon shape with the ability to morph + /// to a star corresponding to the original shape. ie: an equilateral pentagon will morph + /// to a five sided star. + /// + [Serializable] + public struct NStarPolygon: IMPUIComponent { + [SerializeField] private float m_SideCount; + [SerializeField] private float m_Inset; + [SerializeField] private float m_CornerRadius; + [SerializeField] private Vector2 m_Offset; + + /// + /// How many sides should there be in the shape. These sides are equal is size. + /// 3 sides create an equilateral triangle, 6 sides create a hexagon and so on + /// Value of SideCount should remain between 3 and 10. + /// + public float SideCount { + get => m_SideCount; + set { + m_SideCount = Mathf.Clamp(value, 3f, 10f); + if (ShouldModifySharedMat) { + SharedMat.SetFloat(SpNStarPolygonSideCount, m_SideCount); + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + Inset = m_Inset; + } + } + + /// + /// Inset is the value that determine how much should the sides go inside the shape + /// and create a concave star shape. Each sides will break into half and their middle + /// point will go towards the center of the shape + /// Value of inset should remain between 2 and (SideCount - 0.01). 2 is default + /// and means no breaking of the sides. + /// + public float Inset { + get => m_Inset; + set { + m_Inset = Mathf.Clamp(value, 2f, SideCount - 0.01f); + if (ShouldModifySharedMat) { + SharedMat.SetFloat(SpNStarPolygonInset, m_Inset); + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + } + } + + /// + /// Corner Radius of all the corners of the shape. + /// + public float CornerRadius { + get => m_CornerRadius; + set { + m_CornerRadius = Mathf.Max(value, 0); + if (ShouldModifySharedMat) { + SharedMat.SetFloat(SpNStarPolygonCornerRadius, m_CornerRadius); + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + } + } + + /// + /// Position offset of the shape from the origin. + /// + public Vector2 Offset { + get => m_Offset; + set { + m_Offset = value; + if (ShouldModifySharedMat) { + SharedMat.SetVector(SpNStarPolygonOffset, m_Offset); + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + } + } + + private static readonly int SpNStarPolygonSideCount = Shader.PropertyToID("_NStarPolygonSideCount"); + private static readonly int SpNStarPolygonInset = Shader.PropertyToID("_NStarPolygonInset"); + private static readonly int SpNStarPolygonCornerRadius = Shader.PropertyToID("_NStarPolygonCornerRadius"); + private static readonly int SpNStarPolygonOffset = Shader.PropertyToID("_NStarPolygonOffset"); + + public Material SharedMat { get; set; } + public bool ShouldModifySharedMat { get; set; } + public RectTransform RectTransform { get; set; } + + + public void Init(Material sharedMat, Material renderMat, RectTransform rectTransform) { + SharedMat = sharedMat; + ShouldModifySharedMat = sharedMat == renderMat; + RectTransform = rectTransform; + + OnValidate(); + } + + public event EventHandler OnComponentSettingsChanged; + + public void OnValidate() { + SideCount = m_SideCount; + Inset = m_Inset; + CornerRadius = m_CornerRadius; + Offset = m_Offset; + } + + public void InitValuesFromMaterial(ref Material material) { + m_SideCount = material.GetFloat(SpNStarPolygonSideCount); + m_Inset = material.GetFloat(SpNStarPolygonInset); + m_CornerRadius = material.GetFloat(SpNStarPolygonCornerRadius); + m_Offset = material.GetVector(SpNStarPolygonOffset); + } + + public void ModifyMaterial(ref Material material, params object[] otherProperties) { + material.SetFloat(SpNStarPolygonSideCount, m_SideCount); + material.SetFloat(SpNStarPolygonInset, m_Inset); + material.SetFloat(SpNStarPolygonCornerRadius, m_CornerRadius); + material.SetVector(SpNStarPolygonOffset, m_Offset); + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Scripts/Shapes/NStarPolygon.cs.meta b/Assets/MPUIKit/Runtime/Scripts/Shapes/NStarPolygon.cs.meta new file mode 100644 index 0000000..c1b9d1d --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Shapes/NStarPolygon.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 469ccf5eb6d1c89458d9b97be69ac46f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Scripts/Shapes/Pentagon.cs b/Assets/MPUIKit/Runtime/Scripts/Shapes/Pentagon.cs new file mode 100644 index 0000000..64d74ad --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Shapes/Pentagon.cs @@ -0,0 +1,99 @@ +using System; +using UnityEngine; + +namespace MPUIKIT { + /// + /// Pentagon shape with two parallel opposite equal sides. It is basically a rectangle but one of the sides + /// of the rectangle is broken into halves and pulled out. + /// + [Serializable] + public struct Pentagon : IMPUIComponent{ + [SerializeField] private Vector4 m_CornerRadius; + [SerializeField] private bool m_UniformCornerRadius; + [SerializeField] private float m_TipRadius; + [SerializeField] private float m_TipSize; + + /// + /// Radius of the four corners of the rectangular part. Clockwise from top-left + /// x => top-left, y => top-right + /// z => bottom-right, w => bottom-left + /// + public Vector4 CornerRadius { + get => m_CornerRadius; + set { + m_CornerRadius = Vector4.Max(value, Vector4.zero); + if (ShouldModifySharedMat) { + SharedMat.SetVector(SpPentagonRectCornerRadius, m_CornerRadius); + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + } + } + + /// + /// Corner radius of the tip. The fifth corner of the pentagon shape. + /// + public float TipRadius { + get => m_TipRadius; + set { + m_TipRadius = Mathf.Max(value, 0.001f); + if (ShouldModifySharedMat) { + SharedMat.SetFloat(SpPentagonTriangleCornerRadius, m_TipRadius); + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + } + } + + /// + /// Size of the tip (the triangular part sticking out of the rectangular part of the shape) + /// + public float TipSize { + get => m_TipSize; + set { + m_TipSize = Mathf.Max(value, 1); + if (ShouldModifySharedMat) { + SharedMat.SetFloat(SpPentagonTriangleSize, m_TipSize); + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + } + } + + + private static readonly int SpPentagonRectCornerRadius = Shader.PropertyToID("_PentagonCornerRadius"); + private static readonly int SpPentagonTriangleCornerRadius = Shader.PropertyToID("_PentagonTipRadius"); + private static readonly int SpPentagonTriangleSize = Shader.PropertyToID("_PentagonTipSize"); + + + public Material SharedMat { get; set; } + public bool ShouldModifySharedMat { get; set; } + public RectTransform RectTransform { get; set; } + + public void Init(Material sharedMat, Material renderMat, RectTransform rectTransform) { + SharedMat = sharedMat; + ShouldModifySharedMat = sharedMat == renderMat; + RectTransform = rectTransform; + + TipSize = m_TipSize; + TipRadius = m_TipRadius; + } + + public event EventHandler OnComponentSettingsChanged; + + public void OnValidate() { + CornerRadius = m_CornerRadius; + TipSize = m_TipSize; + TipRadius = m_TipRadius; + } + + public void InitValuesFromMaterial(ref Material material) { + m_CornerRadius = material.GetVector(SpPentagonRectCornerRadius); + m_TipSize = material.GetFloat(SpPentagonTriangleSize); + m_TipRadius = material.GetFloat(SpPentagonTriangleCornerRadius); + } + + public void ModifyMaterial(ref Material material, params object[] otherProperties) { + material.SetVector(SpPentagonRectCornerRadius, m_CornerRadius); + material.SetFloat(SpPentagonTriangleCornerRadius, m_TipRadius); + material.SetFloat(SpPentagonTriangleSize, m_TipSize); + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Scripts/Shapes/Pentagon.cs.meta b/Assets/MPUIKit/Runtime/Scripts/Shapes/Pentagon.cs.meta new file mode 100644 index 0000000..7018fc4 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Shapes/Pentagon.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 222e2e3f0ac387549937b151aad31ccc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Scripts/Shapes/Rectangle.cs b/Assets/MPUIKit/Runtime/Scripts/Shapes/Rectangle.cs new file mode 100644 index 0000000..013db10 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Shapes/Rectangle.cs @@ -0,0 +1,77 @@ +using System; +using UnityEngine; + +namespace MPUIKIT { + /// + /// Basic Rectangle shape with the same width and height of the rect-transform + /// + [Serializable] + public struct Rectangle : IMPUIComponent{ + [SerializeField] private Vector4 m_CornerRadius; +#if UNITY_EDITOR + [SerializeField] private bool m_UniformCornerRadius; +#endif + /// + /// Radius of the four corners. Counter-Clockwise from bottom-left + /// x => bottom-left, y => bottom-right + /// z => top-right, w => top-left + /// + public Vector4 CornerRadius { + get => m_CornerRadius; + set { + m_CornerRadius = Vector4.Max(value, Vector4.zero); + if (ShouldModifySharedMat) { + SharedMat.SetVector(SpRectangleCornerRadius, m_CornerRadius); + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + } + } + + public Material SharedMat { get; set; } + public bool ShouldModifySharedMat { get; set; } + public RectTransform RectTransform { get; set; } + + private static readonly int SpRectangleCornerRadius = Shader.PropertyToID("_RectangleCornerRadius"); + + public void Init(Material sharedMat, Material renderMat, RectTransform rectTransform) { + SharedMat = sharedMat; + ShouldModifySharedMat = sharedMat == renderMat; + RectTransform = rectTransform; + } + + public event EventHandler OnComponentSettingsChanged; + + public void OnValidate() { + CornerRadius = m_CornerRadius; + } + + public void InitValuesFromMaterial(ref Material material) { + m_CornerRadius = material.GetVector(SpRectangleCornerRadius); + } + + public void ModifyMaterial(ref Material material, params object[] otherProperties) + { + Vector4 cornerRadius = FixRadius(m_CornerRadius); + material.SetVector(SpRectangleCornerRadius, cornerRadius); + } + + private Vector4 FixRadius(Vector4 radius) + { + Rect rect = RectTransform.rect; + + radius = Vector4.Max(radius, Vector4.zero); + radius = Vector4.Min(radius, Vector4.one * Mathf.Min(rect.width, rect.height)); + float scaleFactor = + Mathf.Min ( + Mathf.Min ( + Mathf.Min ( + Mathf.Min ( + rect.width / (radius.x + radius.y), + rect.width / (radius.z + radius.w)), + rect.height / (radius.x + radius.w)), + rect.height / (radius.z + radius.y)), + 1f); + return radius * scaleFactor; + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Scripts/Shapes/Rectangle.cs.meta b/Assets/MPUIKit/Runtime/Scripts/Shapes/Rectangle.cs.meta new file mode 100644 index 0000000..67e8f9f --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Shapes/Rectangle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2de3730bcb141af4a913830c6d6892b8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Scripts/Shapes/Triangle.cs b/Assets/MPUIKit/Runtime/Scripts/Shapes/Triangle.cs new file mode 100644 index 0000000..063ef31 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Shapes/Triangle.cs @@ -0,0 +1,59 @@ +using System; +using UnityEngine; + +namespace MPUIKIT { + /// + /// Isosceles triangle where two sides of the triangle are equal. Width and height of the shape is + /// the same as the rect-transform + /// + [Serializable] + public struct Triangle : IMPUIComponent { + + [SerializeField] private Vector3 m_CornerRadius; +#if UNITY_EDITOR + [SerializeField] private bool m_UniformCornerRadius; +#endif + + /// + /// Radius of the three corners. Counter-Clockwise from bottom-left + /// x => bottom-left, y => bottom-right + /// z => top + /// + public Vector3 CornerRadius { + get => m_CornerRadius; + set { + m_CornerRadius = Vector3.Max(value, Vector3.zero); + if (ShouldModifySharedMat) { + SharedMat.SetVector(SpTriangleCornerRadius, m_CornerRadius); + } + OnComponentSettingsChanged?.Invoke(this, EventArgs.Empty); + } + } + + private static readonly int SpTriangleCornerRadius = Shader.PropertyToID("_TriangleCornerRadius"); + + public Material SharedMat { get; set; } + public bool ShouldModifySharedMat { get; set; } + public RectTransform RectTransform { get; set; } + + public void Init(Material sharedMat, Material renderMat, RectTransform rectTransform) { + this.SharedMat = sharedMat; + this.ShouldModifySharedMat = sharedMat == renderMat; + this.RectTransform = rectTransform; + } + + public event EventHandler OnComponentSettingsChanged; + + public void OnValidate() { + CornerRadius = m_CornerRadius; + } + + public void InitValuesFromMaterial(ref Material material) { + m_CornerRadius = material.GetVector(SpTriangleCornerRadius); + } + + public void ModifyMaterial(ref Material material, params object[] otherProperties) { + material.SetVector(SpTriangleCornerRadius, m_CornerRadius); + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Scripts/Shapes/Triangle.cs.meta b/Assets/MPUIKit/Runtime/Scripts/Shapes/Triangle.cs.meta new file mode 100644 index 0000000..7c34a46 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Shapes/Triangle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 95ba47d1d57ac7b48a49e6bf89a54b3f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MPUIKit/Runtime/Scripts/Utility.meta b/Assets/MPUIKit/Runtime/Scripts/Utility.meta new file mode 100644 index 0000000..7eadbc8 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Utility.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: bc3ef6245bd1448fb3a15564eec64171 +timeCreated: 1587197957 \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Scripts/Utility/MPImageHelper.cs b/Assets/MPUIKit/Runtime/Scripts/Utility/MPImageHelper.cs new file mode 100644 index 0000000..6303794 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Utility/MPImageHelper.cs @@ -0,0 +1,398 @@ +using System.Text; + +namespace UnityEngine.UI.MPUIKIT { + public static class MPImageHelper { + private static readonly Vector3[] SXy = new Vector3[4]; + private static readonly Vector3[] SUv = new Vector3[4]; + + public static void GenerateSimpleSprite(VertexHelper vh, bool preserveAspect, Canvas canvas, + RectTransform rectTransform, Sprite activeSprite, Color32 color, float falloffDistance) { + vh.Clear(); + + Vector4 v = GetDrawingDimensions(preserveAspect, activeSprite, canvas, rectTransform); + Vector4 uv = (activeSprite != null) + ? Sprites.DataUtility.GetOuterUV(activeSprite) + : new Vector4(0, 0, 1, 1); + + Color32 color32 = color; + vh.Clear(); + + Vector3[] pos = { + new Vector3(v.x, v.y), + new Vector3(v.x, v.w), + new Vector3(v.z, v.w), + new Vector3(v.z, v.y), + }; + + Vector2[] uvs = { + new Vector2(uv.x, uv.y), + new Vector2(uv.x, uv.w), + new Vector2(uv.z, uv.w), + new Vector2(uv.z, uv.y), + }; + + Vector2[] uv1s = + { + new Vector2(0, 0), + new Vector2(0, 1), + new Vector2(1, 1), + new Vector2(1, 0), + }; + + Vector2 size = new Vector2(v.z - v.x, v.w - v.y); + + vh.AddVert(pos[0], color32, uvs[0], uv1s[0], size, Vector2.zero, Vector3.zero, Vector4.zero); + vh.AddVert(pos[1], color32, uvs[1], uv1s[1], size, Vector2.zero, Vector3.zero, Vector4.zero); + vh.AddVert(pos[2], color32, uvs[2], uv1s[2], size, Vector2.zero, Vector3.zero, Vector4.zero); + vh.AddVert(pos[3], color32, uvs[3], uv1s[3], size, Vector2.zero, Vector3.zero, Vector4.zero); + + vh.AddTriangle(0, 1, 2); + vh.AddTriangle(2, 3, 0); + } + + public static void GenerateFilledSprite(VertexHelper toFill, bool preserveAspect, Canvas canvas, + RectTransform rectTransform, Sprite activeSprite, Color32 color, Image.FillMethod fillMethod, + float fillAmount, int fillOrigin, bool fillClockwise, float falloffDistance) { + toFill.Clear(); + + if (fillAmount < 0.001f) + return; + + Vector4 v = GetDrawingDimensions(preserveAspect, activeSprite, canvas, rectTransform); + Vector2 size = new Vector2(v.z - v.x, v.w - v.y); + + Vector4 outer = activeSprite != null + ? Sprites.DataUtility.GetOuterUV(activeSprite) + : new Vector4(0, 0, 1, 1); + UIVertex uiv = UIVertex.simpleVert; + uiv.color = color; + + float tx0 = outer.x; + float ty0 = outer.y; + float tx1 = outer.z; + float ty1 = outer.w; + + // Horizontal and vertical filled sprites are simple -- just end the Image prematurely + if (fillMethod == Image.FillMethod.Horizontal || fillMethod == Image.FillMethod.Vertical) { + if (fillMethod == Image.FillMethod.Horizontal) { + float fill = (tx1 - tx0) * fillAmount; + + if (fillOrigin == 1) { + v.x = v.z - (v.z - v.x) * fillAmount; + tx0 = tx1 - fill; + } + else { + v.z = v.x + (v.z - v.x) * fillAmount; + tx1 = tx0 + fill; + } + } + else if (fillMethod == Image.FillMethod.Vertical) { + float fill = (ty1 - ty0) * fillAmount; + + if (fillOrigin == 1) { + v.y = v.w - (v.w - v.y) * fillAmount; + ty0 = ty1 - fill; + } + else { + v.w = v.y + (v.w - v.y) * fillAmount; + ty1 = ty0 + fill; + } + } + } + + SXy[0] = new Vector2(v.x, v.y); + SXy[1] = new Vector2(v.x, v.w); + SXy[2] = new Vector2(v.z, v.w); + SXy[3] = new Vector2(v.z, v.y); + + SUv[0] = new Vector2(tx0, ty0); + SUv[1] = new Vector2(tx0, ty1); + SUv[2] = new Vector2(tx1, ty1); + SUv[3] = new Vector2(tx1, ty0); + + + { + if (fillAmount < 1f && fillMethod != Image.FillMethod.Horizontal && + fillMethod != Image.FillMethod.Vertical) { + if (fillMethod == Image.FillMethod.Radial90) { + if (RadialCut(SXy, SUv, fillAmount, fillClockwise, fillOrigin)) + AddQuad(toFill, SXy, color, SUv, size); + } + else if (fillMethod == Image.FillMethod.Radial180) { + for (int side = 0; side < 2; ++side) { + float fx0, fx1, fy0, fy1; + int even = fillOrigin > 1 ? 1 : 0; + + if (fillOrigin == 0 || fillOrigin == 2) { + fy0 = 0f; + fy1 = 1f; + if (side == even) { + fx0 = 0f; + fx1 = 0.5f; + } + else { + fx0 = 0.5f; + fx1 = 1f; + } + } + else { + fx0 = 0f; + fx1 = 1f; + if (side == even) { + fy0 = 0.5f; + fy1 = 1f; + } + else { + fy0 = 0f; + fy1 = 0.5f; + } + } + + SXy[0].x = Mathf.Lerp(v.x, v.z, fx0); + SXy[1].x = SXy[0].x; + SXy[2].x = Mathf.Lerp(v.x, v.z, fx1); + SXy[3].x = SXy[2].x; + + SXy[0].y = Mathf.Lerp(v.y, v.w, fy0); + SXy[1].y = Mathf.Lerp(v.y, v.w, fy1); + SXy[2].y = SXy[1].y; + SXy[3].y = SXy[0].y; + + SUv[0].x = Mathf.Lerp(tx0, tx1, fx0); + SUv[1].x = SUv[0].x; + SUv[2].x = Mathf.Lerp(tx0, tx1, fx1); + SUv[3].x = SUv[2].x; + + SUv[0].y = Mathf.Lerp(ty0, ty1, fy0); + SUv[1].y = Mathf.Lerp(ty0, ty1, fy1); + SUv[2].y = SUv[1].y; + SUv[3].y = SUv[0].y; + + float val = fillClockwise ? fillAmount * 2f - side : fillAmount * 2f - (1 - side); + + if (RadialCut(SXy, SUv, Mathf.Clamp01(val), fillClockwise, + ((side + fillOrigin + 3) % 4))) { + AddQuad(toFill, SXy, color, SUv, size); + } + } + } + else if (fillMethod == Image.FillMethod.Radial360) { + for (int corner = 0; corner < 4; ++corner) { + float fx0, fx1, fy0, fy1; + + if (corner < 2) { + fx0 = 0f; + fx1 = 0.5f; + } + else { + fx0 = 0.5f; + fx1 = 1f; + } + + if (corner == 0 || corner == 3) { + fy0 = 0f; + fy1 = 0.5f; + } + else { + fy0 = 0.5f; + fy1 = 1f; + } + + SXy[0].x = Mathf.Lerp(v.x, v.z, fx0); + SXy[1].x = SXy[0].x; + SXy[2].x = Mathf.Lerp(v.x, v.z, fx1); + SXy[3].x = SXy[2].x; + + SXy[0].y = Mathf.Lerp(v.y, v.w, fy0); + SXy[1].y = Mathf.Lerp(v.y, v.w, fy1); + SXy[2].y = SXy[1].y; + SXy[3].y = SXy[0].y; + + SUv[0].x = Mathf.Lerp(tx0, tx1, fx0); + SUv[1].x = SUv[0].x; + SUv[2].x = Mathf.Lerp(tx0, tx1, fx1); + SUv[3].x = SUv[2].x; + + SUv[0].y = Mathf.Lerp(ty0, ty1, fy0); + SUv[1].y = Mathf.Lerp(ty0, ty1, fy1); + SUv[2].y = SUv[1].y; + SUv[3].y = SUv[0].y; + + float val = fillClockwise + ? fillAmount * 4f - ((corner + fillOrigin) % 4) + : fillAmount * 4f - (3 - ((corner + fillOrigin) % 4)); + + if (RadialCut(SXy, SUv, Mathf.Clamp01(val), fillClockwise, ((corner + 2) % 4))) + AddQuad(toFill, SXy, color, SUv, size); + } + } + } + else { + AddQuad(toFill, SXy, color, SUv, size); + } + } + } + + private static void AddQuad(VertexHelper vertexHelper, Vector3[] quadPositions, Color32 color, + Vector3[] quadUVs, Vector2 size) { + int startIndex = vertexHelper.currentVertCount; + + StringBuilder sr = new StringBuilder(); + for (int i = 0; i < 4; ++i) { + vertexHelper.AddVert(quadPositions[i], color, quadUVs[i], quadUVs[i], size, Vector2.zero, + Vector3.zero, Vector4.zero); + sr.AppendLine($"Pos: {quadPositions[i]}, uv: {quadUVs[i]}"); + } + + + vertexHelper.AddTriangle(startIndex, startIndex + 1, startIndex + 2); + vertexHelper.AddTriangle(startIndex + 2, startIndex + 3, startIndex); + } + + private static Vector4 GetDrawingDimensions(bool shouldPreserveAspect, Sprite activeSprite, Canvas canvas, + RectTransform rectTransform) { + var padding = activeSprite == null ? Vector4.zero : Sprites.DataUtility.GetPadding(activeSprite); + var size = activeSprite == null + ? new Vector2(rectTransform.rect.width, rectTransform.rect.height) + : new Vector2(activeSprite.rect.width, activeSprite.rect.height); + + if (size.x <= 0) size.x = 1; + if (size.y <= 0) size.y = 1; + Rect r = GetPixelAdjustedRect(canvas, rectTransform); + //Debug.Log(string.Format("r:{2}, size:{0}, padding:{1}", size, padding, r)); + + int spriteW = Mathf.RoundToInt(size.x); + int spriteH = Mathf.RoundToInt(size.y); + + Vector4 v = new Vector4( + padding.x / spriteW, + padding.y / spriteH, + (spriteW - padding.z) / spriteW, + (spriteH - padding.w) / spriteH); + + if (shouldPreserveAspect && size.sqrMagnitude > 0.0f) { + PreserveSpriteAspectRatio(ref r, rectTransform, size); + } + + v = new Vector4( + r.x + r.width * v.x, + r.y + r.height * v.y, + r.x + r.width * v.z, + r.y + r.height * v.w + ); + + return v; + } + + public static void PreserveSpriteAspectRatio(ref Rect rect, RectTransform rectTransform, Vector2 spriteSize) { + float spriteRatio = spriteSize.x / spriteSize.y; + float rectRatio = rect.width / rect.height; + + if (spriteRatio > rectRatio) { + float oldHeight = rect.height; + rect.height = rect.width * (1.0f / spriteRatio); + rect.y += (oldHeight - rect.height) * rectTransform.pivot.y; + } + else { + float oldWidth = rect.width; + rect.width = rect.height * spriteRatio; + rect.x += (oldWidth - rect.width) * rectTransform.pivot.x; + } + } + + private static Rect GetPixelAdjustedRect(Canvas canvas, RectTransform rectTransform) { + if (!canvas || canvas.renderMode == RenderMode.WorldSpace || canvas.scaleFactor == 0.0f || + !canvas.pixelPerfect) { + return rectTransform.rect; + } + + return RectTransformUtility.PixelAdjustRect(rectTransform, canvas); + } + + private static bool RadialCut(Vector3[] xy, Vector3[] uv, float fill, bool invert, int corner) { + // Nothing to fill + if (fill < 0.001f) return false; + + // Even corners invert the fill direction + if ((corner & 1) == 1) invert = !invert; + + // Nothing to adjust + if (!invert && fill > 0.999f) return true; + + // Convert 0-1 value into 0 to 90 degrees angle in radians + float angle = Mathf.Clamp01(fill); + if (invert) angle = 1f - angle; + angle *= 90f * Mathf.Deg2Rad; + + // Calculate the effective X and Y factors + float cos = Mathf.Cos(angle); + float sin = Mathf.Sin(angle); + + RadialCut(xy, cos, sin, invert, corner); + RadialCut(uv, cos, sin, invert, corner); + return true; + } + + private static void RadialCut(Vector3[] xy, float cos, float sin, bool invert, int corner) { + int i0 = corner; + int i1 = ((corner + 1) % 4); + int i2 = ((corner + 2) % 4); + int i3 = ((corner + 3) % 4); + + if ((corner & 1) == 1) { + if (sin > cos) { + cos /= sin; + sin = 1f; + + if (invert) { + xy[i1].x = Mathf.Lerp(xy[i0].x, xy[i2].x, cos); + xy[i2].x = xy[i1].x; + } + } + else if (cos > sin) { + sin /= cos; + cos = 1f; + + if (!invert) { + xy[i2].y = Mathf.Lerp(xy[i0].y, xy[i2].y, sin); + xy[i3].y = xy[i2].y; + } + } + else { + cos = 1f; + sin = 1f; + } + + if (!invert) xy[i3].x = Mathf.Lerp(xy[i0].x, xy[i2].x, cos); + else xy[i1].y = Mathf.Lerp(xy[i0].y, xy[i2].y, sin); + } + else { + if (cos > sin) { + sin /= cos; + cos = 1f; + + if (!invert) { + xy[i1].y = Mathf.Lerp(xy[i0].y, xy[i2].y, sin); + xy[i2].y = xy[i1].y; + } + } + else if (sin > cos) { + cos /= sin; + sin = 1f; + + if (invert) { + xy[i2].x = Mathf.Lerp(xy[i0].x, xy[i2].x, cos); + xy[i3].x = xy[i2].x; + } + } + else { + cos = 1f; + sin = 1f; + } + + if (invert) xy[i3].y = Mathf.Lerp(xy[i0].y, xy[i2].y, sin); + else xy[i1].x = Mathf.Lerp(xy[i0].x, xy[i2].x, cos); + } + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Scripts/Utility/MPImageHelper.cs.meta b/Assets/MPUIKit/Runtime/Scripts/Utility/MPImageHelper.cs.meta new file mode 100644 index 0000000..9fb1aa4 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Utility/MPImageHelper.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9ce9faf1c41643d88c5ca734c7187921 +timeCreated: 1587197968 \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Scripts/Utility/MPImageUtility.cs b/Assets/MPUIKit/Runtime/Scripts/Utility/MPImageUtility.cs new file mode 100644 index 0000000..54d79d5 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Utility/MPImageUtility.cs @@ -0,0 +1,41 @@ +using System; +using UnityEngine; + +namespace MPUIKIT { + internal class MPImageUtility { + internal static void FixAdditionalShaderChannelsInCanvas(Canvas canvas) { + Canvas c = canvas; + if (canvas == null) return; + AdditionalCanvasShaderChannels additionalShaderChannels = c.additionalShaderChannels; + additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord1; + additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord2; + additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord3; + additionalShaderChannels |= AdditionalCanvasShaderChannels.Normal; + additionalShaderChannels |= AdditionalCanvasShaderChannels.Tangent; + c.additionalShaderChannels = additionalShaderChannels; + } + + internal static Vector2 Encode_0_1_16(Vector4 input) { + float e = 255f / 256f; + float m = 65535f; + float ms = m * m; + float n = m - 1; + Vector4 value = input * e * n; + float x = Mathf.Floor(value.x) / m + Mathf.Floor(value.y) / ms; + float y = Mathf.Floor(value.z) / m + Mathf.Floor(value.w) / ms; + return new Vector2(x, y); + } + + private static Sprite _emptySprite; + + internal static Sprite EmptySprite { + get { + if (_emptySprite == null) { + _emptySprite = Resources.Load("mpui_default_empty_sprite"); + } + + return _emptySprite; + } + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Scripts/Utility/MPImageUtility.cs.meta b/Assets/MPUIKit/Runtime/Scripts/Utility/MPImageUtility.cs.meta new file mode 100644 index 0000000..6178e42 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Utility/MPImageUtility.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a3c7a1cdd7824ef29a4473daa6729d91 +timeCreated: 1605871224 \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Scripts/Utility/MPMaterials.cs b/Assets/MPUIKit/Runtime/Scripts/Utility/MPMaterials.cs new file mode 100644 index 0000000..a07743b --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Utility/MPMaterials.cs @@ -0,0 +1,43 @@ +using UnityEngine; + +namespace MPUIKIT { + public static class MPMaterials { + private const string MpBasicProceduralShaderName = "MPUI/Basic Procedural Image"; + private static string[] MpShapeKeywords = {"CIRCLE", "TRIANGLE", "RECTANGLE", "NSTAR_POLYGON"}; + private const string MpStrokeKeyword = "STROKE"; + private const string MpOutlineKeyword = "OUTLINED"; + private const string MpOutlinedStrokeKeyword = "OUTLINED_STROKE"; + private static Shader _proceduralShader; + internal static Shader MPBasicProceduralShader + { + get { + if (_proceduralShader == null) + _proceduralShader = Shader.Find(MpBasicProceduralShaderName); + return _proceduralShader; + } + } + + private static Material[] _materialDB = new Material[16]; + + internal static ref Material GetMaterial(int shapeIndex, bool stroked, bool outlined) { + int index = shapeIndex * 4; + if (stroked && outlined) index += 3; + else if (outlined) index += 2; + else if (stroked) index += 1; + + ref Material mat = ref _materialDB[index]; + if (mat != null) return ref mat; + + mat = new Material(MPBasicProceduralShader); + string shapeKeyword = MpShapeKeywords[shapeIndex]; + + mat.name = $"Basic Procedural Sprite - {shapeKeyword} {(stroked?MpStrokeKeyword:string.Empty)} {(outlined?MpOutlineKeyword:string.Empty)}"; + mat.EnableKeyword(shapeKeyword); + if(stroked && outlined) mat.EnableKeyword(MpOutlinedStrokeKeyword); + else if(stroked) mat.EnableKeyword(MpStrokeKeyword); + else if(outlined) mat.EnableKeyword(MpOutlineKeyword); + + return ref mat; + } + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Scripts/Utility/MPMaterials.cs.meta b/Assets/MPUIKit/Runtime/Scripts/Utility/MPMaterials.cs.meta new file mode 100644 index 0000000..3e3bd66 --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Utility/MPMaterials.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d0b57d41f1b34dc7bb9e3eaecdc328ec +timeCreated: 1607253294 \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Scripts/Utility/MPVertexStream.cs b/Assets/MPUIKit/Runtime/Scripts/Utility/MPVertexStream.cs new file mode 100644 index 0000000..2589ece --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Utility/MPVertexStream.cs @@ -0,0 +1,10 @@ +using UnityEngine; + +namespace MPUIKIT { + internal struct MPVertexStream { + internal RectTransform RectTransform; + internal Vector2 Uv1, Uv2, Uv3; + internal Vector3 Normal; + internal Vector4 Tangent; + } +} \ No newline at end of file diff --git a/Assets/MPUIKit/Runtime/Scripts/Utility/MPVertexStream.cs.meta b/Assets/MPUIKit/Runtime/Scripts/Utility/MPVertexStream.cs.meta new file mode 100644 index 0000000..f0f41ff --- /dev/null +++ b/Assets/MPUIKit/Runtime/Scripts/Utility/MPVertexStream.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 166f68c49b8e4a65af6cf7955ca0a34e +timeCreated: 1605871469 \ No newline at end of file diff --git a/Assets/MPUIKit/readme.txt b/Assets/MPUIKit/readme.txt new file mode 100644 index 0000000..1e180d2 --- /dev/null +++ b/Assets/MPUIKit/readme.txt @@ -0,0 +1,2 @@ +Read the Documentation at the website: +https://scrollbie.com/documentations/mpuikit-docs/ \ No newline at end of file diff --git a/Assets/MPUIKit/readme.txt.meta b/Assets/MPUIKit/readme.txt.meta new file mode 100644 index 0000000..46b9d3f --- /dev/null +++ b/Assets/MPUIKit/readme.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f5c469485ab6745caa15ede5fe6d4659 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: -- 2.45.2 From f784cbf1425edadd7957cd1388a3e26d29537a5e Mon Sep 17 00:00:00 2001 From: Fangh Date: Thu, 29 Feb 2024 21:34:05 +0100 Subject: [PATCH 07/13] feat(localization): prompts should be in selected language from PC --- Assets/2DAssets/LocalizationIcons.meta | 8 + Assets/2DAssets/LocalizationIcons/fr.png | 3 + Assets/2DAssets/LocalizationIcons/fr.png.meta | 153 ++++++++ Assets/2DAssets/LocalizationIcons/gb.png | 3 + Assets/2DAssets/LocalizationIcons/gb.png.meta | 153 ++++++++ .../UserInterface Shared Data.asset | 4 + Assets/Localization/UserInterface_en.asset | 4 + Assets/Localization/UserInterface_fr.asset | 4 + Assets/Scenes/ComputerView.unity | 351 +++++++++++++++++- Assets/Scripts/DatabaseClasses/Room.cs | 2 + Assets/Scripts/GameManager.cs | 3 + Assets/Scripts/PromptsLanguage.cs | 36 ++ Assets/Scripts/PromptsLanguage.cs.meta | 11 + Assets/Scripts/PropositionHandler.cs | 6 +- Assets/Scripts/QuestionHandler.cs | 2 +- Assets/Scripts/RoomManager.cs | 271 ++++++++------ Assets/Scripts/VotingPage.cs | 2 +- ProjectSettings/LocalizationSettings.asset | 2 +- 18 files changed, 892 insertions(+), 126 deletions(-) create mode 100644 Assets/2DAssets/LocalizationIcons.meta create mode 100644 Assets/2DAssets/LocalizationIcons/fr.png create mode 100644 Assets/2DAssets/LocalizationIcons/fr.png.meta create mode 100644 Assets/2DAssets/LocalizationIcons/gb.png create mode 100644 Assets/2DAssets/LocalizationIcons/gb.png.meta create mode 100644 Assets/Scripts/PromptsLanguage.cs create mode 100644 Assets/Scripts/PromptsLanguage.cs.meta diff --git a/Assets/2DAssets/LocalizationIcons.meta b/Assets/2DAssets/LocalizationIcons.meta new file mode 100644 index 0000000..1297ece --- /dev/null +++ b/Assets/2DAssets/LocalizationIcons.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5ac1099247cfb3e48932f4ab90f393d2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/2DAssets/LocalizationIcons/fr.png b/Assets/2DAssets/LocalizationIcons/fr.png new file mode 100644 index 0000000..5353ec3 --- /dev/null +++ b/Assets/2DAssets/LocalizationIcons/fr.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8bfbed3249f17a361925b4f49d12479cd0d7deaeb673ec040fab52997c7d5d5 +size 13716 diff --git a/Assets/2DAssets/LocalizationIcons/fr.png.meta b/Assets/2DAssets/LocalizationIcons/fr.png.meta new file mode 100644 index 0000000..bbd6680 --- /dev/null +++ b/Assets/2DAssets/LocalizationIcons/fr.png.meta @@ -0,0 +1,153 @@ +fileFormatVersion: 2 +guid: 2c184ca72cbd8c14aacfa9f75e714f73 +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 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 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: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 1 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/2DAssets/LocalizationIcons/gb.png b/Assets/2DAssets/LocalizationIcons/gb.png new file mode 100644 index 0000000..e05d59c --- /dev/null +++ b/Assets/2DAssets/LocalizationIcons/gb.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4cf5c7a90bdd527437a027f960375145c08acdff43dee6c3ca5effe3f873247d +size 94165 diff --git a/Assets/2DAssets/LocalizationIcons/gb.png.meta b/Assets/2DAssets/LocalizationIcons/gb.png.meta new file mode 100644 index 0000000..67ae025 --- /dev/null +++ b/Assets/2DAssets/LocalizationIcons/gb.png.meta @@ -0,0 +1,153 @@ +fileFormatVersion: 2 +guid: 73ca52a46663536498fed319e043fdfe +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 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 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: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 1 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Localization/UserInterface Shared Data.asset b/Assets/Localization/UserInterface Shared Data.asset index 1817ace..7360a84 100644 --- a/Assets/Localization/UserInterface Shared Data.asset +++ b/Assets/Localization/UserInterface Shared Data.asset @@ -121,6 +121,10 @@ MonoBehaviour: m_Key: PhoneView/Canvas/Background/HomeState/NameField/ErrorRoom m_Metadata: m_Items: [] + - m_Id: 710177540153344 + m_Key: ComputerView/Canvas/WaitingForPlayersPage/LanguageLabel + m_Metadata: + m_Items: [] m_Metadata: m_Items: [] m_KeyGenerator: diff --git a/Assets/Localization/UserInterface_en.asset b/Assets/Localization/UserInterface_en.asset index d747996..423bdb0 100644 --- a/Assets/Localization/UserInterface_en.asset +++ b/Assets/Localization/UserInterface_en.asset @@ -131,6 +131,10 @@ MonoBehaviour: m_Localized: 'Error: the room doesn''t exists' m_Metadata: m_Items: [] + - m_Id: 710177540153344 + m_Localized: 'Prompts language:' + m_Metadata: + m_Items: [] references: version: 2 RefIds: [] diff --git a/Assets/Localization/UserInterface_fr.asset b/Assets/Localization/UserInterface_fr.asset index 80ed08d..83fae85 100644 --- a/Assets/Localization/UserInterface_fr.asset +++ b/Assets/Localization/UserInterface_fr.asset @@ -127,6 +127,10 @@ MonoBehaviour: m_Localized: 'Erreur: cette salle n''existe pas' m_Metadata: m_Items: [] + - m_Id: 710177540153344 + m_Localized: 'Langue des phrases :' + m_Metadata: + m_Items: [] references: version: 2 RefIds: [] diff --git a/Assets/Scenes/ComputerView.unity b/Assets/Scenes/ComputerView.unity index 28cb2b9..7dc14c2 100644 --- a/Assets/Scenes/ComputerView.unity +++ b/Assets/Scenes/ComputerView.unity @@ -1626,6 +1626,181 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 233024602} m_CullTransparentMesh: 1 +--- !u!1 &248639606 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 248639607} + - component: {fileID: 248639610} + - component: {fileID: 248639609} + - component: {fileID: 248639608} + m_Layer: 5 + m_Name: PromptsLanguageLabel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &248639607 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 248639606} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1117928115} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -275, y: -25} + m_SizeDelta: {x: 500, y: 120} + m_Pivot: {x: 1, y: 1} +--- !u!114 &248639608 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 248639606} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3} + m_Name: + m_EditorClassIdentifier: + m_StringReference: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde + m_TableEntryReference: + m_KeyId: 710177540153344 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] + m_FormatArguments: [] + m_UpdateString: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 248639609} + m_TargetAssemblyTypeName: TMPro.TMP_Text, Unity.TextMeshPro + m_MethodName: set_text + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + references: + version: 2 + RefIds: [] +--- !u!114 &248639609 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 248639606} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 'Room Code :' + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 72af27804d5aa49408430b4b2500f877, type: 2} + m_sharedMaterial: {fileID: 2100000, guid: 9fb4d071241c54841ab116886c83b585, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4278255610 + m_fontColor: {r: 0.9823009, g: 1, b: 0, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 44 + m_fontSizeBase: 72 + m_fontWeight: 400 + m_enableAutoSizing: 1 + m_fontSizeMin: 32 + m_fontSizeMax: 44 + m_fontStyle: 0 + m_HorizontalAlignment: 4 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &248639610 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 248639606} + m_CullTransparentMesh: 1 --- !u!1 &270606794 stripped GameObject: m_CorrespondingSourceObject: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} @@ -2707,7 +2882,7 @@ Canvas: m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 m_VertexColorAlwaysGammaSpace: 0 - m_AdditionalShaderChannelsFlag: 25 + m_AdditionalShaderChannelsFlag: 31 m_UpdateRectTransformForStandalone: 0 m_SortingLayerID: 0 m_SortingOrder: 0 @@ -5254,6 +5429,8 @@ RectTransform: - {fileID: 220251970} - {fileID: 593191225} - {fileID: 1503133439} + - {fileID: 248639607} + - {fileID: 2142340730} m_Father: {fileID: 610087870} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -8516,7 +8693,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 100, y: -369} - m_SizeDelta: {x: 474, y: 50} + m_SizeDelta: {x: 474, y: 86} m_Pivot: {x: 0, y: 1} --- !u!114 &1677433387 MonoBehaviour: @@ -8573,7 +8750,7 @@ MonoBehaviour: m_fontSizeMax: 72 m_fontStyle: 0 m_HorizontalAlignment: 1 - m_VerticalAlignment: 256 + m_VerticalAlignment: 512 m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 @@ -11967,6 +12144,174 @@ MonoBehaviour: - localeIdentifier: m_Code: fr value: 200 +--- !u!1 &2142340729 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2142340730} + - component: {fileID: 2142340733} + - component: {fileID: 2142340732} + - component: {fileID: 2142340731} + - component: {fileID: 2142340734} + m_Layer: 0 + m_Name: PromptsLanguage + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2142340730 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2142340729} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1117928115} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -145.00006, y: -25} + m_SizeDelta: {x: 120, y: 120} + m_Pivot: {x: 1, y: 1} +--- !u!114 &2142340731 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2142340729} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c71e2cd71561f7948aa3b8690f68fd0f, type: 3} + m_Name: + m_EditorClassIdentifier: + flag_en: {fileID: 21300000, guid: 73ca52a46663536498fed319e043fdfe, type: 3} + flag_fr: {fileID: 21300000, guid: 2c184ca72cbd8c14aacfa9f75e714f73, type: 3} + image: {fileID: 2142340732} +--- !u!114 &2142340732 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2142340729} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fceb93b9d8bf04943b1dd4939eaf6284, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 6b96d6950a9c30743a2e826ee8684ac4, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 + m_DrawShape: 1 + m_ImageType: 0 + m_StrokeWidth: 0 + m_FalloffDistance: 0.5 + m_OutlineWidth: 3 + m_OutlineColor: {r: 0, g: 0, b: 0, a: 1} + m_ShapeRotation: 0 + m_ConstrainRotation: 1 + m_FlipHorizontal: 0 + m_FlipVertical: 0 + m_CornerStyle: 0 + m_RectangleCornerRadius: {x: 0, y: 0, z: 0, w: 0} + m_TriangleCornerRadius: {x: 0, y: 0, z: 0} + m_TriangleUniformCornerRadius: 1 + m_RectangleUniformCornerRadius: 1 + m_CircleRadius: 0 + m_CircleFitToRect: 1 + m_NStarPolygonSideCount: 3 + m_NStarPolygonInset: 2 + m_NStarPolygonCornerRadius: 0 +--- !u!222 &2142340733 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2142340729} + m_CullTransparentMesh: 1 +--- !u!114 &2142340734 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2142340729} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 2142340732} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 2142340731} + m_TargetAssemblyTypeName: PromptsLanguage, Assembly-CSharp + m_MethodName: SwapLanguage + m_Mode: 1 + 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 --- !u!1001 &2214187228236614840 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/DatabaseClasses/Room.cs b/Assets/Scripts/DatabaseClasses/Room.cs index cf2312c..b316614 100644 --- a/Assets/Scripts/DatabaseClasses/Room.cs +++ b/Assets/Scripts/DatabaseClasses/Room.cs @@ -17,6 +17,7 @@ public class Room public int currentQuestionId; public double creationDate; public int currentState; + public string promptsLanguage; public Room(string _code) { @@ -26,6 +27,7 @@ public Room(string _code) questions = new Dictionary(); currentQuestionId = 0; currentState = 1; //default by PC + promptsLanguage = "en"; } public Room Copy() diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index af705d7..e248044 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -18,6 +18,8 @@ /// public class GameManager : MonoBehaviour { + public static GameManager Instance; + private List players = new(); public Player currentPlayer = null; @@ -72,6 +74,7 @@ public class GameManager : MonoBehaviour private void Awake() { submitNewPlayer.interactable = false; + Instance = this; FirebaseInitializer.Instance.onFirebaseReady += Initialize; } diff --git a/Assets/Scripts/PromptsLanguage.cs b/Assets/Scripts/PromptsLanguage.cs new file mode 100644 index 0000000..7b22ea6 --- /dev/null +++ b/Assets/Scripts/PromptsLanguage.cs @@ -0,0 +1,36 @@ +using MPUIKIT; +using UnityEngine; + +public class PromptsLanguage : MonoBehaviour +{ + [SerializeField] private Sprite flag_en; + [SerializeField] private Sprite flag_fr; + [SerializeField] private MPImageBasic image; + + private string currentLanguage = "en"; + + private void Start() + { + RoomManager.Instance.OnRoomCreated += Initialize; + } + + private void Initialize() + { + RoomManager.Instance.OnRoomCreated -= Initialize; + currentLanguage = PlayerPrefs.GetString("promptslanguage", currentLanguage); + SetLanguageOnRoom(); + } + + public void SwapLanguage() + { + currentLanguage = currentLanguage == "en" ? "fr" : "en"; + PlayerPrefs.SetString("promptslanguage", currentLanguage); + SetLanguageOnRoom(); + } + + private void SetLanguageOnRoom() + { + image.sprite = currentLanguage == "fr" ? flag_fr : flag_en; + RoomManager.Instance.SetPromptsLanguage(currentLanguage); + } +} diff --git a/Assets/Scripts/PromptsLanguage.cs.meta b/Assets/Scripts/PromptsLanguage.cs.meta new file mode 100644 index 0000000..10258e9 --- /dev/null +++ b/Assets/Scripts/PromptsLanguage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c71e2cd71561f7948aa3b8690f68fd0f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/PropositionHandler.cs b/Assets/Scripts/PropositionHandler.cs index 7d296e5..c7b741e 100644 --- a/Assets/Scripts/PropositionHandler.cs +++ b/Assets/Scripts/PropositionHandler.cs @@ -19,9 +19,9 @@ public class PropositionHandler : MonoBehaviour public void ShowPlayersProposition(Question currentQuestion) { List props = currentQuestion.propositions.Values.ToList(); - string enPrompt = prompts.GetPromptById(currentQuestion.promptId).en; - promptLabel.text = enPrompt; - Debug.Log($"Showing Question ({currentQuestion.index}) : {enPrompt}"); + string prompt = GameManager.Instance.myRoom.promptsLanguage == "en" ? prompts.GetPromptById(currentQuestion.promptId).en : prompts.GetPromptById(currentQuestion.promptId).fr; + promptLabel.text = prompt; + Debug.Log($"Showing Question ({currentQuestion.index}) : {prompt}"); for (int i = 0; i < 2; i++) { int index = i; // Capture la valeur de i pour cette itération diff --git a/Assets/Scripts/QuestionHandler.cs b/Assets/Scripts/QuestionHandler.cs index 27bdd7c..cdc1efc 100644 --- a/Assets/Scripts/QuestionHandler.cs +++ b/Assets/Scripts/QuestionHandler.cs @@ -40,7 +40,7 @@ void OnEnable() void Redraw(int currentQuestion) { Prompt prompt = promptList.prompts.Find(x => x.id == questionsToAnswer[currentQuestion].promptId); - explainText.SetText(prompt.en); + explainText.SetText(gameManager.myRoom.promptsLanguage == "en" ? prompt.en : prompt.fr); CameraManager cameraManager = gameObject.GetComponent(); cameraManager.WebcamResume(); diff --git a/Assets/Scripts/RoomManager.cs b/Assets/Scripts/RoomManager.cs index 61060e4..8e70472 100644 --- a/Assets/Scripts/RoomManager.cs +++ b/Assets/Scripts/RoomManager.cs @@ -11,7 +11,11 @@ using UnityEngine.Localization.Settings; using UnityEngine.Localization; using UnityEngine.Localization.Tables; +using Google.MiniJSON; +/// +/// This is the game state manager on the PC side +/// public class RoomManager : MonoBehaviour { public static RoomManager Instance; @@ -52,8 +56,12 @@ public class RoomManager : MonoBehaviour public Room myRoom { get; private set; } = null; + public event Action OnRoomCreated; + DatabaseReference realtimeDB; + #region Unity Methods + private void Awake() { Instance = this; @@ -66,17 +74,6 @@ private void Start() InitializeFirstPage(); } - private void InitializeFirstPage() - { - explanationPage.SetActive(false); - waitForPropositionsPage.gameObject.SetActive(false); - votingPage.gameObject.SetActive(false); - scoringPage.gameObject.SetActive(false); - - waitingForPlayersPage.SetActive(true); - ResetAllPlayerLabels(); - } - private void Update() { if (myRoom == null) @@ -97,6 +94,117 @@ private void Update() } + private bool deleteRoomFilesCompleted = false; + private bool deleteRealtimeDBCompleted = false; + + private void OnApplicationQuit() + { + StartCoroutine(Coroutine_ClearCurrentRoom(() => + { + Debug.Log("You can go. Bye bye..."); + })); + } + + #endregion + + #region Public Methods + + /// + /// Automatically called at start of game + /// + [ContextMenu("Create New Room")] + public void CreateNewRoom() + { + WhichCodesAreAlreadyUsed(codes => + { + Room newRoom = new Room(GenerateRandomAvailableCode(codes).ToString("D4")); + myRoom = newRoom; + try + { + string JSON = JsonConvert.SerializeObject(newRoom); + + realtimeDB.Child("rooms").Child(newRoom.code).SetRawJsonValueAsync(JSON).ContinueWithOnMainThread(task => + { + //then subscribe to it + realtimeDB.Child("rooms").Child(newRoom.code).ValueChanged += OnRoomUpdate; + roomCodeLabel.text = myRoom.code; + OnRoomCreated?.Invoke(); + Debug.Log($"room {myRoom.code} has been created on the server"); + }); + } + catch (Exception e) + { + Debug.LogException(e); + } + }); + } + + public void GeneratePrompts() + { + System.Random rnd = new(); + List prompts = promptList.prompts.OrderBy(x => rnd.Next()).Take(myRoom.players.Count()).ToList(); + List players = myRoom.players.Values.ToList().OrderBy(x => rnd.Next()).ToList(); + Dictionary questions = new(); + + for (int i = 0; i < players.Count(); i++) + { + Dictionary propositions = new(); + + for (int j = 0; j < 2; j++) + { + propositions.Add(j, new Proposition(players[i + j < players.Count() ? i + j : 0])); + } + + questions.Add(i, new Question() + { + index = i, + promptId = prompts[i].id, + propositions = propositions, + creationDate = DateTime.Now.ToOADate(), + }); + } + + string JSON = JsonConvert.SerializeObject(questions); + realtimeDB.Child("rooms").Child(myRoom.code).Child("questions").SetRawJsonValueAsync(JSON); + } + + /// + /// + /// + /// can be "en" or "fr" + public void SetPromptsLanguage(string _language) + { + if (myRoom == null) + return; + + if(_language == "en" ||_language == "fr") + realtimeDB.Child("rooms").Child(myRoom.code).Child("promptsLanguage").SetValueAsync(_language); + } + + #endregion + + #region Private Methods + + private void Initialize() + { + FirebaseInitializer.Instance.onFirebaseReady -= Initialize; + realtimeDB = FirebaseDatabase.DefaultInstance.RootReference; + Debug.Log("Realtime DB initialized"); + ClearOldAndCreateNewRoom(); + } + + + private void InitializeFirstPage() + { + explanationPage.SetActive(false); + waitForPropositionsPage.gameObject.SetActive(false); + votingPage.gameObject.SetActive(false); + scoringPage.gameObject.SetActive(false); + + waitingForPlayersPage.SetActive(true); + ResetAllPlayerLabels(); + } + private void SendRoomState(GameState _newState) { //Debug.Log($"sending to RTDB that we are now in the {_newState} state", this); @@ -112,25 +220,6 @@ private void ResetAllPlayerLabels() } } - private bool deleteRoomFilesCompleted = false; - private bool deleteRealtimeDBCompleted = false; - - private void OnApplicationQuit() - { - StartCoroutine(Coroutine_ClearCurrentRoom(() => - { - Debug.Log("You can go. Bye bye..."); - })); - } - - private void Initialize() - { - FirebaseInitializer.Instance.onFirebaseReady -= Initialize; - realtimeDB = FirebaseDatabase.DefaultInstance.RootReference; - Debug.Log("Realtime DB initialized"); - ClearOldAndCreateNewRoom(); - } - private void ClearOldAndCreateNewRoom() { CleanOldRooms(); @@ -142,7 +231,7 @@ private void ClearOldAndCreateNewRoom() private IEnumerator Coroutine_ClearCurrentRoom(Action callback_OnRoomClear = null) { - if(myRoom == null || string.IsNullOrEmpty(myRoom.code)) + if (myRoom == null || string.IsNullOrEmpty(myRoom.code)) { yield return null; Debug.Log("There is no last room to clean", this); @@ -177,92 +266,6 @@ private IEnumerator Coroutine_ClearCurrentRoom(Action callback_OnRoomClear = nul } } - /// - /// Check all the rooms in the server and give back the number already taken - /// - private void WhichCodesAreAlreadyUsed(Action> callback_OnCodesChecked) - { - QueryRoomsInDatabase(onlineRooms => - { - List alreadyUsedCodes = onlineRooms.Select(room => int.Parse(room.code)).ToList(); - Debug.Log($"Codes {string.Join(", ", alreadyUsedCodes)} are already used by other parties", this); - callback_OnCodesChecked?.Invoke(alreadyUsedCodes); - }); - } - - /// - /// Automatically called at start of game - /// - [ContextMenu("Create New Room")] - public void CreateNewRoom() - { - WhichCodesAreAlreadyUsed(codes => - { - Room newRoom = new Room(GenerateRandomAvailableCode(codes).ToString("D4")); - myRoom = newRoom; - try - { - string JSON = JsonConvert.SerializeObject(newRoom); - - realtimeDB.Child("rooms").Child(newRoom.code).SetRawJsonValueAsync(JSON).ContinueWithOnMainThread(task => - { - //then subscribe to it - realtimeDB.Child("rooms").Child(newRoom.code).ValueChanged += OnRoomUpdate; - roomCodeLabel.text = myRoom.code; - Debug.Log($"room {myRoom.code} has been created on the server"); - }); - } - catch (Exception e) - { - Debug.LogException(e); - } - }); - } - - /// - /// Generate a code between 0 and 1000 that is not in the list - /// - /// the list of code you don"t want to get - /// - private int GenerateRandomAvailableCode(List _impossibleCodes) - { - int random = UnityEngine.Random.Range(0, 1000); - while (_impossibleCodes.Contains(random)) - { - Debug.Log($"{random} is already taken, choosing another room code", this); - random = UnityEngine.Random.Range(0, 1000); - } - return random; - } - - public void GeneratePrompts() - { - System.Random rnd = new(); - List prompts = promptList.prompts.OrderBy(x => rnd.Next()).Take(myRoom.players.Count()).ToList(); - List players = myRoom.players.Values.ToList().OrderBy(x => rnd.Next()).ToList(); - Dictionary questions = new(); - - for (int i = 0; i < players.Count(); i++) - { - Dictionary propositions = new(); - - for (int j = 0; j < 2; j++) - { - propositions.Add(j, new Proposition(players[i + j < players.Count() ? i + j : 0])); - } - - questions.Add(i, new Question() - { - index = i, - promptId = prompts[i].id, - propositions = propositions, - creationDate = DateTime.Now.ToOADate(), - }); - } - - string JSON = JsonConvert.SerializeObject(questions); - realtimeDB.Child("rooms").Child(myRoom.code).Child("questions").SetRawJsonValueAsync(JSON); - } /// /// Automatically called when something change in your room @@ -314,6 +317,38 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs value) } } + + + /// + /// Check all the rooms in the server and give back the number already taken + /// + private void WhichCodesAreAlreadyUsed(Action> callback_OnCodesChecked) + { + QueryRoomsInDatabase(onlineRooms => + { + List alreadyUsedCodes = onlineRooms.Select(room => int.Parse(room.code)).ToList(); + Debug.Log($"Codes {string.Join(", ", alreadyUsedCodes)} are already used by other parties", this); + callback_OnCodesChecked?.Invoke(alreadyUsedCodes); + }); + } + + + /// + /// Generate a code between 0 and 1000 that is not in the list + /// + /// the list of code you don"t want to get + /// + private int GenerateRandomAvailableCode(List _impossibleCodes) + { + int random = UnityEngine.Random.Range(0, 1000); + while (_impossibleCodes.Contains(random)) + { + Debug.Log($"{random} is already taken, choosing another room code", this); + random = UnityEngine.Random.Range(0, 1000); + } + return random; + } + /// /// Called when we enter in a new game state /// @@ -463,4 +498,6 @@ private void DeleteRoom(string _roomCode) Debug.Log($"Room {_roomCode} has been deleted"); }); } + + #endregion } diff --git a/Assets/Scripts/VotingPage.cs b/Assets/Scripts/VotingPage.cs index 65de99d..b5c0c4b 100644 --- a/Assets/Scripts/VotingPage.cs +++ b/Assets/Scripts/VotingPage.cs @@ -127,7 +127,7 @@ private void ShowNextQuestion() // Update the prompt text based on the current question's prompt ID. Debug.Log($"Show Question {currentQuestion.promptId}", this); Prompt currentPrompt = promptList.GetPromptById(currentQuestion.promptId); - currentPromptLabel.text = currentPrompt.en; + currentPromptLabel.text = RoomManager.Instance.myRoom.promptsLanguage == "en" ? currentPrompt.en : currentPrompt.fr; Debug.Log($"Prompt is {currentPromptLabel.text}", this); diff --git a/ProjectSettings/LocalizationSettings.asset b/ProjectSettings/LocalizationSettings.asset index 95eca8a..ae34b68 100644 --- a/ProjectSettings/LocalizationSettings.asset +++ b/ProjectSettings/LocalizationSettings.asset @@ -18,4 +18,4 @@ MonoBehaviour: m_AssetTable: m_TableReference: m_TableCollectionName: - m_TrackingChanges: 1 + m_TrackingChanges: 0 -- 2.45.2 From b9c1d74943561c72ba05ac93f7ff115b983f0556 Mon Sep 17 00:00:00 2001 From: Fangh Date: Thu, 29 Feb 2024 21:57:27 +0100 Subject: [PATCH 08/13] fix(localization): remove UnityEditor references for localization --- .../AddressableAssetsData/link.xml | 25 ++++++++++ .../AddressableAssetsData/link.xml.meta | 7 +++ Assets/Scenes/ComputerView.unity | 49 ++++++++++++++++++- Assets/Scenes/PhoneView.unity | 49 ++++++++++++++++++- Assets/Scripts/GameManager.cs | 16 ++---- Assets/Scripts/LanguageManager.cs | 21 ++++++++ Assets/Scripts/LanguageManager.cs.meta | 11 +++++ Assets/Scripts/RoomManager.cs | 12 +---- 8 files changed, 164 insertions(+), 26 deletions(-) create mode 100644 Assets/Localization/AddressableAssetsData/link.xml create mode 100644 Assets/Localization/AddressableAssetsData/link.xml.meta create mode 100644 Assets/Scripts/LanguageManager.cs create mode 100644 Assets/Scripts/LanguageManager.cs.meta diff --git a/Assets/Localization/AddressableAssetsData/link.xml b/Assets/Localization/AddressableAssetsData/link.xml new file mode 100644 index 0000000..6676355 --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/link.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Assets/Localization/AddressableAssetsData/link.xml.meta b/Assets/Localization/AddressableAssetsData/link.xml.meta new file mode 100644 index 0000000..7b4479e --- /dev/null +++ b/Assets/Localization/AddressableAssetsData/link.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1348ae8b4f67ed743a4d30604cebfa9d +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/ComputerView.unity b/Assets/Scenes/ComputerView.unity index 7dc14c2..b985e20 100644 --- a/Assets/Scenes/ComputerView.unity +++ b/Assets/Scenes/ComputerView.unity @@ -1003,6 +1003,53 @@ MonoBehaviour: m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} m_EffectDistance: {x: 10, y: -10} m_UseGraphicAlpha: 1 +--- !u!1 &189589442 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 189589443} + - component: {fileID: 189589444} + m_Layer: 0 + m_Name: LanguageManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &189589443 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 189589442} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 375256414} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &189589444 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 189589442} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4ad1b9d8a84226c48a6c2eae78cc0191, type: 3} + m_Name: + m_EditorClassIdentifier: + currentStringTable: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde --- !u!1 &190388868 GameObject: m_ObjectHideFlags: 0 @@ -2155,7 +2202,6 @@ MonoBehaviour: votingPage: {fileID: 1660260835} scoringPage: {fileID: 581333955} promptList: {fileID: 11400000, guid: 21907abc84e40403ca34c4fb9ab30b06, type: 2} - stringTableCollection: {fileID: 11400000, guid: 3d4b6573839c0274ca08f4bf9dedeca2, type: 2} --- !u!114 &375256413 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2183,6 +2229,7 @@ Transform: m_Children: - {fileID: 1277491650} - {fileID: 1937957482} + - {fileID: 189589443} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &375256415 diff --git a/Assets/Scenes/PhoneView.unity b/Assets/Scenes/PhoneView.unity index dac4e22..95d2e39 100644 --- a/Assets/Scenes/PhoneView.unity +++ b/Assets/Scenes/PhoneView.unity @@ -198,6 +198,53 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 33958867} m_CullTransparentMesh: 1 +--- !u!1 &89490415 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 89490416} + - component: {fileID: 89490417} + m_Layer: 0 + m_Name: LanguageManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &89490416 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 89490415} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 429358650} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &89490417 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 89490415} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4ad1b9d8a84226c48a6c2eae78cc0191, type: 3} + m_Name: + m_EditorClassIdentifier: + currentStringTable: + m_TableReference: + m_TableCollectionName: GUID:9a6eec81bdcf2bb48b63d1f03a258bde --- !u!1 &105416810 GameObject: m_ObjectHideFlags: 0 @@ -971,6 +1018,7 @@ Transform: m_Children: - {fileID: 665178701} - {fileID: 993463148} + - {fileID: 89490416} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &429358652 @@ -1003,7 +1051,6 @@ MonoBehaviour: id: creationDate: 0 explanationTime: 4 - stringTableCollection: {fileID: 11400000, guid: 3d4b6573839c0274ca08f4bf9dedeca2, type: 2} roomCodeField: {fileID: 2023851070} roomError: {fileID: 991600093} playerNameField: {fileID: 1163479463} diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index e248044..8b081bb 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -7,10 +7,7 @@ using Newtonsoft.Json; using TMPro; using Unity.VisualScripting; -using UnityEditor.Localization; using UnityEngine; -using UnityEngine.Localization.Settings; -using UnityEngine.Localization.Tables; using UnityEngine.UI; /// @@ -25,7 +22,6 @@ public class GameManager : MonoBehaviour [Header("Other component")] public float explanationTime = 4f; - public StringTableCollection stringTableCollection; [Header("Home Connection Component")] public TMP_InputField roomCodeField; @@ -66,11 +62,6 @@ public class GameManager : MonoBehaviour private DatabaseReference myOnlineRoom; private DateTime endOfViewDate = DateTime.MinValue; - /// - /// Contains all the translated string for the UI - /// - private StringTable stringTable; - private void Awake() { submitNewPlayer.interactable = false; @@ -81,7 +72,6 @@ private void Awake() private void Start() { InitializeHomePage(); - stringTable = stringTableCollection.GetTable(LocalizationSettings.SelectedLocale.Identifier) as StringTable; } private void InitializeHomePage() @@ -179,7 +169,7 @@ public void PlayerValidateNameAndServerRoom(string _name, string _code) { Debug.LogError("Player name is empty", this); - string errorText = stringTable.GetEntry("PhoneView/Canvas/Background/HomeState/NameField/ErrorNameLabel").LocalizedValue; + string errorText = LanguageManager.Instance.currentStringTable.GetTable().GetEntry("PhoneView/Canvas/Background/HomeState/NameField/ErrorNameLabel").LocalizedValue; nameError.text = errorText; nameError.gameObject.SetActive(true); submitNewPlayer.interactable = true; @@ -191,7 +181,7 @@ public void PlayerValidateNameAndServerRoom(string _name, string _code) { Debug.LogError("Room code is empty", this); - string errorText = stringTable.GetEntry("PhoneView/Canvas/Background/HomeState/NameField/EmptyRoom").LocalizedValue; + string errorText = LanguageManager.Instance.currentStringTable.GetTable().GetEntry("PhoneView/Canvas/Background/HomeState/NameField/EmptyRoom").LocalizedValue; roomError.text = errorText; roomError.gameObject.SetActive(true); submitNewPlayer.interactable = true; @@ -209,7 +199,7 @@ public void PlayerValidateNameAndServerRoom(string _name, string _code) if (room == null) { Debug.LogError("The room doesn't exists"); - string errorText = stringTable.GetEntry("PhoneView/Canvas/Background/HomeState/NameField/ErrorRoom").LocalizedValue; + string errorText = LanguageManager.Instance.currentStringTable.GetTable().GetEntry("PhoneView/Canvas/Background/HomeState/NameField/ErrorRoom").LocalizedValue; roomError.text = errorText; roomError.gameObject.SetActive(true); submitNewPlayer.interactable = true; diff --git a/Assets/Scripts/LanguageManager.cs b/Assets/Scripts/LanguageManager.cs new file mode 100644 index 0000000..2302f6f --- /dev/null +++ b/Assets/Scripts/LanguageManager.cs @@ -0,0 +1,21 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Localization; +using UnityEngine.Localization.Settings; +using UnityEngine.Localization.Tables; + +public class LanguageManager : MonoBehaviour +{ + public static LanguageManager Instance; + + /// + /// Contains all the translated string for the UI + /// + public LocalizedStringTable currentStringTable; + + private void Awake() + { + Instance = this; + } +} diff --git a/Assets/Scripts/LanguageManager.cs.meta b/Assets/Scripts/LanguageManager.cs.meta new file mode 100644 index 0000000..c841d2d --- /dev/null +++ b/Assets/Scripts/LanguageManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4ad1b9d8a84226c48a6c2eae78cc0191 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/RoomManager.cs b/Assets/Scripts/RoomManager.cs index 8e70472..c3dbc9b 100644 --- a/Assets/Scripts/RoomManager.cs +++ b/Assets/Scripts/RoomManager.cs @@ -7,11 +7,8 @@ using Newtonsoft.Json; using System.Linq; using System.Collections; -using UnityEditor.Localization; using UnityEngine.Localization.Settings; -using UnityEngine.Localization; using UnityEngine.Localization.Tables; -using Google.MiniJSON; /// /// This is the game state manager on the PC side @@ -47,12 +44,6 @@ public class RoomManager : MonoBehaviour [Header("Other")] public PromptList promptList; - public StringTableCollection stringTableCollection; - - /// - /// Contains all the translated string for the UI - /// - private StringTable stringTable; public Room myRoom { get; private set; } = null; @@ -66,7 +57,6 @@ private void Awake() { Instance = this; FirebaseInitializer.Instance.onFirebaseReady += Initialize; - stringTable = stringTableCollection.GetTable(LocalizationSettings.SelectedLocale.Identifier) as StringTable; } private void Start() @@ -213,7 +203,7 @@ private void SendRoomState(GameState _newState) private void ResetAllPlayerLabels() { - string label = stringTable.GetEntry("ComputerView/Canvas/WaitingForPlayersPage/WaitingForP").LocalizedValue; + string label = LanguageManager.Instance.currentStringTable.GetTable().GetEntry("ComputerView/Canvas/WaitingForPlayersPage/WaitingForP").LocalizedValue; for (int i = 0; i < playerStickers.Count; i++) { playerStickers[i].Initialize($"{label}{i + 1}", i); -- 2.45.2 From dc20e8e87ef5c5ee420dd94cf35e6e9d806c6319 Mon Sep 17 00:00:00 2001 From: Fangh Date: Thu, 29 Feb 2024 22:06:16 +0100 Subject: [PATCH 09/13] fix(gamemanager): subscribe only after room is created --- Assets/Scripts/GameManager.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 8b081bb..38f383a 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -207,11 +207,12 @@ public void PlayerValidateNameAndServerRoom(string _name, string _code) else { myOnlineRoom = realtimeDB.Child("rooms").Child(_code); - //subscribe to it - myOnlineRoom.ValueChanged += OnRoomUpdate; //if room exists, join it JoinRoom(() => { + //subscribe to it + myOnlineRoom.ValueChanged += OnRoomUpdate; + myRoom.currentState = (int)GameState.WaitingForOtherPlayersToJoin; players.Add(currentPlayer); -- 2.45.2 From 68697c7b068f626254d698438a081943185c0bb6 Mon Sep 17 00:00:00 2001 From: Fangh Date: Thu, 29 Feb 2024 22:13:47 +0100 Subject: [PATCH 10/13] fix(GameManager): onroomupdate --- .../AddressableAssetsData/link.xml | 25 ------------------- .../AddressableAssetsData/link.xml.meta | 7 ------ Assets/Scripts/GameManager.cs | 8 +++--- 3 files changed, 4 insertions(+), 36 deletions(-) delete mode 100644 Assets/Localization/AddressableAssetsData/link.xml delete mode 100644 Assets/Localization/AddressableAssetsData/link.xml.meta diff --git a/Assets/Localization/AddressableAssetsData/link.xml b/Assets/Localization/AddressableAssetsData/link.xml deleted file mode 100644 index 6676355..0000000 --- a/Assets/Localization/AddressableAssetsData/link.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Assets/Localization/AddressableAssetsData/link.xml.meta b/Assets/Localization/AddressableAssetsData/link.xml.meta deleted file mode 100644 index 7b4479e..0000000 --- a/Assets/Localization/AddressableAssetsData/link.xml.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 1348ae8b4f67ed743a4d30604cebfa9d -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 38f383a..30476d3 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -207,11 +207,11 @@ public void PlayerValidateNameAndServerRoom(string _name, string _code) else { myOnlineRoom = realtimeDB.Child("rooms").Child(_code); + //subscribe to it + myOnlineRoom.ValueChanged += OnRoomUpdate; //if room exists, join it JoinRoom(() => { - //subscribe to it - myOnlineRoom.ValueChanged += OnRoomUpdate; myRoom.currentState = (int)GameState.WaitingForOtherPlayersToJoin; players.Add(currentPlayer); @@ -307,8 +307,6 @@ public void StartGame() /// private void OnRoomUpdate(object sender, ValueChangedEventArgs e) { - GameState lastState = (GameState)myRoom.currentState; - try { if (e?.Snapshot?.GetRawJsonValue() != null) @@ -328,6 +326,8 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e) return; } + GameState lastState = (GameState)myRoom.currentState; + Debug.Log($"lasState = {lastState}. Currentstep = {(GameState)myRoom.currentState}", this); if (myRoom.currentState != (int)lastState) { -- 2.45.2 From c69c92d73377174b1980094a42593f71bba62af4 Mon Sep 17 00:00:00 2001 From: Fangh Date: Thu, 29 Feb 2024 22:34:08 +0100 Subject: [PATCH 11/13] fix(gamemanager): try to fix explanation stuck --- Assets/Scripts/DatabaseClasses/Room.cs | 6 ------ Assets/Scripts/GameManager.cs | 6 ++---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/Assets/Scripts/DatabaseClasses/Room.cs b/Assets/Scripts/DatabaseClasses/Room.cs index b316614..b511ddc 100644 --- a/Assets/Scripts/DatabaseClasses/Room.cs +++ b/Assets/Scripts/DatabaseClasses/Room.cs @@ -96,12 +96,6 @@ public List GetQuestionsByPlayer(Player player) return playerQuestions; } - - public void SetPlayersAreReady(int _state) - { - currentState = _state; - } - /// /// Return all the propositions linked to a specific player. /// diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 30476d3..5dc225a 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -207,8 +207,8 @@ public void PlayerValidateNameAndServerRoom(string _name, string _code) else { myOnlineRoom = realtimeDB.Child("rooms").Child(_code); - //subscribe to it - myOnlineRoom.ValueChanged += OnRoomUpdate; + //subscribe to it + myOnlineRoom.ValueChanged += OnRoomUpdate; //if room exists, join it JoinRoom(() => { @@ -282,7 +282,6 @@ private void JoinRoom(Action callback_OnRoomJoined) public void StartGame() { // send Start Game - myRoom.SetPlayersAreReady(1); string JSON = JsonUtility.ToJson(myRoom); Debug.Log(JSON); try @@ -290,7 +289,6 @@ public void StartGame() SendCurrentState(GameState.Explanation, () => { Debug.Log($"start the game", this); - myRoom.currentState = (int)GameState.Explanation; WaitingRoom.SetActive(false); BeforeStart.SetActive(true); -- 2.45.2 From d9580450cc723e1e705e926e19b1b765180d0b8f Mon Sep 17 00:00:00 2001 From: Fangh Date: Thu, 29 Feb 2024 22:40:18 +0100 Subject: [PATCH 12/13] fix(gamemanager): explanationpage is stuck --- Assets/Scripts/GameManager.cs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 5dc225a..bc2dd8c 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -282,17 +282,9 @@ private void JoinRoom(Action callback_OnRoomJoined) public void StartGame() { // send Start Game - string JSON = JsonUtility.ToJson(myRoom); - Debug.Log(JSON); try { - SendCurrentState(GameState.Explanation, () => - { - Debug.Log($"start the game", this); - WaitingRoom.SetActive(false); - BeforeStart.SetActive(true); - - }); + SendCurrentState(GameState.Explanation); } catch (Exception ex) { @@ -473,7 +465,8 @@ private bool CheckIfIAmTheFirst(List players) } return isFirst; } - public void SendCurrentState(GameState state, Action callback_oncCurrentStateSent) + + public void SendCurrentState(GameState state, Action callback_onCurrentStateSent = null) { myOnlineRoom.Child("currentState").SetValueAsync((int)state).ContinueWithOnMainThread(task => { @@ -483,10 +476,9 @@ public void SendCurrentState(GameState state, Action callback_oncCurrentStateSen } else { - callback_oncCurrentStateSent?.Invoke(); + callback_onCurrentStateSent?.Invoke(); } - }); ; - + }); } public void OnClickSubmitSignIn() -- 2.45.2 From 24c001dcc763b6e87eb58cff1971dcac9a3751b6 Mon Sep 17 00:00:00 2001 From: Fangh Date: Thu, 29 Feb 2024 22:45:37 +0100 Subject: [PATCH 13/13] fix(GameManager): give a default value to lastState just in case --- Assets/Scripts/GameManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index bc2dd8c..89b153c 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -297,6 +297,8 @@ public void StartGame() /// private void OnRoomUpdate(object sender, ValueChangedEventArgs e) { + GameState lastState = myRoom != null ? (GameState)myRoom.currentState : GameState.EnteringName; + try { if (e?.Snapshot?.GetRawJsonValue() != null) @@ -316,7 +318,6 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e) return; } - GameState lastState = (GameState)myRoom.currentState; Debug.Log($"lasState = {lastState}. Currentstep = {(GameState)myRoom.currentState}", this); if (myRoom.currentState != (int)lastState) -- 2.45.2