Windows Phone 8 complation fixed (BufferedStream changed to FileStream)

RaggedySpineboy - changed fixedAngle to freezeRotation for Unity 5.1

Changed SkeletonRagdoll2D #if UNITY_5_0 to UNITY_5
This commit is contained in:
Tomasz Jaworski 2015-06-18 18:01:59 +02:00
parent 876b845d16
commit 14803b4fab
3 changed files with 12 additions and 2 deletions

View File

@ -86,7 +86,13 @@ namespace Spine {
using (var input = new BufferedStream(Microsoft.Xna.Framework.TitleContainer.OpenStream(path)))
{
#else
using (var input = new BufferedStream(new FileStream(path, FileMode.Open))) {
#if UNITY_WP8 || UNITY_WP8_1
using (var input = new FileStream(path, FileMode.Open))
{
#else
using (var input = new BufferedStream(new FileStream(path, FileMode.Open)))
{
#endif
#endif
SkeletonData skeletonData = ReadSkeletonData(input);
skeletonData.name = Path.GetFileNameWithoutExtension(path);

View File

@ -18,7 +18,11 @@ public class RaggedySpineboy : MonoBehaviour {
void AddRigidbody () {
var rb = gameObject.AddComponent<Rigidbody2D>();
#if UNITY_5_1
rb.freezeRotation = true;
#else
rb.fixedAngle = true;
#endif
naturalCollider.enabled = true;
}

View File

@ -280,7 +280,7 @@ public class SkeletonRagdoll2D : MonoBehaviour {
if (colliders.Count == 0) {
var box = go.AddComponent<BoxCollider2D>();
box.size = new Vector2(length, thickness);
#if UNITY_5_0
#if UNITY_5
box.offset = new Vector2((b.WorldFlipX ? -length : length) / 2, 0);
#else
box.center = new Vector2((b.WorldFlipX ? -length : length) / 2, 0);