mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-13 10:38:46 +08:00
Compute scale using sprite collection's target ortho size. Removed scale from skeletondata asset.
This commit is contained in:
parent
4ea202a1e6
commit
b096766fe5
@ -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) {
|
||||
|
||||
@ -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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user