mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
0b56367409
Binary file not shown.
Binary file not shown.
@ -0,0 +1,20 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class SpineBlinkPlayer : MonoBehaviour {
|
||||
const int BlinkTrack = 1;
|
||||
|
||||
[SpineAnimation]
|
||||
public string blinkAnimation;
|
||||
public float minimumDelay = 0.15f;
|
||||
public float maximumDelay = 3f;
|
||||
|
||||
IEnumerator Start () {
|
||||
var skeletonAnimation = GetComponent<SkeletonAnimation>(); if (skeletonAnimation == null) yield break;
|
||||
while (true) {
|
||||
skeletonAnimation.state.SetAnimation(SpineBlinkPlayer.BlinkTrack, blinkAnimation, false);
|
||||
yield return new WaitForSeconds(Random.Range(minimumDelay, maximumDelay));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a5ef44bf3e0d864794c0da71c84363d
|
||||
timeCreated: 1455509353
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -29,10 +29,15 @@
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#if (UNITY_5_0 || UNITY_5_1 || UNITY_4)
|
||||
#define PREUNITY_5_2
|
||||
#endif
|
||||
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections;
|
||||
|
||||
#if !(PREUNITY_5_2)
|
||||
namespace Spine.Unity {
|
||||
/// <summary>This is for testing and educational purposes only. This takes about 10 times longer to render than ArraySpineMeshGenerator.</summary>
|
||||
public class VertexHelperSpineMeshGenerator : ISimpleMeshGenerator {
|
||||
@ -94,7 +99,6 @@ namespace Spine.Unity {
|
||||
mesh.SetUVs(0, uvs);
|
||||
mesh.SetNormals(normals);
|
||||
mesh.SetTriangles(indices, 0);
|
||||
|
||||
mesh.RecalculateBounds();
|
||||
}
|
||||
|
||||
@ -233,3 +237,4 @@ namespace Spine.Unity {
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
using UnityEngine;
|
||||
#if (UNITY_5_0 || UNITY_5_1 || UNITY_4)
|
||||
#define PREUNITY_5_2
|
||||
#endif
|
||||
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
using UnityEditor;
|
||||
@ -9,6 +13,7 @@ public class SkeletonGraphicInspector : Editor {
|
||||
SerializedProperty material_, color_;
|
||||
SerializedProperty skeletonDataAsset_, initialSkinName_;
|
||||
SerializedProperty startingAnimation_, startingLoop_, timeScale_, freeze_;
|
||||
#if !PREUNITY_5_2
|
||||
SerializedProperty raycastTarget_;
|
||||
|
||||
SkeletonGraphic thisSkeletonGraphic;
|
||||
@ -201,4 +206,5 @@ public class SkeletonGraphicInspector : Editor {
|
||||
return go;
|
||||
}
|
||||
#endregion
|
||||
#endif
|
||||
}
|
||||
@ -29,6 +29,10 @@
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#if (UNITY_5_0 || UNITY_5_1 || UNITY_4)
|
||||
#define PREUNITY_5_2
|
||||
#endif
|
||||
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using UnityEngine.UI;
|
||||
@ -54,8 +58,7 @@ public class SkeletonGraphic : MaskableGraphic {
|
||||
protected override void OnValidate () {
|
||||
// This handles Scene View preview.
|
||||
base.OnValidate ();
|
||||
this.raycastTarget = false;
|
||||
|
||||
#if !PREUNITY_5_2
|
||||
if (this.IsValid) {
|
||||
if (skeletonDataAsset == null) {
|
||||
Clear();
|
||||
@ -78,6 +81,9 @@ public class SkeletonGraphic : MaskableGraphic {
|
||||
if (skeletonDataAsset != null)
|
||||
Initialize(true);
|
||||
}
|
||||
#else
|
||||
Debug.LogWarning("SkeletonGraphic requres Unity 5.2 or higher.\nUnityEngine.UI 5.1 and below does not accept meshes and can't be used to render Spine skeletons. You may delete the SkeletonGraphic folder under `Modules` if you want to exclude it from your project." );
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@ -90,6 +96,7 @@ public class SkeletonGraphic : MaskableGraphic {
|
||||
#endif
|
||||
#endregion
|
||||
|
||||
#if !PREUNITY_5_2
|
||||
#region Internals
|
||||
// This is used by the UI system to determine what to put in the MaterialPropertyBlock.
|
||||
public override Texture mainTexture {
|
||||
@ -206,4 +213,5 @@ public class SkeletonGraphic : MaskableGraphic {
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endif
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user