天空盒Config已更新

This commit is contained in:
2025-12-19 15:54:51 +08:00
parent fd42a868d8
commit a8b8b82e92
2 changed files with 51 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
using Convention;
using Demo.Game.Attr;
using Demo.Game.ConfigType;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -13,7 +14,7 @@ namespace Demo.Game
{
public class PrefabRootObjectConfig : ScriptLoadableConfig
{
public Dictionary<string, string[]> LoadedGameObjectNames = new();
public Dictionary<string, List<string>> LoadedGameObjectNames = new();
public override void Deserialize(BinaryReader reader)
{
@@ -23,7 +24,7 @@ namespace Demo.Game
var temp = BinarySerializeUtility.DeserializeStringArray(reader);
var key = temp[0];
var value = temp[1..];
LoadedGameObjectNames.Add(key, value);
LoadedGameObjectNames.Add(key, value.ToList());
}
base.Deserialize(reader);
}
@@ -33,9 +34,12 @@ namespace Demo.Game
BinarySerializeUtility.WriteInt(writer, LoadedGameObjectNames.Count);
foreach (var (key,value) in LoadedGameObjectNames)
{
string[] temp = new string[value.Length + 1];
string[] temp = new string[value.Count + 1];
temp[0] = key;
Array.Copy(value, 0, temp, 1, value.Length);
for(int i=0,e=value.Count;i<e;i++)
{
temp[1 + i] = value[i];
}
BinarySerializeUtility.SerializeArray(writer, value.ToArray());
}
base.Serialize(writer);
@@ -52,7 +56,7 @@ namespace Demo.Game
}
private int LoadingCounter = 0;
private readonly Dictionary<string, List<string>> LoadedGameObjectNames = new();
private Dictionary<string, List<string>> LoadedGameObjectNames => GetConfig<PrefabRootObjectConfig>().LoadedGameObjectNames;
private readonly List<GameObject> LoadedGameObjects = new();
protected override IEnumerator DoSomethingDuringApplyScript()