Improve error description for missing effect.

This commit is contained in:
2023-06-02 17:41:09 +08:00
parent 910e3ce277
commit f6741d0acc

View File

@@ -1,4 +1,6 @@
using Cryville.Common;
using Cryville.Common.Collections.Specialized;
using System;
using UnityEngine;
namespace Cryville.Crtr {
@@ -14,10 +16,15 @@ namespace Cryville.Crtr {
foreach (var g in _groups) g.Value.Tick(time);
}
public void Emit(int id, float index) {
_groups[id].Emit(index);
GetGroup(id).Emit(index);
}
public void EmitSelf(int id, float index, Transform target) {
_groups[id].Emit(index, target);
GetGroup(id).Emit(index, target);
}
EffectGroup GetGroup(int id) {
EffectGroup result;
if (_groups.TryGetValue(id, out result)) return result;
throw new ArgumentException(string.Format("The effect \"{0}\" is not found", IdentifierManager.Shared.Retrieve(id)));
}
public void Dispose() {
foreach (var g in _groups) g.Value.Dispose();