mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[spine-unity] Fix SkeletonGhostRenderer namespace.
This commit is contained in:
parent
ebd8831a17
commit
bde07221b3
@ -1,4 +1,4 @@
|
||||
/*****************************************************************************
|
||||
/*****************************************************************************
|
||||
* SkeletonGhostRenderer created by Mitch Thompson
|
||||
* Full irrevocable rights and permissions granted to Esoteric Software
|
||||
*****************************************************************************/
|
||||
@ -6,6 +6,7 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Spine.Unity.Modules {
|
||||
public class SkeletonGhostRenderer : MonoBehaviour {
|
||||
|
||||
public float fadeSpeed = 10;
|
||||
@ -24,21 +25,16 @@ public class SkeletonGhostRenderer : MonoBehaviour {
|
||||
StopAllCoroutines();
|
||||
|
||||
gameObject.SetActive(true);
|
||||
|
||||
|
||||
meshRenderer.sharedMaterials = materials;
|
||||
meshRenderer.sortingLayerID = sortingLayerID;
|
||||
meshRenderer.sortingOrder = sortingOrder;
|
||||
|
||||
meshFilter.sharedMesh = (Mesh)Instantiate(mesh);
|
||||
|
||||
meshFilter.sharedMesh = Instantiate(mesh);
|
||||
colors = meshFilter.sharedMesh.colors32;
|
||||
|
||||
if ((color.a + color.r + color.g + color.b) > 0) {
|
||||
for (int i = 0; i < colors.Length; i++) {
|
||||
for (int i = 0; i < colors.Length; i++)
|
||||
colors[i] = color;
|
||||
}
|
||||
}
|
||||
|
||||
fadeSpeed = speed;
|
||||
|
||||
@ -51,7 +47,6 @@ public class SkeletonGhostRenderer : MonoBehaviour {
|
||||
IEnumerator Fade () {
|
||||
Color32 c;
|
||||
for (int t = 0; t < 500; t++) {
|
||||
|
||||
bool breakout = true;
|
||||
for (int i = 0; i < colors.Length; i++) {
|
||||
c = colors[i];
|
||||
@ -60,16 +55,15 @@ public class SkeletonGhostRenderer : MonoBehaviour {
|
||||
|
||||
colors[i] = Color32.Lerp(c, black, Time.deltaTime * fadeSpeed);
|
||||
}
|
||||
|
||||
meshFilter.sharedMesh.colors32 = colors;
|
||||
|
||||
if (breakout)
|
||||
break;
|
||||
|
||||
yield return null;
|
||||
}
|
||||
|
||||
Destroy(meshFilter.sharedMesh);
|
||||
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
@ -108,3 +102,5 @@ public class SkeletonGhostRenderer : MonoBehaviour {
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user