Implement effect.

This commit is contained in:
2023-02-18 14:51:28 +08:00
parent 6bd32c9aef
commit 900bd7b77a
9 changed files with 194 additions and 7 deletions

View File

@@ -0,0 +1,22 @@
using System.Collections.Generic;
namespace Cryville.Crtr {
public class EffectManager {
readonly Dictionary<int, EffectGroup> _groups
= new Dictionary<int, EffectGroup>();
public EffectManager(PdtSkin skin) {
foreach (var e in skin.effects) {
_groups.Add(e.Key.Key, new EffectGroup(e.Value));
}
}
public void Tick(double time) {
foreach (var g in _groups) g.Value.Tick(time);
}
public void Emit(int id, float index) {
_groups[id].Emit(index);
}
public void Dispose() {
foreach (var g in _groups) g.Value.Dispose();
}
}
}