mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-11 17:48:45 +08:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
72802fd62f
Binary file not shown.
@ -9,14 +9,5 @@
|
||||
<resource>SDK:frameworks/libs/core.swc</resource>
|
||||
<resource>SDK:frameworks/libs/osmf.swc</resource>
|
||||
<resource>SDK:frameworks/libs/textLayout.swc</resource>
|
||||
<resource>frameworks/libs/air/aircore.swc</resource>
|
||||
<resource>frameworks/libs/air/airglobal.swc</resource>
|
||||
<resource>frameworks/libs/air/applicationupdater.swc</resource>
|
||||
<resource>frameworks/libs/air/applicationupdater_ui.swc</resource>
|
||||
<resource>frameworks/libs/air/servicemonitor.swc</resource>
|
||||
<resource>frameworks/libs/authoringsupport.swc</resource>
|
||||
<resource>frameworks/libs/core.swc</resource>
|
||||
<resource>frameworks/libs/osmf.swc</resource>
|
||||
<resource>frameworks/libs/textLayout.swc</resource>
|
||||
</exclude>
|
||||
|
||||
|
||||
@ -99,7 +99,14 @@ public class SkeletonSprite extends DisplayObject {
|
||||
b * slot.b * region.b);
|
||||
|
||||
var image:Image = region.rendererObject as Image;
|
||||
if (image == null) region.rendererObject = image = Image(AtlasRegion(region.rendererObject).rendererObject);
|
||||
if (image == null) {
|
||||
var origImage:Image = Image(AtlasRegion(region.rendererObject).rendererObject);
|
||||
region.rendererObject = image = new Image(origImage.texture);
|
||||
for (var j:int = 0; j < 4; j++) {
|
||||
var p: Point = origImage.getTexCoords(j);
|
||||
image.setTexCoords(j, p.x, p.y);
|
||||
}
|
||||
}
|
||||
|
||||
image.setVertexPosition(0, worldVertices[2], worldVertices[3]);
|
||||
image.setVertexColor(0, rgb);
|
||||
|
||||
@ -208,12 +208,10 @@ namespace Spine.Unity.Editor {
|
||||
skeletonUtilityBoneTable = new Dictionary<int, SkeletonUtilityBone>();
|
||||
boundingBoxFollowerTable = new Dictionary<int, BoundingBoxFollower>();
|
||||
|
||||
#if SPINE_HIERARCHY_ICONS
|
||||
EditorApplication.hierarchyWindowChanged -= HierarchyWindowChanged;
|
||||
EditorApplication.hierarchyWindowChanged += HierarchyWindowChanged;
|
||||
EditorApplication.hierarchyWindowItemOnGUI -= HierarchyWindowItemOnGUI;
|
||||
EditorApplication.hierarchyWindowItemOnGUI += HierarchyWindowItemOnGUI;
|
||||
#endif
|
||||
|
||||
HierarchyWindowChanged();
|
||||
initialized = true;
|
||||
@ -327,24 +325,31 @@ namespace Spine.Unity.Editor {
|
||||
Vector3 spawnPoint = MousePointToWorldPoint2D(mousePos, sceneview.camera, plane);
|
||||
|
||||
var menu = new GenericMenu();
|
||||
// SkeletonAnimation
|
||||
menu.AddItem(new GUIContent("SkeletonAnimation"), false, HandleSkeletonComponentDrop, new SpawnMenuData {
|
||||
skeletonDataAsset = skeletonDataAsset,
|
||||
spawnPoint = spawnPoint,
|
||||
instantiateDelegate = (data) => InstantiateSkeletonAnimation(data)
|
||||
instantiateDelegate = (data) => InstantiateSkeletonAnimation(data),
|
||||
isUI = false
|
||||
});
|
||||
|
||||
foreach (var spawnType in additionalSpawnTypes) {
|
||||
menu.AddItem(new GUIContent(spawnType.menuLabel), false, HandleSkeletonComponentDrop, new SpawnMenuData {
|
||||
skeletonDataAsset = skeletonDataAsset,
|
||||
spawnPoint = spawnPoint,
|
||||
instantiateDelegate = spawnType.instantiateDelegate,
|
||||
isUI = spawnType.isUI
|
||||
});
|
||||
// SkeletonGraphic
|
||||
var skeletonGraphicInspectorType = System.Type.GetType("Spine.Unity.Editor.SkeletonGraphicInspector");
|
||||
if (skeletonGraphicInspectorType != null) {
|
||||
var graphicInstantiateDelegate = skeletonGraphicInspectorType.GetMethod("SpawnSkeletonGraphicFromDrop", BindingFlags.Static | BindingFlags.Public);
|
||||
if (graphicInstantiateDelegate != null)
|
||||
menu.AddItem(new GUIContent("SkeletonGraphic (UI)"), false, HandleSkeletonComponentDrop, new SpawnMenuData {
|
||||
skeletonDataAsset = skeletonDataAsset,
|
||||
spawnPoint = spawnPoint,
|
||||
instantiateDelegate = System.Delegate.CreateDelegate(typeof(InstantiateDelegate), graphicInstantiateDelegate) as InstantiateDelegate,
|
||||
isUI = true
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
#if SPINE_SKELETONANIMATOR
|
||||
menu.AddSeparator("");
|
||||
|
||||
// SkeletonAnimator
|
||||
menu.AddItem(new GUIContent("SkeletonAnimator"), false, HandleSkeletonComponentDrop, new SpawnMenuData {
|
||||
skeletonDataAsset = skeletonDataAsset,
|
||||
spawnPoint = spawnPoint,
|
||||
|
||||
@ -49,40 +49,6 @@ namespace Spine.Unity.Editor {
|
||||
|
||||
SkeletonGraphic thisSkeletonGraphic;
|
||||
|
||||
static SpineEditorUtilities.InstantiateDelegate instantiateDelegate;
|
||||
|
||||
static SkeletonGraphicInspector () {
|
||||
if (!SpineEditorUtilities.initialized)
|
||||
return;
|
||||
|
||||
if (instantiateDelegate == null)
|
||||
instantiateDelegate = new SpineEditorUtilities.InstantiateDelegate(SpawnSkeletonGraphicFromDrop);
|
||||
|
||||
// Drag and Drop Instantiate menu item
|
||||
var spawnTypes = SpineEditorUtilities.additionalSpawnTypes;
|
||||
UnityEngine.Assertions.Assert.IsFalse(spawnTypes == null);
|
||||
bool menuItemExists = false;
|
||||
foreach (var spawnType in spawnTypes) {
|
||||
if (spawnType.instantiateDelegate == SkeletonGraphicInspector.instantiateDelegate) {
|
||||
menuItemExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!menuItemExists) {
|
||||
SpineEditorUtilities.additionalSpawnTypes.Add(new SpineEditorUtilities.SkeletonComponentSpawnType {
|
||||
menuLabel = "SkeletonGraphic (UI)",
|
||||
instantiateDelegate = SkeletonGraphicInspector.instantiateDelegate,
|
||||
isUI = true
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static public Component SpawnSkeletonGraphicFromDrop (SkeletonDataAsset data) {
|
||||
return InstantiateSkeletonGraphic(data);
|
||||
}
|
||||
|
||||
void OnEnable () {
|
||||
var so = this.serializedObject;
|
||||
thisSkeletonGraphic = target as SkeletonGraphic;
|
||||
@ -198,6 +164,11 @@ namespace Spine.Unity.Editor {
|
||||
return true;
|
||||
}
|
||||
|
||||
// SpineEditorUtilities.InstantiateDelegate. Used by drag and drop.
|
||||
public static Component SpawnSkeletonGraphicFromDrop (SkeletonDataAsset data) {
|
||||
return InstantiateSkeletonGraphic(data);
|
||||
}
|
||||
|
||||
public static SkeletonGraphic InstantiateSkeletonGraphic (SkeletonDataAsset skeletonDataAsset, string skinName) {
|
||||
return InstantiateSkeletonGraphic(skeletonDataAsset, skeletonDataAsset.GetSkeletonData(true).FindSkin(skinName));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user