From 197614ecb210057ec5144775f63fab0e12ef16bc Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Sat, 26 Apr 2014 20:00:07 +0200 Subject: [PATCH] Don't serialize computed fields. --- spine-tk2d/Assets/Spine/BoneComponent.cs | 2 ++ spine-tk2d/Assets/Spine/SkeletonRenderer.cs | 2 ++ spine-tk2d/Assets/examples/spineboy/Spineboy.cs | 4 ++-- spine-unity/Assets/Spine/BoneComponent.cs | 2 ++ spine-unity/Assets/Spine/SkeletonRenderer.cs | 4 +++- spine-unity/Assets/examples/spineboy/Spineboy.cs | 4 ++-- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/spine-tk2d/Assets/Spine/BoneComponent.cs b/spine-tk2d/Assets/Spine/BoneComponent.cs index ea88c227e..4486f3343 100644 --- a/spine-tk2d/Assets/Spine/BoneComponent.cs +++ b/spine-tk2d/Assets/Spine/BoneComponent.cs @@ -38,7 +38,9 @@ using Spine; [ExecuteInEditMode] [AddComponentMenu("Spine/BoneComponent")] public class BoneComponent : MonoBehaviour { + [System.NonSerialized] public bool valid; + public SkeletonRenderer skeletonRenderer; public Bone bone; diff --git a/spine-tk2d/Assets/Spine/SkeletonRenderer.cs b/spine-tk2d/Assets/Spine/SkeletonRenderer.cs index 69c668079..c46708d4f 100644 --- a/spine-tk2d/Assets/Spine/SkeletonRenderer.cs +++ b/spine-tk2d/Assets/Spine/SkeletonRenderer.cs @@ -37,7 +37,9 @@ using Spine; /// Renders a skeleton. [ExecuteInEditMode, RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))] public class SkeletonRenderer : MonoBehaviour { + [System.NonSerialized] public bool valid; + [System.NonSerialized] public Skeleton skeleton; public SkeletonDataAsset skeletonDataAsset; diff --git a/spine-tk2d/Assets/examples/spineboy/Spineboy.cs b/spine-tk2d/Assets/examples/spineboy/Spineboy.cs index 615b0e4e0..04bcbd931 100644 --- a/spine-tk2d/Assets/examples/spineboy/Spineboy.cs +++ b/spine-tk2d/Assets/examples/spineboy/Spineboy.cs @@ -41,8 +41,8 @@ public class Spineboy : MonoBehaviour { skeletonAnimation = GetComponent(); // Call our method any time an animation fires an event. skeletonAnimation.state.Event += Event; - // Queue jump to be played on track 0 three seconds after the starting animation. - skeletonAnimation.state.AddAnimation(0, "jump", false, 3); + // Queue jump to be played on track 0 two seconds after the starting animation. + skeletonAnimation.state.AddAnimation(0, "jump", false, 2); // Queue walk to be looped on track 0 after the jump animation. skeletonAnimation.state.AddAnimation(0, "run", true, 0); } diff --git a/spine-unity/Assets/Spine/BoneComponent.cs b/spine-unity/Assets/Spine/BoneComponent.cs index ea88c227e..4486f3343 100644 --- a/spine-unity/Assets/Spine/BoneComponent.cs +++ b/spine-unity/Assets/Spine/BoneComponent.cs @@ -38,7 +38,9 @@ using Spine; [ExecuteInEditMode] [AddComponentMenu("Spine/BoneComponent")] public class BoneComponent : MonoBehaviour { + [System.NonSerialized] public bool valid; + public SkeletonRenderer skeletonRenderer; public Bone bone; diff --git a/spine-unity/Assets/Spine/SkeletonRenderer.cs b/spine-unity/Assets/Spine/SkeletonRenderer.cs index eab839b7f..fc5a6dc3c 100644 --- a/spine-unity/Assets/Spine/SkeletonRenderer.cs +++ b/spine-unity/Assets/Spine/SkeletonRenderer.cs @@ -37,9 +37,11 @@ using Spine; /// Renders a skeleton. [ExecuteInEditMode, RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))] public class SkeletonRenderer : MonoBehaviour { + [System.NonSerialized] public bool valid; + [System.NonSerialized] public Skeleton skeleton; - + public SkeletonDataAsset skeletonDataAsset; public String initialSkinName; public bool calculateNormals; diff --git a/spine-unity/Assets/examples/spineboy/Spineboy.cs b/spine-unity/Assets/examples/spineboy/Spineboy.cs index a97e632a5..86921e512 100644 --- a/spine-unity/Assets/examples/spineboy/Spineboy.cs +++ b/spine-unity/Assets/examples/spineboy/Spineboy.cs @@ -41,8 +41,8 @@ public class Spineboy : MonoBehaviour { skeletonAnimation = GetComponent(); // Call our method any time an animation fires an event. skeletonAnimation.state.Event += Event; - // Queue jump to be played on track 0 tree seconds after the starting animation. - skeletonAnimation.state.AddAnimation(0, "jump", false, 3); + // Queue jump to be played on track 0 two seconds after the starting animation. + skeletonAnimation.state.AddAnimation(0, "jump", false, 2); // Queue walk to be looped on track 0 after the jump animation. skeletonAnimation.state.AddAnimation(0, "run", true, 0); }