命名空间迁移

This commit is contained in:
2025-12-15 17:20:55 +08:00
parent 88c15a43f2
commit 65a5775647
42 changed files with 400 additions and 178 deletions

View File

@@ -1,11 +1,35 @@
using Convention;
using Demo.Attr;
using Demo.Game.Attr;
using System.Collections;
using System.IO;
using UnityEngine;
using UnityEngine.Rendering;
namespace Demo.Game
{
namespace ConfigType
{
// VolumeObject 配置
public class VolumeObjectConfig : BaseVolumeConfig
{
public string MyAssetBundle, MyProfile;
public override void Deserialize(BinaryReader reader)
{
MyAssetBundle = BinarySerializeUtility.ReadString(reader);
MyProfile = BinarySerializeUtility.ReadString(reader);
base.Deserialize(reader);
}
public override void Serialize(BinaryWriter writer)
{
BinarySerializeUtility.WriteString(writer, MyAssetBundle);
BinarySerializeUtility.WriteString(writer, MyProfile);
base.Serialize(writer);
}
}
}
[Scriptable]
public class VolumeObject : BaseVolume, IAssetBundleLoader
{
@@ -14,7 +38,8 @@ namespace Demo.Game
return new GameObject().AddComponent<VolumeObject>();
}
[Content, SerializeField] private bool IsLoading = false;
private bool IsLoading = false;
[Content, SerializeField] private string MyAssetBundle, MyProfile;
protected override IEnumerator DoSomethingDuringApplyScript()
{
@@ -30,6 +55,8 @@ namespace Demo.Game
public void Load(string ab, string profile)
{
IsLoading = true;
MyAssetBundle = ab;
MyProfile = profile;
ConventionUtility.StartCoroutine(this.LoadAssetBundle(ab, x =>
{
MyVolume.profile = x.LoadAsset<VolumeProfile>(profile);
@@ -37,4 +64,4 @@ namespace Demo.Game
}));
}
}
}
}