Wrap Transform into SkinContext. Implement r/w context separation for skins.
This commit is contained in:
@@ -1,12 +1,17 @@
|
|||||||
using UnityEngine;
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr {
|
||||||
public class Anchor {
|
public class Anchor {
|
||||||
public int Name { get; private set; }
|
public int Name { get; private set; }
|
||||||
public Transform Transform { get; set; }
|
public Transform Transform { get; private set; }
|
||||||
public Anchor(int name, Transform transform) {
|
public SkinContext SkinContext { get; private set; }
|
||||||
|
public Dictionary<int, PropSrc.Arbitrary> PropSrcs { get; private set; }
|
||||||
|
public Anchor(int name, Transform transform, bool hasProps = false) {
|
||||||
Name = name;
|
Name = name;
|
||||||
Transform = transform;
|
Transform = transform;
|
||||||
|
if (hasProps) PropSrcs = new Dictionary<int, PropSrc.Arbitrary>();
|
||||||
|
SkinContext = new SkinContext(transform, PropSrcs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -36,7 +36,8 @@ namespace Cryville.Crtr.Event {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// <see cref="GameObject"/> group, the <see cref="Transform"/> containing all the generated elements in the <see cref="ContainerHandler"/>.
|
/// <see cref="GameObject"/> group, the <see cref="Transform"/> containing all the generated elements in the <see cref="ContainerHandler"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Transform gogroup;
|
protected Transform gogroup;
|
||||||
|
public SkinContext SkinContext;
|
||||||
|
|
||||||
public Vector3 Position { get; protected set; }
|
public Vector3 Position { get; protected set; }
|
||||||
public Quaternion Rotation { get; protected set; }
|
public Quaternion Rotation { get; protected set; }
|
||||||
@@ -69,16 +70,17 @@ namespace Cryville.Crtr.Event {
|
|||||||
protected readonly static int _a_tail = IdentifierManager.SharedInstance.Request("tail");
|
protected readonly static int _a_tail = IdentifierManager.SharedInstance.Request("tail");
|
||||||
public virtual void PreInit() {
|
public virtual void PreInit() {
|
||||||
gogroup = new GameObject(TypeName + ":" + Container.GetHashCode().ToString(CultureInfo.InvariantCulture)).transform;
|
gogroup = new GameObject(TypeName + ":" + Container.GetHashCode().ToString(CultureInfo.InvariantCulture)).transform;
|
||||||
|
SkinContext = new SkinContext(gogroup);
|
||||||
if (cs.Parent != null)
|
if (cs.Parent != null)
|
||||||
gogroup.SetParent(cs.Parent.Handler.gogroup, false);
|
gogroup.SetParent(cs.Parent.Handler.gogroup, false);
|
||||||
a_cur = RegisterAnchor(_a_cur);
|
a_cur = RegisterAnchor(_a_cur);
|
||||||
a_head = RegisterAnchor(_a_head);
|
a_head = RegisterAnchor(_a_head);
|
||||||
a_tail = RegisterAnchor(_a_tail);
|
a_tail = RegisterAnchor(_a_tail);
|
||||||
}
|
}
|
||||||
protected Anchor RegisterAnchor(int name) {
|
protected Anchor RegisterAnchor(int name, bool hasPropSrcs = false) {
|
||||||
var go = new GameObject("." + IdentifierManager.SharedInstance.Retrieve(name)).transform;
|
var go = new GameObject("." + IdentifierManager.SharedInstance.Retrieve(name)).transform;
|
||||||
go.SetParent(gogroup, false);
|
go.SetParent(gogroup, false);
|
||||||
var result = new Anchor(name, go);
|
var result = new Anchor(name, go, hasPropSrcs);
|
||||||
List<Anchor> list;
|
List<Anchor> list;
|
||||||
if (!Anchors.TryGetValue(name, out list))
|
if (!Anchors.TryGetValue(name, out list))
|
||||||
Anchors.Add(name, list = new List<Anchor>());
|
Anchors.Add(name, list = new List<Anchor>());
|
||||||
|
@@ -12,90 +12,98 @@ namespace Cryville.Crtr {
|
|||||||
readonly PdtSkin skin;
|
readonly PdtSkin skin;
|
||||||
readonly List<DynamicProperty> dynprops = new List<DynamicProperty>();
|
readonly List<DynamicProperty> dynprops = new List<DynamicProperty>();
|
||||||
struct DynamicProperty {
|
struct DynamicProperty {
|
||||||
public Transform Anchor { get; set; }
|
public RuntimeSkinContext Context { get; set; }
|
||||||
public SkinPropertyKey Key { get; set; }
|
public SkinPropertyKey Key { get; set; }
|
||||||
public PdtExpression Value { get; set; }
|
public PdtExpression Value { get; set; }
|
||||||
}
|
}
|
||||||
readonly List<DynamicElement> dynelems = new List<DynamicElement>();
|
readonly List<DynamicElement> dynelems = new List<DynamicElement>();
|
||||||
struct DynamicElement {
|
struct DynamicElement {
|
||||||
public Transform Anchor { get; set; }
|
public RuntimeSkinContext Context { get; set; }
|
||||||
public SkinSelectors Selectors { get; set; }
|
public SkinSelectors Selectors { get; set; }
|
||||||
public SkinElement Element { get; set; }
|
public SkinElement Element { get; set; }
|
||||||
}
|
}
|
||||||
public SkinContainer(PdtSkin _skin) {
|
public SkinContainer(PdtSkin _skin) {
|
||||||
skin = _skin;
|
skin = _skin;
|
||||||
}
|
}
|
||||||
public void MatchStatic(ContainerState context) {
|
public void MatchStatic(ContainerState state) {
|
||||||
dynprops.Clear(); dynelems.Clear();
|
dynprops.Clear(); dynelems.Clear();
|
||||||
ChartPlayer.etor.ContextState = context;
|
ChartPlayer.etor.ContextState = state;
|
||||||
ChartPlayer.etor.ContextEvent = context.Container;
|
ChartPlayer.etor.ContextEvent = state.Container;
|
||||||
MatchStatic(skin, context, context.Handler.gogroup);
|
MatchStatic(skin, state, new RuntimeSkinContext(state.Handler.SkinContext));
|
||||||
ChartPlayer.etor.ContextEvent = null;
|
ChartPlayer.etor.ContextEvent = null;
|
||||||
ChartPlayer.etor.ContextState = null;
|
ChartPlayer.etor.ContextState = null;
|
||||||
}
|
}
|
||||||
void MatchStatic(SkinElement rel, ContainerState context, Transform anchor = null) {
|
void MatchStatic(SkinElement rel, ContainerState state, RuntimeSkinContext ctx) {
|
||||||
ChartPlayer.etor.ContextTransform = anchor;
|
var rc = ctx.ReadContext;
|
||||||
|
ChartPlayer.etor.ContextTransform = rc.Transform;
|
||||||
foreach (var p in rel.properties) {
|
foreach (var p in rel.properties) {
|
||||||
if (p.Key.Name == 0)
|
if (p.Key.Name == 0)
|
||||||
anchor.gameObject.AddComponent(p.Key.Component);
|
rc.Transform.gameObject.AddComponent(p.Key.Component);
|
||||||
else {
|
else {
|
||||||
ChartPlayer.etor.Evaluate(GetPropOp(anchor, p.Key).Operator, p.Value);
|
ChartPlayer.etor.Evaluate(GetPropOp(ctx.WriteTransform, p.Key).Operator, p.Value);
|
||||||
if (!p.Value.IsConstant) dynprops.Add(
|
if (!p.Value.IsConstant) dynprops.Add(
|
||||||
new DynamicProperty { Anchor = anchor, Key = p.Key, Value = p.Value }
|
new DynamicProperty { Context = ctx, Key = p.Key, Value = p.Value }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ChartPlayer.etor.ContextTransform = null;
|
ChartPlayer.etor.ContextTransform = null;
|
||||||
foreach (var r in rel.elements) {
|
foreach (var r in rel.elements) {
|
||||||
try {
|
try {
|
||||||
var new_anchors = r.Key.MatchStatic(context, anchor);
|
var nctxs = r.Key.MatchStatic(state, rc);
|
||||||
if (new_anchors != null) foreach (var new_anchor in new_anchors) {
|
var roflag = r.Key.annotations.Contains("if");
|
||||||
MatchStatic(r.Value, context, new_anchor);
|
foreach (var nctx in nctxs) {
|
||||||
|
var nrctx = new RuntimeSkinContext(nctx, ctx.WriteTransform, roflag);
|
||||||
|
MatchStatic(r.Value, state, nrctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (SelectorNotStaticException) {
|
catch (SelectorNotStaticException) {
|
||||||
dynelems.Add(
|
dynelems.Add(
|
||||||
new DynamicElement { Anchor = anchor, Selectors = r.Key, Element = r.Value }
|
new DynamicElement { Context = ctx, Selectors = r.Key, Element = r.Value }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void MatchDynamic(ContainerState context) {
|
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 = context;
|
ChartPlayer.etor.ContextState = state;
|
||||||
ChartPlayer.etor.ContextEvent = context.Container;
|
ChartPlayer.etor.ContextEvent = state.Container;
|
||||||
for (int i = 0; i < dynprops.Count; i++) {
|
for (int i = 0; i < dynprops.Count; i++) {
|
||||||
DynamicProperty p = dynprops[i];
|
DynamicProperty p = dynprops[i];
|
||||||
var prop = GetPropOp(p.Anchor, p.Key);
|
var prop = GetPropOp(p.Context.WriteTransform, p.Key);
|
||||||
if (context.CloneType > prop.UpdateCloneType) continue;
|
if (state.CloneType > prop.UpdateCloneType) continue;
|
||||||
ChartPlayer.etor.Evaluate(prop.Operator, p.Value);
|
ChartPlayer.etor.Evaluate(prop.Operator, p.Value);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < dynelems.Count; i++) {
|
for (int i = 0; i < dynelems.Count; i++) {
|
||||||
DynamicElement e = dynelems[i];
|
DynamicElement e = dynelems[i];
|
||||||
var anchor = e.Selectors.MatchDynamic(context, e.Anchor);
|
var nctx = e.Selectors.MatchDynamic(state, e.Context.ReadContext);
|
||||||
if (anchor != null) MatchDynamic(e.Element, context, anchor);
|
if (nctx != null) MatchDynamic(
|
||||||
|
e.Element, state,
|
||||||
|
new RuntimeSkinContext(nctx, e.Context.ReadContext.Transform, e.Selectors.annotations.Contains("if"))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
ChartPlayer.etor.ContextEvent = null;
|
ChartPlayer.etor.ContextEvent = null;
|
||||||
ChartPlayer.etor.ContextState = null;
|
ChartPlayer.etor.ContextState = null;
|
||||||
Profiler.EndSample();
|
Profiler.EndSample();
|
||||||
}
|
}
|
||||||
void MatchDynamic(SkinElement rel, ContainerState context, Transform anchor = null) {
|
void MatchDynamic(SkinElement rel, ContainerState state, RuntimeSkinContext ctx) {
|
||||||
ChartPlayer.etor.ContextTransform = anchor;
|
var rc = ctx.ReadContext;
|
||||||
|
ChartPlayer.etor.ContextTransform = rc.Transform;
|
||||||
foreach (var p in rel.properties) {
|
foreach (var p in rel.properties) {
|
||||||
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(anchor, p.Key);
|
var prop = GetPropOp(ctx.WriteTransform, p.Key);
|
||||||
if (context.CloneType > prop.UpdateCloneType) 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(context)) continue;
|
if (!r.Key.IsUpdatable(state)) continue;
|
||||||
var new_anchor = r.Key.MatchDynamic(context, anchor);
|
var nctx = r.Key.MatchDynamic(state, rc);
|
||||||
if (new_anchor != null) {
|
if (nctx != null) MatchDynamic(
|
||||||
MatchDynamic(r.Value, context, new_anchor);
|
r.Value, state,
|
||||||
}
|
new RuntimeSkinContext(nctx, ctx.WriteTransform, r.Key.annotations.Contains("if"))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SkinProperty GetPropOp(Transform obj, SkinPropertyKey key) {
|
SkinProperty GetPropOp(Transform obj, SkinPropertyKey key) {
|
||||||
@@ -114,4 +122,28 @@ namespace Cryville.Crtr {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public class SkinContext {
|
||||||
|
public Transform Transform { get; private set; }
|
||||||
|
public Dictionary<int, PropSrc.Arbitrary> PropSrcs { get; private set; }
|
||||||
|
public SkinContext(Transform transform, Dictionary<int, PropSrc.Arbitrary> propSrcs = null) {
|
||||||
|
Transform = transform;
|
||||||
|
PropSrcs = propSrcs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public struct RuntimeSkinContext {
|
||||||
|
public SkinContext ReadContext { get; private set; }
|
||||||
|
public Transform WriteTransform { get; private set; }
|
||||||
|
public RuntimeSkinContext(SkinContext rw) {
|
||||||
|
ReadContext = rw;
|
||||||
|
WriteTransform = rw.Transform;
|
||||||
|
}
|
||||||
|
public RuntimeSkinContext(SkinContext r, Transform w) {
|
||||||
|
ReadContext = r;
|
||||||
|
WriteTransform = w;
|
||||||
|
}
|
||||||
|
public RuntimeSkinContext(SkinContext newctx, Transform oldctx, bool roflag) {
|
||||||
|
ReadContext = newctx;
|
||||||
|
WriteTransform = roflag ? oldctx : newctx.Transform;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -12,11 +12,11 @@ using CAnchor = Cryville.Crtr.Anchor;
|
|||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr {
|
||||||
public class SkinSelectors {
|
public class SkinSelectors {
|
||||||
readonly SkinSelector[] selectors;
|
readonly SkinSelector[] selectors;
|
||||||
readonly string[] annotations;
|
public readonly HashSet<string> annotations;
|
||||||
|
|
||||||
public SkinSelectors(IEnumerable<SkinSelector> s, IEnumerable<string> a) {
|
public SkinSelectors(IEnumerable<SkinSelector> s, IEnumerable<string> a) {
|
||||||
selectors = s.ToArray();
|
selectors = s.ToArray();
|
||||||
annotations = a.ToArray();
|
annotations = a.ToHashSet();
|
||||||
}
|
}
|
||||||
public override string ToString() {
|
public override string ToString() {
|
||||||
if (selectors.Length == 0) return "";
|
if (selectors.Length == 0) return "";
|
||||||
@@ -37,8 +37,8 @@ namespace Cryville.Crtr {
|
|||||||
selectors[i].Optimize(etor);
|
selectors[i].Optimize(etor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public IEnumerable<Transform> MatchStatic(ContainerState h, Transform anchor) {
|
public IEnumerable<SkinContext> MatchStatic(ContainerState h, SkinContext ctx) {
|
||||||
IEnumerable<Transform> result = new Transform[] { anchor };
|
IEnumerable<SkinContext> result = new SkinContext[] { ctx };
|
||||||
foreach (var s in selectors) {
|
foreach (var s in selectors) {
|
||||||
result = result.SelectMany(l => s.MatchStatic(h, l));
|
result = result.SelectMany(l => s.MatchStatic(h, l));
|
||||||
}
|
}
|
||||||
@@ -49,30 +49,30 @@ namespace Cryville.Crtr {
|
|||||||
if (!s.IsUpdatable(h)) return false;
|
if (!s.IsUpdatable(h)) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public Transform MatchDynamic(ContainerState h, Transform anchor) {
|
public SkinContext MatchDynamic(ContainerState h, SkinContext ctx) {
|
||||||
foreach (var s in selectors) {
|
foreach (var s in selectors) {
|
||||||
anchor = s.MatchDynamic(h, anchor);
|
ctx = s.MatchDynamic(h, ctx);
|
||||||
if (anchor == null) return null;
|
if (ctx == null) return null;
|
||||||
}
|
}
|
||||||
return anchor;
|
return ctx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class SkinSelector {
|
public abstract class SkinSelector {
|
||||||
protected SkinSelector() { }
|
protected SkinSelector() { }
|
||||||
public virtual void Optimize(PdtEvaluatorBase etor) { }
|
public virtual void Optimize(PdtEvaluatorBase etor) { }
|
||||||
public virtual IEnumerable<Transform> MatchStatic(ContainerState h, Transform a) { throw new SelectorNotStaticException(); }
|
public virtual IEnumerable<SkinContext> MatchStatic(ContainerState h, SkinContext c) { throw new SelectorNotStaticException(); }
|
||||||
public virtual Transform MatchDynamic(ContainerState h, Transform a) { throw new NotSupportedException(); }
|
public virtual SkinContext MatchDynamic(ContainerState h, SkinContext c) { throw new NotSupportedException(); }
|
||||||
public virtual bool IsUpdatable(ContainerState h) {
|
public virtual bool IsUpdatable(ContainerState h) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public class CreateObject : SkinSelector {
|
public class CreateObject : SkinSelector {
|
||||||
public CreateObject() { }
|
public CreateObject() { }
|
||||||
public override IEnumerable<Transform> MatchStatic(ContainerState h, Transform a) {
|
public override IEnumerable<SkinContext> MatchStatic(ContainerState h, SkinContext c) {
|
||||||
var obj = new GameObject("__obj__");
|
var obj = new GameObject("__obj__");
|
||||||
obj.transform.SetParent(a, false);
|
obj.transform.SetParent(c.Transform, false);
|
||||||
obj.AddComponent<TransformInterface>();
|
obj.AddComponent<TransformInterface>();
|
||||||
return new Transform[] { obj.transform };
|
return new SkinContext[] { new SkinContext(obj.transform) };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class Anchor : SkinSelector {
|
public class Anchor : SkinSelector {
|
||||||
@@ -81,12 +81,12 @@ namespace Cryville.Crtr {
|
|||||||
Name = IdentifierManager.SharedInstance.Request(name);
|
Name = IdentifierManager.SharedInstance.Request(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override IEnumerable<Transform> MatchStatic(ContainerState h, Transform a) {
|
public override IEnumerable<SkinContext> MatchStatic(ContainerState h, SkinContext c) {
|
||||||
List<CAnchor> anchors;
|
List<CAnchor> anchors;
|
||||||
if (h.Handler.Anchors.TryGetValue(Name, out anchors)) {
|
if (h.Handler.Anchors.TryGetValue(Name, out anchors)) {
|
||||||
return anchors.Select(a => a.Transform);
|
return anchors.Select(a => a.SkinContext);
|
||||||
}
|
}
|
||||||
else return Enumerable.Empty<Transform>();
|
else return Enumerable.Empty<SkinContext>();
|
||||||
}
|
}
|
||||||
public override bool IsUpdatable(ContainerState h) {
|
public override bool IsUpdatable(ContainerState h) {
|
||||||
return h.Handler.OpenedAnchor.Name == Name;
|
return h.Handler.OpenedAnchor.Name == Name;
|
||||||
@@ -97,8 +97,8 @@ namespace Cryville.Crtr {
|
|||||||
public AtAnchor(string name) {
|
public AtAnchor(string name) {
|
||||||
Name = IdentifierManager.SharedInstance.Request(name);
|
Name = IdentifierManager.SharedInstance.Request(name);
|
||||||
}
|
}
|
||||||
public override Transform MatchDynamic(ContainerState h, Transform a) {
|
public override SkinContext MatchDynamic(ContainerState h, SkinContext c) {
|
||||||
return IsUpdatable(h) ? a : null;
|
return IsUpdatable(h) ? c : null;
|
||||||
}
|
}
|
||||||
public override bool IsUpdatable(ContainerState h) {
|
public override bool IsUpdatable(ContainerState h) {
|
||||||
return h.Handler.OpenedAnchor.Name == Name;
|
return h.Handler.OpenedAnchor.Name == Name;
|
||||||
@@ -115,16 +115,16 @@ namespace Cryville.Crtr {
|
|||||||
public override void Optimize(PdtEvaluatorBase etor) {
|
public override void Optimize(PdtEvaluatorBase etor) {
|
||||||
etor.Optimize(_exp);
|
etor.Optimize(_exp);
|
||||||
}
|
}
|
||||||
public override IEnumerable<Transform> MatchStatic(ContainerState h, Transform a) {
|
public override IEnumerable<SkinContext> MatchStatic(ContainerState h, SkinContext c) {
|
||||||
var result = Match(a);
|
var result = Match(c);
|
||||||
if (result != null) return new Transform[] { result };
|
if (result != null) return new SkinContext[] { result };
|
||||||
else return Enumerable.Empty<Transform>();
|
else return Enumerable.Empty<SkinContext>();
|
||||||
}
|
}
|
||||||
public override Transform MatchDynamic(ContainerState h, Transform a) {
|
public override SkinContext MatchDynamic(ContainerState h, SkinContext c) {
|
||||||
return Match(a, true);
|
return Match(c, true);
|
||||||
}
|
}
|
||||||
public Transform Match(Transform a, bool dyn = false) {
|
public SkinContext Match(SkinContext a, bool dyn = false) {
|
||||||
ChartPlayer.etor.ContextTransform = a;
|
ChartPlayer.etor.ContextTransform = a.Transform;
|
||||||
try {
|
try {
|
||||||
ChartPlayer.etor.Evaluate(_op, _exp);
|
ChartPlayer.etor.Evaluate(_op, _exp);
|
||||||
return _flag ? a : null;
|
return _flag ? a : null;
|
||||||
@@ -140,15 +140,15 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
public class State : SkinSelector {
|
public class State : SkinSelector {
|
||||||
public State(string state) { }
|
public State(string state) { }
|
||||||
public override Transform MatchDynamic(ContainerState h, Transform a) {
|
public override SkinContext MatchDynamic(ContainerState h, SkinContext c) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class ElementType : SkinSelector {
|
public class ElementType : SkinSelector {
|
||||||
readonly string _type;
|
readonly string _type;
|
||||||
public ElementType(string type) { _type = type; }
|
public ElementType(string type) { _type = type; }
|
||||||
public override IEnumerable<Transform> MatchStatic(ContainerState h, Transform a) {
|
public override IEnumerable<SkinContext> MatchStatic(ContainerState h, SkinContext c) {
|
||||||
return h.Handler.TypeName == _type ? new Transform[] { a } : Enumerable.Empty<Transform>();
|
return h.Handler.TypeName == _type ? new SkinContext[] { c } : Enumerable.Empty<SkinContext>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user