Revert "Revise update clone type to update depth."
This reverts commit 4185303bd2
.
This commit is contained in:
@@ -14,9 +14,8 @@ namespace Cryville.Crtr.Components {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name">The name of the property.</param>
|
/// <param name="name">The name of the property.</param>
|
||||||
/// <param name="property">The property.</param>
|
/// <param name="property">The property.</param>
|
||||||
/// <param name="depth">The maximum depth to update the property.</param>
|
protected void SubmitProperty(string name, PdtOperator property, int uct = 1) {
|
||||||
protected void SubmitProperty(string name, PdtOperator property, int depth = 1) {
|
Properties.Add(IdentifierManager.SharedInstance.Request(name), new SkinProperty(property, uct));
|
||||||
Properties.Add(IdentifierManager.SharedInstance.Request(name), new SkinProperty(property, depth));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -31,10 +30,10 @@ namespace Cryville.Crtr.Components {
|
|||||||
}
|
}
|
||||||
public struct SkinProperty {
|
public struct SkinProperty {
|
||||||
public PdtOperator Operator { get; set; }
|
public PdtOperator Operator { get; set; }
|
||||||
public int UpdateDepth { get; set; }
|
public int UpdateCloneType { get; set; }
|
||||||
public SkinProperty(PdtOperator op, int depth = 1) {
|
public SkinProperty(PdtOperator op, int uct = 1) {
|
||||||
Operator = op;
|
Operator = op;
|
||||||
UpdateDepth = depth;
|
UpdateCloneType = uct;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -144,7 +144,7 @@ namespace Cryville.Crtr.Event {
|
|||||||
public virtual void Update(ContainerState s, StampedEvent ev) {
|
public virtual void Update(ContainerState s, StampedEvent ev) {
|
||||||
bool flag = !Awoken && s.CloneType >= 2 && s.CloneType < 16;
|
bool flag = !Awoken && s.CloneType >= 2 && s.CloneType < 16;
|
||||||
if (flag) PreAwake(s);
|
if (flag) PreAwake(s);
|
||||||
if (gogroup && s.CloneType <= 2) skinContainer.MatchDynamic(s, s.CloneType);
|
if (gogroup && s.CloneType <= 2) skinContainer.MatchDynamic(s);
|
||||||
if (flag) Awake(s);
|
if (flag) Awake(s);
|
||||||
}
|
}
|
||||||
public virtual void ExUpdate(ContainerState s, StampedEvent ev) {
|
public virtual void ExUpdate(ContainerState s, StampedEvent ev) {
|
||||||
@@ -158,7 +158,7 @@ namespace Cryville.Crtr.Event {
|
|||||||
tev.Target.Transform.position = GetCurrentWorldPoint();
|
tev.Target.Transform.position = GetCurrentWorldPoint();
|
||||||
tev.Target.Transform.rotation = Quaternion.Euler(s.Direction);
|
tev.Target.Transform.rotation = Quaternion.Euler(s.Direction);
|
||||||
#endif
|
#endif
|
||||||
skinContainer.MatchDynamic(s, 1);
|
skinContainer.MatchDynamic(s);
|
||||||
CloseAnchor();
|
CloseAnchor();
|
||||||
}
|
}
|
||||||
anchorEvPool.Return(tev);
|
anchorEvPool.Return(tev);
|
||||||
@@ -170,7 +170,7 @@ namespace Cryville.Crtr.Event {
|
|||||||
Awoken = false;
|
Awoken = false;
|
||||||
if (gogroup && s.CloneType <= 2) {
|
if (gogroup && s.CloneType <= 2) {
|
||||||
OpenAnchor(a_tail);
|
OpenAnchor(a_tail);
|
||||||
skinContainer.MatchDynamic(s, s.CloneType);
|
skinContainer.MatchDynamic(s);
|
||||||
CloseAnchor();
|
CloseAnchor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -66,7 +66,7 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
if (rc.PropSrcs != null) ChartPlayer.etor.ContextCascadeDiscard();
|
if (rc.PropSrcs != null) ChartPlayer.etor.ContextCascadeDiscard();
|
||||||
}
|
}
|
||||||
public void MatchDynamic(ContainerState state, byte depth) {
|
public void MatchDynamic(ContainerState state) {
|
||||||
if (dynprops.Count == 0 && dynelems.Count == 0) return;
|
if (dynprops.Count == 0 && dynelems.Count == 0) return;
|
||||||
Profiler.BeginSample("SkinContainer.MatchDynamic");
|
Profiler.BeginSample("SkinContainer.MatchDynamic");
|
||||||
ChartPlayer.etor.ContextState = state;
|
ChartPlayer.etor.ContextState = state;
|
||||||
@@ -76,7 +76,7 @@ namespace Cryville.Crtr {
|
|||||||
var psrcs = p.Context.ReadContext.PropSrcs;
|
var psrcs = p.Context.ReadContext.PropSrcs;
|
||||||
if (psrcs != null) ChartPlayer.etor.ContextCascadeInsert(psrcs);
|
if (psrcs != null) ChartPlayer.etor.ContextCascadeInsert(psrcs);
|
||||||
var prop = GetPropOp(p.Context.WriteTransform, p.Key);
|
var prop = GetPropOp(p.Context.WriteTransform, p.Key);
|
||||||
if (depth > prop.UpdateDepth) continue;
|
if (state.CloneType > prop.UpdateCloneType) continue;
|
||||||
ChartPlayer.etor.Evaluate(prop.Operator, p.Value);
|
ChartPlayer.etor.Evaluate(prop.Operator, p.Value);
|
||||||
if (psrcs != null) ChartPlayer.etor.ContextCascadeDiscard();
|
if (psrcs != null) ChartPlayer.etor.ContextCascadeDiscard();
|
||||||
}
|
}
|
||||||
@@ -85,7 +85,7 @@ namespace Cryville.Crtr {
|
|||||||
var psrcs = e.Context.ReadContext.PropSrcs;
|
var psrcs = e.Context.ReadContext.PropSrcs;
|
||||||
if (psrcs != null) ChartPlayer.etor.ContextCascadeInsert(psrcs);
|
if (psrcs != null) ChartPlayer.etor.ContextCascadeInsert(psrcs);
|
||||||
var nctx = e.Selectors.MatchDynamic(state, e.Context.ReadContext);
|
var nctx = e.Selectors.MatchDynamic(state, e.Context.ReadContext);
|
||||||
if (nctx != null) MatchDynamic(e.Element, state, depth, new RuntimeSkinContext(
|
if (nctx != null) MatchDynamic(e.Element, state, new RuntimeSkinContext(
|
||||||
nctx, e.Context, e.Selectors.annotations.Contains("if"), e.Selectors.annotations.Contains("then")
|
nctx, e.Context, e.Selectors.annotations.Contains("if"), e.Selectors.annotations.Contains("then")
|
||||||
));
|
));
|
||||||
if (psrcs != null) ChartPlayer.etor.ContextCascadeDiscard();
|
if (psrcs != null) ChartPlayer.etor.ContextCascadeDiscard();
|
||||||
@@ -94,7 +94,7 @@ namespace Cryville.Crtr {
|
|||||||
ChartPlayer.etor.ContextState = null;
|
ChartPlayer.etor.ContextState = null;
|
||||||
Profiler.EndSample();
|
Profiler.EndSample();
|
||||||
}
|
}
|
||||||
void MatchDynamic(SkinElement rel, ContainerState state, byte depth, RuntimeSkinContext ctx) {
|
void MatchDynamic(SkinElement rel, ContainerState state, RuntimeSkinContext ctx) {
|
||||||
var rc = ctx.ReadContext;
|
var rc = ctx.ReadContext;
|
||||||
ChartPlayer.etor.ContextTransform = rc.Transform;
|
ChartPlayer.etor.ContextTransform = rc.Transform;
|
||||||
if (rc.PropSrcs != null) ChartPlayer.etor.ContextCascadeInsert(rc.PropSrcs);
|
if (rc.PropSrcs != null) ChartPlayer.etor.ContextCascadeInsert(rc.PropSrcs);
|
||||||
@@ -102,14 +102,14 @@ namespace Cryville.Crtr {
|
|||||||
if (p.Key.Name == 0)
|
if (p.Key.Name == 0)
|
||||||
throw new InvalidOperationException("Component creation in dynamic context is not allowed");
|
throw new InvalidOperationException("Component creation in dynamic context is not allowed");
|
||||||
var prop = GetPropOp(ctx.WriteTransform, p.Key);
|
var prop = GetPropOp(ctx.WriteTransform, p.Key);
|
||||||
if (depth > prop.UpdateDepth) continue;
|
if (state.CloneType > prop.UpdateCloneType) continue;
|
||||||
ChartPlayer.etor.Evaluate(prop.Operator, p.Value);
|
ChartPlayer.etor.Evaluate(prop.Operator, p.Value);
|
||||||
}
|
}
|
||||||
ChartPlayer.etor.ContextTransform = null;
|
ChartPlayer.etor.ContextTransform = null;
|
||||||
foreach (var r in rel.elements) {
|
foreach (var r in rel.elements) {
|
||||||
if (!r.Key.IsUpdatable(state)) continue;
|
if (!r.Key.IsUpdatable(state)) continue;
|
||||||
var nctx = r.Key.MatchDynamic(state, rc);
|
var nctx = r.Key.MatchDynamic(state, rc);
|
||||||
if (nctx != null) MatchDynamic(r.Value, state, depth, new RuntimeSkinContext(
|
if (nctx != null) MatchDynamic(r.Value, state, new RuntimeSkinContext(
|
||||||
nctx, ctx, r.Key.annotations.Contains("if"), r.Key.annotations.Contains("then")
|
nctx, ctx, r.Key.annotations.Contains("if"), r.Key.annotations.Contains("then")
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user