Meshes, FFD and skinning for spine-tk2d.
@ -38,44 +38,52 @@ using Spine;
|
||||
[ExecuteInEditMode]
|
||||
[AddComponentMenu("Spine/BoneComponent")]
|
||||
public class BoneComponent : MonoBehaviour {
|
||||
public SkeletonComponent skeletonComponent;
|
||||
public bool valid;
|
||||
public SkeletonRenderer skeletonRenderer;
|
||||
public Bone bone;
|
||||
|
||||
/// <summary>If a bone isn't set, boneName is used to find the bone.</summary>
|
||||
public String boneName;
|
||||
|
||||
protected Transform cachedTransform;
|
||||
protected Transform skeletonComponentTransform;
|
||||
protected Transform skeletonTransform;
|
||||
|
||||
void Awake () {
|
||||
public void Reset () {
|
||||
bone = null;
|
||||
cachedTransform = transform;
|
||||
valid = skeletonRenderer != null && skeletonRenderer.valid;
|
||||
if (!valid) return;
|
||||
skeletonTransform = skeletonRenderer.transform;
|
||||
}
|
||||
|
||||
if(skeletonComponent == null) return;
|
||||
skeletonComponentTransform = skeletonComponent.transform;
|
||||
public void Awake () {
|
||||
Reset();
|
||||
}
|
||||
|
||||
public void LateUpdate () {
|
||||
if (skeletonComponent == null || skeletonComponent.skeleton == null) return;
|
||||
if (!valid) {
|
||||
Reset();
|
||||
return;
|
||||
}
|
||||
|
||||
if (bone == null) {
|
||||
if (boneName == null) return;
|
||||
bone = skeletonComponent.skeleton.FindBone(boneName);
|
||||
if (boneName == null || boneName.Length == 0) return;
|
||||
bone = skeletonRenderer.skeleton.FindBone(boneName);
|
||||
if (bone == null) {
|
||||
Debug.Log("Bone not found: " + boneName, this);
|
||||
Debug.LogError("Bone not found: " + boneName, this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (cachedTransform.parent == skeletonComponentTransform) {
|
||||
if (cachedTransform.parent == skeletonTransform) {
|
||||
cachedTransform.localPosition = new Vector3(bone.worldX, bone.worldY, cachedTransform.localPosition.z);
|
||||
Vector3 rotation = cachedTransform.localRotation.eulerAngles;
|
||||
cachedTransform.localRotation = Quaternion.Euler(rotation.x, rotation.y, bone.worldRotation);
|
||||
} else {
|
||||
cachedTransform.position = skeletonComponentTransform.TransformPoint(new Vector3(bone.worldX, bone.worldY, cachedTransform.position.z));
|
||||
Vector3 rotation = skeletonComponentTransform.rotation.eulerAngles;
|
||||
cachedTransform.position = skeletonTransform.TransformPoint(new Vector3(bone.worldX, bone.worldY, cachedTransform.position.z));
|
||||
Vector3 rotation = skeletonTransform.rotation.eulerAngles;
|
||||
cachedTransform.rotation = Quaternion.Euler(rotation.x, rotation.y,
|
||||
skeletonComponentTransform.rotation.eulerAngles.z + bone.worldRotation);
|
||||
skeletonTransform.rotation.eulerAngles.z + bone.worldRotation);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -34,10 +34,10 @@ using UnityEngine;
|
||||
|
||||
[CustomEditor(typeof(BoneComponent))]
|
||||
public class BoneComponentInspector : Editor {
|
||||
private SerializedProperty boneName, skeletonComponent;
|
||||
private SerializedProperty boneName, skeletonRenderer;
|
||||
|
||||
void OnEnable () {
|
||||
skeletonComponent = serializedObject.FindProperty("skeletonComponent");
|
||||
skeletonRenderer = serializedObject.FindProperty("skeletonRenderer");
|
||||
boneName = serializedObject.FindProperty("boneName");
|
||||
}
|
||||
|
||||
@ -45,13 +45,13 @@ public class BoneComponentInspector : Editor {
|
||||
serializedObject.Update();
|
||||
BoneComponent component = (BoneComponent)target;
|
||||
|
||||
EditorGUILayout.PropertyField(skeletonComponent);
|
||||
EditorGUILayout.PropertyField(skeletonRenderer);
|
||||
|
||||
if (component.skeletonComponent != null) {
|
||||
String[] bones = new String[component.skeletonComponent.skeleton.Data.Bones.Count + 1];
|
||||
if (component.valid) {
|
||||
String[] bones = new String[component.skeletonRenderer.skeleton.Data.Bones.Count + 1];
|
||||
bones[0] = "<None>";
|
||||
for (int i = 0; i < bones.Length - 1; i++)
|
||||
bones[i + 1] = component.skeletonComponent.skeleton.Data.Bones[i].Name;
|
||||
bones[i + 1] = component.skeletonRenderer.skeleton.Data.Bones[i].Name;
|
||||
Array.Sort<String>(bones);
|
||||
int boneIndex = Math.Max(0, Array.IndexOf(bones, boneName.stringValue));
|
||||
|
||||
@ -61,14 +61,13 @@ public class BoneComponentInspector : Editor {
|
||||
boneIndex = EditorGUILayout.Popup(boneIndex, bones);
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
boneName.stringValue = bones[boneIndex];;
|
||||
boneName.stringValue = boneIndex == 0 ? null : bones[boneIndex];
|
||||
}
|
||||
|
||||
if (serializedObject.ApplyModifiedProperties() ||
|
||||
(Event.current.type == EventType.ValidateCommand && Event.current.commandName == "UndoRedoPerformed")
|
||||
) {
|
||||
component.bone = null;
|
||||
component.LateUpdate();
|
||||
component.Reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,9 +54,9 @@ public class Menus {
|
||||
Selection.activeObject = asset;
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/Create Other/Spine SkeletonComponent")]
|
||||
static public void CreateSkeletonComponentGameObject () {
|
||||
GameObject gameObject = new GameObject("New SkeletonComponent", typeof(SkeletonComponent));
|
||||
[MenuItem("GameObject/Create Other/Spine SkeletonRenderer")]
|
||||
static public void CreateSkeletonRendererGameObject () {
|
||||
GameObject gameObject = new GameObject("New SkeletonRenderer", typeof(SkeletonRenderer));
|
||||
EditorUtility.FocusProjectWindow();
|
||||
Selection.activeObject = gameObject;
|
||||
}
|
||||
|
||||
@ -89,10 +89,8 @@ public class SkeletonAnimationInspector : Editor {
|
||||
animationIndex = EditorGUILayout.Popup(animationIndex, animations);
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
if (animationIndex == 0)
|
||||
component.animationName = null;
|
||||
else
|
||||
component.animationName = animations[animationIndex];
|
||||
component.animationName = animationIndex == 0 ? null : animations[animationIndex];
|
||||
animationName.stringValue = component.animationName;
|
||||
}
|
||||
|
||||
// Animation loop.
|
||||
@ -109,8 +107,7 @@ public class SkeletonAnimationInspector : Editor {
|
||||
(Event.current.type == EventType.ValidateCommand && Event.current.commandName == "UndoRedoPerformed")
|
||||
) {
|
||||
if (!Application.isPlaying) {
|
||||
component.Clear();
|
||||
component.Update();
|
||||
component.Reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,8 +32,8 @@ using System;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
[CustomEditor(typeof(SkeletonComponent))]
|
||||
public class SkeletonComponentInspector : Editor {
|
||||
[CustomEditor(typeof(SkeletonRenderer))]
|
||||
public class SkeletonRendererInspector : Editor {
|
||||
private SerializedProperty skeletonDataAsset, initialSkinName, timeScale, normals, tangents;
|
||||
|
||||
void OnEnable () {
|
||||
@ -46,7 +46,7 @@ public class SkeletonComponentInspector : Editor {
|
||||
|
||||
override public void OnInspectorGUI () {
|
||||
serializedObject.Update();
|
||||
SkeletonComponent component = (SkeletonComponent)target;
|
||||
SkeletonRenderer component = (SkeletonRenderer)target;
|
||||
|
||||
EditorGUILayout.PropertyField(skeletonDataAsset);
|
||||
|
||||
@ -78,8 +78,7 @@ public class SkeletonComponentInspector : Editor {
|
||||
(Event.current.type == EventType.ValidateCommand && Event.current.commandName == "UndoRedoPerformed")
|
||||
) {
|
||||
if (!Application.isPlaying) {
|
||||
component.Clear();
|
||||
component.Update();
|
||||
component.Reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dbb89dadcac8d6b48869aeb81b0ae88f
|
||||
guid: 350bd1e336864e045a8d44c7afe923e8
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
@ -34,10 +34,10 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Spine;
|
||||
|
||||
/** Extends SkeletonComponent to apply an animation. */
|
||||
[ExecuteInEditMode, RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
|
||||
[ExecuteInEditMode]
|
||||
[AddComponentMenu("Spine/SkeletonAnimation")]
|
||||
public class SkeletonAnimation : SkeletonComponent {
|
||||
public class SkeletonAnimation : SkeletonRenderer {
|
||||
public float timeScale = 1;
|
||||
public bool loop;
|
||||
public Spine.AnimationState state;
|
||||
|
||||
@ -59,24 +59,30 @@ public class SkeletonAnimation : SkeletonComponent {
|
||||
state.SetAnimation(0, value, loop);
|
||||
}
|
||||
}
|
||||
|
||||
override public void Initialize () {
|
||||
if (Initialized) return;
|
||||
|
||||
base.Initialize();
|
||||
|
||||
public override void Reset () {
|
||||
base.Reset();
|
||||
if (!valid) return;
|
||||
|
||||
state = new Spine.AnimationState(skeletonDataAsset.GetAnimationStateData());
|
||||
if (_animationName != null && _animationName.Length > 0) state.SetAnimation(0, _animationName, loop);
|
||||
if (_animationName != null && _animationName.Length > 0) {
|
||||
state.SetAnimation(0, _animationName, loop);
|
||||
Update(0);
|
||||
}
|
||||
}
|
||||
|
||||
override public void UpdateSkeleton (float deltaTime) {
|
||||
// Apply the animation.
|
||||
public virtual void Update () {
|
||||
Update(Time.deltaTime);
|
||||
}
|
||||
|
||||
public virtual void Update (float deltaTime) {
|
||||
if (!valid) return;
|
||||
|
||||
deltaTime *= timeScale;
|
||||
skeleton.Update(deltaTime);
|
||||
state.Update(deltaTime * timeScale);
|
||||
state.Apply(skeleton);
|
||||
|
||||
if (UpdateBones != null) UpdateBones(this);
|
||||
|
||||
// Call overridden method to call skeleton Update and UpdateWorldTransform.
|
||||
base.UpdateSkeleton(deltaTime);
|
||||
skeleton.UpdateWorldTransform();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,334 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes Software License
|
||||
* Version 2.1
|
||||
*
|
||||
* Copyright (c) 2013, Esoteric Software
|
||||
* All rights reserved.
|
||||
*
|
||||
* You are granted a perpetual, non-exclusive, non-sublicensable and
|
||||
* non-transferable license to install, execute and perform the Spine Runtimes
|
||||
* Software (the "Software") solely for internal use. Without the written
|
||||
* permission of Esoteric Software (typically granted by licensing Spine), you
|
||||
* may not (a) modify, translate, adapt or otherwise create derivative works,
|
||||
* improvements of the Software or develop new applications using the Software
|
||||
* or (b) remove, delete, alter or obscure any trademarks or any copyright,
|
||||
* trademark, patent or other intellectual property or proprietary rights
|
||||
* notices on or in the Software, including any copy thereof. Redistributions
|
||||
* in binary or source form must include this license and terms.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
* EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Spine;
|
||||
|
||||
/** Renders a skeleton. Extend to apply animations, get bones and manipulate them, etc. */
|
||||
[ExecuteInEditMode, RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
|
||||
[AddComponentMenu("Spine/SkeletonComponent")]
|
||||
public class SkeletonComponent : MonoBehaviour {
|
||||
public SkeletonDataAsset skeletonDataAsset;
|
||||
public Skeleton skeleton;
|
||||
public String initialSkinName;
|
||||
public float timeScale = 1;
|
||||
public bool calculateNormals;
|
||||
public bool calculateTangents;
|
||||
public float zSpacing;
|
||||
private MeshFilter meshFilter;
|
||||
private Mesh mesh, mesh1, mesh2;
|
||||
private bool useMesh1;
|
||||
private float[] vertexPositions = new float[8];
|
||||
private int lastVertexCount;
|
||||
private Vector3[] vertices;
|
||||
private Color32[] colors;
|
||||
private Vector2[] uvs;
|
||||
private Material[] sharedMaterials = new Material[0];
|
||||
private List<Material> submeshMaterials = new List<Material>();
|
||||
private List<Submesh> submeshes = new List<Submesh>();
|
||||
|
||||
/// <summary>False if Initialize needs to be called.</summary>
|
||||
public bool Initialized {
|
||||
get {
|
||||
if (skeletonDataAsset == null) return true;
|
||||
SkeletonData skeletonData = skeletonDataAsset.GetSkeletonData(false);
|
||||
if (skeletonData == null) return true;
|
||||
return skeleton != null && skeleton.Data == skeletonData;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Clear () {
|
||||
if (meshFilter != null) meshFilter.sharedMesh = null;
|
||||
if (mesh != null) DestroyImmediate(mesh);
|
||||
if (renderer != null) renderer.sharedMaterial = null;
|
||||
mesh = null;
|
||||
mesh1 = null;
|
||||
mesh2 = null;
|
||||
lastVertexCount = 0;
|
||||
vertices = null;
|
||||
colors = null;
|
||||
uvs = null;
|
||||
sharedMaterials = new Material[0];
|
||||
submeshMaterials.Clear();
|
||||
submeshes.Clear();
|
||||
skeleton = null;
|
||||
}
|
||||
|
||||
public virtual void Initialize () {
|
||||
if (Initialized) return;
|
||||
|
||||
meshFilter = GetComponent<MeshFilter>();
|
||||
mesh1 = newMesh();
|
||||
mesh2 = newMesh();
|
||||
|
||||
vertices = new Vector3[0];
|
||||
|
||||
skeleton = new Skeleton(skeletonDataAsset.GetSkeletonData(false));
|
||||
|
||||
if (initialSkinName != null && initialSkinName.Length > 0 && initialSkinName != "default") {
|
||||
skeleton.SetSkin(initialSkinName);
|
||||
skeleton.SetSlotsToSetupPose();
|
||||
}
|
||||
}
|
||||
|
||||
private Mesh newMesh () {
|
||||
Mesh mesh = new Mesh();
|
||||
mesh.name = "Skeleton Mesh";
|
||||
mesh.hideFlags = HideFlags.HideAndDontSave;
|
||||
mesh.MarkDynamic();
|
||||
return mesh;
|
||||
}
|
||||
|
||||
public virtual void UpdateSkeleton (float deltaTime) {
|
||||
skeleton.Update(deltaTime * timeScale);
|
||||
skeleton.UpdateWorldTransform();
|
||||
}
|
||||
|
||||
public virtual void Update () {
|
||||
if (skeletonDataAsset == null) {
|
||||
Clear();
|
||||
return;
|
||||
}
|
||||
|
||||
SkeletonData skeletonData = skeletonDataAsset.GetSkeletonData(false);
|
||||
|
||||
if (skeletonData == null) {
|
||||
Clear();
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize fields.
|
||||
if (skeleton == null || skeleton.Data != skeletonData)
|
||||
Initialize();
|
||||
|
||||
UpdateSkeleton(Time.deltaTime);
|
||||
|
||||
// Count quads and submeshes.
|
||||
int quadCount = 0, submeshQuadCount = 0;
|
||||
Material lastMaterial = null;
|
||||
submeshMaterials.Clear();
|
||||
List<Slot> drawOrder = skeleton.DrawOrder;
|
||||
for (int i = 0, n = drawOrder.Count; i < n; i++) {
|
||||
RegionAttachment regionAttachment = drawOrder[i].Attachment as RegionAttachment;
|
||||
if (regionAttachment == null)
|
||||
continue;
|
||||
|
||||
// Add submesh when material changes.
|
||||
Material material = (Material)regionAttachment.RendererObject;
|
||||
if (lastMaterial != material && lastMaterial != null) {
|
||||
addSubmesh(lastMaterial, quadCount, submeshQuadCount, false);
|
||||
submeshQuadCount = 0;
|
||||
}
|
||||
lastMaterial = material;
|
||||
|
||||
quadCount++;
|
||||
submeshQuadCount++;
|
||||
}
|
||||
addSubmesh(lastMaterial, quadCount, submeshQuadCount, true);
|
||||
|
||||
// Set materials.
|
||||
if (submeshMaterials.Count == sharedMaterials.Length)
|
||||
submeshMaterials.CopyTo(sharedMaterials);
|
||||
else
|
||||
sharedMaterials = submeshMaterials.ToArray();
|
||||
renderer.sharedMaterials = sharedMaterials;
|
||||
|
||||
// Double buffer mesh.
|
||||
Mesh mesh = useMesh1 ? mesh1 : mesh2;
|
||||
meshFilter.sharedMesh = mesh;
|
||||
|
||||
// Ensure mesh data is the right size.
|
||||
Vector3[] vertices = this.vertices;
|
||||
int vertexCount = quadCount * 4;
|
||||
bool newTriangles = vertexCount > vertices.Length;
|
||||
if (newTriangles) {
|
||||
// Not enough vertices, increase size.
|
||||
this.vertices = vertices = new Vector3[vertexCount];
|
||||
this.colors = new Color32[vertexCount];
|
||||
this.uvs = new Vector2[vertexCount];
|
||||
mesh1.Clear();
|
||||
mesh2.Clear();
|
||||
} else {
|
||||
// Too many vertices, zero the extra.
|
||||
Vector3 zero = Vector3.zero;
|
||||
for (int i = vertexCount, n = lastVertexCount; i < n; i++)
|
||||
vertices[i] = zero;
|
||||
}
|
||||
lastVertexCount = vertexCount;
|
||||
|
||||
// Setup mesh.
|
||||
float[] vertexPositions = this.vertexPositions;
|
||||
Vector2[] uvs = this.uvs;
|
||||
Color32[] colors = this.colors;
|
||||
int vertexIndex = 0;
|
||||
Color32 color = new Color32();
|
||||
float a = skeleton.A * 255, r = skeleton.R, g = skeleton.G, b = skeleton.B, zSpacing = this.zSpacing;
|
||||
for (int i = 0, n = drawOrder.Count; i < n; i++) {
|
||||
Slot slot = drawOrder[i];
|
||||
RegionAttachment regionAttachment = slot.Attachment as RegionAttachment;
|
||||
if (regionAttachment == null)
|
||||
continue;
|
||||
|
||||
regionAttachment.ComputeWorldVertices(skeleton.X, skeleton.Y, slot.Bone, vertexPositions);
|
||||
|
||||
float z = i * zSpacing;
|
||||
vertices[vertexIndex] = new Vector3(vertexPositions[RegionAttachment.X1], vertexPositions[RegionAttachment.Y1], z);
|
||||
vertices[vertexIndex + 1] = new Vector3(vertexPositions[RegionAttachment.X4], vertexPositions[RegionAttachment.Y4], z);
|
||||
vertices[vertexIndex + 2] = new Vector3(vertexPositions[RegionAttachment.X2], vertexPositions[RegionAttachment.Y2], z);
|
||||
vertices[vertexIndex + 3] = new Vector3(vertexPositions[RegionAttachment.X3], vertexPositions[RegionAttachment.Y3], z);
|
||||
|
||||
color.a = (byte)(a * slot.A);
|
||||
color.r = (byte)(r * slot.R * color.a);
|
||||
color.g = (byte)(g * slot.G * color.a);
|
||||
color.b = (byte)(b * slot.B * color.a);
|
||||
if (slot.Data.AdditiveBlending) color.a = 0;
|
||||
colors[vertexIndex] = color;
|
||||
colors[vertexIndex + 1] = color;
|
||||
colors[vertexIndex + 2] = color;
|
||||
colors[vertexIndex + 3] = color;
|
||||
|
||||
float[] regionUVs = regionAttachment.UVs;
|
||||
uvs[vertexIndex] = new Vector2(regionUVs[RegionAttachment.X1], regionUVs[RegionAttachment.Y1]);
|
||||
uvs[vertexIndex + 1] = new Vector2(regionUVs[RegionAttachment.X4], regionUVs[RegionAttachment.Y4]);
|
||||
uvs[vertexIndex + 2] = new Vector2(regionUVs[RegionAttachment.X2], regionUVs[RegionAttachment.Y2]);
|
||||
uvs[vertexIndex + 3] = new Vector2(regionUVs[RegionAttachment.X3], regionUVs[RegionAttachment.Y3]);
|
||||
|
||||
vertexIndex += 4;
|
||||
}
|
||||
|
||||
mesh.vertices = vertices;
|
||||
mesh.colors32 = colors;
|
||||
mesh.uv = uvs;
|
||||
|
||||
int submeshCount = submeshMaterials.Count;
|
||||
mesh.subMeshCount = submeshCount;
|
||||
for (int i = 0; i < submeshCount; ++i)
|
||||
mesh.SetTriangles(submeshes[i].indexes, i);
|
||||
mesh.RecalculateBounds();
|
||||
|
||||
if (newTriangles && calculateNormals) {
|
||||
Vector3[] normals = new Vector3[vertexCount];
|
||||
Vector3 normal = new Vector3(0, 0, -1);
|
||||
for (int i = 0; i < vertexCount; i++)
|
||||
normals[i] = normal;
|
||||
(useMesh1 ? mesh2 : mesh1).vertices = vertices; // Set other mesh vertices.
|
||||
mesh1.normals = normals;
|
||||
mesh2.normals = normals;
|
||||
|
||||
if (calculateTangents) {
|
||||
Vector4[] tangents = new Vector4[vertexCount];
|
||||
Vector3 tangent = new Vector3(0, 0, 1);
|
||||
for (int i = 0; i < vertexCount; i++)
|
||||
tangents[i] = tangent;
|
||||
mesh1.tangents = tangents;
|
||||
mesh2.tangents = tangents;
|
||||
}
|
||||
}
|
||||
|
||||
useMesh1 = !useMesh1;
|
||||
}
|
||||
|
||||
/** Adds a material. Adds submesh indexes if existing indexes aren't sufficient. */
|
||||
private void addSubmesh (Material material, int endQuadCount, int submeshQuadCount, bool lastSubmesh) {
|
||||
int submeshIndex = submeshMaterials.Count;
|
||||
submeshMaterials.Add(material);
|
||||
|
||||
int indexCount = submeshQuadCount * 6;
|
||||
int vertexIndex = (endQuadCount - submeshQuadCount) * 4;
|
||||
|
||||
if (submeshes.Count <= submeshIndex) submeshes.Add(new Submesh());
|
||||
Submesh submesh = submeshes[submeshIndex];
|
||||
|
||||
int[] indexes = submesh.indexes;
|
||||
if (lastSubmesh && submesh.indexCount > indexCount) {
|
||||
// Last submesh may have more indices than required, so zero indexes to the end.
|
||||
submesh.indexCount = indexCount;
|
||||
for (int i = indexCount, n = indexes.Length; i < n; i++)
|
||||
indexes[i] = 0;
|
||||
} else if (indexes.Length != indexCount) {
|
||||
// Reallocate indexes if not the right size.
|
||||
submesh.indexes = indexes = new int[indexCount];
|
||||
submesh.indexCount = 0;
|
||||
}
|
||||
|
||||
// Set indexes if not already set.
|
||||
if (submesh.firstVertex != vertexIndex || submesh.indexCount < indexCount) {
|
||||
submesh.indexCount = indexCount;
|
||||
submesh.firstVertex = vertexIndex;
|
||||
for (int i = 0; i < indexCount; i += 6, vertexIndex += 4) {
|
||||
indexes[i] = vertexIndex;
|
||||
indexes[i + 1] = vertexIndex + 2;
|
||||
indexes[i + 2] = vertexIndex + 1;
|
||||
indexes[i + 3] = vertexIndex + 2;
|
||||
indexes[i + 4] = vertexIndex + 3;
|
||||
indexes[i + 5] = vertexIndex + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void OnEnable () {
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public virtual void Reset () {
|
||||
Initialize();
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
void OnDrawGizmos() {
|
||||
// Make selection easier by drawing a clear gizmo over the skeleton.
|
||||
if (vertices == null) return;
|
||||
Vector3 gizmosCenter = new Vector3();
|
||||
Vector3 gizmosSize = new Vector3();
|
||||
Vector3 min = new Vector3(float.MaxValue, float.MaxValue, 0f);
|
||||
Vector3 max = new Vector3(float.MinValue, float.MinValue, 0f);
|
||||
foreach (Vector3 vert in vertices) {
|
||||
min = Vector3.Min (min, vert);
|
||||
max = Vector3.Max (max, vert);
|
||||
}
|
||||
float width = max.x - min.x;
|
||||
float height = max.y - min.y;
|
||||
gizmosCenter = new Vector3(min.x + (width / 2f), min.y + (height / 2f), 0f);
|
||||
gizmosSize = new Vector3(width, height, 1f);
|
||||
Gizmos.color = Color.clear;
|
||||
Gizmos.matrix = transform.localToWorldMatrix;
|
||||
Gizmos.DrawCube(gizmosCenter, gizmosSize);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
class Submesh {
|
||||
public int[] indexes = new int[0];
|
||||
public int firstVertex = -1;
|
||||
public int indexCount;
|
||||
}
|
||||
@ -30,6 +30,7 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Spine;
|
||||
|
||||
@ -51,14 +52,14 @@ public class SkeletonDataAsset : ScriptableObject {
|
||||
public SkeletonData GetSkeletonData (bool quiet) {
|
||||
if (spriteCollection == null) {
|
||||
if (!quiet)
|
||||
Debug.LogWarning("Sprite collection not set for skeleton data asset: " + name, this);
|
||||
Debug.LogError("Sprite collection not set for skeleton data asset: " + name, this);
|
||||
Clear();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
if (skeletonJSON == null) {
|
||||
if (!quiet)
|
||||
Debug.LogWarning("Skeleton JSON file not set for skeleton data asset: " + name, this);
|
||||
Debug.LogError("Skeleton JSON file not set for skeleton data asset: " + name, this);
|
||||
Clear();
|
||||
return null;
|
||||
}
|
||||
@ -68,19 +69,17 @@ public class SkeletonDataAsset : ScriptableObject {
|
||||
|
||||
SkeletonJson json = new SkeletonJson(new SpriteCollectionAttachmentLoader(spriteCollection));
|
||||
json.Scale = 1.0f / (spriteCollection.invOrthoSize * spriteCollection.halfTargetHeight) * scale;
|
||||
|
||||
try {
|
||||
skeletonData = json.ReadSkeletonData(new StringReader(skeletonJSON.text));
|
||||
} catch (Exception ex) {
|
||||
Debug.Log("Error reading skeleton JSON file for skeleton data asset: " + name + "\n" +
|
||||
ex.Message + "\n" + ex.StackTrace, this);
|
||||
if (!quiet)
|
||||
Debug.LogError("Error reading skeleton JSON file for SkeletonData asset: " + name + "\n" + ex.Message + "\n" + ex.StackTrace, this);
|
||||
return null;
|
||||
}
|
||||
|
||||
stateData = new AnimationStateData(skeletonData);
|
||||
for (int i = 0, n = fromAnimation.Length; i < n; i++) {
|
||||
if (fromAnimation[i].Length == 0 || toAnimation[i].Length == 0)
|
||||
continue;
|
||||
if (fromAnimation[i].Length == 0 || toAnimation[i].Length == 0) continue;
|
||||
stateData.SetMix(fromAnimation[i], toAnimation[i], duration[i]);
|
||||
}
|
||||
|
||||
|
||||
366
spine-tk2d/Assets/Spine/SkeletonRenderer.cs
Normal file
@ -0,0 +1,366 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes Software License
|
||||
* Version 2.1
|
||||
*
|
||||
* Copyright (c) 2013, Esoteric Software
|
||||
* All rights reserved.
|
||||
*
|
||||
* You are granted a perpetual, non-exclusive, non-sublicensable and
|
||||
* non-transferable license to install, execute and perform the Spine Runtimes
|
||||
* Software (the "Software") solely for internal use. Without the written
|
||||
* permission of Esoteric Software (typically granted by licensing Spine), you
|
||||
* may not (a) modify, translate, adapt or otherwise create derivative works,
|
||||
* improvements of the Software or develop new applications using the Software
|
||||
* or (b) remove, delete, alter or obscure any trademarks or any copyright,
|
||||
* trademark, patent or other intellectual property or proprietary rights
|
||||
* notices on or in the Software, including any copy thereof. Redistributions
|
||||
* in binary or source form must include this license and terms.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
* EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Spine;
|
||||
|
||||
/// <summary>Renders a skeleton.</summary>
|
||||
[ExecuteInEditMode, RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
|
||||
public class SkeletonRenderer : MonoBehaviour {
|
||||
public bool valid;
|
||||
public Skeleton skeleton;
|
||||
|
||||
public SkeletonDataAsset skeletonDataAsset;
|
||||
public String initialSkinName;
|
||||
public bool calculateNormals;
|
||||
public bool calculateTangents;
|
||||
public float zSpacing;
|
||||
|
||||
private MeshFilter meshFilter;
|
||||
private Mesh mesh, mesh1, mesh2;
|
||||
private bool useMesh1;
|
||||
private float[] tempVertices = new float[8];
|
||||
private int lastVertexCount;
|
||||
private Vector3[] vertices;
|
||||
private Color32[] colors;
|
||||
private Vector2[] uvs;
|
||||
private Material[] sharedMaterials = new Material[0];
|
||||
private readonly List<Material> submeshMaterials = new List<Material>();
|
||||
private readonly List<Submesh> submeshes = new List<Submesh>();
|
||||
private readonly int[] quadTriangles = {0, 2, 1, 2, 3, 1};
|
||||
|
||||
public virtual void Reset () {
|
||||
if (meshFilter != null) meshFilter.sharedMesh = null;
|
||||
if (mesh != null) DestroyImmediate(mesh);
|
||||
if (renderer != null) renderer.sharedMaterial = null;
|
||||
mesh = null;
|
||||
mesh1 = null;
|
||||
mesh2 = null;
|
||||
lastVertexCount = 0;
|
||||
vertices = null;
|
||||
colors = null;
|
||||
uvs = null;
|
||||
sharedMaterials = new Material[0];
|
||||
submeshMaterials.Clear();
|
||||
submeshes.Clear();
|
||||
skeleton = null;
|
||||
|
||||
if (!skeletonDataAsset) {
|
||||
Debug.LogError("Missing SkeletonData asset.", this);
|
||||
valid = false;
|
||||
return;
|
||||
}
|
||||
valid = true;
|
||||
|
||||
meshFilter = GetComponent<MeshFilter>();
|
||||
mesh1 = newMesh();
|
||||
mesh2 = newMesh();
|
||||
vertices = new Vector3[0];
|
||||
|
||||
skeleton = new Skeleton(skeletonDataAsset.GetSkeletonData(false));
|
||||
if (initialSkinName != null && initialSkinName.Length > 0 && initialSkinName != "default")
|
||||
skeleton.SetSkin(initialSkinName);
|
||||
}
|
||||
|
||||
public void Awake () {
|
||||
Reset();
|
||||
}
|
||||
|
||||
private Mesh newMesh () {
|
||||
Mesh mesh = new Mesh();
|
||||
mesh.name = "Skeleton Mesh";
|
||||
mesh.hideFlags = HideFlags.HideAndDontSave;
|
||||
mesh.MarkDynamic();
|
||||
return mesh;
|
||||
}
|
||||
|
||||
public virtual void OnWillRenderObject () {
|
||||
if (!valid) return;
|
||||
|
||||
// Count vertices and submesh triangles.
|
||||
int vertexCount = 0;
|
||||
int submeshTriangleCount = 0, submeshFirstVertex = 0, submeshStartSlotIndex = 0;
|
||||
Material lastMaterial = null;
|
||||
submeshMaterials.Clear();
|
||||
List<Slot> drawOrder = skeleton.DrawOrder;
|
||||
int drawOrderCount = drawOrder.Count;
|
||||
for (int i = 0; i < drawOrderCount; i++) {
|
||||
Attachment attachment = drawOrder[i].attachment;
|
||||
|
||||
object rendererObject;
|
||||
int attachmentVertexCount, attachmentTriangleCount;
|
||||
|
||||
if (attachment is RegionAttachment) {
|
||||
rendererObject = ((RegionAttachment)attachment).RendererObject;
|
||||
attachmentVertexCount = 4;
|
||||
attachmentTriangleCount = 6;
|
||||
} else if (attachment is MeshAttachment) {
|
||||
MeshAttachment meshAttachment = (MeshAttachment)attachment;
|
||||
rendererObject = meshAttachment.RendererObject;
|
||||
attachmentVertexCount = meshAttachment.vertices.Length / 2;
|
||||
attachmentTriangleCount = meshAttachment.triangles.Length;
|
||||
} else if (attachment is SkinnedMeshAttachment) {
|
||||
SkinnedMeshAttachment meshAttachment = (SkinnedMeshAttachment)attachment;
|
||||
rendererObject = meshAttachment.RendererObject;
|
||||
attachmentVertexCount = meshAttachment.uvs.Length / 2;
|
||||
attachmentTriangleCount = meshAttachment.triangles.Length;
|
||||
} else
|
||||
continue;
|
||||
|
||||
// Populate submesh when material changes.
|
||||
Material material = (Material)rendererObject;
|
||||
if (lastMaterial != material && lastMaterial != null) {
|
||||
addSubmesh(lastMaterial, submeshStartSlotIndex, i, submeshTriangleCount, submeshFirstVertex, false);
|
||||
submeshTriangleCount = 0;
|
||||
submeshFirstVertex = vertexCount;
|
||||
submeshStartSlotIndex = i;
|
||||
}
|
||||
lastMaterial = material;
|
||||
|
||||
submeshTriangleCount += attachmentTriangleCount;
|
||||
vertexCount += attachmentVertexCount;
|
||||
}
|
||||
addSubmesh(lastMaterial, submeshStartSlotIndex, drawOrderCount, submeshTriangleCount, submeshFirstVertex, true);
|
||||
|
||||
// Set materials.
|
||||
if (submeshMaterials.Count == sharedMaterials.Length)
|
||||
submeshMaterials.CopyTo(sharedMaterials);
|
||||
else
|
||||
sharedMaterials = submeshMaterials.ToArray();
|
||||
renderer.sharedMaterials = sharedMaterials;
|
||||
|
||||
// Ensure mesh data is the right size.
|
||||
Vector3[] vertices = this.vertices;
|
||||
bool newTriangles = vertexCount > vertices.Length;
|
||||
if (newTriangles) {
|
||||
// Not enough vertices, increase size.
|
||||
this.vertices = vertices = new Vector3[vertexCount];
|
||||
this.colors = new Color32[vertexCount];
|
||||
this.uvs = new Vector2[vertexCount];
|
||||
mesh1.Clear();
|
||||
mesh2.Clear();
|
||||
} else {
|
||||
// Too many vertices, zero the extra.
|
||||
Vector3 zero = Vector3.zero;
|
||||
for (int i = vertexCount, n = lastVertexCount; i < n; i++)
|
||||
vertices[i] = zero;
|
||||
}
|
||||
lastVertexCount = vertexCount;
|
||||
|
||||
// Setup mesh.
|
||||
float[] tempVertices = this.tempVertices;
|
||||
Vector2[] uvs = this.uvs;
|
||||
Color32[] colors = this.colors;
|
||||
int vertexIndex = 0;
|
||||
Color32 color = new Color32();
|
||||
float x = skeleton.x, y = skeleton.y, zSpacing = this.zSpacing;
|
||||
float a = skeleton.a * 255, r = skeleton.r, g = skeleton.g, b = skeleton.b;
|
||||
for (int i = 0; i < drawOrderCount; i++) {
|
||||
Slot slot = drawOrder[i];
|
||||
Attachment attachment = slot.attachment;
|
||||
if (attachment is RegionAttachment) {
|
||||
RegionAttachment regionAttachment = (RegionAttachment)attachment;
|
||||
regionAttachment.ComputeWorldVertices(x, y, slot.bone, tempVertices);
|
||||
|
||||
float z = i * zSpacing;
|
||||
vertices[vertexIndex] = new Vector3(tempVertices[RegionAttachment.X1], tempVertices[RegionAttachment.Y1], z);
|
||||
vertices[vertexIndex + 1] = new Vector3(tempVertices[RegionAttachment.X4], tempVertices[RegionAttachment.Y4], z);
|
||||
vertices[vertexIndex + 2] = new Vector3(tempVertices[RegionAttachment.X2], tempVertices[RegionAttachment.Y2], z);
|
||||
vertices[vertexIndex + 3] = new Vector3(tempVertices[RegionAttachment.X3], tempVertices[RegionAttachment.Y3], z);
|
||||
|
||||
color.a = (byte)(a * slot.a * regionAttachment.a);
|
||||
color.r = (byte)(r * slot.r * regionAttachment.r * color.a);
|
||||
color.g = (byte)(g * slot.g * regionAttachment.g * color.a);
|
||||
color.b = (byte)(b * slot.b * regionAttachment.b * color.a);
|
||||
if (slot.data.additiveBlending) color.a = 0;
|
||||
colors[vertexIndex] = color;
|
||||
colors[vertexIndex + 1] = color;
|
||||
colors[vertexIndex + 2] = color;
|
||||
colors[vertexIndex + 3] = color;
|
||||
|
||||
float[] regionUVs = regionAttachment.uvs;
|
||||
uvs[vertexIndex] = new Vector2(regionUVs[RegionAttachment.X1], regionUVs[RegionAttachment.Y1]);
|
||||
uvs[vertexIndex + 1] = new Vector2(regionUVs[RegionAttachment.X4], regionUVs[RegionAttachment.Y4]);
|
||||
uvs[vertexIndex + 2] = new Vector2(regionUVs[RegionAttachment.X2], regionUVs[RegionAttachment.Y2]);
|
||||
uvs[vertexIndex + 3] = new Vector2(regionUVs[RegionAttachment.X3], regionUVs[RegionAttachment.Y3]);
|
||||
|
||||
vertexIndex += 4;
|
||||
} else if (attachment is MeshAttachment) {
|
||||
MeshAttachment meshAttachment = (MeshAttachment)attachment;
|
||||
int meshVertexCount = meshAttachment.vertices.Length;
|
||||
if (tempVertices.Length < meshVertexCount) tempVertices = new float[meshVertexCount];
|
||||
meshAttachment.ComputeWorldVertices(x, y, slot, tempVertices);
|
||||
|
||||
color.a = (byte)(a * slot.a * meshAttachment.a);
|
||||
color.r = (byte)(r * slot.r * meshAttachment.r * color.a);
|
||||
color.g = (byte)(g * slot.g * meshAttachment.g * color.a);
|
||||
color.b = (byte)(b * slot.b * meshAttachment.b * color.a);
|
||||
if (slot.data.additiveBlending) color.a = 0;
|
||||
|
||||
float[] meshUVs = meshAttachment.uvs;
|
||||
float z = i * zSpacing;
|
||||
for (int ii = 0; ii < meshVertexCount; ii += 2, vertexIndex++) {
|
||||
vertices[vertexIndex] = new Vector3(tempVertices[ii], tempVertices[ii + 1], z);
|
||||
colors[vertexIndex] = color;
|
||||
uvs[vertexIndex] = new Vector2(meshUVs[ii], meshUVs[ii + 1]);
|
||||
}
|
||||
} else if (attachment is SkinnedMeshAttachment) {
|
||||
SkinnedMeshAttachment meshAttachment = (SkinnedMeshAttachment)attachment;
|
||||
int meshVertexCount = meshAttachment.uvs.Length;
|
||||
if (tempVertices.Length < meshVertexCount) tempVertices = new float[meshVertexCount];
|
||||
meshAttachment.ComputeWorldVertices(x, y, slot, tempVertices);
|
||||
|
||||
color.a = (byte)(a * slot.a * meshAttachment.a);
|
||||
color.r = (byte)(r * slot.r * meshAttachment.r * color.a);
|
||||
color.g = (byte)(g * slot.g * meshAttachment.g * color.a);
|
||||
color.b = (byte)(b * slot.b * meshAttachment.b * color.a);
|
||||
if (slot.data.additiveBlending) color.a = 0;
|
||||
|
||||
float[] meshUVs = meshAttachment.uvs;
|
||||
float z = i * zSpacing;
|
||||
for (int ii = 0; ii < meshVertexCount; ii += 2, vertexIndex++) {
|
||||
vertices[vertexIndex] = new Vector3(tempVertices[ii], tempVertices[ii + 1], z);
|
||||
colors[vertexIndex] = color;
|
||||
uvs[vertexIndex] = new Vector2(meshUVs[ii], meshUVs[ii + 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Double buffer mesh.
|
||||
Mesh mesh = useMesh1 ? mesh1 : mesh2;
|
||||
meshFilter.sharedMesh = mesh;
|
||||
|
||||
mesh.vertices = vertices;
|
||||
mesh.colors32 = colors;
|
||||
mesh.uv = uvs;
|
||||
|
||||
int submeshCount = submeshMaterials.Count;
|
||||
mesh.subMeshCount = submeshCount;
|
||||
for (int i = 0; i < submeshCount; ++i)
|
||||
mesh.SetTriangles(submeshes[i].triangles, i);
|
||||
mesh.RecalculateBounds();
|
||||
|
||||
if (newTriangles && calculateNormals) {
|
||||
Vector3[] normals = new Vector3[vertexCount];
|
||||
Vector3 normal = new Vector3(0, 0, -1);
|
||||
for (int i = 0; i < vertexCount; i++)
|
||||
normals[i] = normal;
|
||||
(useMesh1 ? mesh2 : mesh1).vertices = vertices; // Set other mesh vertices.
|
||||
mesh1.normals = normals;
|
||||
mesh2.normals = normals;
|
||||
|
||||
if (calculateTangents) {
|
||||
Vector4[] tangents = new Vector4[vertexCount];
|
||||
Vector3 tangent = new Vector3(0, 0, 1);
|
||||
for (int i = 0; i < vertexCount; i++)
|
||||
tangents[i] = tangent;
|
||||
mesh1.tangents = tangents;
|
||||
mesh2.tangents = tangents;
|
||||
}
|
||||
}
|
||||
|
||||
useMesh1 = !useMesh1;
|
||||
}
|
||||
|
||||
/** Stores vertices and triangles for a single material. */
|
||||
private void addSubmesh (Material material, int startSlot, int endSlot, int triangleCount, int firstVertex, bool lastSubmesh) {
|
||||
int submeshIndex = submeshMaterials.Count;
|
||||
submeshMaterials.Add(material);
|
||||
|
||||
if (submeshes.Count <= submeshIndex) submeshes.Add(new Submesh());
|
||||
Submesh submesh = submeshes[submeshIndex];
|
||||
|
||||
int[] triangles = submesh.triangles;
|
||||
int trianglesCapacity = triangles.Length;
|
||||
if (lastSubmesh && trianglesCapacity > triangleCount) {
|
||||
// Last submesh may have more triangles than required, so zero triangles to the end.
|
||||
for (int i = triangleCount; i < trianglesCapacity; i++)
|
||||
triangles[i] = 0;
|
||||
submesh.triangleCount = triangleCount;
|
||||
} else if (trianglesCapacity != triangleCount) {
|
||||
// Reallocate triangles when not the exact size needed.
|
||||
submesh.triangles = triangles = new int[triangleCount];
|
||||
submesh.triangleCount = 0;
|
||||
}
|
||||
|
||||
List<Slot> drawOrder = skeleton.DrawOrder;
|
||||
for (int i = startSlot, triangleIndex = 0; i < endSlot; i++) {
|
||||
Attachment attachment = drawOrder[i].attachment;
|
||||
int[] attachmentTriangles;
|
||||
int attachmentVertexCount;
|
||||
if (attachment is RegionAttachment) {
|
||||
attachmentVertexCount = 4;
|
||||
attachmentTriangles = quadTriangles;
|
||||
} else if (attachment is MeshAttachment) {
|
||||
MeshAttachment meshAttachment = (MeshAttachment)attachment;
|
||||
attachmentVertexCount = meshAttachment.vertices.Length / 2;
|
||||
attachmentTriangles = meshAttachment.triangles;
|
||||
} else if (attachment is SkinnedMeshAttachment) {
|
||||
SkinnedMeshAttachment meshAttachment = (SkinnedMeshAttachment)attachment;
|
||||
attachmentVertexCount = meshAttachment.uvs.Length / 2;
|
||||
attachmentTriangles = meshAttachment.triangles;
|
||||
} else
|
||||
continue;
|
||||
for (int ii = 0, nn = attachmentTriangles.Length; ii < nn; ii++, triangleIndex++)
|
||||
triangles[triangleIndex] = firstVertex + attachmentTriangles[ii];
|
||||
firstVertex += attachmentVertexCount;
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
void OnDrawGizmos() {
|
||||
// Make selection easier by drawing a clear gizmo over the skeleton.
|
||||
if (vertices == null) return;
|
||||
Vector3 gizmosCenter = new Vector3();
|
||||
Vector3 gizmosSize = new Vector3();
|
||||
Vector3 min = new Vector3(float.MaxValue, float.MaxValue, 0f);
|
||||
Vector3 max = new Vector3(float.MinValue, float.MinValue, 0f);
|
||||
foreach (Vector3 vert in vertices) {
|
||||
min = Vector3.Min (min, vert);
|
||||
max = Vector3.Max (max, vert);
|
||||
}
|
||||
float width = max.x - min.x;
|
||||
float height = max.y - min.y;
|
||||
gizmosCenter = new Vector3(min.x + (width / 2f), min.y + (height / 2f), 0f);
|
||||
gizmosSize = new Vector3(width, height, 1f);
|
||||
Gizmos.color = Color.clear;
|
||||
Gizmos.matrix = transform.localToWorldMatrix;
|
||||
Gizmos.DrawCube(gizmosCenter, gizmosSize);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
class Submesh {
|
||||
public int[] triangles = new int[0];
|
||||
public int triangleCount;
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9da572b571dc33444bd6622951ef62ba
|
||||
guid: 0f77b79230dc4c246a1194a03578bb4e
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
5
spine-tk2d/Assets/examples/goblins.meta
Normal file
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a9308cf14d9ae5040ad789b02f1b3baf
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/Goblins SkeletonData.asset
Normal file
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4a195bd4c354a814b86d191f4921f54b
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
63
spine-tk2d/Assets/examples/goblins/Goblins.cs
Normal file
@ -0,0 +1,63 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes Software License
|
||||
* Version 2.1
|
||||
*
|
||||
* Copyright (c) 2013, Esoteric Software
|
||||
* All rights reserved.
|
||||
*
|
||||
* You are granted a perpetual, non-exclusive, non-sublicensable and
|
||||
* non-transferable license to install, execute and perform the Spine Runtimes
|
||||
* Software (the "Software") solely for internal use. Without the written
|
||||
* permission of Esoteric Software (typically granted by licensing Spine), you
|
||||
* may not (a) modify, translate, adapt or otherwise create derivative works,
|
||||
* improvements of the Software or develop new applications using the Software
|
||||
* or (b) remove, delete, alter or obscure any trademarks or any copyright,
|
||||
* trademark, patent or other intellectual property or proprietary rights
|
||||
* notices on or in the Software, including any copy thereof. Redistributions
|
||||
* in binary or source form must include this license and terms.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
* EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using Spine;
|
||||
|
||||
public class Goblins : MonoBehaviour {
|
||||
private bool girlSkin;
|
||||
private SkeletonAnimation skeletonAnimation;
|
||||
private Bone headBone;
|
||||
|
||||
public void Start () {
|
||||
skeletonAnimation = GetComponent<SkeletonAnimation>();
|
||||
headBone = skeletonAnimation.skeleton.FindBone("head");
|
||||
skeletonAnimation.UpdateBones += UpdateBones;
|
||||
}
|
||||
|
||||
// This is called after the animation is applied to the skeleton and can be used to adjust the bones dynamically.
|
||||
public void UpdateBones (SkeletonAnimation skeletonAnimation) {
|
||||
headBone.Rotation += 15;
|
||||
}
|
||||
|
||||
public void OnMouseDown () {
|
||||
skeletonAnimation.skeleton.SetSkin(girlSkin ? "goblin" : "goblingirl");
|
||||
skeletonAnimation.skeleton.SetSlotsToSetupPose();
|
||||
|
||||
girlSkin = !girlSkin;
|
||||
|
||||
if (girlSkin) {
|
||||
skeletonAnimation.skeleton.SetAttachment("right hand item", null);
|
||||
skeletonAnimation.skeleton.SetAttachment("left hand item", "spear");
|
||||
} else
|
||||
skeletonAnimation.skeleton.SetAttachment("left hand item", "dagger");
|
||||
}
|
||||
}
|
||||
8
spine-tk2d/Assets/examples/goblins/Goblins.cs.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3a41b9a80b4f2c045b7ad76e0d652ddc
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 982b49f422d2cb04bbaf38993fef207b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31c989bbbeeeab24e99b68ac7975d2b8
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0b38b0b706d87b04ab4621c37c7d5019
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/GoblinsAtlas Data/atlas0.png
Normal file
|
After Width: | Height: | Size: 96 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e76e8228e3b38264194b3dfad10b7af7
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/GoblinsAtlas.prefab
Normal file
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: db91f44e9acec474fb74db538fe06935
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
1005
spine-tk2d/Assets/examples/goblins/goblins-ffd.json.txt
Normal file
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 03dfe4c9b91b93b47816439a1f91a48a
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/goblins.unity
Normal file
4
spine-tk2d/Assets/examples/goblins/goblins.unity.meta
Normal file
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc2d822d0267e2e46bd5ee22ebc89b36
|
||||
DefaultImporter:
|
||||
userData:
|
||||
5
spine-tk2d/Assets/examples/goblins/images.meta
Normal file
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4b989f3dd92ba6d46b9f473be0ef27fc
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/images/dagger.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
45
spine-tk2d/Assets/examples/goblins/images/dagger.png.meta
Normal file
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cff16cdb2ad3d54478e6d12afd6f835c
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
5
spine-tk2d/Assets/examples/goblins/images/goblin.meta
Normal file
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5ec67732682a81943a13b2dfd7b316d1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/images/goblin/eyes-closed.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2f9da4d291a7421488b5d8c4c33fc5b4
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/images/goblin/head.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bcce48841f8498e49876846c151dc4d7
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/images/goblin/left-arm.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cf0aa5059c48db64380b5d8d9d48bbf7
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/images/goblin/left-foot.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 14451be1ccd40764e9be7944b1b35d7e
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/images/goblin/left-hand.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2f39487177b6d0f429497745e64e1db0
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
|
After Width: | Height: | Size: 6.0 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d875337f331493b448affcae727ab7b0
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6c0265e742cac734e86738c88cac3187
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
|
After Width: | Height: | Size: 5.6 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 30edd05fdf3f3ec4897c5f095cfba8f9
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/images/goblin/neck.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 946e1ac49a597d642940d2bc61a74ceb
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/images/goblin/pelvis.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 34721831e8dc33048a1c642af9c91860
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/images/goblin/right-arm.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0fc0421ba4507d7479276646539febf7
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/images/goblin/right-foot.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 232f1d4aee7e76547b4a3349b7fd4f29
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/images/goblin/right-hand.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e89eca7d89b489f4491b5ec1cbb3ddf7
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
|
After Width: | Height: | Size: 6.2 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aab7b79018a3ec84baccbeb6d9c40554
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
|
After Width: | Height: | Size: 4.6 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0937186e72f856419c9dbcaec82762d
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
|
After Width: | Height: | Size: 5.7 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 438e00f2d68cac24bace724555e443b5
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/images/goblin/torso.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9427b1a031010ab41b9cda104be8c204
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
|
After Width: | Height: | Size: 3.8 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9cfb974ed9f3dd042895ccfe0e2461b1
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/images/goblin/undies.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 10fccc8bd5aead04ca7376a040205f6f
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1c61c40d4513f844b9c4bb7bfb8992a6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/images/shield.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
45
spine-tk2d/Assets/examples/goblins/images/shield.png.meta
Normal file
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 95c2d261ccd8d8c4b8760693cba0e08a
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
spine-tk2d/Assets/examples/goblins/images/spear.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
45
spine-tk2d/Assets/examples/goblins/images/spear.png.meta
Normal file
@ -0,0 +1,45 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 54e7cc7562d107b4d96e0422dc7ed587
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 4096
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
@ -41,8 +41,8 @@ public class Spineboy : MonoBehaviour {
|
||||
skeletonAnimation = GetComponent<SkeletonAnimation>();
|
||||
// Call our method any time an animation fires an event.
|
||||
skeletonAnimation.state.Event += Event;
|
||||
// Queue jump to be played on track 0 after the starting animation.
|
||||
skeletonAnimation.state.AddAnimation(0, "jump", false, 0);
|
||||
// Queue jump to be played on track 0 three seconds after the starting animation.
|
||||
skeletonAnimation.state.AddAnimation(0, "jump", false, 3);
|
||||
// Queue walk to be looped on track 0 after the jump animation.
|
||||
skeletonAnimation.state.AddAnimation(0, "run", true, 0);
|
||||
}
|
||||
|
||||
@ -1815,55 +1815,55 @@
|
||||
"slots": {
|
||||
"front_fist": {
|
||||
"attachment": [
|
||||
{ "time": 0, "name": "front_fist_closed" },
|
||||
{ "time": 0.2666, "name": "front_fist_open" }
|
||||
{ "time": 0.1333, "name": "front_fist_closed" },
|
||||
{ "time": 0.4, "name": "front_fist_open" }
|
||||
]
|
||||
},
|
||||
"mouth": {
|
||||
"attachment": [
|
||||
{ "time": 0, "name": "mouth_grind" }
|
||||
{ "time": 0.1333, "name": "mouth_grind" }
|
||||
]
|
||||
},
|
||||
"muzzle": {
|
||||
"attachment": [
|
||||
{ "time": 0, "name": "muzzle" },
|
||||
{ "time": 0.1333, "name": null }
|
||||
{ "time": 0.1333, "name": "muzzle" },
|
||||
{ "time": 0.2666, "name": null }
|
||||
],
|
||||
"color": [
|
||||
{
|
||||
"time": 0,
|
||||
"time": 0.1333,
|
||||
"color": "ffffff00",
|
||||
"curve": [ 0.118, 0.99, 0.75, 1 ]
|
||||
},
|
||||
{
|
||||
"time": 0.0333,
|
||||
"time": 0.1666,
|
||||
"color": "ffffffff",
|
||||
"curve": [ 0.821, 0, 0.909, 0.89 ]
|
||||
},
|
||||
{ "time": 0.1333, "color": "ffffff00" }
|
||||
{ "time": 0.2666, "color": "ffffff00" }
|
||||
]
|
||||
}
|
||||
},
|
||||
"bones": {
|
||||
"front_fist": {
|
||||
"scale": [
|
||||
{ "time": 0, "x": 1, "y": 1, "curve": "stepped" },
|
||||
{ "time": 0.2666, "x": 1, "y": 1 }
|
||||
{ "time": 0.1333, "x": 1, "y": 1, "curve": "stepped" },
|
||||
{ "time": 0.4, "x": 1, "y": 1 }
|
||||
]
|
||||
},
|
||||
"gunTip": {
|
||||
"translate": [
|
||||
{ "time": 0, "x": 0, "y": 0 },
|
||||
{ "time": 0.0666, "x": 20.93, "y": 1.57 }
|
||||
{ "time": 0.1333, "x": 0, "y": 0 },
|
||||
{ "time": 0.2, "x": 20.93, "y": 1.57 }
|
||||
],
|
||||
"scale": [
|
||||
{ "time": 0, "x": 1, "y": 1 },
|
||||
{ "time": 0.0666, "x": 1.247, "y": 1.516 }
|
||||
{ "time": 0.1333, "x": 1, "y": 1 },
|
||||
{ "time": 0.2, "x": 1.247, "y": 1.516 }
|
||||
]
|
||||
},
|
||||
"gun": {
|
||||
"rotate": [
|
||||
{ "time": 0, "angle": 0 }
|
||||
{ "time": 0, "angle": 1.9 }
|
||||
],
|
||||
"translate": [
|
||||
{
|
||||
@ -1872,13 +1872,13 @@
|
||||
"y": 5.84,
|
||||
"curve": [ 0, 0.3, 0.678, 1 ]
|
||||
},
|
||||
{ "time": 0.1666, "x": -9.3, "y": -1.41 },
|
||||
{ "time": 0.2666, "x": 0, "y": 0 }
|
||||
{ "time": 0.3, "x": -9.3, "y": -1.41 },
|
||||
{ "time": 0.4, "x": 0, "y": 0 }
|
||||
]
|
||||
},
|
||||
"rear_bracer": {
|
||||
"rotate": [
|
||||
{ "time": 0, "angle": 0 }
|
||||
{ "time": 0, "angle": -30.47 }
|
||||
],
|
||||
"translate": [
|
||||
{
|
||||
@ -1887,13 +1887,13 @@
|
||||
"y": 0,
|
||||
"curve": [ 0, 0.3, 0.678, 1 ]
|
||||
},
|
||||
{ "time": 0.1666, "x": -5.99, "y": -3.71 },
|
||||
{ "time": 0.2666, "x": 0, "y": 0 }
|
||||
{ "time": 0.3, "x": -5.99, "y": -3.71 },
|
||||
{ "time": 0.4, "x": 0, "y": 0 }
|
||||
]
|
||||
},
|
||||
"rear_upper_arm": {
|
||||
"rotate": [
|
||||
{ "time": 0, "angle": 0 }
|
||||
{ "time": 0, "angle": 62.3 }
|
||||
],
|
||||
"translate": [
|
||||
{
|
||||
@ -1902,8 +1902,8 @@
|
||||
"y": 0,
|
||||
"curve": [ 0, 0.3, 0.678, 1 ]
|
||||
},
|
||||
{ "time": 0.1666, "x": 2.81, "y": 11.41 },
|
||||
{ "time": 0.2666, "x": 0, "y": 0 }
|
||||
{ "time": 0.3, "x": 2.81, "y": 11.41 },
|
||||
{ "time": 0.4, "x": 0, "y": 0 }
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||