Skip to content

Commit

Permalink
Merge branch 'feature/draw_order' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
nicloay committed Aug 22, 2014
2 parents f83c75e + bd4ae7d commit da3a3f3
Show file tree
Hide file tree
Showing 26 changed files with 641 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System.Collections.Generic;
using LitJson;

namespace UnitySpineImporter{
public class SpineAnimation {
public Dictionary<string, SpineBoneAnimation> bones;
public Dictionary<string, SpineSlotAnimation> slots;
public List<SpineDrawOrderAnimation> draworder;

public Dictionary< string, SpineBoneAnimation > bones;
public Dictionary< string, SpineSlotAnimation > slots;
public List< SpineDrawOrderAnimation > draworder;
public List< JsonData > events;
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
using UnityEngine;
using System.Collections;
using LitJson;
namespace UnitySpineImporter {
public class SpineAnimationEvent {
public double time;
public string name;

public class SpineAnimationEvent : MonoBehaviour {

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class SpineImporterWizard :ScriptableWizard {
public bool buildAvatarMask = true;
public AnimationImportType animationImportType = AnimationImportType.MECANIM;
public bool updateResources = true;
public float zStep = 0.01f;
[HideInInspector]
public string path;

Expand Down Expand Up @@ -55,13 +56,14 @@ void OnWizardCreate(){
Dictionary<string, Slot> slotByName;
List<Skin> skins;
AttachmentGOByNameBySlot attachmentGOByNameBySlot;

if (File.Exists(path)){
try{
SpineMultiatlas spineMultiAtlas = SpineMultiatlas.deserializeFromFile(atlasPath );
SpineData spineData = SpineData .deserializeFromFile(path);

SpineUtil.updateImporters(spineMultiAtlas, directory, pixelsPerUnit, out spriteByName);
GameObject rootGO = SpineUtil.buildSceleton(name, spineData, pixelsPerUnit, out boneGOByName, out slotByName);
GameObject rootGO = SpineUtil.buildSceleton(name, spineData, pixelsPerUnit, zStep, out boneGOByName, out slotByName);
rootGO.name = name;
SpineUtil.addAllAttahcmentsSlots(spineData, spriteByName, slotByName, pixelsPerUnit, out skins, out attachmentGOByNameBySlot);
SkinController sk = SpineUtil.addSkinController(rootGO, spineData, skins, slotByName);
Expand All @@ -73,8 +75,8 @@ void OnWizardCreate(){

ModelImporterAnimationType modelImporterAnimationType = getModelImporterAnimationType();
if (spineData.animations !=null && spineData.animations.Count > 0)
SpineUtil.addAnimation(rootGO, directory, spineData, boneGOByName, attachmentGOByNameBySlot,
pixelsPerUnit, modelImporterAnimationType, updateResources);
SpineUtil.addAnimation(rootGO, directory, spineData, boneGOByName, slotByName, attachmentGOByNameBySlot, skins,
pixelsPerUnit, zStep, modelImporterAnimationType, updateResources );
sk.showDefaulSlots();
SpineUtil.buildPrefab(rootGO, directory, name);
GameObject.DestroyImmediate(rootGO);
Expand Down
Loading

0 comments on commit da3a3f3

Please sign in to comment.