mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 10:16:01 +08:00
Merge branch 'master' of https://github.com/EsotericSoftware/spine-runtimes
This commit is contained in:
commit
345f45d8a5
@ -147,9 +147,14 @@ public class SkeletonDataAssetInspector : Editor {
|
|||||||
GUILayout.Space(32);
|
GUILayout.Space(32);
|
||||||
if (GUILayout.Button(new GUIContent("Generate Mecanim Controller"), GUILayout.Width(195), GUILayout.Height(20)))
|
if (GUILayout.Button(new GUIContent("Generate Mecanim Controller"), GUILayout.Width(195), GUILayout.Height(20)))
|
||||||
SkeletonBaker.GenerateMecanimAnimationClips(m_skeletonDataAsset);
|
SkeletonBaker.GenerateMecanimAnimationClips(m_skeletonDataAsset);
|
||||||
//GUILayout.Label(new GUIContent("Alternative to SkeletonAnimation, not a requirement.", SpineEditorUtilities.Icons.warning));
|
|
||||||
GUILayout.EndHorizontal();
|
GUILayout.EndHorizontal();
|
||||||
EditorGUILayout.LabelField("SkeletonAnimator is the Mecanim alternative to SkeletonAnimation. It is not required.", EditorStyles.miniLabel);
|
EditorGUILayout.LabelField("SkeletonAnimator is the Mecanim alternative to SkeletonAnimation. It is not required.", EditorStyles.miniLabel);
|
||||||
|
} else {
|
||||||
|
GUILayout.BeginHorizontal();
|
||||||
|
GUILayout.Space(32);
|
||||||
|
if (GUILayout.Button(new GUIContent("Update Controller Animations"), GUILayout.Width(195), GUILayout.Height(20)))
|
||||||
|
SkeletonBaker.GenerateMecanimAnimationClips(m_skeletonDataAsset);
|
||||||
|
GUILayout.EndHorizontal();
|
||||||
}
|
}
|
||||||
EditorGUI.indentLevel--;
|
EditorGUI.indentLevel--;
|
||||||
}
|
}
|
||||||
@ -228,6 +233,7 @@ public class SkeletonDataAssetInspector : Editor {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawReimportButton () {
|
void DrawReimportButton () {
|
||||||
EditorGUI.BeginDisabledGroup(skeletonJSON.objectReferenceValue == null);
|
EditorGUI.BeginDisabledGroup(skeletonJSON.objectReferenceValue == null);
|
||||||
if (GUILayout.Button(new GUIContent("Attempt Reimport", SpineEditorUtilities.Icons.warning))) {
|
if (GUILayout.Button(new GUIContent("Attempt Reimport", SpineEditorUtilities.Icons.warning))) {
|
||||||
@ -302,10 +308,14 @@ public class SkeletonDataAssetInspector : Editor {
|
|||||||
if (!showAnimationList)
|
if (!showAnimationList)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (GUILayout.Button(new GUIContent("Setup Pose", SpineEditorUtilities.Icons.skeleton), GUILayout.Width(105), GUILayout.Height(18))) {
|
if (m_skeletonAnimation != null && m_skeletonAnimation.state != null) {
|
||||||
StopAnimation();
|
if (GUILayout.Button(new GUIContent("Setup Pose", SpineEditorUtilities.Icons.skeleton), GUILayout.Width(105), GUILayout.Height(18))) {
|
||||||
m_skeletonAnimation.skeleton.SetToSetupPose();
|
StopAnimation();
|
||||||
m_requireRefresh = true;
|
m_skeletonAnimation.skeleton.SetToSetupPose();
|
||||||
|
m_requireRefresh = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
EditorGUILayout.HelpBox("Animations can be previewed if you expand the Preview window below.", MessageType.Info);
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorGUILayout.LabelField("Name", "Duration");
|
EditorGUILayout.LabelField("Name", "Duration");
|
||||||
@ -498,6 +508,10 @@ public class SkeletonDataAssetInspector : Editor {
|
|||||||
private Color m_originColor = new Color(0.3f, 0.3f, 0.3f, 1);
|
private Color m_originColor = new Color(0.3f, 0.3f, 0.3f, 1);
|
||||||
|
|
||||||
private void StopAnimation () {
|
private void StopAnimation () {
|
||||||
|
if (m_skeletonAnimation == null) {
|
||||||
|
Debug.LogWarning("Animation was stopped but preview doesn't exist. It's possible that the Preview Panel is closed.");
|
||||||
|
}
|
||||||
|
|
||||||
m_skeletonAnimation.state.ClearTrack(0);
|
m_skeletonAnimation.state.ClearTrack(0);
|
||||||
m_playing = false;
|
m_playing = false;
|
||||||
}
|
}
|
||||||
@ -562,7 +576,7 @@ public class SkeletonDataAssetInspector : Editor {
|
|||||||
m_initialized = true;
|
m_initialized = true;
|
||||||
AdjustCameraGoals(true);
|
AdjustCameraGoals(true);
|
||||||
} catch {
|
} catch {
|
||||||
|
// WARNING: Suppresses errors.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -861,6 +875,7 @@ public class SkeletonDataAssetInspector : Editor {
|
|||||||
if (position.Contains(current.mousePosition)) {
|
if (position.Contains(current.mousePosition)) {
|
||||||
|
|
||||||
m_orthoGoal += current.delta.y;
|
m_orthoGoal += current.delta.y;
|
||||||
|
m_orthoGoal = Mathf.Max(0.01f, m_orthoGoal);
|
||||||
GUIUtility.hotControl = controlID;
|
GUIUtility.hotControl = controlID;
|
||||||
current.Use();
|
current.Use();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user