Don't serialize computed fields.

This commit is contained in:
NathanSweet 2014-04-26 20:00:07 +02:00
parent 57b5f3a35f
commit 197614ecb2
6 changed files with 13 additions and 5 deletions

View File

@ -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;

View File

@ -37,7 +37,9 @@ using Spine;
/// <summary>Renders a skeleton.</summary>
[ExecuteInEditMode, RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
public class SkeletonRenderer : MonoBehaviour {
[System.NonSerialized]
public bool valid;
[System.NonSerialized]
public Skeleton skeleton;
public SkeletonDataAsset skeletonDataAsset;

View File

@ -41,8 +41,8 @@ public class Spineboy : MonoBehaviour {
skeletonAnimation = GetComponent<SkeletonAnimation>();
// 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);
}

View File

@ -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;

View File

@ -37,9 +37,11 @@ using Spine;
/// <summary>Renders a skeleton.</summary>
[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;

View File

@ -41,8 +41,8 @@ public class Spineboy : MonoBehaviour {
skeletonAnimation = GetComponent<SkeletonAnimation>();
// 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);
}