提交小游戏项目
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
/Library
|
||||
/Temp
|
||||
/Assets/Firebase
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"visualstudiotoolsforunity.vstuc"
|
||||
]
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Attach to Unity",
|
||||
"type": "vstuc",
|
||||
"request": "attach"
|
||||
}
|
||||
]
|
||||
}
|
||||
Vendored
+55
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"files.exclude": {
|
||||
"**/.DS_Store": true,
|
||||
"**/.git": true,
|
||||
"**/.gitmodules": true,
|
||||
"**/*.booproj": true,
|
||||
"**/*.pidb": true,
|
||||
"**/*.suo": true,
|
||||
"**/*.user": true,
|
||||
"**/*.userprefs": true,
|
||||
"**/*.unityproj": true,
|
||||
"**/*.dll": true,
|
||||
"**/*.exe": true,
|
||||
"**/*.pdf": true,
|
||||
"**/*.mid": true,
|
||||
"**/*.midi": true,
|
||||
"**/*.wav": true,
|
||||
"**/*.gif": true,
|
||||
"**/*.ico": true,
|
||||
"**/*.jpg": true,
|
||||
"**/*.jpeg": true,
|
||||
"**/*.png": true,
|
||||
"**/*.psd": true,
|
||||
"**/*.tga": true,
|
||||
"**/*.tif": true,
|
||||
"**/*.tiff": true,
|
||||
"**/*.3ds": true,
|
||||
"**/*.3DS": true,
|
||||
"**/*.fbx": true,
|
||||
"**/*.FBX": true,
|
||||
"**/*.lxo": true,
|
||||
"**/*.LXO": true,
|
||||
"**/*.ma": true,
|
||||
"**/*.MA": true,
|
||||
"**/*.obj": true,
|
||||
"**/*.OBJ": true,
|
||||
"**/*.asset": true,
|
||||
"**/*.cubemap": true,
|
||||
"**/*.flare": true,
|
||||
"**/*.mat": true,
|
||||
"**/*.meta": true,
|
||||
"**/*.prefab": true,
|
||||
"**/*.unity": true,
|
||||
"build/": true,
|
||||
"Build/": true,
|
||||
"Library/": true,
|
||||
"library/": true,
|
||||
"obj/": true,
|
||||
"Obj/": true,
|
||||
"ProjectSettings/": true,
|
||||
"temp/": true,
|
||||
"Temp/": true
|
||||
},
|
||||
"dotnet.defaultSolution": "MInigame_unity_GP.sln"
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Vendored
BIN
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 692a8563bf4ba9749905419c982657c8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,155 @@
|
||||
%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: 98b940330fccc574ab75cbe9169e853b
|
||||
m_currentHash:
|
||||
serializedVersion: 2
|
||||
Hash: 00000000000000000000000000000000
|
||||
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:
|
||||
m_RemoteCatalogLoadPath:
|
||||
m_Id:
|
||||
m_ContentStateBuildPathProfileVariableName:
|
||||
m_CustomContentStateBuildPath:
|
||||
m_ContentStateBuildPath:
|
||||
m_BuildAddressablesWithPlayerBuild: 0
|
||||
m_overridePlayerVersion: '[UnityEditor.PlayerSettings.bundleVersion]'
|
||||
m_GroupAssets:
|
||||
- {fileID: 0}
|
||||
- {fileID: 11400000, guid: 0835c4975fed7d14795ec925b54bca80, type: 2}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 11400000, guid: 902fafad9bba93345b7a8d95737094ff, type: 2}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
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: f268c945e460aee4fa44790880c0ddf5
|
||||
m_ProfileName: Default
|
||||
m_Values:
|
||||
- m_Id: 22b0d123a5a1666458159aae517f65cc
|
||||
m_Value: ServerData/[BuildTarget]
|
||||
- m_Id: 2a9f3a8dde39a1e40a3b995445d88fab
|
||||
m_Value: '[UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget]'
|
||||
- m_Id: 563174009125bb94bb9464cb96db4b39
|
||||
m_Value: http://[PrivateIpAddress]:[HostingServicePort]
|
||||
- m_Id: 93fc9f7e01825344a961779d14e9f9fa
|
||||
m_Value: '{UnityEngine.AddressableAssets.Addressables.RuntimePath}/[BuildTarget]'
|
||||
- m_Id: a749bdbcbb3e8ba4c9e6245249a510a4
|
||||
m_Value: '[UnityEditor.EditorUserBuildSettings.activeBuildTarget]'
|
||||
m_ProfileEntryNames:
|
||||
- m_Id: 22b0d123a5a1666458159aae517f65cc
|
||||
m_Name: Remote.BuildPath
|
||||
m_InlineUsage: 0
|
||||
- m_Id: 2a9f3a8dde39a1e40a3b995445d88fab
|
||||
m_Name: Local.BuildPath
|
||||
m_InlineUsage: 0
|
||||
- m_Id: 563174009125bb94bb9464cb96db4b39
|
||||
m_Name: Remote.LoadPath
|
||||
m_InlineUsage: 0
|
||||
- m_Id: 93fc9f7e01825344a961779d14e9f9fa
|
||||
m_Name: Local.LoadPath
|
||||
m_InlineUsage: 0
|
||||
- m_Id: a749bdbcbb3e8ba4c9e6245249a510a4
|
||||
m_Name: BuildTarget
|
||||
m_InlineUsage: 0
|
||||
m_ProfileVersion: 1
|
||||
m_LabelTable:
|
||||
m_LabelNames:
|
||||
- default
|
||||
- config
|
||||
m_SchemaTemplates: []
|
||||
m_GroupTemplateObjects:
|
||||
- {fileID: 11400000, guid: e3717cb91779b3c42b0fa261a19e2089, type: 2}
|
||||
m_InitializationObjects: []
|
||||
m_CertificateHandlerType:
|
||||
m_AssemblyName:
|
||||
m_ClassName:
|
||||
m_ActivePlayerDataBuilderIndex: 3
|
||||
m_DataBuilders:
|
||||
- {fileID: 11400000, guid: e3793cbe36022934c8e448ba864e7d23, type: 2}
|
||||
- {fileID: 11400000, guid: c1b22d2e9c442004aa8ce9415342d39b, type: 2}
|
||||
- {fileID: 11400000, guid: 09b58a3e361fb894bb05487b13037296, type: 2}
|
||||
- {fileID: 11400000, guid: 451c87b652b66324b93ed04ca22c9f79, type: 2}
|
||||
m_ActiveProfileId: f268c945e460aee4fa44790880c0ddf5
|
||||
m_HostingServicesManager:
|
||||
m_HostingServiceInfos: []
|
||||
m_Settings: {fileID: 11400000}
|
||||
m_NextInstanceId: 0
|
||||
m_RegisteredServiceTypeRefs: []
|
||||
m_PingTimeoutInMilliseconds: 5000
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e60983ba8459aa349988c3ecb65abf31
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d7cae625b9f8c7f4f8e046df6f8afada
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 906b7069055749f4d990ca1b79309fd9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0da0bb3855501354a9bc91673adc7b14
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,76 @@
|
||||
%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: 1a3c5d64ac83548c09dd1678b9f6f1cd, type: 3}
|
||||
m_Name: Packed Assets
|
||||
m_EditorClassIdentifier:
|
||||
m_SchemaObjects:
|
||||
- {fileID: 8641779412788623790}
|
||||
- {fileID: 4811456341964958481}
|
||||
m_Description: Pack assets into asset bundles.
|
||||
m_Settings: {fileID: 11400000, guid: e60983ba8459aa349988c3ecb65abf31, type: 2}
|
||||
--- !u!114 &4811456341964958481
|
||||
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 &8641779412788623790
|
||||
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
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e3717cb91779b3c42b0fa261a19e2089
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0177e9cd130f2644c94ff6f27591f32f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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: bbb281ee3bf0b054c82ac2347e9e782c, type: 3}
|
||||
m_Name: Built In Data
|
||||
m_EditorClassIdentifier:
|
||||
m_GroupName: Built In Data
|
||||
m_Data:
|
||||
m_SerializedData: []
|
||||
m_GUID: 0cc8e75169f233d44b9ddac7929cf2a5
|
||||
m_SerializeEntries: []
|
||||
m_ReadOnly: 1
|
||||
m_Settings: {fileID: 11400000, guid: e60983ba8459aa349988c3ecb65abf31, type: 2}
|
||||
m_SchemaSet:
|
||||
m_Schemas: []
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0835c4975fed7d14795ec925b54bca80
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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: Default Local Group
|
||||
m_EditorClassIdentifier:
|
||||
m_GroupName: Default Local Group
|
||||
m_Data:
|
||||
m_SerializedData: []
|
||||
m_GUID: 97afe08e07be46a4ca39561ec32df5fb
|
||||
m_SerializeEntries:
|
||||
- m_GUID: 2286bdb9423d4da48ba3b1bd8765173f
|
||||
m_Address: Assets/Configs
|
||||
m_ReadOnly: 0
|
||||
m_SerializedLabels:
|
||||
- config
|
||||
FlaggedDuringContentUpdateRestriction: 0
|
||||
m_ReadOnly: 0
|
||||
m_Settings: {fileID: 11400000, guid: e60983ba8459aa349988c3ecb65abf31, type: 2}
|
||||
m_SchemaSet:
|
||||
m_Schemas:
|
||||
- {fileID: 11400000, guid: a6c2bb9206a787d40a5ddd394de13ea2, type: 2}
|
||||
- {fileID: 11400000, guid: 38bec3dff28f2014194d6df27120ffe2, type: 2}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 902fafad9bba93345b7a8d95737094ff
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a65b9c2fafd9b444aa0ce2c532b4133d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+17
@@ -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: 0835c4975fed7d14795ec925b54bca80, type: 2}
|
||||
m_IncludeResourcesFolders: 1
|
||||
m_IncludeBuildSettingsScenes: 1
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20981212fe0549c4f8f7200e0ce3f519
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+45
@@ -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: 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: 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: 2a9f3a8dde39a1e40a3b995445d88fab
|
||||
m_LoadPath:
|
||||
m_Id: 93fc9f7e01825344a961779d14e9f9fa
|
||||
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
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6c2bb9206a787d40a5ddd394de13ea2
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+16
@@ -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: 0}
|
||||
m_StaticContent: 0
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 38bec3dff28f2014194d6df27120ffe2
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 72553237eae78744ba2ff551ec768030
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e3793cbe36022934c8e448ba864e7d23
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 451c87b652b66324b93ed04ca22c9f79
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 09b58a3e361fb894bb05487b13037296
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c1b22d2e9c442004aa8ce9415342d39b
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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: e60983ba8459aa349988c3ecb65abf31
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f9b9b19ab849a34f8c66956df64c186
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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: 7e3976da977cb49238499ea3b4c237ae, type: 3}
|
||||
m_Name: ProfileDataSourceSettings
|
||||
m_EditorClassIdentifier:
|
||||
profileGroupTypes:
|
||||
- m_GroupTypePrefix: Built-In
|
||||
m_Variables:
|
||||
- m_Suffix: BuildPath
|
||||
m_Value: '[UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget]'
|
||||
- m_Suffix: LoadPath
|
||||
m_Value: '{UnityEngine.AddressableAssets.Addressables.RuntimePath}/[BuildTarget]'
|
||||
- m_GroupTypePrefix: Editor Hosted
|
||||
m_Variables:
|
||||
- m_Suffix: BuildPath
|
||||
m_Value: ServerData/[BuildTarget]
|
||||
- m_Suffix: LoadPath
|
||||
m_Value: http://[PrivateIpAddress]:[HostingServicePort]
|
||||
environments: []
|
||||
currentEnvironment:
|
||||
id:
|
||||
projectId:
|
||||
projectGenesisId:
|
||||
name:
|
||||
isDefault: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 59f7c3bb2d35146c88dfedf2004a8ae7
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2286bdb9423d4da48ba3b1bd8765173f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5edaeabbeb4fccd488dec974100ce1a5
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9603306be2f49024683e0675909d9557
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 47687e2a037fd460ba47c2a7156e77cb
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e757d2dc930dc4d66890aa6fa69bcbe0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f38e3ab3aa7d44f7922af4e7191babd
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7fae64f16d4a32c44a9dfb5ef538d4d6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,38 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e2d7ea0845de4cf984265d2a444b7aa4
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.186
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.186/Google.IOSResolver.dll
|
||||
- gvhp_targets-editor
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 0
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: baf24db2bf904e729e7796721c09e8ad
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_rename_to_disable
|
||||
- gvh_version-1.2.186
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.186/Google.IOSResolver.pdb
|
||||
- gvhp_targets-editor
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,38 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa49a85d4ba140a0ae21528ed12d174c
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.186
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.186/Google.JarResolver.dll
|
||||
- gvhp_targets-editor
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d13c8602d5e14e43b0e92459754c4315
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_rename_to_disable
|
||||
- gvh_version-1.2.186
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.186/Google.JarResolver.pdb
|
||||
- gvhp_targets-editor
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
+38
@@ -0,0 +1,38 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d8bb10c56a0147bc855a6296778e025e
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.186
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.186/Google.PackageManagerResolver.dll
|
||||
- gvhp_targets-editor
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a695eb9f64fe49569a2db0c4246c877d
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_rename_to_disable
|
||||
- gvh_version-1.2.186
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.186/Google.PackageManagerResolver.pdb
|
||||
- gvhp_targets-editor
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,38 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5980a684c61d42fbb6b74e2eb3477016
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.186
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.186/Google.VersionHandlerImpl.dll
|
||||
- gvhp_targets-editor
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f56badf3ca84753b00163c3b632d4e5
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_rename_to_disable
|
||||
- gvh_version-1.2.186
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.186/Google.VersionHandlerImpl.pdb
|
||||
- gvhp_targets-editor
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aba4ee01c6d145f7bf2d944d892f709a
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.186
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/CHANGELOG.md
|
||||
timeCreated: 1584567712
|
||||
licenseType: Pro
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,36 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f7632a50b10045458c53a5ddf7b6d238
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.186
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/Google.VersionHandler.dll
|
||||
- gvhp_targets-editor
|
||||
timeCreated: 1480838400
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 57f5a82a79ab4b098f09326c8f3c73a6
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.186
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/Google.VersionHandler.pdb
|
||||
timeCreated: 1538009133
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,245 @@
|
||||
Copyright (C) 2014 Google Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
====================================================================================================
|
||||
This package uses MiniJSON
|
||||
|
||||
Copyright (c) 2013 Calvin Rien
|
||||
|
||||
Based on the JSON parser by Patrick van Bergen
|
||||
http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
|
||||
|
||||
Simplified it so that it doesn't throw exceptions
|
||||
and can be used in Unity iPhone with maximum code stripping.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae8b2bc8d1ac4ad48f0ab2b2e7ac75fb
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.186
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/LICENSE
|
||||
timeCreated: 1584567712
|
||||
licenseType: Pro
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,903 @@
|
||||
# External Dependency Manager for Unity
|
||||
|
||||
[](https://openupm.com/packages/com.google.external-dependency-manager/)
|
||||
[](https://openupm.com/packages/com.google.external-dependency-manager/)
|
||||
|
||||
## Overview
|
||||
|
||||
The External Dependency Manager for Unity (EDM4U) (formerly Play Services
|
||||
Resolver/Jar Resolver) is intended to be used by any Unity package or user that
|
||||
requires:
|
||||
|
||||
* Android specific libraries (e.g
|
||||
[AARs](https://developer.android.com/studio/projects/android-library.html))
|
||||
|
||||
* iOS [CocoaPods](https://cocoapods.org/)
|
||||
|
||||
* Version management of transitive dependencies
|
||||
|
||||
* Management of Package Manager (PM) Registries
|
||||
|
||||
If you want to add and use iOS/Android dependencies directly in your project,
|
||||
then you should to install EDM4U in your project.
|
||||
|
||||
If you are a package user and the plugin you are using depends on EDM4U, *and*
|
||||
the package does not include EDM4U as a package dependency already, then you
|
||||
should to install EDM4U in your project.
|
||||
|
||||
If you are a UPM package maintainer and your package requires EDM4U, then you
|
||||
should add EDM4U as a
|
||||
[package dependency](https://docs.unity3d.com/2019.3/Documentation/Manual/upm-dependencies.html)
|
||||
in your package manifest (`package.json`):
|
||||
|
||||
```json
|
||||
{
|
||||
"dependencies": {
|
||||
"com.google.external-dependency-manager": "1.2.178"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You should still install EDM4U to test out the package during development.
|
||||
|
||||
If you are a legacy `.unitypackage` package maintainer and your package requires
|
||||
EDM4U, please ask the user to install EDM4U separately. You should install EDM4U
|
||||
to test out the package during development.
|
||||
|
||||
Updated releases are available on
|
||||
[GitHub](https://github.com/googlesamples/unity-jar-resolver)
|
||||
|
||||
## Requirements
|
||||
|
||||
The *Android Resolver* and *iOS Resolver* components of the plugin only work
|
||||
with Unity version 4.6.8 or higher.
|
||||
|
||||
The *Version Handler* component only works with Unity 5.x or higher as it
|
||||
depends upon the `PluginImporter` UnityEditor API.
|
||||
|
||||
The *Package Manager Resolver* component only works with Unity 2018.4 or above,
|
||||
when [scoped registry](https://docs.unity3d.com/Manual/upm-scoped.html) support
|
||||
was added to the Package Manager.
|
||||
|
||||
## Getting Started
|
||||
|
||||
Check out [troubleshooting](troubleshooting-faq.md) if you need help.
|
||||
|
||||
### Install via OpenUPM
|
||||
|
||||
EDM4U is available on
|
||||
[OpenUPM](https://openupm.com/packages/com.google.external-dependency-manager/):
|
||||
|
||||
```shell
|
||||
openupm add com.google.external-dependency-manager
|
||||
```
|
||||
|
||||
### Install via git URL
|
||||
1. Open Package Manager
|
||||
2. Click on the + icon on the top left corner of the "Package Manager" screen
|
||||
3. Click on "Install package from git url..."
|
||||
4. Paste: https://github.com/googlesamples/unity-jar-resolver.git?path=upm
|
||||
|
||||
### Install via Google APIs for Unity
|
||||
|
||||
EDM4U is available both in UPM and legacy `.unitypackage` formats on
|
||||
[Google APIs for Unity](https://developers.google.com/unity/archive#external_dependency_manager_for_unity).
|
||||
|
||||
You may install the UPM version (.tgz) as a
|
||||
[local UPM package](https://docs.unity3d.com/Manual/upm-ui-local.html).
|
||||
|
||||
You can also install EDM4U in your project as a `.unitypackage`. This is not
|
||||
recommended due to potential conflicts.
|
||||
|
||||
### Conflict Resolution
|
||||
|
||||
For historical reasons, a package maintainer may choose to embed EDM4U in their
|
||||
package for ease of installation. This will create a conflict when you try to
|
||||
install EDM4U with the steps above, or with another package with embedded EDM4U.
|
||||
If your project imported a `.unitypackage` that has a copy of EDM4U embedded in
|
||||
it, you may safely delete it from your Assets folder. If your project depends on
|
||||
another UPM package with EDM4U, please reach out to the package maintainer and
|
||||
ask them to replace it with a dependency to this package. In the meantime, you
|
||||
can workaround the issue by copying the package to your Packages folder (to
|
||||
create an
|
||||
[embedded package](https://docs.unity3d.com/Manual/upm-concepts.html#Embedded))
|
||||
and perform the steps yourself to avoid a dependency conflict.
|
||||
|
||||
### Config file
|
||||
|
||||
To start adding dependencies to your project, copy and rename the
|
||||
[SampleDependencies.xml](https://github.com/googlesamples/unity-jar-resolver/blob/master/sample/Assets/ExternalDependencyManager/Editor/SampleDependencies.xml)
|
||||
file into your plugin and add the dependencies your project requires.
|
||||
|
||||
The XML file needs to be under an `Editor` directory and match the name
|
||||
`*Dependencies.xml`. For example, `MyPlugin/Editor/MyPluginDependencies.xml`.
|
||||
|
||||
## Usages
|
||||
|
||||
### Android Resolver
|
||||
|
||||
The Android Resolver copies specified dependencies from local or remote Maven
|
||||
repositories into the Unity project when a user selects Android as the build
|
||||
target in the Unity editor.
|
||||
|
||||
For example, to add the Google Play Games library
|
||||
(`com.google.android.gms:play-services-games` package) at version `9.8.0` to the
|
||||
set of a plugin's Android dependencies:
|
||||
|
||||
```xml
|
||||
<dependencies>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.google.android.gms:play-services-games:9.8.0">
|
||||
<androidSdkPackageIds>
|
||||
<androidSdkPackageId>extra-google-m2repository</androidSdkPackageId>
|
||||
</androidSdkPackageIds>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
</dependencies>
|
||||
```
|
||||
|
||||
The version specification (last component) supports:
|
||||
|
||||
* Specific versions e.g `9.8.0`
|
||||
|
||||
* Partial matches e.g `9.8.+` would match 9.8.0, 9.8.1 etc. choosing the most
|
||||
recent version
|
||||
|
||||
* Latest version using `LATEST` or `+`. We do *not* recommend using this
|
||||
unless you're 100% sure the library you depend upon will not break your
|
||||
Unity plugin in future
|
||||
|
||||
The above example specifies the dependency as a component of the Android SDK
|
||||
manager such that the Android SDK manager will be executed to install the
|
||||
package if it's not found. If your Android dependency is located on Maven
|
||||
central it's possible to specify the package simply using the `androidPackage`
|
||||
element:
|
||||
|
||||
```xml
|
||||
<dependencies>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.google.api-client:google-api-client-android:1.22.0" />
|
||||
</androidPackages>
|
||||
</dependencies>
|
||||
```
|
||||
|
||||
#### Auto-resolution
|
||||
|
||||
By default the Android Resolver automatically monitors the dependencies you have
|
||||
specified and the `Plugins/Android` folder of your Unity project. The resolution
|
||||
process runs when the specified dependencies are not present in your project.
|
||||
|
||||
The *auto-resolution* process can be disabled via the `Assets > External
|
||||
Dependency Manager > Android Resolver > Settings` menu.
|
||||
|
||||
Manual resolution can be performed using the following menu options:
|
||||
|
||||
* `Assets > External Dependency Manager > Android Resolver > Resolve`
|
||||
|
||||
* `Assets > External Dependency Manager > Android Resolver > Force Resolve`
|
||||
|
||||
#### Deleting libraries
|
||||
|
||||
Resolved packages are tracked via asset labels by the Android Resolver. They can
|
||||
easily be deleted using the `Assets > External Dependency Manager > Android
|
||||
Resolver > Delete Resolved Libraries` menu item.
|
||||
|
||||
#### Android Manifest Variable Processing
|
||||
|
||||
Some AAR files (for example play-services-measurement) contain variables that
|
||||
are processed by the Android Gradle plugin. Unfortunately, Unity does not
|
||||
perform the same processing when using Unity's Internal Build System, so the
|
||||
Android Resolver plugin handles known cases of this variable substitution by
|
||||
exploding the AAR into a folder and replacing `${applicationId}` with the
|
||||
`bundleID`.
|
||||
|
||||
Disabling AAR explosion and therefore Android manifest processing can be done
|
||||
via the `Assets > External Dependency Manager > Android Resolver > Settings`
|
||||
menu. You may want to disable explosion of AARs if you're exporting a project to
|
||||
be built with Gradle/Android Studio.
|
||||
|
||||
#### ABI Stripping
|
||||
|
||||
Some AAR files contain native libraries (.so files) for each ABI supported by
|
||||
Android. Unfortunately, when targeting a single ABI (e.g x86), Unity does not
|
||||
strip native libraries for unused ABIs. To strip unused ABIs, the Android
|
||||
Resolver plugin explodes an AAR into a folder and removes unused ABIs to reduce
|
||||
the built APK size. Furthermore, if native libraries are not stripped from an
|
||||
APK (e.g you have a mix of Unity's x86 library and some armeabi-v7a libraries)
|
||||
Android may attempt to load the wrong library for the current runtime ABI
|
||||
completely breaking your plugin when targeting some architectures.
|
||||
|
||||
AAR explosion and therefore ABI stripping can be disabled via the `Assets >
|
||||
External Dependency Manager > Android Resolver > Settings` menu. You may want to
|
||||
disable explosion of AARs if you're exporting a project to be built with
|
||||
Gradle/Android Studio.
|
||||
|
||||
#### Resolution Strategies
|
||||
|
||||
By default the Android Resolver will use Gradle to download dependencies prior
|
||||
to integrating them into a Unity project. This works with Unity's internal build
|
||||
system and Gradle/Android Studio project export.
|
||||
|
||||
It's possible to change the resolution strategy via the `Assets > External
|
||||
Dependency Manager > Android Resolver > Settings` menu.
|
||||
|
||||
##### Download Artifacts with Gradle
|
||||
|
||||
Using the default resolution strategy, the Android resolver executes the
|
||||
following operations:
|
||||
|
||||
- Remove the result of previous Android resolutions. E.g Delete all files and
|
||||
directories labeled with "gpsr" under `Plugins/Android` from the project.
|
||||
|
||||
- Collect the set of Android dependencies (libraries) specified by a project's
|
||||
`*Dependencies.xml` files.
|
||||
|
||||
- Run `download_artifacts.gradle` with Gradle to resolve conflicts and, if
|
||||
successful, download the set of resolved Android libraries (AARs, JARs).
|
||||
|
||||
- Process each AAR/JAR so that it can be used with the currently selected
|
||||
Unity build system (e.g Internal vs. Gradle, Export vs. No Export). This
|
||||
involves patching each reference to `applicationId` in the
|
||||
`AndroidManifest.xml` with the project's bundle ID. This means resolution
|
||||
must be run again if the bundle ID has changed.
|
||||
|
||||
- Move the processed AARs to `Plugins/Android` so they will be included when
|
||||
Unity invokes the Android build.
|
||||
|
||||
##### Integrate into mainTemplate.gradle
|
||||
|
||||
Unity 5.6 introduced support for customizing the `build.gradle` used to build
|
||||
Unity projects with Gradle. When the *Patch mainTemplate.gradle* setting is
|
||||
enabled, rather than downloading artifacts before the build, Android resolution
|
||||
results in the execution of the following operations:
|
||||
|
||||
- Remove the result of previous Android resolutions. E.g Delete all files and
|
||||
directories labeled with "gpsr" under `Plugins/Android` from the project and
|
||||
remove sections delimited with `// Android Resolver * Start` and `// Android
|
||||
Resolver * End` lines.
|
||||
|
||||
- Collect the set of Android dependencies (libraries) specified by a project's
|
||||
`*Dependencies.xml` files.
|
||||
|
||||
- Rename any `.srcaar` files in the build to `.aar` and exclude them from
|
||||
being included directly by Unity in the Android build as
|
||||
`mainTemplate.gradle` will be patched to include them instead from their
|
||||
local maven repositories.
|
||||
|
||||
- Inject the required Gradle repositories into `mainTemplate.gradle` at the
|
||||
line matching the pattern `.*apply plugin:
|
||||
'com\.android\.(application|library)'.*` or the section starting at the line
|
||||
`// Android Resolver Repos Start`. If you want to control the injection
|
||||
point in the file, the section delimited by the lines `// Android Resolver
|
||||
Repos Start` and `// Android Resolver Repos End` should be placed in the
|
||||
global scope before the `dependencies` section.
|
||||
|
||||
- Inject the required Android dependencies (libraries) into
|
||||
`mainTemplate.gradle` at the line matching the pattern `***DEPS***` or the
|
||||
section starting at the line `// Android Resolver Dependencies Start`. If
|
||||
you want to control the injection point in the file, the section delimited
|
||||
by the lines `// Android Resolver Dependencies Start` and `// Android
|
||||
Resolver Dependencies End` should be placed in the `dependencies` section.
|
||||
|
||||
- Inject the packaging options logic, which excludes architecture specific
|
||||
libraries based upon the selected build target, into `mainTemplate.gradle`
|
||||
at the line matching the pattern `android +{` or the section starting at the
|
||||
line `// Android Resolver Exclusions Start`. If you want to control the
|
||||
injection point in the file, the section delimited by the lines `// Android
|
||||
Resolver Exclusions Start` and `// Android Resolver Exclusions End` should
|
||||
be placed in the global scope before the `android` section.
|
||||
|
||||
#### Dependency Tracking
|
||||
|
||||
The Android Resolver creates the
|
||||
`ProjectSettings/AndroidResolverDependencies.xml` to quickly determine the set
|
||||
of resolved dependencies in a project. This is used by the auto-resolution
|
||||
process to only run the expensive resolution process when necessary.
|
||||
|
||||
#### Displaying Dependencies
|
||||
|
||||
It's possible to display the set of dependencies the Android Resolver would
|
||||
download and process in your project via the `Assets > External Dependency
|
||||
Manager > Android Resolver > Display Libraries` menu item.
|
||||
|
||||
### iOS Resolver
|
||||
|
||||
The iOS resolver component of this plugin manages
|
||||
[CocoaPods](https://cocoapods.org/). A CocoaPods `Podfile` is generated and the
|
||||
`pod` tool is executed as a post build process step to add dependencies to the
|
||||
Xcode project exported by Unity.
|
||||
|
||||
Dependencies for iOS are added by referring to CocoaPods.
|
||||
|
||||
For example, to add the AdMob pod, version 7.0 or greater with bitcode enabled:
|
||||
|
||||
```xml
|
||||
<dependencies>
|
||||
<iosPods>
|
||||
<iosPod name="Google-Mobile-Ads-SDK" version="~> 7.0" bitcodeEnabled="true"
|
||||
minTargetSdk="6.0" addToAllTargets="false" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
```
|
||||
|
||||
#### Integration Strategies
|
||||
|
||||
The `CocoaPods` are either:
|
||||
|
||||
* Downloaded and injected into the Xcode project file directly, rather than
|
||||
creating a separate xcworkspace. We call this `Xcode project` integration.
|
||||
|
||||
* If the Unity version supports opening a xcworkspace file, the `pod` tool is
|
||||
used as intended to generate a xcworkspace which references the CocoaPods.
|
||||
We call this `Xcode workspace` integration.
|
||||
|
||||
The resolution strategy can be changed via the `Assets > External Dependency
|
||||
Manager > iOS Resolver > Settings` menu.
|
||||
|
||||
##### Appending text to generated Podfile
|
||||
|
||||
In order to modify the generated Podfile you can create a script like this:
|
||||
|
||||
```csharp
|
||||
using System.IO;
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEditor.Callbacks;
|
||||
using UnityEngine;
|
||||
|
||||
public class PostProcessIOS : MonoBehaviour
|
||||
{
|
||||
// Must be between 40 and 50 to ensure that it's not overriden by Podfile generation (40) and
|
||||
// that it's added before "pod install" (50).
|
||||
[PostProcessBuildAttribute(45)]
|
||||
private static void PostProcessBuild_iOS(BuildTarget target, string buildPath)
|
||||
{
|
||||
if (target == BuildTarget.iOS)
|
||||
{
|
||||
using (StreamWriter sw = File.AppendText(buildPath + "/Podfile"))
|
||||
{
|
||||
// E.g. add an app extension
|
||||
sw.WriteLine("\ntarget 'NSExtension' do\n pod 'Firebase/Messaging', '6.6.0'\nend");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Package Manager Resolver
|
||||
|
||||
Adding registries to the
|
||||
[Package Manager](https://docs.unity3d.com/Manual/Packages.html) (PM) is a
|
||||
manual process. The Package Manager Resolver (PMR) component of this plugin
|
||||
makes it easy for plugin maintainers to distribute new PM registry servers and
|
||||
easy for plugin users to manage PM registry servers.
|
||||
|
||||
#### Adding Registries
|
||||
|
||||
For example, to add a registry for plugins in the scope `com.coolstuff`:
|
||||
|
||||
```xml
|
||||
<registries>
|
||||
<registry name="Cool Stuff"
|
||||
url="https://unityregistry.coolstuff.com"
|
||||
termsOfService="https://coolstuff.com/unityregistry/terms"
|
||||
privacyPolicy="https://coolstuff.com/unityregistry/privacy">
|
||||
<scopes>
|
||||
<scope>com.coolstuff</scope>
|
||||
</scopes>
|
||||
</registry>
|
||||
</registries>
|
||||
```
|
||||
|
||||
When PMR is loaded it will prompt the developer to add the registry to their
|
||||
project if it isn't already present in the `Packages/manifest.json` file.
|
||||
|
||||
For more information, see Unity's documentation on
|
||||
[scoped package registries](https://docs.unity3d.com/Manual/upm-scoped.html).
|
||||
|
||||
#### Managing Registries
|
||||
|
||||
It's possible to add and remove registries that are specified via PMR XML
|
||||
configuration files via the following menu options:
|
||||
|
||||
* `Assets > External Dependency Manager > Package Manager Resolver > Add
|
||||
Registries` will prompt the user with a window which allows them to add
|
||||
registries discovered in the project to the Package Manager.
|
||||
|
||||
* `Assets > External Dependency Manager > Package Manager Resolver > Remove
|
||||
Registries` will prompt the user with a window which allows them to remove
|
||||
registries discovered in the project from the Package Manager.
|
||||
|
||||
* `Assets > External Dependency Manager > Package Manager Resolver > Modify
|
||||
Registries` will prompt the user with a window which allows them to add or
|
||||
remove registries discovered in the project.
|
||||
|
||||
#### Migration
|
||||
|
||||
PMR can migrate Version Handler packages installed in the `Assets` folder to PM
|
||||
packages. This requires the plugins to implement the following:
|
||||
|
||||
* `.unitypackage` must include a Version Handler manifests that describes the
|
||||
components of the plugin. If the plugin has no dependencies the manifest
|
||||
would just include the files in the plugin.
|
||||
|
||||
* The PM package JSON provided by the registry must include a keyword (in the
|
||||
`versions.VERSION.keyword` list) that maps the PM package to a Version
|
||||
Handler package using the format `vh-name:VERSION_HANDLER_MANIFEST_NAME`
|
||||
where `VERSION_HANDLER_MANIFEST_NAME` is the name of the manifest defined in
|
||||
the `.unitypackage`. For more information see the description of the
|
||||
`gvhp_manifestname` asset label in the [Version Handler](#version-handler)
|
||||
section.
|
||||
|
||||
When using the `Assets > External Dependency Manager > Package Manager
|
||||
Resolver > Migrate Packages` menu option, PMR then will:
|
||||
|
||||
* List all Version Handler manager packages in the project.
|
||||
|
||||
* Search all available packages in the PM registries and fetch keywords
|
||||
associated with each package parsing the Version Handler manifest names for
|
||||
each package.
|
||||
|
||||
* Map each installed Version Handler package to a PM package.
|
||||
|
||||
* Prompt the user to migrate the discovered packages.
|
||||
|
||||
* Perform package migration for all selected packages if the user clicks the
|
||||
`Apply` button.
|
||||
|
||||
#### Configuration
|
||||
|
||||
PMR can be configured via the `Assets > External Dependency Manager > Package
|
||||
Manager Resolver > Settings` menu option:
|
||||
|
||||
* `Add package registries` when enabled, when the plugin loads or registry
|
||||
configuration files change, this will prompt the user to add registries that
|
||||
are not present in the Package Manager.
|
||||
|
||||
* `Prompt to add package registries` will cause a developer to be prompted
|
||||
with a window that will ask for confirmation before adding registries. When
|
||||
this is disabled registries are added silently to the project.
|
||||
|
||||
* `Prompt to migrate packages` will cause a developer to be prompted with a
|
||||
window that will ask for confirmation before migrating packages installed in
|
||||
the `Assets` directory to PM packages.
|
||||
|
||||
* `Enable Analytics Reporting` when enabled, reports the use of the plugin to
|
||||
the developers so they can make imrpovements.
|
||||
|
||||
* `Verbose logging` when enabled prints debug information to the console which
|
||||
can be useful when filing bug reports.
|
||||
|
||||
### Version Handler
|
||||
|
||||
The Version Handler component of this plugin manages:
|
||||
|
||||
* Shared Unity plugin dependencies.
|
||||
|
||||
* Upgrading Unity plugins by cleaning up old files from previous versions.
|
||||
|
||||
* Uninstallation of plugins that are distributed with manifest files.
|
||||
|
||||
* Restoration of plugin assets to their original install locations if assets
|
||||
are tagged with the `exportpath` label.
|
||||
|
||||
Since the Version Handler needs to modify Unity asset metadata (`.meta` files),
|
||||
to enable/disable components, rename and delete asset files it does not work
|
||||
with Package Manager installed packages. It's still possible to include EDM4U in
|
||||
Package Manager packages, the Version Handler component simply won't do anything
|
||||
to PM plugins in this case.
|
||||
|
||||
#### Using Version Handler Managed Plugins
|
||||
|
||||
If a plugin is imported at multiple different versions into a project, if the
|
||||
Version Handler is enabled, it will automatically check all managed assets to
|
||||
determine the set of assets that are out of date and assets that should be
|
||||
removed. To disable automatic checking managed assets disable the `Enable
|
||||
version management` option in the `Assets > External Dependency Manager >
|
||||
Version Handler > Settings` menu.
|
||||
|
||||
If version management is disabled, it's possible to check managed assets
|
||||
manually using the `Assets > External Dependency Manager > Version Handler >
|
||||
Update` menu option.
|
||||
|
||||
##### Listing Managed Plugins
|
||||
|
||||
Plugins managed by the Version Handler, those that ship with manifest files, can
|
||||
displayed using the `Assets > External Dependency Manager > Version Handler >
|
||||
Display Managed Packages` menu option. The list of plugins are written to the
|
||||
console window along with the set of files used by each plugin.
|
||||
|
||||
##### Uninstalling Managed Plugins
|
||||
|
||||
Plugins managed by the Version Handler, those that ship with manifest files, can
|
||||
be removed using the `Assets > External Dependency Manager > Version Handler >
|
||||
Uninstall Managed Packages` menu option. This operation will display a window
|
||||
that allows a developer to select a set of plugins to remove which will remove
|
||||
all files owned by each plugin excluding those that are in use by other
|
||||
installed plugins.
|
||||
|
||||
Files managed by the Version Handler, those labeled with the `gvh` asset label,
|
||||
can be checked to see whether anything needs to be upgraded, disabled or removed
|
||||
using the `Assets > External Dependency Manager > Version Handler > Update` menu
|
||||
option.
|
||||
|
||||
##### Restore Install Paths
|
||||
|
||||
Some developers move assets around in their project which can make it harder for
|
||||
plugin maintainers to debug issues if this breaks Unity's
|
||||
[special folders](https://docs.unity3d.com/Manual/SpecialFolders.html) rules. If
|
||||
assets are labeled with their original install/export path (see
|
||||
`gvhp_exportpath` below), Version Handler can restore assets to their original
|
||||
locations when using the `Assets > External Dependency Manager > Version
|
||||
Handler > Move Files To Install Locations` menu option.
|
||||
|
||||
##### Settings
|
||||
|
||||
Some behavior of the Version Handler can be configured via the `Assets >
|
||||
External Dependency Manager > Version Handler > Settings` menu option.
|
||||
|
||||
* `Enable version management` controls whether the plugin should automatically
|
||||
check asset versions and apply changes. If this is disabled the process
|
||||
should be run manually when installing or upgrading managed plugins using
|
||||
`Assets > External Dependency Manager > Version Handler > Update`.
|
||||
|
||||
* `Rename to canonical filenames` is a legacy option that will rename files to
|
||||
remove version numbers and other labels from filenames.
|
||||
|
||||
* `Prompt for obsolete file deletion` enables the display of a window when
|
||||
obsolete files are deleted allowing the developer to select which files to
|
||||
delete and those to keep.
|
||||
|
||||
* `Allow disabling files via renaming` controls whether obsolete or disabled
|
||||
files should be disabled by renaming them to `myfilename_DISABLED`. Renaming
|
||||
to disable files is required in some scenarios where Unity doesn't support
|
||||
removing files from the build via the PluginImporter.
|
||||
|
||||
* `Enable Analytics Reporting` enables/disables usage reporting to plugin
|
||||
developers to improve the product.
|
||||
|
||||
* `Verbose logging` enables *very* noisy log output that is useful for
|
||||
debugging while filing a bug report or building a new managed plugin.
|
||||
|
||||
* `Use project settings` saves settings for the plugin in the project rather
|
||||
than system-wide.
|
||||
|
||||
#### Redistributing a Managed Plugin
|
||||
|
||||
The Version Handler employs a couple of methods for managing version selection,
|
||||
upgrade and removal of plugins.
|
||||
|
||||
* Each plugin can ship with a manifest file that lists the files it includes.
|
||||
This makes it possible for Version Handler to calculate the difference in
|
||||
assets between the most recent release of a plugin and the previous release
|
||||
installed in a project. If a files are removed the Version Handler will
|
||||
prompt the user to clean up obsolete files.
|
||||
|
||||
* Plugins can ship using assets with unique names, unique GUIDs and version
|
||||
number labels. Version numbers can be attached to assets using labels or
|
||||
added to the filename (e.g `myfile.txt` would be `myfile_version-x.y.z.txt).
|
||||
This allows the Version Handler to determine which set of files are the same
|
||||
file at different versions, select the most recent version and prompt the
|
||||
developer to clean up old versions.
|
||||
|
||||
Unity plugins can be managed by the Version Handler using the following steps:
|
||||
|
||||
1. Add the `gvh` asset label to each asset (file) you want Version Handler to
|
||||
manage.
|
||||
|
||||
1. Add the `gvh_version-VERSION` label to each asset where `VERSION` is the
|
||||
version of the plugin you're releasing (e.g 1.2.3).
|
||||
|
||||
1. Add the `gvhp_exportpath-PATH` label to each asset where `PATH` is the
|
||||
export path of the file when the `.unitypackage` is created. This is used to
|
||||
track files if they're moved around in a project by developers.
|
||||
|
||||
1. Optional: Add `gvh_targets-editor` label to each editor DLL in your plugin
|
||||
and disable `editor` as a target platform for the DLL. The Version Handler
|
||||
will enable the most recent version of this DLL when the plugin is imported.
|
||||
|
||||
1. Optional: If your plugin is included in other Unity plugins, you should add
|
||||
the version number to each filename and change the GUID of each asset. This
|
||||
allows multiple versions of your plugin to be imported into a Unity project,
|
||||
with the Version Handler component activating only the most recent version.
|
||||
|
||||
1. Create a manifest text file named `MY_UNIQUE_PLUGIN_NAME_VERSION.txt` that
|
||||
lists all the files in your plugin relative to the project root. Then add
|
||||
the `gvh_manifest` label to the asset to indicate this file is a plugin
|
||||
manifest.
|
||||
|
||||
1. Optional: Add a `gvhp_manifestname-NAME` label to your manifest file to
|
||||
provide a human readable name for your package. If this isn't provided the
|
||||
name of the manifest file will be used as the package name. NAME can match
|
||||
the pattern `[0-9]+[a-zA-Z -]` where a leading integer will set the priority
|
||||
of the name where `0` is the highest priority and preferably used as the
|
||||
display name. The lowest value (i.e highest priority name) will be used as
|
||||
the display name and all other specified names will be aliases of the
|
||||
display name. Aliases can refer to previous names of the package allowing
|
||||
renaming across published versions.
|
||||
|
||||
1. Redistribute EDM4U Unity plugin with your plugin. See the
|
||||
[Plugin Redistribution](#plugin-redistribution) section for details.
|
||||
|
||||
If you follow these steps:
|
||||
|
||||
* When users import a newer version of your plugin, files referenced by the
|
||||
older version's manifest are cleaned up.
|
||||
|
||||
* The latest version of the plugin will be selected when users import multiple
|
||||
packages that include your plugin, assuming the steps in
|
||||
[Plugin Redistribution](#plugin-redistribution) are followed.
|
||||
|
||||
## Background
|
||||
|
||||
Many Unity plugins have dependencies upon Android specific libraries, iOS
|
||||
CocoaPods, and sometimes have transitive dependencies upon other Unity plugins.
|
||||
This causes the following problems:
|
||||
|
||||
* Integrating platform specific (e.g Android and iOS) libraries within a Unity
|
||||
project can be complex and a burden on a Unity plugin maintainer.
|
||||
* The process of resolving conflicting dependencies on platform specific
|
||||
libraries is pushed to the developer attempting to use a Unity plugin. The
|
||||
developer trying to use your plugin is very likely to give up when faced
|
||||
with Android or iOS specific build errors.
|
||||
* The process of resolving conflicting Unity plugins (due to shared Unity
|
||||
plugin components) is pushed to the developer attempting to use your Unity
|
||||
plugin. In an effort to resolve conflicts, the developer will very likely
|
||||
attempt to resolve problems by deleting random files in your plugin, report
|
||||
bugs when that doesn't work and finally give up.
|
||||
|
||||
EDM4U provides solutions for each of these problems.
|
||||
|
||||
### Android Dependency Management
|
||||
|
||||
The *Android Resolver* component of this plugin will download and integrate
|
||||
Android library dependencies and handle any conflicts between plugins that share
|
||||
the same dependencies.
|
||||
|
||||
Without the Android Resolver, typically Unity plugins bundle their AAR and JAR
|
||||
dependencies, e.g. a Unity plugin `SomePlugin` that requires the Google Play
|
||||
Games Android library would redistribute the library and its transitive
|
||||
dependencies in the folder `SomePlugin/Android/`. When a user imports
|
||||
`SomeOtherPlugin` that includes the same libraries (potentially at different
|
||||
versions) in `SomeOtherPlugin/Android/`, the developer using `SomePlugin` and
|
||||
`SomeOtherPlugin` will see an error when building for Android that can be hard
|
||||
to interpret.
|
||||
|
||||
Using the Android Resolver to manage Android library dependencies:
|
||||
|
||||
* Solves Android library conflicts between plugins.
|
||||
* Handles all of the various processing steps required to use Android
|
||||
libraries (AARs, JARs) in Unity 4.x and above projects. Almost all versions
|
||||
of Unity have - at best - partial support for AARs.
|
||||
* (Experimental) Supports minification of included Java components without
|
||||
exporting a project.
|
||||
|
||||
### iOS Dependency Management
|
||||
|
||||
The *iOS Resolver* component of this plugin integrates with
|
||||
[CocoaPods](https://cocoapods.org/) to download and integrate iOS libraries and
|
||||
frameworks into the Xcode project Unity generates when building for iOS. Using
|
||||
CocoaPods allows multiple plugins to utilize shared components without forcing
|
||||
developers to fix either duplicate or incompatible versions of libraries
|
||||
included through multiple Unity plugins in their project.
|
||||
|
||||
### Package Manager Registry Setup
|
||||
|
||||
The [Package Manager](https://docs.unity3d.com/Manual/Packages.html) (PM) makes
|
||||
use of [NPM](https://www.npmjs.com/) registry servers for package hosting and
|
||||
provides ways to discover, install, upgrade and uninstall packages. This makes
|
||||
it easier for developers to manage plugins within their projects.
|
||||
|
||||
However, installing additional package registries requires a few manual steps
|
||||
that can potentially be error prone. The *Package Manager Resolver* component of
|
||||
this plugin integrates with [PM](https://docs.unity3d.com/Manual/Packages.html)
|
||||
to provide a way to auto-install PM package registries when a `.unitypackage` is
|
||||
installed which allows plugin maintainers to ship a `.unitypackage` that can
|
||||
provide access to their own PM registry server to make it easier for developers
|
||||
to manage their plugins.
|
||||
|
||||
### Unity Plugin Version Management
|
||||
|
||||
Finally, the *Version Handler* component of this plugin simplifies the process
|
||||
of managing transitive dependencies of Unity plugins and each plugin's upgrade
|
||||
process.
|
||||
|
||||
For example, without the Version Handler plugin, if:
|
||||
|
||||
* Unity plugin `SomePlugin` includes `EDM4U` plugin at version 1.1.
|
||||
* Unity plugin `SomeOtherPlugin` includes `EDM4U` plugin at version 1.2.
|
||||
|
||||
The version of `EDM4U` included in the developer's project depends upon the
|
||||
order the developer imports `SomePlugin` or `SomeOtherPlugin`.
|
||||
|
||||
This results in:
|
||||
|
||||
* `EDM4U` at version 1.2, if `SomePlugin` is imported then `SomeOtherPlugin`
|
||||
is imported.
|
||||
* `EDM4U` at version 1.1, if `SomeOtherPlugin` is imported then `SomePlugin`
|
||||
is imported.
|
||||
|
||||
The Version Handler solves the problem of managing transitive dependencies by:
|
||||
|
||||
* Specifying a set of packaging requirements that enable a plugin at different
|
||||
versions to be imported into a Unity project.
|
||||
* Providing activation logic that selects the latest version of a plugin
|
||||
within a project.
|
||||
|
||||
When using the Version Handler to manage `EDM4U` included in `SomePlugin` and
|
||||
`SomeOtherPlugin`, from the prior example, version 1.2 will always be the
|
||||
version activated in a developer's Unity project.
|
||||
|
||||
Plugin creators are encouraged to adopt this library to ease integration for
|
||||
their customers. For more information about integrating EDM4U into your own
|
||||
plugin, see the [Plugin Redistribution](#plugin-redistribution) section of this
|
||||
document.
|
||||
|
||||
## Analytics
|
||||
|
||||
The External Dependency Manager for Unity plugin by default logs usage to Google
|
||||
Analytics. The purpose of the logging is to quantitatively measure the usage of
|
||||
functionality, to gather reports on integration failures and to inform future
|
||||
improvements to the developer experience of the External Dependency Manager
|
||||
plugin. Note that the analytics collected are limited to the scope of the EDM4U
|
||||
plugin’s usage.
|
||||
|
||||
For details of what is logged, please refer to the usage of
|
||||
`EditorMeasurement.Report()` in the source code.
|
||||
|
||||
## Plugin Redistribution
|
||||
|
||||
If you are a package maintainer and your package depends on EDM4U, it is highly
|
||||
recommended to use the UPM format and add EDM4U as a dependency. If you must
|
||||
include it in your `.unitypackage`, redistributing `EDM4U` inside your own
|
||||
plugin might ease the integration process for your users.
|
||||
|
||||
If you wish to redistribute `EDM4U` inside your plugin, you **must** follow
|
||||
these steps when importing the `external-dependency-manager-*.unitypackage`, and
|
||||
when exporting your own plugin package:
|
||||
|
||||
1. Import the `external-dependency-manager-*.unitypackage` into your plugin
|
||||
project by
|
||||
[running Unity from the command line](https://docs.unity3d.com/Manual/CommandLineArguments.html),
|
||||
ensuring that you add the `-gvh_disable` option.
|
||||
1. Export your plugin by
|
||||
[running Unity from the command line](https://docs.unity3d.com/Manual/CommandLineArguments.html),
|
||||
ensuring that you:
|
||||
- Include the contents of the `Assets/PlayServicesResolver` and
|
||||
`Assets/ExternalDependencyManager` directory.
|
||||
- Add the `-gvh_disable` option.
|
||||
|
||||
You **must** specify the `-gvh_disable` option in order for the Version Handler
|
||||
to work correctly!
|
||||
|
||||
For example, the following command will import the
|
||||
`external-dependency-manager-1.2.46.0.unitypackage` into the project
|
||||
`MyPluginProject` and export the entire Assets folder to
|
||||
`MyPlugin.unitypackage`:
|
||||
|
||||
```shell
|
||||
Unity -gvh_disable \
|
||||
-batchmode \
|
||||
-importPackage external-dependency-manager-1.2.46.0.unitypackage \
|
||||
-projectPath MyPluginProject \
|
||||
-exportPackage Assets MyPlugin.unitypackage \
|
||||
-quit
|
||||
```
|
||||
|
||||
### Background
|
||||
|
||||
The *Version Handler* component relies upon deferring the load of editor DLLs so
|
||||
that it can run first and determine the latest version of a plugin component to
|
||||
activate. The build of `EDM4U` plugin has Unity asset metadata that is
|
||||
configured so that the editor components are not initially enabled when it's
|
||||
imported into a Unity project. To maintain this configuration when importing the
|
||||
`external-dependency-manager.unitypackage` into a Unity plugin project, you
|
||||
*must* specify the command line option `-gvh_disable` which will prevent the
|
||||
Version Handler component from running and changing the Unity asset metadata.
|
||||
|
||||
## Building from Source
|
||||
|
||||
To build this plugin from source you need the following tools installed: * Unity
|
||||
2021 and below (with iOS and Android modules installed) * Java 11
|
||||
|
||||
You can build the plugin by running the following from your shell (Linux / OSX):
|
||||
|
||||
```shell
|
||||
./gradlew build
|
||||
|
||||
```
|
||||
|
||||
or Windows:
|
||||
|
||||
```shell
|
||||
./gradlew.bat build
|
||||
```
|
||||
|
||||
If Java 11 is not your default Java command, add
|
||||
`-Dorg.gradle.java.home=<PATH_TO_JAVA_HOME>` to the command above.
|
||||
|
||||
## Testing
|
||||
|
||||
You can run the tests by running the following from your shell (Linux / OSX):
|
||||
|
||||
```shell
|
||||
./gradlew test
|
||||
```
|
||||
|
||||
or Windows:
|
||||
|
||||
```shell
|
||||
./gradlew.bat test
|
||||
```
|
||||
|
||||
The following properties can be set to narrow down the tests to run or change
|
||||
the test run behavior.
|
||||
|
||||
* `INTERACTIVE_MODE_TESTS_ENABLED` - Default to `1`. Set to `1` to enable
|
||||
interactive mode tests, which requires GPU on the machine. Otherwise, only
|
||||
run tests in the batch mode.
|
||||
* `INCLUDE_TEST_TYPES` - Default to empty string, which means to include every
|
||||
type of the test. To narrow down the types of test to run, set this
|
||||
properties with a list of case-insensitive type strings separated by comma.
|
||||
For instance, `-PINCLUDE_TEST_TYPES="Python,NUnit"` means to include only
|
||||
Python tests and NUnit tests. See `TestTypeEnum` in `build.gradle` for
|
||||
available options.
|
||||
* `EXCLUDE_TEST_TYPES` - Default to empty string, which means to exclude none.
|
||||
To add types of tests to exclude, set this properties with a list of
|
||||
case-insensitive type strings separated by comma. For instance,
|
||||
`-PEXCLUDE_TEST_TYPES="Python,NUnit"` means to exclude Python tests and
|
||||
NUnit tests. See `TestTypeEnum` in `build.gradle` for available options.
|
||||
* `INCLUDE_TEST_MODULES` - Default to empty string, which means to include the
|
||||
tests for every modules. To narrow down modules to test, set this properties
|
||||
with a list of case-insensitive module strings separated by comma. For
|
||||
instance, `-PINCLUDE_TEST_MODULES="Tool,AndroidResolver"` means to run tests
|
||||
for tools and Android Resolver only. See `TestModuleEnum` in `build.gradle`
|
||||
for available options.
|
||||
* `EXCLUDE_TEST_MODULES` - Default to empty string, which means to exclude
|
||||
none. To add modules to exclude, set this properties with a list of
|
||||
case-insensitive module strings separated by comma. For instance,
|
||||
`-PEXCLUDE_TEST_MODULES="Tool,AndroidResolver"` means to run tests for any
|
||||
modules other than tools and Android Resolver. See `TestModuleEnum` in
|
||||
`build.gradle` for available options.
|
||||
* `EXCLUDE_TESTS` - Default to empty string, which means to exclude none. To
|
||||
add tests to exclude, set this properties with a list of case-insensitive
|
||||
test names separated by comma. For instance,
|
||||
`-PEXCLUDE_TESTS="testGenGuids,testDownloadArtifacts"` means to run tests
|
||||
except the tests with name of `testGenGuids` and `testDownloadArtifacts`.
|
||||
* `CONTINUE_ON_FAIL_FOR_TESTS_ENABLED` - Default to `1`. Set to `1` to
|
||||
continue running the next test when the current one fails. Otherwise, the
|
||||
build script stops whenever any test fails.
|
||||
|
||||
For instance, by running the following command, it only runs the Unity
|
||||
integration tests that does not requires GPU, but exclude tests for Android
|
||||
Resolver module and iOS Resolver module.
|
||||
|
||||
```shell
|
||||
./gradlew test \
|
||||
-PINTERACTIVE_MODE_TESTS_ENABLED=0 \
|
||||
-PINCLUDE_TEST_TYPES="Integration" \
|
||||
-PEXCLUDE_TEST_MODULES="AndroidResolver,iOSResolver"
|
||||
```
|
||||
|
||||
## Releasing
|
||||
|
||||
Each time a new build of this plugin is checked into the source tree you need to
|
||||
do the following:
|
||||
|
||||
* Bump the plugin version variable `pluginVersion` in `build.gradle`
|
||||
* Update `CHANGELOG.md` with the new version number and changes included in
|
||||
the release.
|
||||
* Build the release using `./gradlew release` which performs the following:
|
||||
* Updates `external-dependency-manager-*.unitypackage`
|
||||
* Copies the unpacked plugin to the `exploded` directory.
|
||||
* Updates template metadata files in the `plugin` directory. The GUIDs of
|
||||
all asset metadata is modified due to the version number change. Each
|
||||
file within the plugin is versioned to allow multiple versions of the
|
||||
plugin to be imported into a Unity project which allows the most recent
|
||||
version to be activated by the Version Handler component.
|
||||
* Create release commit using `./gradlew gitCreateReleaseCommit` which
|
||||
performs `git commit -a -m "description from CHANGELOG.md"`
|
||||
* Once the release commit is merge, tag the release using `./gradlew
|
||||
gitTagRelease` which performs the following:
|
||||
* `git tag -a pluginVersion -m "version RELEASE"` to tag the release.
|
||||
* Update tags on remote branch using `git push --tag REMOTE HEAD:master`
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 77919e84cef8419ab4b725fc16e83d52
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.186
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/README.md
|
||||
timeCreated: 1584567712
|
||||
licenseType: Pro
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
Assets/ExternalDependencyManager/Editor/1.2.186/Google.IOSResolver.dll
|
||||
Assets/ExternalDependencyManager/Editor/1.2.186/Google.IOSResolver.pdb
|
||||
Assets/ExternalDependencyManager/Editor/1.2.186/Google.JarResolver.dll
|
||||
Assets/ExternalDependencyManager/Editor/1.2.186/Google.JarResolver.pdb
|
||||
Assets/ExternalDependencyManager/Editor/1.2.186/Google.PackageManagerResolver.dll
|
||||
Assets/ExternalDependencyManager/Editor/1.2.186/Google.PackageManagerResolver.pdb
|
||||
Assets/ExternalDependencyManager/Editor/1.2.186/Google.VersionHandlerImpl.dll
|
||||
Assets/ExternalDependencyManager/Editor/1.2.186/Google.VersionHandlerImpl.pdb
|
||||
Assets/ExternalDependencyManager/Editor/CHANGELOG.md
|
||||
Assets/ExternalDependencyManager/Editor/Google.VersionHandler.dll
|
||||
Assets/ExternalDependencyManager/Editor/Google.VersionHandler.pdb
|
||||
Assets/ExternalDependencyManager/Editor/LICENSE
|
||||
Assets/ExternalDependencyManager/Editor/README.md
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c9a3138961c74d99b7046b783112fceb
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_manifest
|
||||
- gvh_version-1.2.186
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.186_manifest.txt
|
||||
- gvhp_manifestname-0External Dependency Manager
|
||||
- gvhp_manifestname-play-services-resolver
|
||||
timeCreated: 1474401009
|
||||
licenseType: Pro
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cd2cbfb3e5d39fb4496cd6281c622367
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d38455675bd5f5d458f5edb537cf71ab
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 995ad800eccbc434ca2582ccc143a103
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ff5e0b2f5cc5c914fa1da521ad39932a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3980c9e2ccf6c644a899e15c7075b1ce
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7e17412c20991f149b300b68a97520a1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b36e8ab4e5984c041a9918fddeed38f7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,254 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
using DG.Tweening;
|
||||
using TowerClimberChronicles;
|
||||
|
||||
public class level1 : MonoBehaviour
|
||||
{
|
||||
public GameObject plate_parent;
|
||||
public GameObject item_parent;
|
||||
private List<ItemState> _itemList;
|
||||
public Camera cam;
|
||||
private GameObject selected;
|
||||
private Vector3 offset;
|
||||
private int out_layers = 30;
|
||||
private GameObject guo;
|
||||
private List<Vector3> originalPositions = new List<Vector3>();
|
||||
void Awake()
|
||||
{
|
||||
Camera orthoCamera = GameObject.Find("Main Camera").GetComponent<Camera>();
|
||||
|
||||
float size = (float)System.Math.Round(5.5f / ((float)Screen.width / Screen.height), 4);
|
||||
// string type = SystemInfo.deviceModel.ToLower().Trim();
|
||||
// // Debug.Log($"type==========={type}");
|
||||
// if (type.Substring(0, 3) == "ipa")
|
||||
// {//iPad机型
|
||||
// size = 49.9f;
|
||||
// }
|
||||
Debug.Log(size + "////////////////");
|
||||
orthoCamera.orthographicSize = size;
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
guo = GameObject.Find("guo");
|
||||
_itemList = new List<ItemState>();
|
||||
foreach (Transform child in plate_parent.transform)
|
||||
{
|
||||
Debug.Log("子物体: " + child.name);
|
||||
originalPositions.Add(child.position);
|
||||
|
||||
// 先把它们全部移到 (0,14)
|
||||
child.position = new Vector3(0f, 14f, child.position.z);
|
||||
}
|
||||
originalPositions.Add(guo.transform.position);
|
||||
guo.transform.position = new Vector3(0f, -15f, 0);
|
||||
// 启动协程,逐个缓动回原位置
|
||||
StartCoroutine(MoveBackCoroutine());
|
||||
guo.transform.DOMove(originalPositions[originalPositions.Count - 1], 1f).SetEase(Ease.OutQuad);
|
||||
|
||||
|
||||
foreach (Transform child in item_parent.transform)
|
||||
{
|
||||
Debug.Log("子物体: " + child.name);
|
||||
Debug.Log("子物体: " + child.tag);
|
||||
_itemList.Add(new ItemState()
|
||||
{
|
||||
_position = child.position,
|
||||
_orderInLayer = child.GetComponent<SpriteRenderer>().sortingOrder,
|
||||
_tag = child.tag,
|
||||
_isFull = false
|
||||
});
|
||||
}
|
||||
foreach (Transform child in item_parent.transform)
|
||||
{
|
||||
float randomX = Random.Range(-3f, 3f); // X 在 -2 ~ 2
|
||||
float randomY = 14f + Random.Range(-2f, 2f); // Y 在 -16 ~ -12
|
||||
child.position = new Vector3(randomX, randomY, child.position.z);
|
||||
}
|
||||
DOVirtual.DelayedCall(2.5f, () =>
|
||||
{
|
||||
StartCoroutine(MoveChildrenCoroutine());
|
||||
});
|
||||
Debug.Log(JsonConvert.SerializeObject(_itemList));
|
||||
}
|
||||
IEnumerator MoveChildrenCoroutine()
|
||||
{
|
||||
foreach (Transform child in item_parent.transform)
|
||||
{
|
||||
// 随机目标 Y 在 -5 ~ 5
|
||||
float targetY = Random.Range(-5f, 5f);
|
||||
Vector3 targetPos = new Vector3(child.position.x, targetY, child.position.z);
|
||||
|
||||
// DOTween 缓动到目标位置
|
||||
child.DOMove(targetPos, 1.7f).SetEase(Ease.InCubic);
|
||||
|
||||
// 每个间隔 0.1s
|
||||
yield return new WaitForSeconds(0.05f);
|
||||
}
|
||||
}
|
||||
IEnumerator MoveBackCoroutine()
|
||||
{
|
||||
int index = 0;
|
||||
foreach (Transform child in plate_parent.transform)
|
||||
{
|
||||
// 缓动到原始位置
|
||||
child.DOMove(originalPositions[index], 0.5f).SetEase(Ease.OutQuad);
|
||||
|
||||
index++;
|
||||
// 每隔 0.3s 执行一个
|
||||
yield return new WaitForSeconds(0.2f);
|
||||
}
|
||||
}
|
||||
private GameObject Popup;
|
||||
void Update()
|
||||
{
|
||||
// 鼠标按下时检测
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
if (Popup == null) Popup = GameObject.Find("Popup");
|
||||
if (Popup != null && Popup.transform.childCount != 0) return;
|
||||
Vector2 mousePos = cam.ScreenToWorldPoint(Input.mousePosition);
|
||||
RaycastHit2D[] hits = Physics2D.RaycastAll(mousePos, Vector2.zero);
|
||||
|
||||
if (hits.Length > 0)
|
||||
{
|
||||
selected = GetTopSprite(hits);
|
||||
if (selected != null)
|
||||
{
|
||||
// ✅ 如果该物体已经在 _itemList 中,释放槽位
|
||||
foreach (var item in _itemList)
|
||||
{
|
||||
if (item._inGameobject == selected)
|
||||
{
|
||||
item._isFull = false;
|
||||
item._inGameobject = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
selected.GetComponent<SpriteRenderer>().sortingLayerName = "layer_4_drag";
|
||||
|
||||
// 点击时强制修正为 0 度旋转
|
||||
selected.transform.DORotate(Vector3.zero, 0.2f).SetEase(Ease.OutQuad);
|
||||
|
||||
// DOTween 缩放到固定 1.1 倍
|
||||
selected.transform.DOScale(Vector3.one * 1.1f, 0.2f).SetEase(Ease.OutBack);
|
||||
|
||||
Vector3 pos = cam.ScreenToWorldPoint(Input.mousePosition);
|
||||
offset = selected.transform.position - new Vector3(pos.x, pos.y, selected.transform.position.z);
|
||||
selected.GetComponent<SpriteRenderer>().sortingOrder = out_layers;
|
||||
out_layers++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 拖拽中
|
||||
if (Input.GetMouseButton(0) && selected != null)
|
||||
{
|
||||
Vector3 pos = cam.ScreenToWorldPoint(Input.mousePosition);
|
||||
selected.transform.position = new Vector3(pos.x, pos.y, selected.transform.position.z) + offset;
|
||||
}
|
||||
|
||||
// 鼠标松开
|
||||
if (Input.GetMouseButtonUp(0) && selected != null)
|
||||
{
|
||||
// DOTween 缩放还原到固定 1 倍
|
||||
selected.transform.DOScale(Vector3.one, 0.2f).SetEase(Ease.InOutSine);
|
||||
|
||||
bool snapped = false;
|
||||
|
||||
// 吸附逻辑:检查标签和位置
|
||||
string tag = selected.tag;
|
||||
foreach (var item in _itemList)
|
||||
{
|
||||
if (item._isFull) continue;
|
||||
if (item._tag == tag)
|
||||
{
|
||||
float dist = Vector3.Distance(selected.transform.position, item._position);
|
||||
if (dist < 1f)
|
||||
{
|
||||
// 吸附过去并旋转归零
|
||||
selected.transform.DOMove(item._position, 0.2f).SetEase(Ease.OutQuad);
|
||||
selected.transform.DORotate(Vector3.zero, 0.2f).SetEase(Ease.OutQuad);
|
||||
selected.GetComponent<SpriteRenderer>().sortingLayerName = "layer_2_inslot";
|
||||
selected.GetComponent<SpriteRenderer>().sortingOrder = item._orderInLayer;
|
||||
item._isFull = true;
|
||||
item._inGameobject = selected;
|
||||
snapped = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 如果吸附成功 → 检查整个列表
|
||||
if (snapped)
|
||||
{
|
||||
bool allFull = true;
|
||||
foreach (var item in _itemList)
|
||||
{
|
||||
if (!item._isFull)
|
||||
{
|
||||
allFull = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (allFull)
|
||||
{
|
||||
Debug.Log("所有物体都已吸附完成!");
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.GameSuccess);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果没有吸附成功 → 随机旋转 ±8°
|
||||
selected.GetComponent<SpriteRenderer>().sortingLayerName = "layer_3_out";
|
||||
int randomChoice = Random.Range(0, 2); // 0 或 1
|
||||
float randomAngle = (randomChoice == 0) ? -8f : 8f;
|
||||
selected.transform.DORotate(new Vector3(0, 0, randomAngle), 0.3f).SetEase(Ease.OutQuad);
|
||||
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.GameSuccess);//zhushi
|
||||
}
|
||||
|
||||
selected = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private GameObject GetTopSprite(RaycastHit2D[] hits)
|
||||
{
|
||||
GameObject top = null;
|
||||
int topLayer = int.MinValue;
|
||||
int topOrder = int.MinValue;
|
||||
|
||||
foreach (var hit in hits)
|
||||
{
|
||||
SpriteRenderer sr = hit.collider.GetComponent<SpriteRenderer>();
|
||||
if (sr != null)
|
||||
{
|
||||
int layerID = SortingLayer.GetLayerValueFromID(sr.sortingLayerID);
|
||||
int order = sr.sortingOrder;
|
||||
|
||||
if (layerID > topLayer || (layerID == topLayer && order > topOrder))
|
||||
{
|
||||
top = sr.gameObject;
|
||||
topLayer = layerID;
|
||||
topOrder = order;
|
||||
}
|
||||
}
|
||||
}
|
||||
return top;
|
||||
}
|
||||
}
|
||||
|
||||
public class ItemState
|
||||
{
|
||||
[JsonIgnore]
|
||||
public Vector2 _position;
|
||||
public int _orderInLayer;
|
||||
public string _tag;
|
||||
public bool _isFull;
|
||||
public GameObject _inGameobject;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eb842c17c005e9e42b7b73a9eb4d12f3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44937624a42e12c4395b12789b4233a4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,325 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
using DG.Tweening;
|
||||
using TowerClimberChronicles;
|
||||
|
||||
public class level2 : MonoBehaviour
|
||||
{
|
||||
|
||||
public GameObject item_parent;
|
||||
public GameObject item_parent_big;
|
||||
private List<ItemState_2> _itemList;
|
||||
public Camera cam;
|
||||
private GameObject selected;
|
||||
private Vector3 offset;
|
||||
private int out_layers = 30;
|
||||
public GameObject empty_parent;
|
||||
|
||||
private List<Vector3> originalPositions = new List<Vector3>();
|
||||
void Awake()
|
||||
{
|
||||
Camera orthoCamera = GameObject.Find("Main Camera").GetComponent<Camera>();
|
||||
|
||||
float size = (float)System.Math.Round(5.5f / ((float)Screen.width / Screen.height), 4);
|
||||
// string type = SystemInfo.deviceModel.ToLower().Trim();
|
||||
// // Debug.Log($"type==========={type}");
|
||||
// if (type.Substring(0, 3) == "ipa")
|
||||
// {//iPad机型
|
||||
// size = 49.9f;
|
||||
// }
|
||||
orthoCamera.orthographicSize = size;
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
|
||||
_itemList = new List<ItemState_2>();
|
||||
|
||||
int index_ = 0;
|
||||
foreach (Transform child in item_parent.transform)
|
||||
{
|
||||
// Debug.Log("子物体: " + child.name);
|
||||
// Debug.Log("子物体: " + child.tag);
|
||||
_itemList.Add(new ItemState_2()
|
||||
{
|
||||
_position = positionList[index_],
|
||||
_orderInLayer = child.GetComponent<SpriteRenderer>().sortingOrder,
|
||||
_tag = child.tag,
|
||||
_isFull = false,
|
||||
type = 1,
|
||||
});
|
||||
index_++;
|
||||
|
||||
}
|
||||
foreach (Transform child in empty_parent.transform)
|
||||
{
|
||||
// Debug.Log("子物体: " + child.name);
|
||||
// Debug.Log("子物体: " + child.tag);
|
||||
_itemList.Add(new ItemState_2()
|
||||
{
|
||||
_position = positionList[index_],
|
||||
_orderInLayer = child.GetComponent<SpriteRenderer>().sortingOrder,
|
||||
_tag = child.tag,
|
||||
_isFull = false,
|
||||
type = 2
|
||||
});
|
||||
index_++;
|
||||
}
|
||||
|
||||
|
||||
// foreach (Transform child in item_parent.transform)
|
||||
// {
|
||||
// float randomX = Random.Range(-3f, 3f); // X 在 -2 ~ 2
|
||||
// float randomY = 14f + Random.Range(-2f, 2f); // Y 在 -16 ~ -12
|
||||
// child.position = new Vector3(randomX, randomY, child.position.z);
|
||||
// }
|
||||
|
||||
// DOVirtual.DelayedCall(2.5f, () =>
|
||||
// {
|
||||
// StartCoroutine(MoveChildrenCoroutine());
|
||||
// });
|
||||
|
||||
// Debug.Log(JsonConvert.SerializeObject(_itemList));
|
||||
// foreach (var pos in positionList)
|
||||
// {
|
||||
// Debug.Log("Position: " + pos);
|
||||
// }
|
||||
}
|
||||
List<Vector3> positionList = new List<Vector3>()
|
||||
{
|
||||
new Vector3(0.44f, 1.30f, 0.00f),
|
||||
new Vector3(1.34f, -1.84f, 0.00f),
|
||||
new Vector3(-0.46f, -1.38f, 0.00f),
|
||||
new Vector3(-1.36f, 0.39f, 0.00f),
|
||||
new Vector3(1.17f, 2.46f, 0.00f),
|
||||
new Vector3(5.10f, 1.39f, 0.00f),
|
||||
new Vector3(1.06f, 1.38f, 0.00f),
|
||||
new Vector3(-1.48f, -1.30f, 0.00f),
|
||||
new Vector3(-6.83f, -0.40f, 0.00f),
|
||||
new Vector3(-2.82f, -0.40f, 0.00f),
|
||||
new Vector3(2.80f, 2.46f, 0.00f),
|
||||
new Vector3(-1.90f, -0.40f, 0.00f),
|
||||
new Vector3(-1.39f, -2.17f, 0.00f),
|
||||
new Vector3(0.83f, -0.41f, 0.00f),
|
||||
new Vector3(-5.81f, 0.49f, 0.00f),
|
||||
new Vector3(-6.61f, -1.29f, 0.00f),
|
||||
new Vector3(-0.31f, 0.49f, 0.00f),
|
||||
new Vector3(6.27f, -2.18f, 0.00f),
|
||||
new Vector3(-2.58f, 1.39f, 0.00f)
|
||||
};
|
||||
|
||||
// IEnumerator MoveChildrenCoroutine()
|
||||
// {
|
||||
// foreach (Transform child in item_parent.transform)
|
||||
// {
|
||||
// // 随机目标 Y 在 -5 ~ 5
|
||||
// float targetY = Random.Range(-5f, 5f);
|
||||
// Vector3 targetPos = new Vector3(child.position.x, targetY, child.position.z);
|
||||
|
||||
// // DOTween 缓动到目标位置
|
||||
// child.DOMove(targetPos, 1.7f).SetEase(Ease.InCubic);
|
||||
|
||||
// // 每个间隔 0.1s
|
||||
// yield return new WaitForSeconds(0.05f);
|
||||
// }
|
||||
// }
|
||||
// IEnumerator MoveBackCoroutine()
|
||||
// {
|
||||
// int index = 0;
|
||||
// foreach (Transform child in plate_parent.transform)
|
||||
// {
|
||||
// // 缓动到原始位置
|
||||
// child.DOMove(originalPositions[index], 0.5f).SetEase(Ease.OutQuad);
|
||||
|
||||
// index++;
|
||||
// // 每隔 0.3s 执行一个
|
||||
// yield return new WaitForSeconds(0.2f);
|
||||
// }
|
||||
// }
|
||||
private GameObject Popup;
|
||||
void Update()
|
||||
{
|
||||
// 鼠标按下时检测
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
if (Popup == null) Popup = GameObject.Find("Popup");
|
||||
if (Popup != null && Popup.transform.childCount != 0) return;
|
||||
Vector2 mousePos = cam.ScreenToWorldPoint(Input.mousePosition);
|
||||
RaycastHit2D[] hits = Physics2D.RaycastAll(mousePos, Vector2.zero);
|
||||
|
||||
if (hits.Length > 0)
|
||||
{
|
||||
selected = GetTopSprite(hits);
|
||||
if (selected != null)
|
||||
{
|
||||
if (selected.tag == "bg")
|
||||
{
|
||||
// bg 不做缩放和旋转,只记录偏移
|
||||
Vector3 pos = cam.ScreenToWorldPoint(Input.mousePosition);
|
||||
offset = selected.transform.position - new Vector3(pos.x, selected.transform.position.y, selected.transform.position.z);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ✅ 如果该物体已经在 _itemList 中,释放槽位
|
||||
foreach (var item in _itemList)
|
||||
{
|
||||
if (item._inGameobject == selected)
|
||||
{
|
||||
item._isFull = false;
|
||||
item._inGameobject = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
selected.GetComponent<SpriteRenderer>().sortingLayerName = "layer_4_drag";
|
||||
|
||||
// 点击时强制修正为 0 度旋转
|
||||
selected.transform.DORotate(Vector3.zero, 0.2f).SetEase(Ease.OutQuad);
|
||||
|
||||
// DOTween 缩放到固定 1.1 倍
|
||||
selected.transform.DOScale(Vector3.one * 1.1f, 0.2f).SetEase(Ease.OutBack);
|
||||
|
||||
Vector3 pos = cam.ScreenToWorldPoint(Input.mousePosition);
|
||||
offset = selected.transform.position - new Vector3(pos.x, pos.y, selected.transform.position.z);
|
||||
selected.GetComponent<SpriteRenderer>().sortingOrder = out_layers;
|
||||
out_layers++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 拖拽中
|
||||
if (Input.GetMouseButton(0) && selected != null)
|
||||
{
|
||||
Vector3 pos = cam.ScreenToWorldPoint(Input.mousePosition);
|
||||
|
||||
if (selected.tag == "bg")
|
||||
{
|
||||
// 只允许 X 方向拖拽,限制在 [-2.3, 2.3]
|
||||
float newX = pos.x + offset.x;
|
||||
newX = Mathf.Clamp(newX, -2.8f, 2.8f);
|
||||
selected.transform.position = new Vector3(newX, selected.transform.position.y, selected.transform.position.z);
|
||||
}
|
||||
else
|
||||
{
|
||||
selected.transform.position = new Vector3(pos.x, pos.y, selected.transform.position.z) + offset;
|
||||
}
|
||||
}
|
||||
|
||||
// 鼠标松开
|
||||
if (Input.GetMouseButtonUp(0) && selected != null)
|
||||
{
|
||||
if (selected.tag != "bg")
|
||||
{
|
||||
// DOTween 缩放还原到固定 1 倍
|
||||
selected.transform.DOScale(Vector3.one, 0.2f).SetEase(Ease.InOutSine);
|
||||
|
||||
bool snapped = false;
|
||||
|
||||
// 吸附逻辑:检查标签和位置
|
||||
string tag = selected.tag;
|
||||
foreach (var item in _itemList)
|
||||
{
|
||||
if (item._isFull) continue;
|
||||
if (item._tag == tag)
|
||||
{
|
||||
float dist = 0;
|
||||
if (item.type == 1)
|
||||
{
|
||||
dist = Vector3.Distance(selected.transform.localPosition, item._position);
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector3 localPosInTarget = item_parent_big.transform.InverseTransformPoint(selected.transform.position);
|
||||
dist = Vector3.Distance(localPosInTarget, item._position);
|
||||
}
|
||||
|
||||
if (dist < 0.5f)
|
||||
{
|
||||
// selected.SetParent(item_parent_big);
|
||||
if (item.type == 2) selected.transform.SetParent(item_parent_big.transform, true);
|
||||
|
||||
// 吸附过去并旋转归零
|
||||
selected.transform.DOLocalMove(item._position, 0.2f).SetEase(Ease.OutQuad);
|
||||
selected.transform.DORotate(Vector3.zero, 0.2f).SetEase(Ease.OutQuad);
|
||||
selected.GetComponent<SpriteRenderer>().sortingLayerName = "layer_2_inslot";
|
||||
selected.GetComponent<SpriteRenderer>().sortingOrder = item._orderInLayer;
|
||||
item._isFull = true;
|
||||
item._inGameobject = selected;
|
||||
snapped = true;
|
||||
selected.GetComponent<PolygonCollider2D>().enabled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 如果吸附成功 → 检查整个列表
|
||||
if (snapped)
|
||||
{
|
||||
bool allFull = true;
|
||||
foreach (var item in _itemList)
|
||||
{
|
||||
if (!item._isFull)
|
||||
{
|
||||
allFull = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (allFull)
|
||||
{
|
||||
Debug.Log("所有物体都已吸附完成!");
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.GameSuccess);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果没有吸附成功 → 随机旋转 ±8°
|
||||
selected.GetComponent<SpriteRenderer>().sortingLayerName = "layer_3_out";
|
||||
int randomChoice = Random.Range(0, 2); // 0 或 1
|
||||
float randomAngle = (randomChoice == 0) ? -8f : 8f;
|
||||
selected.transform.DORotate(new Vector3(0, 0, randomAngle), 0.3f).SetEase(Ease.OutQuad);
|
||||
}
|
||||
}
|
||||
|
||||
selected = null;
|
||||
}
|
||||
}
|
||||
|
||||
private GameObject GetTopSprite(RaycastHit2D[] hits)
|
||||
{
|
||||
GameObject top = null;
|
||||
int topLayer = int.MinValue;
|
||||
int topOrder = int.MinValue;
|
||||
|
||||
foreach (var hit in hits)
|
||||
{
|
||||
SpriteRenderer sr = hit.collider.GetComponent<SpriteRenderer>();
|
||||
if (sr != null)
|
||||
{
|
||||
int layerID = SortingLayer.GetLayerValueFromID(sr.sortingLayerID);
|
||||
int order = sr.sortingOrder;
|
||||
|
||||
if (layerID > topLayer || (layerID == topLayer && order > topOrder))
|
||||
{
|
||||
top = sr.gameObject;
|
||||
topLayer = layerID;
|
||||
topOrder = order;
|
||||
}
|
||||
}
|
||||
}
|
||||
return top;
|
||||
}
|
||||
}
|
||||
|
||||
public class ItemState_2
|
||||
{
|
||||
[JsonIgnore]
|
||||
public Vector2 _position;
|
||||
public int _orderInLayer;
|
||||
public string _tag;
|
||||
public bool _isFull;
|
||||
public GameObject _inGameobject;
|
||||
public int type;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c1711a5743f98a4498b91f7d8357e33b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 189c50593805e66479a52dbda84febed
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,214 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
using DG.Tweening;
|
||||
using TowerClimberChronicles;
|
||||
|
||||
public class level3 : MonoBehaviour
|
||||
{
|
||||
public GameObject plate_parent;
|
||||
public GameObject item_parent;
|
||||
private List<ItemState> _itemList;
|
||||
public Camera cam;
|
||||
private GameObject selected;
|
||||
private Vector3 offset;
|
||||
private int out_layers = 30;
|
||||
private List<Vector3> originalPositions = new List<Vector3>();
|
||||
void Awake()
|
||||
{
|
||||
Camera orthoCamera = GameObject.Find("Main Camera").GetComponent<Camera>();
|
||||
|
||||
float size = (float)System.Math.Round(5.5f / ((float)Screen.width / Screen.height), 4);
|
||||
// string type = SystemInfo.deviceModel.ToLower().Trim();
|
||||
// // Debug.Log($"type==========={type}");
|
||||
// if (type.Substring(0, 3) == "ipa")
|
||||
// {//iPad机型
|
||||
// size = 49.9f;
|
||||
// }
|
||||
Debug.Log(size + "////////////////");
|
||||
orthoCamera.orthographicSize = size;
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
_itemList = new List<ItemState>();
|
||||
|
||||
|
||||
foreach (Transform child in item_parent.transform)
|
||||
{
|
||||
Debug.Log("子物体: " + child.name);
|
||||
Debug.Log("子物体: " + child.tag);
|
||||
_itemList.Add(new ItemState()
|
||||
{
|
||||
_position = child.position,
|
||||
_orderInLayer = child.GetComponent<SpriteRenderer>().sortingOrder,
|
||||
_tag = child.tag,
|
||||
_isFull = false
|
||||
});
|
||||
}
|
||||
foreach (Transform child in item_parent.transform)
|
||||
{
|
||||
Rigidbody2D rb = child.GetComponent<Rigidbody2D>();
|
||||
if (rb != null)
|
||||
{
|
||||
rb.simulated = true;
|
||||
|
||||
// 随机方向
|
||||
Vector2 randomDir = Random.insideUnitCircle.normalized;
|
||||
|
||||
// 随机力度(比如 5~10)
|
||||
float randomForce = Random.Range(2f,3f);
|
||||
|
||||
// 添加力
|
||||
rb.AddForce(randomDir * randomForce, ForceMode2D.Impulse);
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Log(JsonConvert.SerializeObject(_itemList));
|
||||
}
|
||||
|
||||
|
||||
private GameObject Popup;
|
||||
void Update()
|
||||
{
|
||||
// 鼠标按下时检测
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
if (Popup == null) Popup = GameObject.Find("Popup");
|
||||
if (Popup != null && Popup.transform.childCount != 0) return;
|
||||
Vector2 mousePos = cam.ScreenToWorldPoint(Input.mousePosition);
|
||||
RaycastHit2D[] hits = Physics2D.RaycastAll(mousePos, Vector2.zero);
|
||||
|
||||
if (hits.Length > 0)
|
||||
{
|
||||
selected = GetTopSprite(hits);
|
||||
if (selected != null)
|
||||
{
|
||||
// ✅ 如果该物体已经在 _itemList 中,释放槽位
|
||||
foreach (var item in _itemList)
|
||||
{
|
||||
if (item._inGameobject == selected)
|
||||
{
|
||||
item._isFull = false;
|
||||
item._inGameobject = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
selected.GetComponent<SpriteRenderer>().sortingLayerName = "layer_4_drag";
|
||||
selected.GetComponent<Rigidbody2D>().simulated = false;
|
||||
// 点击时强制修正为 0 度旋转
|
||||
selected.transform.DORotate(Vector3.zero, 0.2f).SetEase(Ease.OutQuad);
|
||||
|
||||
// DOTween 缩放到固定 1.1 倍
|
||||
// selected.transform.DOScale(Vector3.one * 1.1f, 0.2f).SetEase(Ease.OutBack);
|
||||
|
||||
Vector3 pos = cam.ScreenToWorldPoint(Input.mousePosition);
|
||||
offset = selected.transform.position - new Vector3(pos.x, pos.y, selected.transform.position.z);
|
||||
selected.GetComponent<SpriteRenderer>().sortingOrder = out_layers;
|
||||
out_layers++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 拖拽中
|
||||
if (Input.GetMouseButton(0) && selected != null)
|
||||
{
|
||||
Vector3 pos = cam.ScreenToWorldPoint(Input.mousePosition);
|
||||
selected.transform.position = new Vector3(pos.x, pos.y, selected.transform.position.z) + offset;
|
||||
}
|
||||
|
||||
// 鼠标松开
|
||||
if (Input.GetMouseButtonUp(0) && selected != null)
|
||||
{
|
||||
// DOTween 缩放还原到固定 1 倍
|
||||
selected.transform.DOScale(Vector3.one, 0.2f).SetEase(Ease.InOutSine);
|
||||
|
||||
bool snapped = false;
|
||||
|
||||
// 吸附逻辑:检查标签和位置
|
||||
string tag = selected.tag;
|
||||
foreach (var item in _itemList)
|
||||
{
|
||||
if (item._isFull) continue;
|
||||
if (item._tag == tag)
|
||||
{
|
||||
float dist = Vector3.Distance(selected.transform.position, item._position);
|
||||
if (dist < 0.5f)
|
||||
{
|
||||
// 吸附过去并旋转归零
|
||||
selected.transform.DOMove(item._position, 0.2f).SetEase(Ease.OutQuad);
|
||||
selected.transform.DORotate(Vector3.zero, 0.2f).SetEase(Ease.OutQuad);
|
||||
selected.GetComponent<SpriteRenderer>().sortingLayerName = "layer_2_inslot";
|
||||
selected.GetComponent<SpriteRenderer>().sortingOrder = item._orderInLayer;
|
||||
item._isFull = true;
|
||||
item._inGameobject = selected;
|
||||
snapped = true;
|
||||
selected.GetComponent<PolygonCollider2D>().enabled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 如果吸附成功 → 检查整个列表
|
||||
if (snapped)
|
||||
{
|
||||
bool allFull = true;
|
||||
foreach (var item in _itemList)
|
||||
{
|
||||
if (!item._isFull)
|
||||
{
|
||||
allFull = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (allFull)
|
||||
{
|
||||
Debug.Log("所有物体都已吸附完成!");
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.GameSuccess);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果没有吸附成功 → 随机旋转 ±8°
|
||||
selected.GetComponent<SpriteRenderer>().sortingLayerName = "layer_3_out";
|
||||
selected.GetComponent<Rigidbody2D>().simulated = true;
|
||||
// int randomChoice = Random.Range(0, 2); // 0 或 1
|
||||
// float randomAngle = (randomChoice == 0) ? -8f : 8f;
|
||||
// selected.transform.DORotate(new Vector3(0, 0, randomAngle), 0.3f).SetEase(Ease.OutQuad);
|
||||
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.GameSuccess);//zhushi
|
||||
}
|
||||
|
||||
selected = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private GameObject GetTopSprite(RaycastHit2D[] hits)
|
||||
{
|
||||
GameObject top = null;
|
||||
int topLayer = int.MinValue;
|
||||
int topOrder = int.MinValue;
|
||||
|
||||
foreach (var hit in hits)
|
||||
{
|
||||
SpriteRenderer sr = hit.collider.GetComponent<SpriteRenderer>();
|
||||
if (sr != null)
|
||||
{
|
||||
int layerID = SortingLayer.GetLayerValueFromID(sr.sortingLayerID);
|
||||
int order = sr.sortingOrder;
|
||||
|
||||
if (layerID > topLayer || (layerID == topLayer && order > topOrder))
|
||||
{
|
||||
top = sr.gameObject;
|
||||
topLayer = layerID;
|
||||
topOrder = order;
|
||||
}
|
||||
}
|
||||
}
|
||||
return top;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1bc32a0fe02add54f91838ab980bb751
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0af2e8e17d7b814493090d8113952d6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,520 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
using DG.Tweening;
|
||||
using TowerClimberChronicles;
|
||||
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class level4 : MonoBehaviour
|
||||
{
|
||||
public GameObject feiliao;
|
||||
public GameObject zhongzi;
|
||||
public GameObject feiliaodai;
|
||||
public GameObject zhongzidai;
|
||||
public Text progress_text;
|
||||
public Image progress_;
|
||||
public Image end_point;
|
||||
public GameObject sunlight;
|
||||
public Camera cam;
|
||||
private GameObject selected;
|
||||
private Vector3 offset;
|
||||
private int out_layers = 30;
|
||||
public GameObject water_;
|
||||
private float now_sunlight;
|
||||
private float max_sunlight = 300;
|
||||
public List<ItemState_4> _itemlist = new List<ItemState_4>();
|
||||
public List<GameObject> sunlight_list = new List<GameObject>();
|
||||
void Awake()
|
||||
{
|
||||
Camera orthoCamera = GameObject.Find("Main Camera").GetComponent<Camera>();
|
||||
|
||||
float size = (float)System.Math.Round(5.5f / ((float)Screen.width / Screen.height), 4);
|
||||
// string type = SystemInfo.deviceModel.ToLower().Trim();
|
||||
// // Debug.Log($"type==========={type}");
|
||||
// if (type.Substring(0, 3) == "ipa")
|
||||
// {//iPad机型
|
||||
// size = 49.9f;
|
||||
// }
|
||||
Debug.Log(size + "////////////////");
|
||||
orthoCamera.orthographicSize = size;
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
ItemState_4 _item = new ItemState_4()
|
||||
{
|
||||
_gameobject = GameObject.Find("item_" + i),
|
||||
};
|
||||
_itemlist.Add(_item);
|
||||
}
|
||||
_itemlist[0].plant_state = 1;
|
||||
progress_text.text = now_sunlight + "/" + max_sunlight;
|
||||
progress_.rectTransform.sizeDelta = new Vector2(0, 20);
|
||||
}
|
||||
private int stage_ = 0;
|
||||
private float spawnTimer = 0f;
|
||||
private float spawnInterval = 0.1f;
|
||||
private GameObject Popup;
|
||||
void Update()
|
||||
{
|
||||
// 鼠标按下时检测
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
if (Popup == null) Popup = GameObject.Find("Popup");
|
||||
if (Popup != null && Popup.transform.childCount != 0) return;
|
||||
Vector2 mousePos = cam.ScreenToWorldPoint(Input.mousePosition);
|
||||
RaycastHit2D[] hits = Physics2D.RaycastAll(mousePos, Vector2.zero);
|
||||
|
||||
if (hits.Length > 0)
|
||||
{
|
||||
selected = GetTopSprite(hits);
|
||||
if (selected != null)
|
||||
{
|
||||
|
||||
if (selected.tag == "item_tag_0" || selected.tag == "item_tag_1")
|
||||
{
|
||||
selected.transform.DORotate(new Vector3(0, 0, 45), 0.2f).SetEase(Ease.OutQuad);
|
||||
}
|
||||
|
||||
Vector3 pos = cam.ScreenToWorldPoint(Input.mousePosition);
|
||||
offset = selected.transform.position - new Vector3(pos.x, pos.y, selected.transform.position.z);
|
||||
selected.GetComponent<SpriteRenderer>().sortingOrder = 2;
|
||||
//out_layers++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Input.GetMouseButton(0) && selected != null)
|
||||
{
|
||||
Vector3 pos = cam.ScreenToWorldPoint(Input.mousePosition);
|
||||
|
||||
if (selected.tag == "bg")
|
||||
{
|
||||
float newX = pos.x + offset.x;
|
||||
newX = Mathf.Clamp(newX, -5f, 5f);
|
||||
|
||||
selected.transform.position = new Vector3(
|
||||
newX,
|
||||
selected.transform.position.y,
|
||||
selected.transform.position.z);
|
||||
|
||||
water_.SetActive(true);
|
||||
if (stage_ == 0)
|
||||
{
|
||||
if ((selected.transform.position.x > -1) && (selected.transform.position.x < 1))
|
||||
{
|
||||
_itemlist[0].water_time += Time.deltaTime;
|
||||
}
|
||||
if (_itemlist[0].water_time >= 1 && _itemlist[0].plant_state < 5)
|
||||
{
|
||||
_itemlist[0]._gameobject.transform.GetChild(_itemlist[0].plant_state - 1).GetComponent<SpriteRenderer>().enabled = false;
|
||||
_itemlist[0]._gameobject.transform.GetChild(_itemlist[0].plant_state).GetComponent<SpriteRenderer>().enabled = true;
|
||||
_itemlist[0].plant_state++;
|
||||
_itemlist[0].water_time = 0;
|
||||
|
||||
}
|
||||
if (_itemlist[0].plant_state == 5 && !_itemlist[0].is_end)
|
||||
{
|
||||
_itemlist[0].is_end = true;
|
||||
CrearSunlight(0);
|
||||
Debug.Log("生产阳光");
|
||||
}
|
||||
}
|
||||
if (stage_ == 1)
|
||||
{
|
||||
if ((selected.transform.position.x > -3) && (selected.transform.position.x < -1) && (_itemlist[1].plant_state > 0))
|
||||
{
|
||||
_itemlist[1].water_time += Time.deltaTime;
|
||||
}
|
||||
if ((selected.transform.position.x > 1) && (selected.transform.position.x < 3) && (_itemlist[2].plant_state > 0))
|
||||
{
|
||||
_itemlist[2].water_time += Time.deltaTime;
|
||||
}
|
||||
for (int i = 1; i < 3; i++)
|
||||
{
|
||||
if (_itemlist[i].water_time >= 1 && _itemlist[i].plant_state < 5)
|
||||
{
|
||||
|
||||
if (!_itemlist[i].use_feiliao && _itemlist[i].plant_state == 4)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_itemlist[i]._gameobject.transform.GetChild(_itemlist[i].plant_state - 1).GetComponent<SpriteRenderer>().enabled = false;
|
||||
_itemlist[i]._gameobject.transform.GetChild(_itemlist[i].plant_state).GetComponent<SpriteRenderer>().enabled = true;
|
||||
_itemlist[i].plant_state++;
|
||||
_itemlist[i].water_time = 0;
|
||||
}
|
||||
}
|
||||
if (_itemlist[i].plant_state == 5 && !_itemlist[i].is_end)
|
||||
{
|
||||
_itemlist[i].is_end = true;
|
||||
// _itemlist[i]._gameobject.SetActive(false);
|
||||
// Debug.Log("生产阳光");
|
||||
CrearSunlight(i);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (stage_ == 2)
|
||||
{
|
||||
if ((selected.transform.position.x > -3) && (selected.transform.position.x < -1) && (_itemlist[3].plant_state > 0))
|
||||
{
|
||||
_itemlist[3].water_time += Time.deltaTime;
|
||||
}
|
||||
if ((selected.transform.position.x > 1) && (selected.transform.position.x < 3) && (_itemlist[4].plant_state > 0))
|
||||
{
|
||||
_itemlist[4].water_time += Time.deltaTime;
|
||||
}
|
||||
for (int i = 3; i < 5; i++)
|
||||
{
|
||||
if (_itemlist[i].water_time >= 1 && _itemlist[i].plant_state < 5)
|
||||
{
|
||||
|
||||
if (!_itemlist[i].use_feiliao && _itemlist[i].plant_state == 4)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_itemlist[i]._gameobject.transform.GetChild(_itemlist[i].plant_state - 1).GetComponent<SpriteRenderer>().enabled = false;
|
||||
_itemlist[i]._gameobject.transform.GetChild(_itemlist[i].plant_state).GetComponent<SpriteRenderer>().enabled = true;
|
||||
_itemlist[i].plant_state++;
|
||||
_itemlist[i].water_time = 0;
|
||||
}
|
||||
}
|
||||
if (_itemlist[i].plant_state == 5 && !_itemlist[i].is_end)
|
||||
{
|
||||
_itemlist[i].is_end = true;
|
||||
// _itemlist[i]._gameobject.SetActive(false);
|
||||
// // stage_ = 1;
|
||||
// Debug.Log("生产阳光");
|
||||
CrearSunlight(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
selected.transform.position = new Vector3(pos.x, pos.y, selected.transform.position.z) + offset;
|
||||
|
||||
// Y > 2 时开始定时生成
|
||||
if (selected.transform.position.y > 0f)
|
||||
{
|
||||
spawnTimer += Time.deltaTime;
|
||||
|
||||
if (spawnTimer >= spawnInterval)
|
||||
{
|
||||
spawnTimer = 0f;
|
||||
if (selected.tag == "item_tag_0") SpawnDropObject(0);
|
||||
else if (selected.tag == "item_tag_1") SpawnDropObject(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
spawnTimer = 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
spawnTimer = 0f;
|
||||
}
|
||||
if (Input.GetMouseButton(0))
|
||||
{
|
||||
if (Popup == null) Popup = GameObject.Find("Popup");
|
||||
if (Popup != null && Popup.transform.childCount != 0) return;
|
||||
Vector2 mousePos = cam.ScreenToWorldPoint(Input.mousePosition);
|
||||
RaycastHit2D[] hits = Physics2D.RaycastAll(mousePos, Vector2.zero);
|
||||
|
||||
foreach (var hit in hits)
|
||||
{
|
||||
if (hit.collider.CompareTag("item_tag_3"))
|
||||
{
|
||||
Transform obj = hit.collider.transform;
|
||||
|
||||
// 1. UI 转屏幕坐标(传入你的 UI 所属的 Canvas 的相机)
|
||||
Vector3 screenPos = RectTransformUtility.WorldToScreenPoint(cam, end_point.rectTransform.position);
|
||||
|
||||
// 2. 屏幕坐标转场景世界坐标,z 要给一个合适的深度
|
||||
Vector3 targetPos = cam.ScreenToWorldPoint(new Vector3(screenPos.x, screenPos.y, cam.nearClipPlane + 5f));
|
||||
|
||||
// 3. DOTween Sequence:移动 + 缩放,同时执行
|
||||
DG.Tweening.Sequence seq = DOTween.Sequence();
|
||||
seq.Join(obj.DOMove(targetPos, 0.7f).SetEase(Ease.OutCubic));
|
||||
seq.Join(obj.DOScale(Vector3.one * 0.2f, 0.7f).SetEase(Ease.OutCubic));
|
||||
|
||||
// 4. 动画完成后销毁物体
|
||||
seq.OnComplete(() =>
|
||||
{
|
||||
sunlight_list.Remove(obj.gameObject);
|
||||
now_sunlight += 10;
|
||||
|
||||
progress_text.text = now_sunlight + "/" + max_sunlight;
|
||||
progress_.rectTransform.sizeDelta = new Vector2((now_sunlight / max_sunlight) * 100, 20);
|
||||
Destroy(obj.gameObject);
|
||||
if (sunlight_list.Count <= 0)
|
||||
{
|
||||
if (stage_ == 0)
|
||||
{
|
||||
// _itemlist[0]._gameobject.SetActive(false);
|
||||
SpriteRenderer sr = _itemlist[0]._gameobject.transform.GetChild(4).GetComponent<SpriteRenderer>();
|
||||
sr.DOFade(0f, 1f); // 1秒内透明度变为0
|
||||
|
||||
stage_ = 1;
|
||||
}
|
||||
else if (stage_ == 1)
|
||||
{
|
||||
if (_itemlist[1].is_end && _itemlist[2].is_end)
|
||||
{
|
||||
// _itemlist[1]._gameobject.SetActive(false);
|
||||
// _itemlist[2]._gameobject.SetActive(false);
|
||||
SpriteRenderer sr = _itemlist[1]._gameobject.transform.GetChild(4).GetComponent<SpriteRenderer>();
|
||||
sr.DOFade(0f, 1f); // 1秒内透明度变为0
|
||||
SpriteRenderer sr1 = _itemlist[2]._gameobject.transform.GetChild(4).GetComponent<SpriteRenderer>();
|
||||
sr1.DOFade(0f, 1f); // 1秒内透明度变为0
|
||||
stage_ = 2;
|
||||
}
|
||||
|
||||
}
|
||||
else if (stage_ == 2)
|
||||
{
|
||||
if (_itemlist[3].is_end && _itemlist[4].is_end)
|
||||
{
|
||||
Debug.Log("所有物体都已吸附完成!");
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.GameSuccess);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
hit.collider.enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 鼠标松开
|
||||
if (Input.GetMouseButtonUp(0) && selected != null)
|
||||
{
|
||||
if (selected.tag == "bg")
|
||||
{
|
||||
water_.SetActive(false);
|
||||
selected.transform.DOMove(new Vector3(-5, -11.44f, 0), 0.4f).SetEase(Ease.Linear);
|
||||
|
||||
}
|
||||
if (selected.tag == "item_tag_0")
|
||||
{
|
||||
|
||||
selected.transform.DORotate(Vector3.zero, 0.2f).SetEase(Ease.OutQuad);
|
||||
selected.transform.DOMove(new Vector3(2.64f, -4.73f, 0), 0.3f).SetEase(Ease.Linear);
|
||||
selected.GetComponent<SpriteRenderer>().sortingOrder = 1;
|
||||
}
|
||||
if (selected.tag == "item_tag_1")
|
||||
{
|
||||
|
||||
selected.transform.DORotate(Vector3.zero, 0.2f).SetEase(Ease.OutQuad);
|
||||
selected.transform.DOMove(new Vector3(3.91f, -3.88f, 0), 0.3f).SetEase(Ease.Linear);
|
||||
selected.GetComponent<SpriteRenderer>().sortingOrder = 0;
|
||||
}
|
||||
|
||||
selected = null;
|
||||
}
|
||||
|
||||
}
|
||||
void SpawnDropObject(int type)
|
||||
{
|
||||
|
||||
GameObject go = null;
|
||||
if (type == 0)
|
||||
{
|
||||
go = Instantiate(
|
||||
zhongzi,
|
||||
new Vector3(selected.transform.position.x - 1f, selected.transform.position.y, 0),
|
||||
Quaternion.identity);
|
||||
}
|
||||
else
|
||||
{
|
||||
go = Instantiate(
|
||||
feiliao,
|
||||
new Vector3(selected.transform.position.x - 1f, selected.transform.position.y, 0),
|
||||
Quaternion.identity);
|
||||
}
|
||||
|
||||
go.transform.DOMoveY(-1f, 8f)
|
||||
.SetSpeedBased()
|
||||
.SetEase(Ease.Linear)
|
||||
.OnComplete(() =>
|
||||
{
|
||||
if (stage_ == 1 && type == 0)
|
||||
{
|
||||
if (_itemlist[1].plant_state == 0)
|
||||
{
|
||||
if (go.transform.position.x > -3 && go.transform.position.x < -1)
|
||||
{
|
||||
_itemlist[1].plant_state = 1;
|
||||
_itemlist[1]._gameobject.transform.GetChild(0).GetComponent<SpriteRenderer>().enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (_itemlist[2].plant_state == 0)
|
||||
{
|
||||
if (go.transform.position.x > 1 && go.transform.position.x < 3)
|
||||
{
|
||||
_itemlist[2].plant_state = 1;
|
||||
_itemlist[2]._gameobject.transform.GetChild(0).GetComponent<SpriteRenderer>().enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (stage_ == 2 && type == 0)
|
||||
{
|
||||
if (_itemlist[3].plant_state == 0)
|
||||
{
|
||||
if (go.transform.position.x > -3 && go.transform.position.x < -1)
|
||||
{
|
||||
_itemlist[3].plant_state = 1;
|
||||
_itemlist[3]._gameobject.transform.GetChild(0).GetComponent<SpriteRenderer>().enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (_itemlist[4].plant_state == 0)
|
||||
{
|
||||
if (go.transform.position.x > 1 && go.transform.position.x < 3)
|
||||
{
|
||||
_itemlist[4].plant_state = 1;
|
||||
_itemlist[4]._gameobject.transform.GetChild(0).GetComponent<SpriteRenderer>().enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (stage_ == 1 && type == 1)
|
||||
{
|
||||
|
||||
if (go.transform.position.x > -3 && go.transform.position.x < -1)
|
||||
{
|
||||
CheckFeiliao(1);
|
||||
}
|
||||
|
||||
if (go.transform.position.x > 1 && go.transform.position.x < 3)
|
||||
{
|
||||
CheckFeiliao(2);
|
||||
}
|
||||
|
||||
}
|
||||
if (stage_ == 2 && type == 1)
|
||||
{
|
||||
|
||||
if (go.transform.position.x > -3 && go.transform.position.x < -1)
|
||||
{
|
||||
CheckFeiliao(3);
|
||||
}
|
||||
|
||||
if (go.transform.position.x > 1 && go.transform.position.x < 3)
|
||||
{
|
||||
CheckFeiliao(4);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Destroy(go);
|
||||
});
|
||||
}
|
||||
void CheckFeiliao(int index)
|
||||
{
|
||||
if (!_itemlist[index].use_feiliao)
|
||||
{
|
||||
_itemlist[index].use_feiliao = true;
|
||||
if (_itemlist[index].water_time >= 1 && _itemlist[index].plant_state < 5)
|
||||
{
|
||||
if (!_itemlist[index].use_feiliao && _itemlist[index].plant_state == 4)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_itemlist[index]._gameobject.transform.GetChild(_itemlist[index].plant_state - 1).GetComponent<SpriteRenderer>().enabled = false;
|
||||
_itemlist[index]._gameobject.transform.GetChild(_itemlist[index].plant_state).GetComponent<SpriteRenderer>().enabled = true;
|
||||
_itemlist[index].plant_state++;
|
||||
_itemlist[index].water_time = 0;
|
||||
}
|
||||
}
|
||||
if (_itemlist[index].plant_state == 5 && !_itemlist[index].is_end)
|
||||
{
|
||||
_itemlist[index].is_end = true;
|
||||
// _itemlist[index]._gameobject.SetActive(false);
|
||||
// // stage_ = 1;
|
||||
// Debug.Log("生产阳光");
|
||||
CrearSunlight(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
void CrearSunlight(int index)
|
||||
{
|
||||
for (int j = 0; j < 6; j++)
|
||||
{
|
||||
// 在指定位置生成
|
||||
GameObject obj = Instantiate(sunlight, _itemlist[index]._gameobject.transform.position, Quaternion.identity);
|
||||
|
||||
// 获取刚体
|
||||
Rigidbody2D rb = obj.GetComponent<Rigidbody2D>();
|
||||
if (rb != null)
|
||||
{
|
||||
// 随机方向
|
||||
Vector2 randomDir = Random.insideUnitCircle.normalized;
|
||||
// 随机力度
|
||||
float randomForce = Random.Range(2, 3);
|
||||
// 添加力(瞬间冲量)
|
||||
rb.AddForce(randomDir * randomForce, ForceMode2D.Impulse);
|
||||
}
|
||||
sunlight_list.Add(obj);
|
||||
}
|
||||
}
|
||||
|
||||
private GameObject GetTopSprite(RaycastHit2D[] hits)
|
||||
{
|
||||
GameObject top = null;
|
||||
int topLayer = int.MinValue;
|
||||
int topOrder = int.MinValue;
|
||||
|
||||
foreach (var hit in hits)
|
||||
{
|
||||
SpriteRenderer sr = hit.collider.GetComponent<SpriteRenderer>();
|
||||
if (sr != null)
|
||||
{
|
||||
int layerID = SortingLayer.GetLayerValueFromID(sr.sortingLayerID);
|
||||
int order = sr.sortingOrder;
|
||||
|
||||
if (layerID > topLayer || (layerID == topLayer && order > topOrder))
|
||||
{
|
||||
top = sr.gameObject;
|
||||
topLayer = layerID;
|
||||
topOrder = order;
|
||||
}
|
||||
}
|
||||
}
|
||||
return top;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class ItemState_4
|
||||
{
|
||||
public float water_time = 0f;
|
||||
public int plant_state = 0;
|
||||
public bool use_feiliao = false;
|
||||
public GameObject _gameobject;
|
||||
public bool is_end;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ec7dafbe92c87dd4293025c35249ce3a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user