using Convention; using Demo.Attr; using System.Collections; using UnityEngine; using UnityEngine.Rendering; namespace Demo.Game { [Scriptable] public class VolumeObject : BaseVolume, IAssetBundleLoader { public static VolumeObject Make() { return new GameObject().AddComponent(); } [Content, SerializeField] private bool IsLoading = false; protected override IEnumerator DoSomethingDuringApplyScript() { yield return base.DoSomethingDuringApplyScript(); yield return new WaitUntil(() => !IsLoading); if (MyVolume.profile == null) { MyVolume.profile = Resources.Load("Volume/Default"); } } [Convention.RScript.Variable.Attr.Method] public void Load(string ab, string profile) { IsLoading = true; ConventionUtility.StartCoroutine(this.LoadAssetBundle(ab, x => { MyVolume.profile = x.LoadAsset(profile); IsLoading = false; })); } } }