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

@@ -98,16 +98,21 @@ namespace Cryville.Crtr {
}
public class EmitEffect : SkinPropertyKey {
public int Name { get; set; }
public EmitEffect() { }
public EmitEffect() {
_op = new PropOp.Float(v => _index = v);
}
public override string ToString() {
return string.Format("@emit {0}", IdentifierManager.SharedInstance.Retrieve(Name));
}
public override bool IsValueRequired { get { return true; } }
public override void ExecuteStatic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp) {
// TODO
throw new InvalidOperationException("Emitting effect in static context is not allowed");
}
float _index;
readonly PropOp _op;
public override void ExecuteDynamic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp, int dl) {
// TODO
ChartPlayer.etor.Evaluate(_op, exp);
ChartPlayer.effectManager.Emit(Name, _index);
}
}
}