mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
[unity] Fixed compile error on older Unity versions introduced in last commit 1af0805. See #3013.
This commit is contained in:
parent
1af080578d
commit
da7d20c4bc
@ -31,6 +31,10 @@
|
|||||||
#define USE_COLLIDER_COMPOSITE_OPERATION
|
#define USE_COLLIDER_COMPOSITE_OPERATION
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if UNITY_6000_0_OR_NEWER
|
||||||
|
#define RIGIDBODY2D_USES_LINEAR_VELOCITY
|
||||||
|
#endif
|
||||||
|
|
||||||
using Spine.Unity;
|
using Spine.Unity;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@ -69,7 +73,12 @@ namespace Spine.Unity.Examples {
|
|||||||
void Launch () {
|
void Launch () {
|
||||||
RemoveRigidbody();
|
RemoveRigidbody();
|
||||||
ragdoll.Apply();
|
ragdoll.Apply();
|
||||||
ragdoll.RootRigidbody.linearVelocity = new Vector2(Random.Range(-launchVelocity.x, launchVelocity.x), launchVelocity.y);
|
Vector2 velocity = new Vector2(Random.Range(-launchVelocity.x, launchVelocity.x), launchVelocity.y);
|
||||||
|
#if RIGIDBODY2D_USES_LINEAR_VELOCITY
|
||||||
|
ragdoll.RootRigidbody.linearVelocity = velocity;
|
||||||
|
#else
|
||||||
|
ragdoll.RootRigidbody.velocity = velocity;
|
||||||
|
#endif
|
||||||
StartCoroutine(WaitUntilStopped());
|
StartCoroutine(WaitUntilStopped());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user