Răsfoiți Sursa

[unity] Some fixes and docs for frame limit example.

pharan 6 ani în urmă
părinte
comite
55f4a2968b

+ 8 - 4
spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonAnimationFixedTimestep.cs

@@ -1,4 +1,4 @@
-/******************************************************************************
+/******************************************************************************
  * Spine Runtimes Software License v2.5
  *
  * Copyright (c) 2013-2016, Esoteric Software
@@ -30,19 +30,23 @@
 using UnityEngine;
 
 namespace Spine.Unity {
+
+	// To use this example component, add it to your SkeletonAnimation Spine GameObject.
+	// This component will disable that SkeletonAnimation component to prevent it from calling its own Update and LateUpdate methods.
+
 	[DisallowMultipleComponent]
 	public sealed class SkeletonAnimationFixedTimestep : MonoBehaviour {
 		#region Inspector
 		public SkeletonAnimation skeletonAnimation;
 
-		[Tooltip("The duration of each frame in seconds. For 12fps: enter '1/12' in the Unity inspector.")]
+		[Tooltip("The duration of each frame in seconds. For 12 fps: enter '1/12' in the Unity inspector.")]
 		public float frameDeltaTime = 1 / 15f;
 
 		[Header("Advanced")]
 		[Tooltip("The maximum number of fixed timesteps. If the game framerate drops below the If the framerate is consistently faster than the limited frames, this does nothing.")]
 		public int maxFrameSkip = 4;
 
-		[Tooltip("If enabled, the Skeleton mesh will be updated only on the same frame when the animation is updated./n/nDisable this or call SkeletonAnimation.LateUpdate yourself if you are modifying the Skeleton using other components that don't run in the same fixed timestep.")]
+		[Tooltip("If enabled, the Skeleton mesh will be updated only on the same frame when the animation and skeleton are updated. Disable this or call SkeletonAnimation.LateUpdate yourself if you are modifying the Skeleton using other components that don't run in the same fixed timestep.")]
 		public bool frameskipMeshUpdate = true;
 
 		[Tooltip("This is the amount the internal accumulator starts with. Set it to some fraction of your frame delta time if you want to stagger updates between multiple skeletons.")]
@@ -55,7 +59,7 @@ namespace Spine.Unity {
 		void OnValidate () {
 			skeletonAnimation = GetComponent<SkeletonAnimation>();
 			if (frameDeltaTime <= 0) frameDeltaTime = 1 / 60f;
-			if (maxFrameSkip <= 1) maxFrameSkip = 1;
+			if (maxFrameSkip < 1) maxFrameSkip = 1;
 		}
 
 		void Awake () {