Skin select box and goblins example for Unity.

This commit is contained in:
NathanSweet 2013-04-24 18:41:57 +02:00
parent 86e75d96d7
commit 4b9b17e190
69 changed files with 474 additions and 295 deletions

View File

@ -1,4 +1,2 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 89dad76e10ea944ee9f29109535294be guid: 89dad76e10ea944ee9f29109535294be
DefaultImporter:
userData:

View File

@ -1,4 +1,2 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 65ba3309ea8c447678ade95f3fa398da guid: 65ba3309ea8c447678ade95f3fa398da
DefaultImporter:
userData:

View File

@ -1,4 +1,2 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 3ac78ae082927411cba77d73efde27d4 guid: 3ac78ae082927411cba77d73efde27d4
DefaultImporter:
userData:

View File

@ -5,4 +5,3 @@ MonoImporter:
defaultReferences: [] defaultReferences: []
executionOrder: 0 executionOrder: 0
icon: {instanceID: 0} icon: {instanceID: 0}
userData:

View File

@ -5,4 +5,3 @@ MonoImporter:
defaultReferences: [] defaultReferences: []
executionOrder: 0 executionOrder: 0
icon: {instanceID: 0} icon: {instanceID: 0}
userData:

View File

@ -29,10 +29,11 @@ using UnityEngine;
[CustomEditor(typeof(SkeletonComponent))] [CustomEditor(typeof(SkeletonComponent))]
public class SkeletonComponentInspector : Editor { public class SkeletonComponentInspector : Editor {
private SerializedProperty skeletonDataAsset, animationName, loop, timeScale; private SerializedProperty skeletonDataAsset, animationName, skinName, loop, timeScale;
void OnEnable () { void OnEnable () {
skeletonDataAsset = serializedObject.FindProperty("skeletonDataAsset"); skeletonDataAsset = serializedObject.FindProperty("skeletonDataAsset");
skinName = serializedObject.FindProperty("skinName");
animationName = serializedObject.FindProperty("animationName"); animationName = serializedObject.FindProperty("animationName");
loop = serializedObject.FindProperty("loop"); loop = serializedObject.FindProperty("loop");
timeScale = serializedObject.FindProperty("timeScale"); timeScale = serializedObject.FindProperty("timeScale");
@ -46,6 +47,24 @@ public class SkeletonComponentInspector : Editor {
EditorGUILayout.PropertyField(skeletonDataAsset); EditorGUILayout.PropertyField(skeletonDataAsset);
if (component.skeleton != null) { if (component.skeleton != null) {
// Skin name.
String[] skins = new String[component.skeleton.Data.Skins.Count + 1];
int skinIndex = 0;
for (int i = 0; i < skins.Length - 1; i++) {
String name = component.skeleton.Data.Skins[i].Name;
skins[i] = name;
if (name == skinName.stringValue) skinIndex = i;
}
EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField("Skin");
EditorGUIUtility.LookLikeControls();
skinIndex = EditorGUILayout.Popup(skinIndex, skins);
EditorGUIUtility.LookLikeInspector();
EditorGUILayout.EndHorizontal();
skinName.stringValue = skinIndex == 0 ? null : skins[skinIndex];
// Animation name. // Animation name.
String[] animations = new String[component.skeleton.Data.Animations.Count + 1]; String[] animations = new String[component.skeleton.Data.Animations.Count + 1];
animations[0] = "<None>"; animations[0] = "<None>";
@ -53,8 +72,7 @@ public class SkeletonComponentInspector : Editor {
for (int i = 0; i < animations.Length - 1; i++) { for (int i = 0; i < animations.Length - 1; i++) {
String name = component.skeleton.Data.Animations[i].Name; String name = component.skeleton.Data.Animations[i].Name;
animations[i + 1] = name; animations[i + 1] = name;
if (name == animationName.stringValue) if (name == animationName.stringValue) animationIndex = i + 1;
animationIndex = i + 1;
} }
EditorGUILayout.BeginHorizontal(); EditorGUILayout.BeginHorizontal();
@ -75,10 +93,10 @@ public class SkeletonComponentInspector : Editor {
EditorGUILayout.PropertyField(timeScale); EditorGUILayout.PropertyField(timeScale);
if (!Application.isPlaying) { if (serializedObject.ApplyModifiedProperties() ||
if (serializedObject.ApplyModifiedProperties() || (Event.current.type == EventType.ValidateCommand && Event.current.commandName == "UndoRedoPerformed")
(Event.current.type == EventType.ValidateCommand && Event.current.commandName == "UndoRedoPerformed") ) {
) { if (!Application.isPlaying) {
component.Clear(); component.Clear();
component.Update(); component.Update();
} }

View File

@ -5,4 +5,3 @@ MonoImporter:
defaultReferences: [] defaultReferences: []
executionOrder: 0 executionOrder: 0
icon: {instanceID: 0} icon: {instanceID: 0}
userData:

View File

@ -5,4 +5,3 @@ MonoImporter:
defaultReferences: [] defaultReferences: []
executionOrder: 0 executionOrder: 0
icon: {instanceID: 0} icon: {instanceID: 0}
userData:

View File

@ -1,4 +1,2 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: c6674329008ae4c65a7b7e8f1b2a6523 guid: c6674329008ae4c65a7b7e8f1b2a6523
DefaultImporter:
userData:

View File

@ -5,4 +5,3 @@ MonoImporter:
defaultReferences: [] defaultReferences: []
executionOrder: 0 executionOrder: 0
icon: {instanceID: 0} icon: {instanceID: 0}
userData:

View File

@ -32,6 +32,7 @@ using Spine;
public class SkeletonComponent : MonoBehaviour { public class SkeletonComponent : MonoBehaviour {
public SkeletonDataAsset skeletonDataAsset; public SkeletonDataAsset skeletonDataAsset;
public Skeleton skeleton; public Skeleton skeleton;
public String skinName;
public String animationName; public String animationName;
public bool loop; public bool loop;
public float timeScale = 1; public float timeScale = 1;
@ -80,15 +81,26 @@ public class SkeletonComponent : MonoBehaviour {
Initialize(); Initialize();
// Keep AnimationState in sync with animationName and loop fields. // Keep AnimationState in sync with animationName and loop fields.
if (animationName == null && state.Animation != null) if (animationName == null || animationName.Length == 0) {
state.ClearAnimation(); if (state.Animation != null) state.ClearAnimation();
else if (state.Animation == null || animationName != state.Animation.Name) { } else if (state.Animation == null || animationName != state.Animation.Name) {
Spine.Animation animation = skeleton.Data.FindAnimation(animationName); Spine.Animation animation = skeleton.Data.FindAnimation(animationName);
if (animation != null) if (animation != null)
state.SetAnimation(animation, loop); state.SetAnimation(animation, loop);
} }
state.Loop = loop; state.Loop = loop;
// Keep Skeleton in sync with skinName.
if (skinName == null || skinName.Length == 0) {
if (skeleton.Skin != null) {
skeleton.SetSkin((Skin)null);
skeleton.SetSlotsToBindPose();
}
} else if (skeleton.Skin == null || skinName != skeleton.Skin.Name) {
skeleton.SetSkin(skinName);
skeleton.SetSlotsToBindPose();
}
UpdateAnimation(); UpdateAnimation();
// Count quads. // Count quads.
@ -107,6 +119,7 @@ public class SkeletonComponent : MonoBehaviour {
vertices = new Vector3[quadCount * 4]; vertices = new Vector3[quadCount * 4];
uvs = new Vector2[quadCount * 4]; uvs = new Vector2[quadCount * 4];
triangles = new int[quadCount * 6]; triangles = new int[quadCount * 6];
mesh.Clear();
} }
// Setup mesh. // Setup mesh.
@ -125,18 +138,11 @@ public class SkeletonComponent : MonoBehaviour {
vertices[vertexIndex + 2] = new Vector3(regionVertices[RegionAttachment.X2], regionVertices[RegionAttachment.Y2], 0); vertices[vertexIndex + 2] = new Vector3(regionVertices[RegionAttachment.X2], regionVertices[RegionAttachment.Y2], 0);
vertices[vertexIndex + 3] = new Vector3(regionVertices[RegionAttachment.X3], regionVertices[RegionAttachment.Y3], 0); vertices[vertexIndex + 3] = new Vector3(regionVertices[RegionAttachment.X3], regionVertices[RegionAttachment.Y3], 0);
AtlasRegion region = regionAttachment.Region; float[] regionUVs = regionAttachment.UVs;
if (region.rotate) { uvs[vertexIndex] = new Vector2(regionUVs[RegionAttachment.X1], 1 - regionUVs[RegionAttachment.Y1]);
uvs[vertexIndex + 1] = new Vector2(region.u, 1 - region.v2); uvs[vertexIndex + 1] = new Vector2(regionUVs[RegionAttachment.X4], 1 - regionUVs[RegionAttachment.Y4]);
uvs[vertexIndex + 2] = new Vector2(region.u2, 1 - region.v2); uvs[vertexIndex + 2] = new Vector2(regionUVs[RegionAttachment.X2], 1 - regionUVs[RegionAttachment.Y2]);
uvs[vertexIndex + 3] = new Vector2(region.u, 1 - region.v); uvs[vertexIndex + 3] = new Vector2(regionUVs[RegionAttachment.X3], 1 - regionUVs[RegionAttachment.Y3]);
uvs[vertexIndex] = new Vector2(region.u2, 1 - region.v);
} else {
uvs[vertexIndex] = new Vector2(region.u, 1 - region.v2);
uvs[vertexIndex + 1] = new Vector2(region.u2, 1 - region.v2);
uvs[vertexIndex + 2] = new Vector2(region.u, 1 - region.v);
uvs[vertexIndex + 3] = new Vector2(region.u2, 1 - region.v);
}
int index = quadIndex * 6; int index = quadIndex * 6;
triangles[index] = vertexIndex; triangles[index] = vertexIndex;

View File

@ -5,4 +5,3 @@ MonoImporter:
defaultReferences: [] defaultReferences: []
executionOrder: 0 executionOrder: 0
icon: {instanceID: 0} icon: {instanceID: 0}
userData:

View File

@ -5,4 +5,3 @@ MonoImporter:
defaultReferences: [] defaultReferences: []
executionOrder: 0 executionOrder: 0
icon: {instanceID: 0} icon: {instanceID: 0}
userData:

View File

@ -1,4 +1,2 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 1b62d1da83172ed4f9bfc9077b196f79 guid: 1b62d1da83172ed4f9bfc9077b196f79
DefaultImporter:
userData:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0420fbdc5d996d142a6850f8bc69b789
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 04676fb0853784d40a83ea746566d7d9
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f053f134e4ff2fe489038eabf85706e2
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -98,8 +98,13 @@ namespace Spine {
region.u = x / (float)page.width; region.u = x / (float)page.width;
region.v = y / (float)page.height; region.v = y / (float)page.height;
region.u2 = (x + width) / (float)page.width; if (region.rotate) {
region.v2 = (y + height) / (float)page.height; region.u2 = (x + height) / (float)page.width;
region.v2 = (y + width) / (float)page.height;
} else {
region.u2 = (x + width) / (float)page.width;
region.v2 = (y + height) / (float)page.height;
}
region.x = x; region.x = x;
region.y = y; region.y = y;
region.width = Math.Abs(width); region.width = Math.Abs(width);

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 6e3ac7a5e853f8c418686b97eb793a49
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: eca0339f92705724385840be789d03e3

View File

@ -40,7 +40,14 @@ namespace Spine {
AtlasRegion region = atlas.FindRegion(name); AtlasRegion region = atlas.FindRegion(name);
if (region == null) throw new Exception("Region not found in atlas: " + name + " (" + type + ")"); if (region == null) throw new Exception("Region not found in atlas: " + name + " (" + type + ")");
RegionAttachment attachment = new RegionAttachment(name); RegionAttachment attachment = new RegionAttachment(name);
attachment.Region = region; attachment.Texture = region.page.texture;
attachment.SetUVs(region.u, region.v, region.u2, region.v2, region.rotate);
attachment.RegionOffsetX = region.offsetX;
attachment.RegionOffsetY = region.offsetY;
attachment.RegionWidth = region.width;
attachment.RegionHeight = region.height;
attachment.RegionOriginalWidth = region.originalWidth;
attachment.RegionOriginalHeight = region.originalHeight;
return attachment; return attachment;
} }
throw new Exception("Unknown attachment type: " + type); throw new Exception("Unknown attachment type: " + type);

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0c1ff82f1740b034480656d1ea5ba5c9
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3a9d34b8d423e46439ed489f9088a81a
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d55032acb28c73c4287a3a500e318215
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b8cd583653fbdab46a2ed87a0eb729d3
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -45,45 +45,61 @@ namespace Spine {
public float Width { get; set; } public float Width { get; set; }
public float Height { get; set; } public float Height { get; set; }
public Object Texture { get; set; }
public float RegionOffsetX { get; set; }
public float RegionOffsetY { get; set; } // Pixels stripped from the bottom left, unrotated.
public float RegionWidth { get; set; }
public float RegionHeight { get; set; } // Unrotated, stripped size.
public float RegionOriginalWidth { get; set; }
public float RegionOriginalHeight { get; set; } // Unrotated, unstripped size.
public float[] Offset { get; private set; } public float[] Offset { get; private set; }
public float[] Vertices { get; private set; } public float[] Vertices { get; private set; }
public AtlasRegion Region { get; set; } public float[] UVs { get; private set; }
public RegionAttachment (string name) public RegionAttachment (string name)
: base(name) { : base(name) {
Offset = new float[8]; Offset = new float[8];
Vertices = new float[8]; Vertices = new float[8];
UVs = new float[8];
ScaleX = 1; ScaleX = 1;
ScaleY = 1; ScaleY = 1;
} }
public void SetUVs (float u, float v, float u2, float v2, bool rotate) {
float[] uvs = UVs;
if (rotate) {
uvs[X2] = u;
uvs[Y2] = v2;
uvs[X3] = u;
uvs[Y3] = v;
uvs[X4] = u2;
uvs[Y4] = v;
uvs[X1] = u2;
uvs[Y1] = v2;
} else {
uvs[X1] = u;
uvs[Y1] = v2;
uvs[X2] = u;
uvs[Y2] = v;
uvs[X3] = u2;
uvs[Y3] = v;
uvs[X4] = u2;
uvs[Y4] = v2;
}
}
public void UpdateOffset () { public void UpdateOffset () {
float width = Width; float width = Width;
float height = Height; float height = Height;
float localX2 = width / 2;
float localY2 = height / 2;
float localX = -localX2;
float localY = -localY2;
AtlasRegion region = Region;
if (region != null) {
if (region.rotate) {
localX += region.offsetX / region.originalWidth * height;
localY += region.offsetY / region.originalHeight * width;
localX2 -= (region.originalWidth - region.offsetX - region.height) / region.originalWidth * width;
localY2 -= (region.originalHeight - region.offsetY - region.width) / region.originalHeight * height;
} else {
localX += region.offsetX / region.originalWidth * width;
localY += region.offsetY / region.originalHeight * height;
localX2 -= (region.originalWidth - region.offsetX - region.width) / region.originalWidth * width;
localY2 -= (region.originalHeight - region.offsetY - region.height) / region.originalHeight * height;
}
}
float scaleX = ScaleX; float scaleX = ScaleX;
float scaleY = ScaleY; float scaleY = ScaleY;
localX *= scaleX; float regionScaleX = width / RegionOriginalWidth * scaleX;
localY *= scaleY; float regionScaleY = height / RegionOriginalHeight * scaleY;
localX2 *= scaleX; float localX = -width / 2 * scaleX + RegionOffsetX * regionScaleX;
localY2 *= scaleY; float localY = -height / 2 * scaleY + RegionOffsetY * regionScaleY;
float localX2 = localX + RegionWidth * regionScaleX;
float localY2 = localY + RegionHeight * regionScaleY;
float radians = Rotation * (float)Math.PI / 180; float radians = Rotation * (float)Math.PI / 180;
float cos = (float)Math.Cos(radians); float cos = (float)Math.Cos(radians);
float sin = (float)Math.Sin(radians); float sin = (float)Math.Sin(radians);

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: cf530751ed6f2d94684dd5d3f0a46b32
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9ac20594bc8a0214bacc799c1a24584b
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 40e05d62889ff8f49a201a4207075ab7
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 543c95fda2aa74849b8bd90a810318a7
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c3d73fa94450faf4eb0073fa19e30a62
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: db93a39a328e01d479bcd2820c7b1137
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: db9e0e85729911e4c9d3ca5638cd016d
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3a8af7042d0b3f54cbae97de4504bab7
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 6486acd3c3094b44288f9fc6666aaf65
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ea1befda235c3cf429acd2a0b095e74b
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -1,4 +1,2 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: b41395738f68d4fbba8311d333db62b1 guid: b41395738f68d4fbba8311d333db62b1
DefaultImporter:
userData:

View File

@ -1,4 +1,2 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 1e8a610c9e01c3648bac42585e5fc676 guid: 1e8a610c9e01c3648bac42585e5fc676
ShaderImporter:
userData:

View File

@ -1,4 +1,2 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: e6712a5a0c05f9f4092f9a3197925e99 guid: e6712a5a0c05f9f4092f9a3197925e99
DefaultImporter:
userData:

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 97269dddd903cfd469a75f320a0cef8f

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 4e70126bb9873e841b4935b7275730cc

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 618309bc7071d724ca2dbfd70e14feef

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 78ac5e44b15e8a7418ea5313951ea050

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 3f474a0bd32d8d448afdbe538067b5a7

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: a8b1d5a7e1dcd0e42aee4a2ec763e0d0

View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 6982507deb28dc243803f492193a3d7f
DefaultImporter:
userData:

View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: fc3c1868caff80847bef02256afc1929
NativeFormatImporter:
userData:

View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 03bd08e6a86550d43862ec7c8d3299fa
NativeFormatImporter:
userData:

View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 6cc4b79878746da48a07ee8a3e0539f8
NativeFormatImporter:
userData:

View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: b82102ea5922f7c4d814eef0895967ca
DefaultImporter:
userData:

View File

@ -1,4 +1,2 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 63d11713f97bfe54bb06572e24050ecb guid: 63d11713f97bfe54bb06572e24050ecb
DefaultImporter:
userData:

View File

@ -3,283 +3,283 @@ goblins.png
format: RGBA8888 format: RGBA8888
filter: Linear,Linear filter: Linear,Linear
repeat: none repeat: none
images/spear spear
rotate: false rotate: true
xy: 2, 142 xy: 2, 104
size: 22, 368 size: 22, 368
orig: 22, 368 orig: 22, 368
offset: 0, 0 offset: 0, 0
index: -1 index: -1
images/goblingirl/head goblingirl/head
rotate: false rotate: false
xy: 26, 429 xy: 2, 23
size: 103, 81 size: 103, 79
orig: 103, 81 orig: 103, 81
offset: 0, 0 offset: 0, 2
index: -1 index: -1
images/goblin/head goblin/head
rotate: false rotate: false
xy: 26, 361 xy: 107, 38
size: 103, 66 size: 103, 64
orig: 103, 66 orig: 103, 66
offset: 0, 0 offset: 0, 0
index: -1 index: -1
images/goblin/torso goblin/torso
rotate: false rotate: true
xy: 131, 414 xy: 212, 34
size: 68, 96 size: 68, 96
orig: 68, 96 orig: 68, 96
offset: 0, 0 offset: 0, 0
index: -1 index: -1
images/goblingirl/torso goblin/right-upper-leg
rotate: false rotate: true
xy: 26, 263 xy: 107, 2
size: 68, 96 size: 34, 63
orig: 68, 96 orig: 34, 63
offset: 0, 0 offset: 0, 0
index: -1 index: -1
images/dagger goblin/left-lower-leg
rotate: true
xy: 172, 2
size: 30, 70
orig: 33, 70
offset: 2, 0
index: -1
goblingirl/left-lower-leg
rotate: true
xy: 244, 2
size: 30, 70
orig: 33, 70
offset: 2, 0
index: -1
goblin/undie-straps
rotate: false rotate: false
xy: 26, 153 xy: 2, 2
size: 55, 19
orig: 55, 19
offset: 0, 0
index: -1
dagger
rotate: true
xy: 372, 100
size: 26, 108 size: 26, 108
orig: 26, 108 orig: 156, 238
offset: 100, 30
index: -1
goblingirl/torso
rotate: true
xy: 482, 60
size: 66, 96
orig: 68, 96
offset: 0, 0 offset: 0, 0
index: -1 index: -1
images/goblin/right-lower-leg goblin/right-lower-leg
rotate: false rotate: true
xy: 201, 434 xy: 580, 91
size: 36, 76 size: 35, 76
orig: 36, 76 orig: 36, 76
offset: 0, 0 offset: 1, 0
index: -1 index: -1
images/goblingirl/right-lower-leg goblingirl/right-lower-leg
rotate: false rotate: true
xy: 54, 185 xy: 658, 91
size: 36, 76 size: 35, 76
orig: 36, 76 orig: 36, 76
offset: 0, 0 offset: 1, 0
index: -1 index: -1
images/goblin/left-upper-leg goblin/left-upper-leg
rotate: false rotate: true
xy: 96, 286 xy: 736, 93
size: 33, 73 size: 33, 73
orig: 33, 73 orig: 33, 73
offset: 0, 0 offset: 0, 0
index: -1 index: -1
images/goblin/pelvis goblin/pelvis
rotate: false rotate: true
xy: 131, 369 xy: 310, 40
size: 62, 43 size: 62, 43
orig: 62, 43 orig: 62, 43
offset: 0, 0 offset: 0, 0
index: -1 index: -1
images/goblingirl/pelvis goblin/left-hand
rotate: true
xy: 316, 2
size: 36, 41
orig: 36, 41
offset: 0, 0
index: -1
goblingirl/left-upper-leg
rotate: true
xy: 811, 93
size: 33, 70
orig: 33, 70
offset: 0, 0
index: -1
goblin/left-foot
rotate: false rotate: false
xy: 131, 324 xy: 883, 95
size: 62, 43 size: 65, 31
orig: 65, 31
offset: 0, 0
index: -1
goblingirl/left-foot
rotate: false
xy: 950, 95
size: 65, 31
orig: 65, 31
offset: 0, 0
index: -1
goblin/right-foot
rotate: false
xy: 580, 56
size: 63, 33
orig: 63, 33
offset: 0, 0
index: -1
goblingirl/right-foot
rotate: false
xy: 645, 56
size: 63, 33
orig: 63, 33
offset: 0, 0
index: -1
goblingirl/pelvis
rotate: false
xy: 355, 55
size: 59, 43
orig: 62, 43 orig: 62, 43
offset: 0, 0 offset: 1, 0
index: -1 index: -1
images/goblin/right-foot goblingirl/right-upper-leg
rotate: false rotate: true
xy: 131, 289 xy: 416, 64
size: 63, 33
orig: 63, 33
offset: 0, 0
index: -1
images/goblin/left-lower-leg
rotate: false
xy: 2, 70
size: 33, 70
orig: 33, 70
offset: 0, 0
index: -1
images/goblin/right-upper-leg
rotate: false
xy: 2, 5
size: 34, 63 size: 34, 63
orig: 34, 63 orig: 34, 63
offset: 0, 0 offset: 0, 0
index: -1 index: -1
images/goblingirl/left-lower-leg goblin/right-shoulder
rotate: false rotate: false
xy: 195, 342 xy: 359, 11
size: 33, 70 size: 39, 42
orig: 33, 70 orig: 39, 45
offset: 0, 0 offset: 0, 0
index: -1 index: -1
images/goblingirl/left-upper-leg goblingirl/undie-straps
rotate: false rotate: false
xy: 37, 81 xy: 416, 43
size: 33, 70
orig: 33, 70
offset: 0, 0
index: -1
images/goblingirl/right-upper-leg
rotate: false
xy: 38, 16
size: 34, 63
orig: 34, 63
offset: 0, 0
index: -1
images/goblin/eyes-closed
rotate: false
xy: 38, 2
size: 34, 12
orig: 34, 12
offset: 0, 0
index: -1
images/goblin/undies
rotate: false
xy: 54, 154
size: 36, 29
orig: 36, 29
offset: 0, 0
index: -1
images/goblin/right-arm
rotate: false
xy: 72, 102
size: 23, 50
orig: 23, 50
offset: 0, 0
index: -1
images/goblin/left-foot
rotate: false
xy: 131, 256
size: 65, 31
orig: 65, 31
offset: 0, 0
index: -1
images/goblingirl/right-arm
rotate: false
xy: 196, 290
size: 28, 50
orig: 28, 50
offset: 0, 0
index: -1
images/goblingirl/left-shoulder
rotate: false
xy: 226, 294
size: 28, 46
orig: 28, 46
offset: 0, 0
index: -1
images/goblin/left-arm
rotate: false
xy: 198, 253
size: 37, 35
orig: 37, 35
offset: 0, 0
index: -1
images/goblingirl/left-foot
rotate: false
xy: 92, 223
size: 65, 31
orig: 65, 31
offset: 0, 0
index: -1
images/goblingirl/right-foot
rotate: false
xy: 92, 188
size: 63, 33
orig: 63, 33
offset: 0, 0
index: -1
images/goblin/undie-straps
rotate: false
xy: 92, 167
size: 55, 19 size: 55, 19
orig: 55, 19 orig: 55, 19
offset: 0, 0 offset: 0, 0
index: -1 index: -1
images/goblingirl/left-arm goblingirl/right-shoulder
rotate: false rotate: true
xy: 159, 219 xy: 400, 2
size: 39, 42
orig: 39, 45
offset: 0, 0
index: -1
goblin/left-arm
rotate: true
xy: 444, 4
size: 37, 35 size: 37, 35
orig: 37, 35 orig: 37, 35
offset: 0, 0 offset: 0, 0
index: -1 index: -1
images/goblin/right-shoulder goblin/neck
rotate: false rotate: false
xy: 97, 120 xy: 481, 17
size: 39, 45
orig: 39, 45
offset: 0, 0
index: -1
images/goblingirl/right-shoulder
rotate: false
xy: 198, 206
size: 39, 45
orig: 39, 45
offset: 0, 0
index: -1
images/goblin/left-hand
rotate: false
xy: 157, 176
size: 36, 41 size: 36, 41
orig: 36, 41 orig: 36, 41
offset: 0, 0 offset: 0, 0
index: -1 index: -1
images/goblin/neck goblingirl/left-hand
rotate: false rotate: false
xy: 195, 163 xy: 519, 18
size: 36, 41
orig: 36, 41
offset: 0, 0
index: -1
images/goblingirl/undie-straps
rotate: false
xy: 97, 99
size: 55, 19
orig: 55, 19
offset: 0, 0
index: -1
images/goblingirl/neck
rotate: false
xy: 138, 120
size: 35, 41
orig: 35, 41
offset: 0, 0
index: -1
images/goblingirl/left-hand
rotate: false
xy: 175, 121
size: 35, 40 size: 35, 40
orig: 35, 40 orig: 35, 40
offset: 0, 0 offset: 0, 0
index: -1 index: -1
images/goblin/left-shoulder goblingirl/right-arm
rotate: false rotate: false
xy: 212, 117 xy: 556, 8
size: 22, 50
orig: 28, 50
offset: 3, 0
index: -1
goblingirl/neck
rotate: false
xy: 580, 13
size: 33, 41
orig: 35, 41
offset: 0, 0
index: -1
goblin/left-shoulder
rotate: true
xy: 615, 25
size: 29, 44 size: 29, 44
orig: 29, 44 orig: 29, 44
offset: 0, 0 offset: 0, 0
index: -1 index: -1
images/goblingirl/eyes-closed goblingirl/left-shoulder
rotate: true
xy: 661, 26
size: 28, 45
orig: 28, 46
offset: 0, 1
index: -1
goblingirl/left-arm
rotate: false rotate: false
xy: 154, 97 xy: 710, 54
size: 37, 21 size: 37, 35
orig: 37, 21 orig: 37, 35
offset: 0, 0 offset: 0, 0
index: -1 index: -1
images/goblin/right-hand goblin/right-arm
rotate: false rotate: false
xy: 193, 78 xy: 708, 2
size: 23, 50
orig: 23, 50
offset: 0, 0
index: -1
goblin/right-hand
rotate: false
xy: 749, 54
size: 36, 37 size: 36, 37
orig: 36, 37 orig: 36, 37
offset: 0, 0 offset: 0, 0
index: -1 index: -1
images/goblingirl/right-hand goblingirl/right-hand
rotate: false rotate: false
xy: 74, 39 xy: 733, 15
size: 36, 37 size: 35, 37
orig: 36, 37 orig: 36, 37
offset: 0, 0 offset: 1, 0
index: -1 index: -1
images/goblingirl/undies goblin/undies
rotate: false rotate: false
xy: 74, 8 xy: 787, 62
size: 36, 29 size: 36, 29
orig: 36, 29 orig: 36, 29
offset: 0, 0 offset: 0, 0
index: -1 index: -1
goblingirl/undies
rotate: false
xy: 825, 62
size: 36, 29
orig: 36, 29
offset: 0, 0
index: -1
goblingirl/eyes-closed
rotate: false
xy: 59, 6
size: 37, 15
orig: 37, 21
offset: 0, 0
index: -1
goblin/eyes-closed
rotate: true
xy: 770, 18
size: 34, 12
orig: 34, 12
offset: 0, 0
index: -1

View File

@ -1,4 +1,2 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 7d22747254815624999fd0ab7e8f851c guid: 7d22747254815624999fd0ab7e8f851c
TextScriptImporter:
userData:

View File

@ -3,26 +3,26 @@
{ "name": "root" }, { "name": "root" },
{ "name": "hip", "parent": "root", "x": 0.64, "y": 114.41 }, { "name": "hip", "parent": "root", "x": 0.64, "y": 114.41 },
{ "name": "left upper leg", "parent": "hip", "length": 50.39, "x": 14.45, "y": 2.81, "rotation": -89.09 }, { "name": "left upper leg", "parent": "hip", "length": 50.39, "x": 14.45, "y": 2.81, "rotation": -89.09 },
{ "name": "left lower leg", "parent": "left upper leg", "length": 49.89, "x": 56.34, "y": 0.98, "rotation": -16.65 }, { "name": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 },
{ "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 58.94, "y": -7.61, "rotation": 102.43 },
{ "name": "right upper leg", "parent": "hip", "length": 42.45, "x": -20.07, "y": -6.83, "rotation": -97.49 }, { "name": "right upper leg", "parent": "hip", "length": 42.45, "x": -20.07, "y": -6.83, "rotation": -97.49 },
{ "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 42.99, "y": -0.61, "rotation": -14.34 },
{ "name": "right foot", "parent": "right lower leg", "length": 45.45, "x": 64.88, "y": 0.04, "rotation": 110.3 },
{ "name": "torso", "parent": "hip", "length": 85.82, "x": -6.42, "y": 1.97, "rotation": 93.92 }, { "name": "torso", "parent": "hip", "length": 85.82, "x": -6.42, "y": 1.97, "rotation": 93.92 },
{ "name": "neck", "parent": "torso", "length": 18.38, "x": 81.67, "y": -6.34, "rotation": -1.51 }, { "name": "left lower leg", "parent": "left upper leg", "length": 49.89, "x": 56.34, "y": 0.98, "rotation": -16.65 },
{ "name": "head", "parent": "neck", "length": 68.28, "x": 20.93, "y": 11.59, "rotation": -13.92 },
{ "name": "right shoulder", "parent": "torso", "length": 37.24, "x": 76.02, "y": 18.14, "rotation": 133.88 },
{ "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 37.6, "y": 0.31, "rotation": 36.32 },
{ "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 },
{ "name": "left shoulder", "parent": "torso", "length": 35.43, "x": 74.04, "y": -20.38, "rotation": -156.96 }, { "name": "left shoulder", "parent": "torso", "length": 35.43, "x": 74.04, "y": -20.38, "rotation": -156.96 },
{ "name": "neck", "parent": "torso", "length": 18.38, "x": 81.67, "y": -6.34, "rotation": -1.51 },
{ "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 42.99, "y": -0.61, "rotation": -14.34 },
{ "name": "right shoulder", "parent": "torso", "length": 37.24, "x": 76.02, "y": 18.14, "rotation": 133.88 },
{ "name": "head", "parent": "neck", "length": 68.28, "x": 20.93, "y": 11.59, "rotation": -13.92 },
{ "name": "left arm", "parent": "left shoulder", "length": 35.62, "x": 37.85, "y": -2.34, "rotation": 28.16 }, { "name": "left arm", "parent": "left shoulder", "length": 35.62, "x": 37.85, "y": -2.34, "rotation": 28.16 },
{ "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 58.94, "y": -7.61, "rotation": 102.43 },
{ "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 37.6, "y": 0.31, "rotation": 36.32 },
{ "name": "right foot", "parent": "right lower leg", "length": 45.45, "x": 64.88, "y": 0.04, "rotation": 110.3 },
{ "name": "left hand", "parent": "left arm", "length": 11.52, "x": 35.62, "y": 0.07, "rotation": 2.7 }, { "name": "left hand", "parent": "left arm", "length": 11.52, "x": 35.62, "y": 0.07, "rotation": 2.7 },
{ "name": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 } { "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 }
], ],
"slots": [ "slots": [
{ "name": "left shoulder", "bone": "left shoulder", "attachment": "left shoulder" }, { "name": "left shoulder", "bone": "left shoulder", "attachment": "left shoulder" },
{ "name": "left arm", "bone": "left arm", "attachment": "left arm" }, { "name": "left arm", "bone": "left arm", "attachment": "left arm" },
{ "name": "left hand item", "bone": "left hand", "attachment": "spear" }, { "name": "left hand item", "bone": "left hand", "attachment": "dagger" },
{ "name": "left hand", "bone": "left hand", "attachment": "left hand" }, { "name": "left hand", "bone": "left hand", "attachment": "left hand" },
{ "name": "left foot", "bone": "left foot", "attachment": "left foot" }, { "name": "left foot", "bone": "left foot", "attachment": "left foot" },
{ "name": "left lower leg", "bone": "left lower leg", "attachment": "left lower leg" }, { "name": "left lower leg", "bone": "left lower leg", "attachment": "left lower leg" },
@ -45,11 +45,11 @@
"skins": { "skins": {
"default": { "default": {
"left hand item": { "left hand item": {
"dagger": { "x": 7.88, "y": -23.45, "rotation": 10.47, "width": 26, "height": 108 }, "dagger": { "x": -35.5, "y": 3.85, "rotation": 10.47, "width": 156, "height": 238 },
"spear": { "x": -4.55, "y": 39.2, "rotation": 13.04, "width": 22, "height": 368 } "spear": { "x": -4.55, "y": 39.2, "rotation": 13.04, "width": 22, "height": 368 }
}, },
"right hand item": { "right hand item": {
"dagger": { "x": 6.51, "y": -24.15, "rotation": -8.06, "width": 26, "height": 108 } "dagger": { "x": -21.57, "y": 15.8, "rotation": -8.06, "width": 156, "height": 238 }
} }
}, },
"goblin": { "goblin": {

View File

@ -1,4 +1,2 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 06f2130f3bf8d4f499a15c55bdcda650 guid: 06f2130f3bf8d4f499a15c55bdcda650
TextScriptImporter:
userData:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

After

Width:  |  Height:  |  Size: 148 KiB

View File

@ -19,7 +19,6 @@ TextureImporter:
isReadable: 0 isReadable: 0
grayScaleToAlpha: 0 grayScaleToAlpha: 0
generateCubemap: 0 generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1 textureFormat: -1
maxTextureSize: 1024 maxTextureSize: 1024
textureSettings: textureSettings:
@ -32,4 +31,3 @@ TextureImporter:
compressionQuality: 50 compressionQuality: 50
textureType: -1 textureType: -1
buildTargetSettings: [] buildTargetSettings: []
userData:

View File

@ -1,4 +1,2 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: a42989bcd9f91aa49a56dc67cf27b96a guid: a42989bcd9f91aa49a56dc67cf27b96a
TextScriptImporter:
userData:

View File

@ -1,4 +1,2 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: b84c2137744fea946bde0d5cd51e4e3d guid: b84c2137744fea946bde0d5cd51e4e3d
TextScriptImporter:
userData:

View File

@ -19,7 +19,6 @@ TextureImporter:
isReadable: 0 isReadable: 0
grayScaleToAlpha: 0 grayScaleToAlpha: 0
generateCubemap: 0 generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1 textureFormat: -1
maxTextureSize: 1024 maxTextureSize: 1024
textureSettings: textureSettings:
@ -32,4 +31,3 @@ TextureImporter:
compressionQuality: 50 compressionQuality: 50
textureType: -1 textureType: -1
buildTargetSettings: [] buildTargetSettings: []
userData:

View File

@ -11,3 +11,7 @@ Note that you *must* delete the Unity 4 directory or Unity will crash.
1. Delete the "Assets/examples/Unity 4" directory. 1. Delete the "Assets/examples/Unity 4" directory.
1. Open the "Assets/examples/Unity 3.5/spineboy.unity" scene. 1. Open the "Assets/examples/Unity 3.5/spineboy.unity" scene.
# Notes
- Atlas images should use premultiplied alpha.