mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 15:24:55 +08:00
- Fixed source textures being included in the build along the atlas. ***NOT BACKWARD COMPATIBLE***
This commit is contained in:
parent
d1d1c6a638
commit
73f2407f9d
@ -138,10 +138,10 @@ public class tk2dSpineSkeleton : MonoBehaviour, tk2dRuntime.ISpriteCollectionFor
|
||||
mesh.uv = uvs;
|
||||
mesh.triangles = triangles;
|
||||
|
||||
if (skeletonDataAsset.sprites.normalGenerationMode != tk2dSpriteCollection.NormalGenerationMode.None) {
|
||||
if (skeletonDataAsset.normalGenerationMode != tk2dSpriteCollection.NormalGenerationMode.None) {
|
||||
mesh.RecalculateNormals();
|
||||
|
||||
if (skeletonDataAsset.sprites.normalGenerationMode == tk2dSpriteCollection.NormalGenerationMode.NormalsAndTangents) {
|
||||
if (skeletonDataAsset.normalGenerationMode == tk2dSpriteCollection.NormalGenerationMode.NormalsAndTangents) {
|
||||
Vector4[] tangents = new Vector4[mesh.normals.Length];
|
||||
for (int t = 0; t < tangents.Length; ++t) {
|
||||
tangents[t] = new Vector4(1, 0, 0, 1);
|
||||
@ -150,7 +150,7 @@ public class tk2dSpineSkeleton : MonoBehaviour, tk2dRuntime.ISpriteCollectionFor
|
||||
}
|
||||
}
|
||||
|
||||
renderer.sharedMaterial = skeletonDataAsset.sprites.spriteCollection.inst.materials[0];
|
||||
renderer.sharedMaterial = skeletonDataAsset.spritesData.inst.materials[0];
|
||||
}
|
||||
|
||||
/*
|
||||
@ -203,7 +203,7 @@ public class tk2dSpineSkeleton : MonoBehaviour, tk2dRuntime.ISpriteCollectionFor
|
||||
}
|
||||
|
||||
public bool UsesSpriteCollection(tk2dSpriteCollectionData spriteCollection) {
|
||||
return skeletonDataAsset.sprites.spriteCollection == spriteCollection;
|
||||
return skeletonDataAsset.spritesData == spriteCollection;
|
||||
}
|
||||
|
||||
public void ForceBuild() {
|
||||
|
||||
@ -9,7 +9,9 @@ public class tk2dSpineSkeletonDataAsset : ScriptableObject {
|
||||
|
||||
/*
|
||||
*/
|
||||
public tk2dSpriteCollection sprites;
|
||||
public tk2dSpriteCollectionData spritesData;
|
||||
public tk2dSpriteCollection.NormalGenerationMode normalGenerationMode = tk2dSpriteCollection.NormalGenerationMode.None;
|
||||
|
||||
public TextAsset skeletonJSON;
|
||||
|
||||
public float scale = 1;
|
||||
@ -42,7 +44,7 @@ public class tk2dSpineSkeletonDataAsset : ScriptableObject {
|
||||
/*
|
||||
*/
|
||||
private void MakeSkeletonAndAnimationData() {
|
||||
if(sprites == null) {
|
||||
if(spritesData == null) {
|
||||
Debug.LogWarning("Sprite collection not set for skeleton data asset: " + name,this);
|
||||
return;
|
||||
}
|
||||
@ -52,7 +54,7 @@ public class tk2dSpineSkeletonDataAsset : ScriptableObject {
|
||||
return;
|
||||
}
|
||||
|
||||
SkeletonJson json = new SkeletonJson(new tk2dSpineAttachmentLoader(sprites.spriteCollection));
|
||||
SkeletonJson json = new SkeletonJson(new tk2dSpineAttachmentLoader(spritesData));
|
||||
json.Scale = scale;
|
||||
|
||||
try {
|
||||
|
||||
@ -10,18 +10,29 @@ public class tk2dSpineSkeletonDataAssetInspector : Editor {
|
||||
|
||||
/*
|
||||
*/
|
||||
private SerializedProperty sprites;
|
||||
private SerializedProperty skeletonJSON;
|
||||
private SerializedProperty scale;
|
||||
private SerializedProperty fromAnimation;
|
||||
private SerializedProperty toAnimation;
|
||||
private SerializedProperty duration;
|
||||
private bool showAnimationStateData = true;
|
||||
|
||||
|
||||
private tk2dSpriteCollection sprites;
|
||||
|
||||
/*
|
||||
*/
|
||||
void OnEnable () {
|
||||
sprites = serializedObject.FindProperty("sprites");
|
||||
|
||||
tk2dSpineSkeletonDataAsset skeletonDataAsset = target as tk2dSpineSkeletonDataAsset;
|
||||
|
||||
if (skeletonDataAsset != null) {
|
||||
tk2dSpriteCollectionData spritesData = skeletonDataAsset.spritesData;
|
||||
|
||||
if (spritesData != null) {
|
||||
sprites = AssetDatabase.LoadAssetAtPath( AssetDatabase.GUIDToAssetPath(spritesData.spriteCollectionGUID), typeof(tk2dSpriteCollection) ) as tk2dSpriteCollection;
|
||||
}
|
||||
}
|
||||
|
||||
skeletonJSON = serializedObject.FindProperty("skeletonJSON");
|
||||
scale = serializedObject.FindProperty("scale");
|
||||
fromAnimation = serializedObject.FindProperty("fromAnimation");
|
||||
@ -37,7 +48,22 @@ public class tk2dSpineSkeletonDataAssetInspector : Editor {
|
||||
tk2dSpineSkeletonDataAsset asset = target as tk2dSpineSkeletonDataAsset;
|
||||
|
||||
EditorGUIUtility.LookLikeInspector();
|
||||
EditorGUILayout.PropertyField(sprites);
|
||||
sprites = EditorGUILayout.ObjectField("Sprites", sprites, typeof(tk2dSpriteCollection), false) as tk2dSpriteCollection;
|
||||
|
||||
if (sprites != null) {
|
||||
SerializedProperty spritesData = serializedObject.FindProperty("spritesData");
|
||||
spritesData.objectReferenceValue = sprites.spriteCollection;
|
||||
|
||||
SerializedProperty normalGenerationMode = serializedObject.FindProperty("normalGenerationMode");
|
||||
normalGenerationMode.enumValueIndex = (int)sprites.normalGenerationMode;
|
||||
} else {
|
||||
SerializedProperty spritesData = serializedObject.FindProperty("spritesData");
|
||||
spritesData.objectReferenceValue = null;
|
||||
|
||||
SerializedProperty normalGenerationMode = serializedObject.FindProperty("normalGenerationMode");
|
||||
normalGenerationMode.enumValueIndex = (int)tk2dSpriteCollection.NormalGenerationMode.None;
|
||||
}
|
||||
|
||||
EditorGUILayout.PropertyField(skeletonJSON);
|
||||
EditorGUILayout.PropertyField(scale);
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user