mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Merge branch '3.8' into 3.9-beta
This commit is contained in:
commit
56c45856de
@ -35,6 +35,7 @@ namespace spine {
|
|||||||
|
|
||||||
AttachmentVertices::AttachmentVertices (Texture2D* texture, int verticesCount, unsigned short* triangles, int trianglesCount) {
|
AttachmentVertices::AttachmentVertices (Texture2D* texture, int verticesCount, unsigned short* triangles, int trianglesCount) {
|
||||||
_texture = texture;
|
_texture = texture;
|
||||||
|
if (_texture) _texture->retain();
|
||||||
|
|
||||||
_triangles = new TrianglesCommand::Triangles();
|
_triangles = new TrianglesCommand::Triangles();
|
||||||
_triangles->verts = new V3F_C4B_T2F[verticesCount];
|
_triangles->verts = new V3F_C4B_T2F[verticesCount];
|
||||||
@ -46,6 +47,7 @@ AttachmentVertices::AttachmentVertices (Texture2D* texture, int verticesCount, u
|
|||||||
AttachmentVertices::~AttachmentVertices () {
|
AttachmentVertices::~AttachmentVertices () {
|
||||||
delete [] _triangles->verts;
|
delete [] _triangles->verts;
|
||||||
delete _triangles;
|
delete _triangles;
|
||||||
|
if (_texture) _texture->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -696,11 +696,8 @@ namespace Spine.Unity.Editor {
|
|||||||
SkeletonAnimation skeletonAnimation;
|
SkeletonAnimation skeletonAnimation;
|
||||||
GameObject previewGameObject;
|
GameObject previewGameObject;
|
||||||
internal bool requiresRefresh;
|
internal bool requiresRefresh;
|
||||||
|
|
||||||
#if !SPINE_UNITY_2018_PREVIEW_API
|
|
||||||
float animationLastTime;
|
float animationLastTime;
|
||||||
#endif
|
|
||||||
|
|
||||||
static float CurrentTime { get { return (float)EditorApplication.timeSinceStartup; } }
|
static float CurrentTime { get { return (float)EditorApplication.timeSinceStartup; } }
|
||||||
|
|
||||||
Action Repaint;
|
Action Repaint;
|
||||||
@ -793,10 +790,8 @@ namespace Spine.Unity.Editor {
|
|||||||
|
|
||||||
if (previewRenderUtility == null) {
|
if (previewRenderUtility == null) {
|
||||||
previewRenderUtility = new PreviewRenderUtility(true);
|
previewRenderUtility = new PreviewRenderUtility(true);
|
||||||
#if !SPINE_UNITY_2018_PREVIEW_API
|
|
||||||
animationLastTime = CurrentTime;
|
animationLastTime = CurrentTime;
|
||||||
#endif
|
|
||||||
|
|
||||||
const int PreviewLayer = 30;
|
const int PreviewLayer = 30;
|
||||||
const int PreviewCameraCullingMask = 1 << PreviewLayer;
|
const int PreviewCameraCullingMask = 1 << PreviewLayer;
|
||||||
|
|
||||||
@ -885,12 +880,10 @@ namespace Spine.Unity.Editor {
|
|||||||
|
|
||||||
|
|
||||||
if (!EditorApplication.isPlaying) {
|
if (!EditorApplication.isPlaying) {
|
||||||
#if !SPINE_UNITY_2018_PREVIEW_API
|
|
||||||
float current = CurrentTime;
|
float current = CurrentTime;
|
||||||
float deltaTime = (current - animationLastTime);
|
float deltaTime = (current - animationLastTime);
|
||||||
skeletonAnimation.Update(deltaTime);
|
skeletonAnimation.Update(deltaTime);
|
||||||
animationLastTime = current;
|
animationLastTime = current;
|
||||||
#endif
|
|
||||||
skeletonAnimation.LateUpdate();
|
skeletonAnimation.LateUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user