mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +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 tk2dSpriteCollection.NormalGenerationMode normalGenerationMode = tk2dSpriteCollection.NormalGenerationMode.None;
|
||||||
|
|
||||||
public TextAsset skeletonJSON;
|
public TextAsset skeletonJSON;
|
||||||
|
|
||||||
public float scale = 1;
|
|
||||||
|
|
||||||
public string[] fromAnimation;
|
public string[] fromAnimation;
|
||||||
public string[] toAnimation;
|
public string[] toAnimation;
|
||||||
public float[] duration;
|
public float[] duration;
|
||||||
@ -44,8 +42,8 @@ public class tk2dSpineSkeletonDataAsset : ScriptableObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SkeletonJson json = new SkeletonJson(new tk2dSpineAttachmentLoader(spritesData));
|
SkeletonJson json = new SkeletonJson(new tk2dSpineAttachmentLoader(spritesData));
|
||||||
json.Scale = scale;
|
json.Scale = 1.0f / (spritesData.invOrthoSize * spritesData.halfTargetHeight);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
skeletonData = json.ReadSkeletonData(new StringReader(skeletonJSON.text));
|
skeletonData = json.ReadSkeletonData(new StringReader(skeletonJSON.text));
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|||||||
@ -11,7 +11,6 @@ public class tk2dSpineSkeletonDataAssetInspector : Editor {
|
|||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
private SerializedProperty skeletonJSON;
|
private SerializedProperty skeletonJSON;
|
||||||
private SerializedProperty scale;
|
|
||||||
private SerializedProperty fromAnimation;
|
private SerializedProperty fromAnimation;
|
||||||
private SerializedProperty toAnimation;
|
private SerializedProperty toAnimation;
|
||||||
private SerializedProperty duration;
|
private SerializedProperty duration;
|
||||||
@ -34,7 +33,6 @@ public class tk2dSpineSkeletonDataAssetInspector : Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
skeletonJSON = serializedObject.FindProperty("skeletonJSON");
|
skeletonJSON = serializedObject.FindProperty("skeletonJSON");
|
||||||
scale = serializedObject.FindProperty("scale");
|
|
||||||
fromAnimation = serializedObject.FindProperty("fromAnimation");
|
fromAnimation = serializedObject.FindProperty("fromAnimation");
|
||||||
toAnimation = serializedObject.FindProperty("toAnimation");
|
toAnimation = serializedObject.FindProperty("toAnimation");
|
||||||
duration = serializedObject.FindProperty("duration");
|
duration = serializedObject.FindProperty("duration");
|
||||||
@ -65,7 +63,6 @@ public class tk2dSpineSkeletonDataAssetInspector : Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EditorGUILayout.PropertyField(skeletonJSON);
|
EditorGUILayout.PropertyField(skeletonJSON);
|
||||||
EditorGUILayout.PropertyField(scale);
|
|
||||||
|
|
||||||
SkeletonData skeletonData = asset.GetSkeletonData();
|
SkeletonData skeletonData = asset.GetSkeletonData();
|
||||||
if(skeletonData != null) {
|
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