Browse Source

json的数据对比

main
coffee 4 months ago
parent
commit
e34fff4498
  1. 3
      Assets/AddressableAssetsData/AddressableAssetSettings.asset
  2. 28
      Assets/AddressableAssetsData/AssetGroups/Json Packed Assets.asset
  3. 8
      Assets/AddressableAssetsData/AssetGroups/Json Packed Assets.asset.meta
  4. 47
      Assets/AddressableAssetsData/AssetGroups/Schemas/Json Packed Assets_BundledAssetGroupSchema.asset
  5. 8
      Assets/AddressableAssetsData/AssetGroups/Schemas/Json Packed Assets_BundledAssetGroupSchema.asset.meta
  6. 16
      Assets/AddressableAssetsData/AssetGroups/Schemas/Json Packed Assets_ContentUpdateGroupSchema.asset
  7. 8
      Assets/AddressableAssetsData/AssetGroups/Schemas/Json Packed Assets_ContentUpdateGroupSchema.asset.meta
  8. 1
      Assets/StreamingAssetsdata.json
  9. 7
      Assets/StreamingAssetsdata.json.meta
  10. 1
      Assets/Unity-Tools/ExcelResolver/Editor/Core/Data/TableType.cs
  11. 1
      Assets/_Project/Scenes/SampleScene.unity
  12. 30
      Assets/_Project/Scripts/Test.cs
  13. 1
      Packages/manifest.json
  14. 7
      Packages/packages-lock.json

3
Assets/AddressableAssetsData/AddressableAssetSettings.asset

@ -15,7 +15,7 @@ MonoBehaviour:
m_DefaultGroup: 1a1a29f812b440749bc2decf250b92b3
m_currentHash:
serializedVersion: 2
Hash: 12945adec42561e519805a2fcc49aac9
Hash: 00000000000000000000000000000000
m_OptimizeCatalogSize: 0
m_BuildRemoteCatalog: 0
m_CatalogRequestsTimeout: 0
@ -60,6 +60,7 @@ MonoBehaviour:
m_overridePlayerVersion: '[UnityEditor.PlayerSettings.bundleVersion]'
m_GroupAssets:
- {fileID: 11400000, guid: 494d7176b32abc04191886111cdb3155, type: 2}
- {fileID: 11400000, guid: ca18133c115d83e4f9abd956a8e6eb50, type: 2}
- {fileID: 11400000, guid: 5debb34cef6619c42af7052c204e9889, type: 2}
m_BuildSettings:
m_LogResourceManagerExceptions: 1

28
Assets/AddressableAssetsData/AssetGroups/Json Packed Assets.asset

@ -0,0 +1,28 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3}
m_Name: Json Packed Assets
m_EditorClassIdentifier:
m_GroupName: Json Packed Assets
m_GUID: 369d22163e436324197be4ded598d9b7
m_SerializeEntries:
- m_GUID: aec6d94a3399e33469e7f8851d2b3652
m_Address: Assets/StreamingAssetsdata.json
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
m_ReadOnly: 0
m_Settings: {fileID: 11400000, guid: 91dcd7e6baab06c46bc87a1a999177f4, type: 2}
m_SchemaSet:
m_Schemas:
- {fileID: 11400000, guid: a4125c9361b982243b99177608e7a610, type: 2}
- {fileID: 11400000, guid: 7ba443807cf7bd0469d0c97a6fde0692, type: 2}

8
Assets/AddressableAssetsData/AssetGroups/Json Packed Assets.asset.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ca18133c115d83e4f9abd956a8e6eb50
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

47
Assets/AddressableAssetsData/AssetGroups/Schemas/Json Packed Assets_BundledAssetGroupSchema.asset

@ -0,0 +1,47 @@
%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: Json Packed Assets_BundledAssetGroupSchema
m_EditorClassIdentifier:
m_Group: {fileID: 11400000, guid: ca18133c115d83e4f9abd956a8e6eb50, type: 2}
m_InternalBundleIdMode: 1
m_Compression: 1
m_IncludeAddressInCatalog: 1
m_IncludeGUIDInCatalog: 1
m_IncludeLabelsInCatalog: 1
m_InternalIdNamingMode: 0
m_CacheClearBehavior: 0
m_IncludeInBuild: 1
m_BundledAssetProviderType:
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider
m_ForceUniqueProvider: 0
m_UseAssetBundleCache: 1
m_UseAssetBundleCrc: 1
m_UseAssetBundleCrcForCachedBundles: 1
m_UseUWRForLocalBundles: 0
m_Timeout: 0
m_ChunkedTransfer: 0
m_RedirectLimit: -1
m_RetryCount: 0
m_BuildPath:
m_Id: f24583c23c48d6741b4aec08d4afa91b
m_LoadPath:
m_Id: 6f344906102872849a3c6274dc7d506c
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_UseDefaultSchemaSettings: 0
m_SelectedPathPairIndex: 0
m_BundleNaming: 0
m_AssetLoadMode: 0

