Implement anchor related annotations.
This commit is contained in:
@@ -77,7 +77,7 @@ namespace Cryville.Crtr.Event {
|
||||
a_head = RegisterAnchor(_a_head);
|
||||
a_tail = RegisterAnchor(_a_tail);
|
||||
}
|
||||
protected Anchor RegisterAnchor(int name, int propSrcCount = 0) {
|
||||
public Anchor RegisterAnchor(int name, int propSrcCount = 0) {
|
||||
var go = new GameObject("." + IdentifierManager.SharedInstance.Retrieve(name)).transform;
|
||||
go.SetParent(gogroup, false);
|
||||
var result = new Anchor(name, go, propSrcCount);
|
||||
@@ -129,7 +129,15 @@ namespace Cryville.Crtr.Event {
|
||||
}
|
||||
static readonly SimpleObjectPool<StampedEvent.Anchor> anchorEvPool
|
||||
= new SimpleObjectPool<StampedEvent.Anchor>(1024);
|
||||
protected void PushAnchorEvent(double time, Anchor anchor) {
|
||||
public void PushAnchorEvent(double time, int name) {
|
||||
List<Anchor> anchors;
|
||||
if (!Anchors.TryGetValue(name, out anchors))
|
||||
throw new ArgumentException(string.Format("Specified anchor \"{0}\" not found", IdentifierManager.SharedInstance.Retrieve(name)));
|
||||
if (anchors.Count != 1)
|
||||
throw new InvalidOperationException(string.Format("Cannot set a static anchor \"{0}\"", IdentifierManager.SharedInstance.Retrieve(name)));
|
||||
PushAnchorEvent(time, anchors[0]);
|
||||
}
|
||||
void PushAnchorEvent(double time, Anchor anchor) {
|
||||
var tev = anchorEvPool.Rent();
|
||||
tev.Time = time;
|
||||
tev.Container = Container;
|
||||
|
Reference in New Issue
Block a user