Fix wrong context access in component creation.

This commit is contained in:
2023-02-09 18:08:12 +08:00
parent 041c1e374e
commit 3dd25b51a8

View File

@@ -18,7 +18,7 @@ namespace Cryville.Crtr {
}
public override bool IsValueRequired { get { return false; } }
public override void ExecuteStatic(ContainerState state, RuntimeSkinContext ctx, PdtExpression exp) {
ctx.ReadContext.Transform.gameObject.AddComponent(Component);
ctx.WriteTransform.gameObject.AddComponent(Component);
}
public override void ExecuteDynamic(ContainerState state, RuntimeSkinContext ctx, PdtExpression exp) {
throw new InvalidOperationException("Component creation in dynamic context is not allowed");