Add invisible_bounds
contextual variable.
This commit is contained in:
@@ -67,6 +67,7 @@ namespace Cryville.Crtr.Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static readonly int _var_current_time = IdentifierManager.SharedInstance.Request("current_time");
|
static readonly int _var_current_time = IdentifierManager.SharedInstance.Request("current_time");
|
||||||
|
static readonly int _var_invisible_bounds = IdentifierManager.SharedInstance.Request("invisible_bounds");
|
||||||
public readonly Dictionary<int, PropSrc> PropSrcs = new Dictionary<int, PropSrc>();
|
public readonly Dictionary<int, PropSrc> PropSrcs = new Dictionary<int, PropSrc>();
|
||||||
SkinContainer skinContainer;
|
SkinContainer skinContainer;
|
||||||
protected Judge judge;
|
protected Judge judge;
|
||||||
@@ -85,6 +86,8 @@ namespace Cryville.Crtr.Event {
|
|||||||
protected readonly static int _a_cur = IdentifierManager.SharedInstance.Request("cur");
|
protected readonly static int _a_cur = IdentifierManager.SharedInstance.Request("cur");
|
||||||
protected readonly static int _a_head = IdentifierManager.SharedInstance.Request("head");
|
protected readonly static int _a_head = IdentifierManager.SharedInstance.Request("head");
|
||||||
protected readonly static int _a_tail = IdentifierManager.SharedInstance.Request("tail");
|
protected readonly static int _a_tail = IdentifierManager.SharedInstance.Request("tail");
|
||||||
|
double atime_head;
|
||||||
|
double atime_tail;
|
||||||
public Anchor RegisterAnchor(int name, bool dyn = false, int propSrcCount = 0) {
|
public Anchor RegisterAnchor(int name, bool dyn = false, int propSrcCount = 0) {
|
||||||
var strname = IdentifierManager.SharedInstance.Retrieve(name);
|
var strname = IdentifierManager.SharedInstance.Retrieve(name);
|
||||||
var go = new GameObject("." + strname).transform;
|
var go = new GameObject("." + strname).transform;
|
||||||
@@ -123,6 +126,7 @@ namespace Cryville.Crtr.Event {
|
|||||||
a_head = RegisterAnchor(_a_head, true);
|
a_head = RegisterAnchor(_a_head, true);
|
||||||
a_tail = RegisterAnchor(_a_tail, true);
|
a_tail = RegisterAnchor(_a_tail, true);
|
||||||
PropSrcs.Add(_var_current_time, new PropSrc.Float(() => (float)cs.rootPrototype.Time));
|
PropSrcs.Add(_var_current_time, new PropSrc.Float(() => (float)cs.rootPrototype.Time));
|
||||||
|
PropSrcs.Add(_var_invisible_bounds, new PropSrc.Boolean(() => atime_head > atime_tail));
|
||||||
}
|
}
|
||||||
public virtual void Init() {
|
public virtual void Init() {
|
||||||
skinContainer.MatchStatic(ps);
|
skinContainer.MatchStatic(ps);
|
||||||
@@ -187,11 +191,13 @@ namespace Cryville.Crtr.Event {
|
|||||||
public virtual void Anchor() {
|
public virtual void Anchor() {
|
||||||
foreach (var p in PropSrcs.Values) p.Invalidate();
|
foreach (var p in PropSrcs.Values) p.Invalidate();
|
||||||
foreach (var a in DynamicAnchors.Keys) DynamicAnchorSet[a] = false;
|
foreach (var a in DynamicAnchors.Keys) DynamicAnchorSet[a] = false;
|
||||||
|
atime_head = cs.StampedContainer.Time;
|
||||||
|
atime_tail = atime_head + cs.StampedContainer.Duration;
|
||||||
skinContainer.MatchDynamic(cs);
|
skinContainer.MatchDynamic(cs);
|
||||||
if (cs.Active) PushAnchorEvent(cs.Time, a_cur);
|
if (cs.Active) PushAnchorEvent(cs.Time, a_cur);
|
||||||
if (Alive) {
|
if (Alive) {
|
||||||
if (!DynamicAnchorSet[_a_head]) PushAnchorEvent(cs.StampedContainer.Time, a_head, -1, true);
|
if (!DynamicAnchorSet[_a_head]) PushAnchorEvent(atime_head, a_head, -1, true);
|
||||||
if (!DynamicAnchorSet[_a_tail]) PushAnchorEvent(cs.StampedContainer.Time + cs.StampedContainer.Duration, a_tail, 1, true);
|
if (!DynamicAnchorSet[_a_tail]) PushAnchorEvent(atime_tail, a_tail, 1, true);
|
||||||
foreach (var anchors in Anchors.Values) foreach (var anchor in anchors) anchor.Transform.gameObject.SetActive(false);
|
foreach (var anchors in Anchors.Values) foreach (var anchor in anchors) anchor.Transform.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -205,8 +211,8 @@ namespace Cryville.Crtr.Event {
|
|||||||
throw new InvalidOperationException(string.Format("Specified anchor \"{0}\" has been set", IdentifierManager.SharedInstance.Retrieve(name)));
|
throw new InvalidOperationException(string.Format("Specified anchor \"{0}\" has been set", IdentifierManager.SharedInstance.Retrieve(name)));
|
||||||
int priority = 0;
|
int priority = 0;
|
||||||
bool forced = true;
|
bool forced = true;
|
||||||
if (name == _a_head) priority = -1;
|
if (name == _a_head) { priority = -1; atime_head = time; }
|
||||||
else if (name == _a_tail) priority = 1;
|
else if (name == _a_tail) { priority = 1; atime_tail = time; }
|
||||||
else forced = false;
|
else forced = false;
|
||||||
PushAnchorEvent(time, anchor, priority, forced);
|
PushAnchorEvent(time, anchor, priority, forced);
|
||||||
DynamicAnchorSet[name] = true;
|
DynamicAnchorSet[name] = true;
|
||||||
|
Reference in New Issue
Block a user