mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-19 08:16:41 +08:00
SkeletonAnimator update
Unity5 compatibility pass
This commit is contained in:
parent
f25f33fbc5
commit
9c7b95ff30
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -68,13 +68,13 @@ public class SpineboyController : MonoBehaviour {
|
||||
|
||||
if (absX > 0.7f) {
|
||||
SetAnimation(runAnimation, true);
|
||||
rigidbody2D.velocity = new Vector2(runVelocity * Mathf.Sign(x), rigidbody2D.velocity.y);
|
||||
GetComponent<Rigidbody2D>().velocity = new Vector2(runVelocity * Mathf.Sign(x), GetComponent<Rigidbody2D>().velocity.y);
|
||||
} else if (absX > 0) {
|
||||
SetAnimation(walkAnimation, true);
|
||||
rigidbody2D.velocity = new Vector2(walkVelocity * Mathf.Sign(x), rigidbody2D.velocity.y);
|
||||
GetComponent<Rigidbody2D>().velocity = new Vector2(walkVelocity * Mathf.Sign(x), GetComponent<Rigidbody2D>().velocity.y);
|
||||
} else {
|
||||
SetAnimation(idleAnimation, true);
|
||||
rigidbody2D.velocity = new Vector2(0, rigidbody2D.velocity.y);
|
||||
GetComponent<Rigidbody2D>().velocity = new Vector2(0, GetComponent<Rigidbody2D>().velocity.y);
|
||||
}
|
||||
} else {
|
||||
if (skeletonAnimation.state.GetCurrent(0).Animation.Name != hitAnimation)
|
||||
@ -101,7 +101,7 @@ public class SpineboyController : MonoBehaviour {
|
||||
} else {
|
||||
skeletonAnimation.state.SetAnimation(0, hitAnimation, false);
|
||||
skeletonAnimation.state.AddAnimation(0, currentAnimation, true, 0);
|
||||
rigidbody2D.velocity = new Vector2(0, rigidbody2D.velocity.y);
|
||||
GetComponent<Rigidbody2D>().velocity = new Vector2(0, GetComponent<Rigidbody2D>().velocity.y);
|
||||
hit = true;
|
||||
}
|
||||
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -20,6 +20,9 @@ TextureImporter:
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
@ -30,6 +33,7 @@ TextureImporter:
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
@ -45,3 +49,5 @@ TextureImporter:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -27,6 +27,11 @@
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
* SkeletonAnimatorInspector created by Mitch Thompson
|
||||
* Full irrevocable rights and permissions granted to Esoteric Software
|
||||
*****************************************************************************/
|
||||
using System;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
@ -39,15 +44,11 @@ public class SkeletonAnimatorInspector : SkeletonRendererInspector {
|
||||
protected override void OnEnable () {
|
||||
base.OnEnable();
|
||||
layerMixModes = serializedObject.FindProperty("layerMixModes");
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected override void gui () {
|
||||
base.gui();
|
||||
|
||||
|
||||
EditorGUILayout.PropertyField(layerMixModes, true);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -89,20 +89,32 @@ public static class SkeletonBaker {
|
||||
|
||||
var skeletonData = skeletonDataAsset.GetSkeletonData(true);
|
||||
bool hasAnimations = bakeAnimations && skeletonData.Animations.Count > 0;
|
||||
#if UNITY_5
|
||||
UnityEditor.Animations.AnimatorController controller = null;
|
||||
#else
|
||||
UnityEditorInternal.AnimatorController controller = null;
|
||||
|
||||
#endif
|
||||
if (hasAnimations) {
|
||||
string controllerPath = outputPath + "/" + skeletonDataAsset.skeletonJSON.name + " Controller.controller";
|
||||
bool newAnimContainer = false;
|
||||
|
||||
var runtimeController = AssetDatabase.LoadAssetAtPath(controllerPath, typeof(RuntimeAnimatorController));
|
||||
|
||||
#if UNITY_5
|
||||
if (runtimeController != null) {
|
||||
controller = (UnityEditor.Animations.AnimatorController)runtimeController;
|
||||
} else {
|
||||
controller = UnityEditor.Animations.AnimatorController.CreateAnimatorControllerAtPath(controllerPath);
|
||||
newAnimContainer = true;
|
||||
}
|
||||
#else
|
||||
if (runtimeController != null) {
|
||||
controller = (UnityEditorInternal.AnimatorController)runtimeController;
|
||||
} else {
|
||||
controller = UnityEditorInternal.AnimatorController.CreateAnimatorControllerAtPath(controllerPath);
|
||||
newAnimContainer = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
Dictionary<string, AnimationClip> existingClipTable = new Dictionary<string, AnimationClip>();
|
||||
List<string> unusedClipNames = new List<string>();
|
||||
@ -147,7 +159,12 @@ public static class SkeletonBaker {
|
||||
unusedClipNames.Remove(clip.name);
|
||||
} else {
|
||||
AssetDatabase.AddObjectToAsset(clip, controller);
|
||||
AnimatorController.AddAnimationClipToController(controller, clip);
|
||||
#if UNITY_5_0
|
||||
controller.AddMotion(clip);
|
||||
#else
|
||||
UnityEditorInternal.AnimatorController.AddAnimationClipToController(controller, clip);
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -308,8 +325,8 @@ public static class SkeletonBaker {
|
||||
attachmentTransform.gameObject.AddComponent<MeshRenderer>();
|
||||
}
|
||||
|
||||
attachmentTransform.renderer.sharedMaterial = material;
|
||||
attachmentTransform.renderer.sortingOrder = i;
|
||||
attachmentTransform.GetComponent<Renderer>().sharedMaterial = material;
|
||||
attachmentTransform.GetComponent<Renderer>().sortingOrder = i;
|
||||
|
||||
if (attachmentName != slotData.AttachmentName)
|
||||
attachmentTransform.gameObject.SetActive(false);
|
||||
@ -365,23 +382,40 @@ public static class SkeletonBaker {
|
||||
string controllerPath = dataPath.Replace("_SkeletonData", "_Controller").Replace(".asset", ".controller");
|
||||
|
||||
|
||||
|
||||
AnimatorController controller;
|
||||
#if UNITY_5
|
||||
UnityEditor.Animations.AnimatorController controller;
|
||||
|
||||
if (skeletonDataAsset.controller != null) {
|
||||
controller = (AnimatorController)skeletonDataAsset.controller;
|
||||
controller = (UnityEditor.Animations.AnimatorController)skeletonDataAsset.controller;
|
||||
} else {
|
||||
if (File.Exists(controllerPath)) {
|
||||
if (EditorUtility.DisplayDialog("Controller Overwrite Warning", "Unknown Controller already exists at: " + controllerPath, "Update", "Overwrite")) {
|
||||
controller = (AnimatorController)AssetDatabase.LoadAssetAtPath(controllerPath, typeof(RuntimeAnimatorController));
|
||||
controller = (UnityEditor.Animations.AnimatorController)AssetDatabase.LoadAssetAtPath(controllerPath, typeof(RuntimeAnimatorController));
|
||||
} else {
|
||||
controller = (AnimatorController)AnimatorController.CreateAnimatorControllerAtPath(controllerPath);
|
||||
controller = (UnityEditor.Animations.AnimatorController)UnityEditor.Animations.AnimatorController.CreateAnimatorControllerAtPath(controllerPath);
|
||||
}
|
||||
} else {
|
||||
controller = (AnimatorController)AnimatorController.CreateAnimatorControllerAtPath(controllerPath);
|
||||
controller = (UnityEditor.Animations.AnimatorController)UnityEditor.Animations.AnimatorController.CreateAnimatorControllerAtPath(controllerPath);
|
||||
}
|
||||
|
||||
}
|
||||
#else
|
||||
UnityEditorInternal.AnimatorController controller;
|
||||
|
||||
if (skeletonDataAsset.controller != null) {
|
||||
controller = (UnityEditorInternal.AnimatorController)skeletonDataAsset.controller;
|
||||
} else {
|
||||
if (File.Exists(controllerPath)) {
|
||||
if (EditorUtility.DisplayDialog("Controller Overwrite Warning", "Unknown Controller already exists at: " + controllerPath, "Update", "Overwrite")) {
|
||||
controller = (UnityEditorInternal.AnimatorController)AssetDatabase.LoadAssetAtPath(controllerPath, typeof(RuntimeAnimatorController));
|
||||
} else {
|
||||
controller = (UnityEditorInternal.AnimatorController)UnityEditorInternal.AnimatorController.CreateAnimatorControllerAtPath(controllerPath);
|
||||
}
|
||||
} else {
|
||||
controller = (UnityEditorInternal.AnimatorController)UnityEditorInternal.AnimatorController.CreateAnimatorControllerAtPath(controllerPath);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
skeletonDataAsset.controller = controller;
|
||||
EditorUtility.SetDirty(skeletonDataAsset);
|
||||
@ -405,7 +439,11 @@ public static class SkeletonBaker {
|
||||
//generate new dummy clip
|
||||
AnimationClip newClip = new AnimationClip();
|
||||
newClip.name = name;
|
||||
#if UNITY_5
|
||||
#else
|
||||
AnimationUtility.SetAnimationType(newClip, ModelImporterAnimationType.Generic);
|
||||
#endif
|
||||
|
||||
AssetDatabase.AddObjectToAsset(newClip, controller);
|
||||
clipTable.Add(name, newClip);
|
||||
}
|
||||
@ -735,10 +773,14 @@ public static class SkeletonBaker {
|
||||
}
|
||||
|
||||
static void SetAnimationSettings (AnimationClip clip, AnimationClipSettings settings) {
|
||||
#if UNITY_5
|
||||
AnimationUtility.SetAnimationClipSettings(clip, settings);
|
||||
#else
|
||||
MethodInfo methodInfo = typeof(AnimationUtility).GetMethod("SetAnimationClipSettings", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
methodInfo.Invoke(null, new object[] { clip, settings });
|
||||
|
||||
EditorUtility.SetDirty(clip);
|
||||
#endif
|
||||
}
|
||||
|
||||
static AnimationClip ExtractAnimation (string name, SkeletonData skeletonData, Dictionary<int, List<string>> slotLookup, bool bakeIK, SendMessageOptions eventOptions, AnimationClip clip = null) {
|
||||
@ -753,7 +795,11 @@ public static class SkeletonBaker {
|
||||
AnimationUtility.SetAnimationEvents(clip, new AnimationEvent[0]);
|
||||
}
|
||||
|
||||
#if UNITY_5
|
||||
|
||||
#else
|
||||
AnimationUtility.SetAnimationType(clip, ModelImporterAnimationType.Generic);
|
||||
#endif
|
||||
|
||||
clip.name = name;
|
||||
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -528,7 +528,7 @@ public class SkeletonDataAssetInspector : Editor {
|
||||
if (this.m_previewUtility == null) {
|
||||
this.m_lastTime = Time.realtimeSinceStartup;
|
||||
this.m_previewUtility = new PreviewRenderUtility(true);
|
||||
this.m_previewUtility.m_Camera.isOrthoGraphic = true;
|
||||
this.m_previewUtility.m_Camera.orthographic = true;
|
||||
this.m_previewUtility.m_Camera.orthographicSize = 1;
|
||||
this.m_previewUtility.m_Camera.cullingMask = -2147483648;
|
||||
this.m_previewUtility.m_Camera.nearClipPlane = 0.01f;
|
||||
@ -554,7 +554,7 @@ public class SkeletonDataAssetInspector : Editor {
|
||||
|
||||
m_skeletonData = m_skeletonAnimation.skeletonDataAsset.GetSkeletonData(true);
|
||||
|
||||
m_previewInstance.renderer.enabled = false;
|
||||
m_previewInstance.GetComponent<Renderer>().enabled = false;
|
||||
|
||||
m_initialized = true;
|
||||
AdjustCameraGoals(true);
|
||||
@ -624,7 +624,7 @@ public class SkeletonDataAssetInspector : Editor {
|
||||
|
||||
GameObject go = this.m_previewInstance;
|
||||
|
||||
Bounds bounds = go.renderer.bounds;
|
||||
Bounds bounds = go.GetComponent<Renderer>().bounds;
|
||||
m_orthoGoal = bounds.size.y;
|
||||
|
||||
m_posGoal = bounds.center + new Vector3(0, 0, -10);
|
||||
@ -661,7 +661,7 @@ public class SkeletonDataAssetInspector : Editor {
|
||||
GameObject go = this.m_previewInstance;
|
||||
|
||||
if (m_requireRefresh && go != null) {
|
||||
go.renderer.enabled = true;
|
||||
go.GetComponent<Renderer>().enabled = true;
|
||||
|
||||
if (EditorApplication.isPlaying) {
|
||||
//do nothing
|
||||
@ -683,7 +683,7 @@ public class SkeletonDataAssetInspector : Editor {
|
||||
}
|
||||
|
||||
this.m_previewUtility.m_Camera.Render();
|
||||
go.renderer.enabled = false;
|
||||
go.GetComponent<Renderer>().enabled = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -3,3 +3,5 @@ guid: 66988de88a15abd4e8846c6805485f57
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -2,3 +2,5 @@ fileFormatVersion: 2
|
||||
guid: 43227e5adadc6f24bb4bf74b92a56fb4
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -3,3 +3,5 @@ guid: 913475501bf19374c84390868a9d6d3d
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -3,3 +3,5 @@ guid: 1e8a610c9e01c3648bac42585e5fc676
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -3,3 +3,5 @@ guid: bd83c75f51f5e23498ae22ffcdfe92c3
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -1,4 +1,38 @@
|
||||
using UnityEngine;
|
||||
/******************************************************************************
|
||||
* Spine Runtimes Software License
|
||||
* Version 2.1
|
||||
*
|
||||
* Copyright (c) 2013, Esoteric Software
|
||||
* All rights reserved.
|
||||
*
|
||||
* You are granted a perpetual, non-exclusive, non-sublicensable and
|
||||
* non-transferable license to install, execute and perform the Spine Runtimes
|
||||
* Software (the "Software") solely for internal use. Without the written
|
||||
* permission of Esoteric Software (typically granted by licensing Spine), you
|
||||
* may not (a) modify, translate, adapt or otherwise create derivative works,
|
||||
* improvements of the Software or develop new applications using the Software
|
||||
* or (b) remove, delete, alter or obscure any trademarks or any copyright,
|
||||
* trademark, patent or other intellectual property or proprietary rights
|
||||
* notices on or in the Software, including any copy thereof. Redistributions
|
||||
* in binary or source form must include this license and terms.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
* EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
* SkeletonAnimator created by Mitch Thompson
|
||||
* Full irrevocable rights and permissions granted to Esoteric Software
|
||||
*****************************************************************************/
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Spine;
|
||||
@ -69,10 +103,15 @@ public class SkeletonAnimator : SkeletonRenderer, ISkeletonAnimation {
|
||||
layerWeight = 1;
|
||||
|
||||
var stateInfo = animator.GetCurrentAnimatorStateInfo(i);
|
||||
var clipInfo = animator.GetCurrentAnimationClipState(i);
|
||||
var nextStateInfo = animator.GetNextAnimatorStateInfo(i);
|
||||
var nextClipInfo = animator.GetNextAnimationClipState(i);
|
||||
|
||||
#if UNITY_5
|
||||
var clipInfo = animator.GetCurrentAnimatorClipInfo(i);
|
||||
var nextClipInfo = animator.GetNextAnimatorClipInfo(i);
|
||||
#else
|
||||
var clipInfo = animator.GetCurrentAnimationClipState(i);
|
||||
var nextClipInfo = animator.GetNextAnimationClipState(i);
|
||||
#endif
|
||||
MixMode mode = layerMixModes[i];
|
||||
|
||||
if (mode == MixMode.AlwaysMix) {
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -76,8 +76,8 @@ public class SkeletonRenderer : MonoBehaviour {
|
||||
public virtual void Reset () {
|
||||
if (meshFilter != null)
|
||||
meshFilter.sharedMesh = null;
|
||||
if (renderer != null)
|
||||
renderer.sharedMaterial = null;
|
||||
if (GetComponent<Renderer>() != null)
|
||||
GetComponent<Renderer>().sharedMaterial = null;
|
||||
|
||||
if (mesh1 != null) {
|
||||
if (Application.isPlaying)
|
||||
@ -225,7 +225,7 @@ public class SkeletonRenderer : MonoBehaviour {
|
||||
submeshMaterials.CopyTo(sharedMaterials);
|
||||
else
|
||||
sharedMaterials = submeshMaterials.ToArray();
|
||||
renderer.sharedMaterials = sharedMaterials;
|
||||
GetComponent<Renderer>().sharedMaterials = sharedMaterials;
|
||||
|
||||
// Ensure mesh data is the right size.
|
||||
Vector3[] vertices = this.vertices;
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -246,7 +246,7 @@ public class SkeletonUtilityBoneInspector : Editor {
|
||||
bool CanCreateHingeChain () {
|
||||
if (utilityBone == null)
|
||||
return false;
|
||||
if (utilityBone.rigidbody != null)
|
||||
if (utilityBone.GetComponent<Rigidbody>() != null)
|
||||
return false;
|
||||
if (utilityBone.bone != null && utilityBone.bone.Children.Count == 0)
|
||||
return false;
|
||||
@ -266,7 +266,7 @@ public class SkeletonUtilityBoneInspector : Editor {
|
||||
AttachRigidbody(utilBone);
|
||||
}
|
||||
|
||||
utilityBone.rigidbody.isKinematic = true;
|
||||
utilityBone.GetComponent<Rigidbody>().isKinematic = true;
|
||||
|
||||
foreach (var utilBone in utilBoneArr) {
|
||||
if (utilBone == utilityBone)
|
||||
@ -276,13 +276,13 @@ public class SkeletonUtilityBoneInspector : Editor {
|
||||
|
||||
HingeJoint joint = utilBone.gameObject.AddComponent<HingeJoint>();
|
||||
joint.axis = Vector3.forward;
|
||||
joint.connectedBody = utilBone.transform.parent.rigidbody;
|
||||
joint.connectedBody = utilBone.transform.parent.GetComponent<Rigidbody>();
|
||||
joint.useLimits = true;
|
||||
JointLimits limits = new JointLimits();
|
||||
limits.min = -20;
|
||||
limits.max = 20;
|
||||
joint.limits = limits;
|
||||
utilBone.rigidbody.mass = utilBone.transform.parent.rigidbody.mass * 0.75f;
|
||||
utilBone.GetComponent<Rigidbody>().mass = utilBone.transform.parent.GetComponent<Rigidbody>().mass * 0.75f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -338,11 +338,11 @@ public class SkeletonUtility : MonoBehaviour {
|
||||
SkeletonUtilitySubmeshRenderer s = go.AddComponent<SkeletonUtilitySubmeshRenderer>();
|
||||
s.sortingOrder = i * 10;
|
||||
s.submeshIndex = i;
|
||||
s.Initialize(renderer);
|
||||
s.Initialize(GetComponent<Renderer>());
|
||||
s.Update();
|
||||
}
|
||||
|
||||
if (disablePrimaryRenderer)
|
||||
renderer.enabled = false;
|
||||
GetComponent<Renderer>().enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -57,7 +57,7 @@ public class SkeletonUtilityKinematicShadow : MonoBehaviour {
|
||||
continue;
|
||||
|
||||
foreach (var sb in shadowBones) {
|
||||
if (sb.rigidbody == null)
|
||||
if (sb.GetComponent<Rigidbody>() == null)
|
||||
continue;
|
||||
|
||||
if (sb.boneName == b.boneName) {
|
||||
@ -72,8 +72,8 @@ public class SkeletonUtilityKinematicShadow : MonoBehaviour {
|
||||
}
|
||||
|
||||
void FixedUpdate () {
|
||||
shadowRoot.rigidbody.MovePosition(transform.position);
|
||||
shadowRoot.rigidbody.MoveRotation(transform.rotation);
|
||||
shadowRoot.GetComponent<Rigidbody>().MovePosition(transform.position);
|
||||
shadowRoot.GetComponent<Rigidbody>().MoveRotation(transform.rotation);
|
||||
|
||||
foreach (var pair in shadowTable) {
|
||||
pair.Value.localPosition = pair.Key.localPosition;
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -16,7 +16,7 @@ public class SkeletonUtilitySubmeshRenderer : MonoBehaviour {
|
||||
MeshFilter parentFilter;
|
||||
|
||||
void Awake () {
|
||||
cachedRenderer = renderer;
|
||||
cachedRenderer = GetComponent<Renderer>();
|
||||
sharedMaterials = cachedRenderer.sharedMaterials;
|
||||
filter = GetComponent<MeshFilter>();
|
||||
|
||||
@ -53,13 +53,13 @@ public class SkeletonUtilitySubmeshRenderer : MonoBehaviour {
|
||||
}
|
||||
|
||||
if (cachedRenderer == null)
|
||||
cachedRenderer = renderer;
|
||||
cachedRenderer = GetComponent<Renderer>();
|
||||
|
||||
if (mesh == null || submeshIndex > mesh.subMeshCount - 1) {
|
||||
cachedRenderer.enabled = false;
|
||||
return;
|
||||
} else {
|
||||
renderer.enabled = true;
|
||||
GetComponent<Renderer>().enabled = true;
|
||||
}
|
||||
|
||||
bool changed = false;
|
||||
@ -71,7 +71,7 @@ public class SkeletonUtilitySubmeshRenderer : MonoBehaviour {
|
||||
|
||||
|
||||
|
||||
for (int i = 0; i < renderer.sharedMaterials.Length; i++) {
|
||||
for (int i = 0; i < GetComponent<Renderer>().sharedMaterials.Length; i++) {
|
||||
if (i == submeshIndex)
|
||||
continue;
|
||||
|
||||
|
||||
@ -10,3 +10,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@ -6,3 +6,5 @@ MonoImporter:
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user