Skip to content

Commit beedb35

Browse files
committed
Merge branch 'release/v0.3'
2 parents b236f0d + cbed08e commit beedb35

File tree

3 files changed

+214
-61
lines changed

3 files changed

+214
-61
lines changed

Assets/UnitySpineImporter/3DParty/CurveExtension/KeyframeUtil.cs

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System;
55

66
namespace CurveExtended{
7+
[Flags]
78
public enum TangentMode
89
{
910
Editable = 0,
@@ -102,6 +103,14 @@ public static void SetKeyBroken(object keyframe, bool broken)
102103
tangentMode &= -2;
103104
field.SetValue(keyframe, tangentMode);
104105
}
106+
107+
// UnityEditor.CurveUtility.cs (c) Unity Technologies
108+
public static bool isKeyBroken(object keyframe){
109+
Type t = typeof( UnityEngine.Keyframe );
110+
FieldInfo field = t.GetField( "m_TangentMode", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance );
111+
int tangentMode = (int)field.GetValue(keyframe);
112+
return (tangentMode & 1) != 0;
113+
}
105114

106115
}
107116
}

Assets/UnitySpineImporter/Scripts/Editor/SpineImporterWizard.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class SpineImporterWizard :ScriptableWizard {
1515
public int pixelsPerUnit = 100;
1616
public bool buildAvatarMask = true;
1717
public AnimationImportType animationImportType = AnimationImportType.MECANIM;
18+
public bool updateResources = true;
1819
[HideInInspector]
1920
public string path;
2021

@@ -33,7 +34,8 @@ public static bool validateContext(){
3334

3435
void OnWizardUpdate() {
3536
helpString = "Be carefull, don't use small amout of pixels per unit (e.g. 1 or 10) \n" +
36-
"if you are going to use result model with unity 2d physics and gravity";
37+
"if you are going to use result model with unity 2d physics and gravity\n" +
38+
"update resources means - instead of create new animator and new animations update them";
3739
if (pixelsPerUnit <=0)
3840
errorString = "PixelsPerUnit must be greater than zero";
3941
else
@@ -70,11 +72,10 @@ void OnWizardCreate(){
7072
}
7173

7274
ModelImporterAnimationType modelImporterAnimationType = getModelImporterAnimationType();
73-
SpineUtil.addAnimation(rootGO, directory, spineData, boneGOByName, attachmentGOByNameBySlot, pixelsPerUnit, modelImporterAnimationType);
75+
SpineUtil.addAnimation(rootGO, directory, spineData, boneGOByName, attachmentGOByNameBySlot,
76+
pixelsPerUnit, modelImporterAnimationType, updateResources);
7477
sk.showDefaulSlots();
75-
7678
SpineUtil.buildPrefab(rootGO, directory, name);
77-
7879
GameObject.DestroyImmediate(rootGO);
7980

8081
} catch (SpineMultiatlasCreationException e){

0 commit comments

Comments
 (0)