8
Assets/AddressableAssetsData/AssetGroups/Schemas/Json Packed Assets_BundledAssetGroupSchema.asset.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a4125c9361b982243b99177608e7a610
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

16
Assets/AddressableAssetsData/AssetGroups/Schemas/Json Packed Assets_ContentUpdateGroupSchema.asset

@ -0,0 +1,16 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3}
m_Name: Json Packed Assets_ContentUpdateGroupSchema
m_EditorClassIdentifier:
m_Group: {fileID: 11400000, guid: ca18133c115d83e4f9abd956a8e6eb50, type: 2}
m_StaticContent: 0

8
Assets/AddressableAssetsData/AssetGroups/Schemas/Json Packed Assets_ContentUpdateGroupSchema.asset.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7ba443807cf7bd0469d0c97a6fde0692
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

1
Assets/StreamingAssetsdata.json

File diff suppressed because one or more lines are too long

7
Assets/StreamingAssetsdata.json.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: aec6d94a3399e33469e7f8851d2b3652
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1
Assets/Unity-Tools/ExcelResolver/Editor/Core/Data/TableType.cs

@ -7,5 +7,6 @@
MultiKeyTable, // 多主键表(独立索引)
NotKetTable, // 无主键表
ColumnTable, // 纵表
JsonTable, // Json表
}
}

1
Assets/_Project/Scenes/SampleScene.unity

@ -455,6 +455,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0612f54544cdb1841a14e836c052db63, type: 3}
m_Name:
m_EditorClassIdentifier:
monsterUtil: {fileID: 11400000, guid: bf6bb3a2fdddadd43940a4760ebbcfe9, type: 2}
--- !u!4 &1798497132
Transform:
m_ObjectHideFlags: 0

30
Assets/_Project/Scripts/Test.cs

@ -1,7 +1,8 @@
using System;
using System.Linq;
using System.IO;
using Cysharp.Threading.Tasks;
using Newtonsoft.Json;
using Sirenix.OdinInspector;
using Sirenix.Serialization;
using Tools.ExcelResolver;
using UnityEngine;
using UnityEngine.AddressableAssets;
@ -11,9 +12,28 @@ public class Test : MonoBehaviour
private async void Start()
{
Debug.Log(Time.time);
await Addressables.LoadAssetsAsync<monsterUtil>("default", null);
Debug.Log(Time.time);
await Addressables.LoadAssetsAsync<monster>("monster", null);
await Addressables.LoadAssetsAsync<monsterUtil>("default", util =>
{
Debug.Log(util.Data[1].name);
});
Debug.Log(Time.time);
// TextAsset a = await Addressables.LoadAssetAsync<TextAsset>("Assets/StreamingAssetsdata.json");
// Debug.Log($"成功获取到json文件 {Time.time}");
// monsterUtil b = JsonConvert.DeserializeObject<monsterUtil>(a.text);
// Debug.Log($"反序列化成功 {Time.time}");
}
public monsterUtil monsterUtil;
string streamingAssetsPath = Application.streamingAssetsPath + "data.json";
[Button]
private void DataToJson()
{
var settings = new JsonSerializerSettings
{
ReferenceLoopHandling = ReferenceLoopHandling.Ignore // 忽略循环引用
};
var json = JsonConvert.SerializeObject(monsterUtil, settings);
File.WriteAllText(streamingAssetsPath, json);
}
}

1
Packages/manifest.json

@ -4,6 +4,7 @@
"com.unity.collab-proxy": "2.6.0",
"com.unity.ide.rider": "3.0.34",
"com.unity.inputsystem": "1.11.2",
"com.unity.nuget.newtonsoft-json": "3.2.1",
"com.unity.render-pipelines.universal": "17.0.3",
"com.unity.timeline": "1.8.7",
"com.unity.ugui": "2.0.0",

7
Packages/packages-lock.json

@ -83,6 +83,13 @@
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.nuget.newtonsoft-json": {
"version": "3.2.1",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.profiling.core": {
"version": "1.0.2",
"depth": 1,

Loading…
Cancel
Save