From 3dd25b51a8bc94fa3988bea111cf385f2d9349e8 Mon Sep 17 00:00:00 2001 From: PopSlime Date: Thu, 9 Feb 2023 18:08:12 +0800 Subject: [PATCH] Fix wrong context access in component creation. --- Assets/Cryville/Crtr/SkinPropertyKey.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Cryville/Crtr/SkinPropertyKey.cs b/Assets/Cryville/Crtr/SkinPropertyKey.cs index a6f511f..016ff5b 100644 --- a/Assets/Cryville/Crtr/SkinPropertyKey.cs +++ b/Assets/Cryville/Crtr/SkinPropertyKey.cs @@ -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");