Add BeatTime properties.

This commit is contained in:
2022-10-28 12:00:12 +08:00
parent bd2e1747b7
commit 47b1314033
3 changed files with 31 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using RBeatTime = Cryville.Crtr.BeatTime;
namespace Cryville.Crtr {
public abstract class PropOp : PdtOperator {
@@ -52,6 +53,14 @@ namespace Cryville.Crtr {
_cb((T)(object)result);
}
}
public class BeatTime : PropOp {
readonly Action<RBeatTime> _cb;
public BeatTime(Action<RBeatTime> cb) { _cb = cb; }
protected override unsafe void Execute() {
var o = GetOperand(0);
_cb(*(RBeatTime*)o.TrustedAsOfLength(sizeof(RBeatTime)));
}
}
public class Vector2 : PropOp {
readonly Action<UnityEngine.Vector2> _cb;
public Vector2(Action<UnityEngine.Vector2> cb) { _cb = cb; }