Compute scale using sprite collection's target ortho size. Removed scale from skeletondata asset.

This commit is contained in:
NathanSweet 2013-06-03 21:18:12 +02:00
parent 4ea202a1e6
commit b096766fe5
6 changed files with 3 additions and 8 deletions

View File

@ -8,9 +8,7 @@ public class tk2dSpineSkeletonDataAsset : ScriptableObject {
public tk2dSpriteCollection.NormalGenerationMode normalGenerationMode = tk2dSpriteCollection.NormalGenerationMode.None;
public TextAsset skeletonJSON;
public float scale = 1;
public string[] fromAnimation;
public string[] toAnimation;
public float[] duration;
@ -44,8 +42,8 @@ public class tk2dSpineSkeletonDataAsset : ScriptableObject {
}
SkeletonJson json = new SkeletonJson(new tk2dSpineAttachmentLoader(spritesData));
json.Scale = scale;
json.Scale = 1.0f / (spritesData.invOrthoSize * spritesData.halfTargetHeight);
try {
skeletonData = json.ReadSkeletonData(new StringReader(skeletonJSON.text));
} catch (Exception ex) {

View File

@ -11,7 +11,6 @@ public class tk2dSpineSkeletonDataAssetInspector : Editor {
/*
*/
private SerializedProperty skeletonJSON;
private SerializedProperty scale;
private SerializedProperty fromAnimation;
private SerializedProperty toAnimation;
private SerializedProperty duration;
@ -34,7 +33,6 @@ public class tk2dSpineSkeletonDataAssetInspector : Editor {
}
skeletonJSON = serializedObject.FindProperty("skeletonJSON");
scale = serializedObject.FindProperty("scale");
fromAnimation = serializedObject.FindProperty("fromAnimation");
toAnimation = serializedObject.FindProperty("toAnimation");
duration = serializedObject.FindProperty("duration");
@ -65,7 +63,6 @@ public class tk2dSpineSkeletonDataAssetInspector : Editor {
}
EditorGUILayout.PropertyField(skeletonJSON);
EditorGUILayout.PropertyField(scale);
SkeletonData skeletonData = asset.GetSkeletonData();
if(skeletonData != null) {

Binary file not shown.