Improve error description for missing effect.
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user