Merge branch '3.7-beta' into 3.7-beta-ue4-cpp

This commit is contained in:
badlogic 2018-06-05 15:11:00 +02:00
commit 7899277aec
397 changed files with 7610 additions and 7509 deletions

View File

@ -138,6 +138,9 @@ namespace Spine {
bool finished = UpdateMixingFrom(from, delta);
from.animationLast = from.nextAnimationLast;
from.trackLast = from.nextTrackLast;
// Require mixTime > 0 to ensure the mixing from entry was applied at least once.
if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {
// Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).
@ -149,8 +152,6 @@ namespace Spine {
return finished;
}
from.animationLast = from.nextAnimationLast;
from.trackLast = from.nextTrackLast;
from.trackTime += delta * from.timeScale;
to.mixTime += delta * to.timeScale;
return false;

View File

@ -166,6 +166,9 @@ public class AnimationState {
boolean finished = updateMixingFrom(from, delta);
from.animationLast = from.nextAnimationLast;
from.trackLast = from.nextTrackLast;
// Require mixTime > 0 to ensure the mixing from entry was applied at least once.
if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {
// Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).
@ -177,8 +180,6 @@ public class AnimationState {
return finished;
}
from.animationLast = from.nextAnimationLast;
from.trackLast = from.nextTrackLast;
from.trackTime += delta * from.timeScale;
to.mixTime += delta * to.timeScale;
return false;

View File

@ -1,7 +1,7 @@
fileFormatVersion: 2
guid: 0cb4e560224445d44affd8e57c1ae8b1
guid: 30918bcaadaaecc42bc215ff52f75b21
folderAsset: yes
timeCreated: 1495071888
timeCreated: 1488288531
licenseType: Free
DefaultImporter:
userData:

View File

@ -1,7 +1,7 @@
fileFormatVersion: 2
guid: fc5fac7eface2ba4fbb6146017e41192
guid: ad14d5a4cd7a0444286d315541ee0495
folderAsset: yes
timeCreated: 1500876410
timeCreated: 1527569319
licenseType: Free
DefaultImporter:
userData:

View File

@ -0,0 +1,12 @@
{
"name": "spine-unity-editor",
"references": [
"spine-unity"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 173464ddf4cdb6640a4dfa8a9281ad69
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 83fbec88df35fe34bab43a5dde6788af
folderAsset: yes
timeCreated: 1527569675
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 515 B

After

Width:  |  Height:  |  Size: 515 B

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 587 B

After

Width:  |  Height:  |  Size: 587 B

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 603 B

After

Width:  |  Height:  |  Size: 603 B

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 519 B

After

Width:  |  Height:  |  Size: 519 B

View File

Before

Width:  |  Height:  |  Size: 687 B

After

Width:  |  Height:  |  Size: 687 B

View File

Before

Width:  |  Height:  |  Size: 555 B

After

Width:  |  Height:  |  Size: 555 B

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 634 B

After

Width:  |  Height:  |  Size: 634 B

View File

Before

Width:  |  Height:  |  Size: 672 B

After

Width:  |  Height:  |  Size: 672 B

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 649 B

After

Width:  |  Height:  |  Size: 649 B

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 698 B

After

Width:  |  Height:  |  Size: 698 B

View File

@ -35,31 +35,6 @@ using UnityEngine;
namespace Spine.Unity.Editor {
public static class Menus {
[MenuItem("Assets/Create/Spine/Atlas Asset")]
static public void CreateAtlas () {
CreateAsset<AtlasAsset>("New Atlas");
}
[MenuItem("Assets/Create/Spine/SkeletonData Asset")]
static public void CreateSkeletonData () {
CreateAsset<SkeletonDataAsset>("New SkeletonData");
}
static void CreateAsset<T> (String name) where T : ScriptableObject {
var dir = "Assets/";
var selected = Selection.activeObject;
if (selected != null) {
var assetDir = AssetDatabase.GetAssetPath(selected.GetInstanceID());
if (assetDir.Length > 0 && Directory.Exists(assetDir))
dir = assetDir + "/";
}
ScriptableObject asset = ScriptableObject.CreateInstance<T>();
AssetDatabase.CreateAsset(asset, dir + name + ".asset");
AssetDatabase.SaveAssets();
EditorUtility.FocusProjectWindow();
Selection.activeObject = asset;
}
[MenuItem("GameObject/Spine/SkeletonRenderer", false, 10)]
static public void CreateSkeletonRendererGameObject () {
CreateSpineGameObject<SkeletonRenderer>("New SkeletonRenderer");

View File

@ -332,7 +332,7 @@ namespace Spine.Unity.Editor {
else {
EditorGUILayout.HelpBox("Atlas array should not have null entries!", MessageType.Error);
if (SpineInspectorUtility.CenteredButton(SpineInspectorUtility.TempContent("Remove null entries"))) {
var trimmedAtlasAssets = new List<AtlasAsset>();
var trimmedAtlasAssets = new List<AtlasAssetBase>();
foreach (var a in targetSkeletonDataAsset.atlasAssets) {
if (a != null)
trimmedAtlasAssets.Add(a);
@ -651,7 +651,12 @@ namespace Spine.Unity.Editor {
SkeletonAnimation skeletonAnimation;
GameObject previewGameObject;
internal bool requiresRefresh;
#if !(UNITY_2017_4 || UNITY_2018)
float animationLastTime;
#endif
static float CurrentTime { get { return (float)EditorApplication.timeSinceStartup; } }
Action Repaint;
public event Action<string> OnSkinChanged;
@ -742,7 +747,9 @@ namespace Spine.Unity.Editor {
if (previewRenderUtility == null) {
previewRenderUtility = new PreviewRenderUtility(true);
animationLastTime = Time.realtimeSinceStartup;
#if !(UNITY_2017_4 || UNITY_2018)
animationLastTime = CurrentTime;
#endif
const int PreviewLayer = 30;
const int PreviewCameraCullingMask = 1 << PreviewLayer;
@ -770,6 +777,10 @@ namespace Spine.Unity.Editor {
skeletonAnimation.initialSkinName = skinName;
skeletonAnimation.LateUpdate();
previewGameObject.GetComponent<Renderer>().enabled = false;
#if UNITY_2017_4 || UNITY_2018
previewRenderUtility.AddSingleGO(previewGameObject);
#endif
}
if (this.ActiveTrack != null) cameraAdjustEndFrame = EditorApplication.timeSinceStartup + skeletonAnimation.AnimationState.GetCurrent(0).Alpha;
@ -813,6 +824,7 @@ namespace Spine.Unity.Editor {
previewRenderUtility.BeginStaticPreview(new Rect(0, 0, width, height));
DoRenderPreview(false);
var tex = previewRenderUtility.EndStaticPreview();
return tex;
}
@ -825,10 +837,15 @@ namespace Spine.Unity.Editor {
var renderer = go.GetComponent<Renderer>();
renderer.enabled = true;
if (!EditorApplication.isPlaying) {
skeletonAnimation.Update((Time.realtimeSinceStartup - animationLastTime));
#if !(UNITY_2017_4 || UNITY_2018)
float current = CurrentTime;
float deltaTime = (current - animationLastTime);
skeletonAnimation.Update(deltaTime);
animationLastTime = current;
#endif
skeletonAnimation.LateUpdate();
animationLastTime = Time.realtimeSinceStartup;
}
var thisPreviewUtilityCamera = this.PreviewUtilityCamera;
@ -861,7 +878,7 @@ namespace Spine.Unity.Editor {
if (previewRenderUtility == null)
return;
if (EditorApplication.timeSinceStartup < cameraAdjustEndFrame)
if (CurrentTime < cameraAdjustEndFrame)
AdjustCameraGoals();
lastCameraPositionGoal = cameraPositionGoal;

View File

@ -33,9 +33,9 @@
using UnityEditor;
namespace Spine.Unity.Editor {
[CustomEditor(typeof(SkeletonAnimator))]
[CustomEditor(typeof(SkeletonMecanim))]
[CanEditMultipleObjects]
public class SkeletonAnimatorInspector : SkeletonRendererInspector {
public class SkeletonMecanimInspector : SkeletonRendererInspector {
protected SerializedProperty mecanimTranslator;
protected override void OnEnable () {

Some files were not shown because too many files have changed in this diff Show More