mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Merge branch '3.8-beta' of https://github.com/esotericsoftware/spine-runtimes into 3.8-beta
This commit is contained in:
commit
9531cb0b7d
@ -270,7 +270,7 @@ namespace Spine {
|
|||||||
return clipped;
|
return clipped;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MakeClockwise (ExposedList<float> polygon) {
|
public static void MakeClockwise (ExposedList<float> polygon) {
|
||||||
float[] vertices = polygon.Items;
|
float[] vertices = polygon.Items;
|
||||||
int verticeslength = polygon.Count;
|
int verticeslength = polygon.Count;
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Spine {
|
namespace Spine {
|
||||||
internal class Triangulator {
|
public class Triangulator {
|
||||||
private readonly ExposedList<ExposedList<float>> convexPolygons = new ExposedList<ExposedList<float>>();
|
private readonly ExposedList<ExposedList<float>> convexPolygons = new ExposedList<ExposedList<float>>();
|
||||||
private readonly ExposedList<ExposedList<int>> convexPolygonsIndices = new ExposedList<ExposedList<int>>();
|
private readonly ExposedList<ExposedList<int>> convexPolygonsIndices = new ExposedList<ExposedList<int>>();
|
||||||
|
|
||||||
|
|||||||
@ -175,6 +175,8 @@ public class SkeletonBinary {
|
|||||||
if (skeletonData.hash.isEmpty()) skeletonData.hash = null;
|
if (skeletonData.hash.isEmpty()) skeletonData.hash = null;
|
||||||
skeletonData.version = input.readString();
|
skeletonData.version = input.readString();
|
||||||
if (skeletonData.version.isEmpty()) skeletonData.version = null;
|
if (skeletonData.version.isEmpty()) skeletonData.version = null;
|
||||||
|
skeletonData.x = input.readFloat();
|
||||||
|
skeletonData.y = input.readFloat();
|
||||||
skeletonData.width = input.readFloat();
|
skeletonData.width = input.readFloat();
|
||||||
skeletonData.height = input.readFloat();
|
skeletonData.height = input.readFloat();
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ public class SkeletonData {
|
|||||||
final Array<IkConstraintData> ikConstraints = new Array();
|
final Array<IkConstraintData> ikConstraints = new Array();
|
||||||
final Array<TransformConstraintData> transformConstraints = new Array();
|
final Array<TransformConstraintData> transformConstraints = new Array();
|
||||||
final Array<PathConstraintData> pathConstraints = new Array();
|
final Array<PathConstraintData> pathConstraints = new Array();
|
||||||
float width, height;
|
float x, y, width, height;
|
||||||
String version, hash;
|
String version, hash;
|
||||||
|
|
||||||
// Nonessential.
|
// Nonessential.
|
||||||
@ -234,6 +234,24 @@ public class SkeletonData {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** The X coordinate of the skeleton's axis aligned bounding box in the setup pose. */
|
||||||
|
public float getX () {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setX (float x) {
|
||||||
|
this.x = x;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The Y coordinate of the skeleton's axis aligned bounding box in the setup pose. */
|
||||||
|
public float getY () {
|
||||||
|
return y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setY (float y) {
|
||||||
|
this.y = y;
|
||||||
|
}
|
||||||
|
|
||||||
/** The width of the skeleton's axis aligned bounding box in the setup pose. */
|
/** The width of the skeleton's axis aligned bounding box in the setup pose. */
|
||||||
public float getWidth () {
|
public float getWidth () {
|
||||||
return width;
|
return width;
|
||||||
|
|||||||
@ -122,6 +122,8 @@ public class SkeletonJson {
|
|||||||
if (skeletonMap != null) {
|
if (skeletonMap != null) {
|
||||||
skeletonData.hash = skeletonMap.getString("hash", null);
|
skeletonData.hash = skeletonMap.getString("hash", null);
|
||||||
skeletonData.version = skeletonMap.getString("spine", null);
|
skeletonData.version = skeletonMap.getString("spine", null);
|
||||||
|
skeletonData.x = skeletonMap.getFloat("x", 0);
|
||||||
|
skeletonData.y = skeletonMap.getFloat("y", 0);
|
||||||
skeletonData.width = skeletonMap.getFloat("width", 0);
|
skeletonData.width = skeletonMap.getFloat("width", 0);
|
||||||
skeletonData.height = skeletonMap.getFloat("height", 0);
|
skeletonData.height = skeletonMap.getFloat("height", 0);
|
||||||
skeletonData.fps = skeletonMap.getFloat("fps", 30);
|
skeletonData.fps = skeletonMap.getFloat("fps", 30);
|
||||||
|
|||||||
@ -65,9 +65,9 @@ namespace Spine {
|
|||||||
|
|
||||||
// String name = "spineboy-ess";
|
// String name = "spineboy-ess";
|
||||||
// String name = "goblins-pro";
|
// String name = "goblins-pro";
|
||||||
// String name = "raptor-pro";
|
String name = "raptor-pro";
|
||||||
// String name = "tank-pro";
|
// String name = "tank-pro";
|
||||||
String name = "coin-pro";
|
// String name = "coin-pro";
|
||||||
String atlasName = name.Replace("-pro", "").Replace("-ess", "");
|
String atlasName = name.Replace("-pro", "").Replace("-ess", "");
|
||||||
bool binaryData = false;
|
bool binaryData = false;
|
||||||
|
|
||||||
@ -109,17 +109,17 @@ namespace Spine {
|
|||||||
state.Complete += Complete;
|
state.Complete += Complete;
|
||||||
state.Event += Event;
|
state.Event += Event;
|
||||||
|
|
||||||
state.SetAnimation(0, "test", false);
|
state.SetAnimation(0, "run", false);
|
||||||
TrackEntry entry = state.AddAnimation(0, "jump", false, 0);
|
TrackEntry entry = state.AddAnimation(0, "jump", false, 0);
|
||||||
entry.End += End; // Event handling for queued animations.
|
entry.End += End; // Event handling for queued animations.
|
||||||
state.AddAnimation(0, "run", true, 0);
|
state.AddAnimation(0, "run", true, 0);
|
||||||
}
|
}
|
||||||
else if (name == "raptor-pro") {
|
else if (name == "raptor-pro") {
|
||||||
state.SetAnimation(0, "walk", true);
|
state.SetAnimation(0, "walk", true);
|
||||||
state.AddAnimation(1, "gungrab", false, 2);
|
state.AddAnimation(1, "gun-grab", false, 2);
|
||||||
}
|
}
|
||||||
else if (name == "coin-pro") {
|
else if (name == "coin-pro") {
|
||||||
state.SetAnimation(0, "rotate", true);
|
state.SetAnimation(0, "animation", true);
|
||||||
}
|
}
|
||||||
else if (name == "tank-pro") {
|
else if (name == "tank-pro") {
|
||||||
state.SetAnimation(0, "drive", true);
|
state.SetAnimation(0, "drive", true);
|
||||||
@ -127,9 +127,10 @@ namespace Spine {
|
|||||||
else {
|
else {
|
||||||
state.SetAnimation(0, "walk", true);
|
state.SetAnimation(0, "walk", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
skeleton.X = 400 + (name == "tank-pro" ? 300 : 0);
|
skeleton.X = 400 + (name == "tank-pro" ? 300 : 0);
|
||||||
skeleton.Y = GraphicsDevice.Viewport.Height;
|
skeleton.Y = GraphicsDevice.Viewport.Height;
|
||||||
|
skeleton.ScaleY = -1;
|
||||||
skeleton.UpdateWorldTransform();
|
skeleton.UpdateWorldTransform();
|
||||||
|
|
||||||
headSlot = skeleton.FindSlot("head");
|
headSlot = skeleton.FindSlot("head");
|
||||||
|
|||||||
@ -42,6 +42,15 @@
|
|||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="..\..\spine-xna\src\ShapeRenderer.cs">
|
||||||
|
<Link>spine-xna\ShapeRenderer.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="..\..\spine-xna\src\SkeletonDebugRenderer.cs">
|
||||||
|
<Link>spine-xna\SkeletonDebugRenderer.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="..\..\spine-xna\src\VertexEffect.cs">
|
||||||
|
<Link>spine-xna\VertexEffect.cs</Link>
|
||||||
|
</Compile>
|
||||||
<Compile Include="..\..\spine-xna\src\MeshBatcher.cs">
|
<Compile Include="..\..\spine-xna\src\MeshBatcher.cs">
|
||||||
<Link>spine-xna\MeshBatcher.cs</Link>
|
<Link>spine-xna\MeshBatcher.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|||||||
@ -7,9 +7,15 @@ DefaultGraphicsPerformance=Maximum
|
|||||||
AppliedDefaultGraphicsPerformance=Maximum
|
AppliedDefaultGraphicsPerformance=Maximum
|
||||||
|
|
||||||
[/Script/EngineSettings.GameMapsSettings]
|
[/Script/EngineSettings.GameMapsSettings]
|
||||||
GameDefaultMap=/Game/Test/Test.Test
|
GameDefaultMap=/Game/Test/NewWorld.NewWorld
|
||||||
GlobalDefaultGameMode=/Game/Test/Blueprints/TouchClick.TouchClick_C
|
GlobalDefaultGameMode=/Game/Test/Blueprints/TouchClick.TouchClick_C
|
||||||
|
|
||||||
|
[/Script/IOSRuntimeSettings.IOSRuntimeSettings]
|
||||||
|
bSupportsPortraitOrientation=False
|
||||||
|
bSupportsUpsideDownOrientation=False
|
||||||
|
bSupportsLandscapeLeftOrientation=True
|
||||||
|
PreferredLandscapeOrientation=LandscapeLeft
|
||||||
|
|
||||||
[/Script/Engine.PhysicsSettings]
|
[/Script/Engine.PhysicsSettings]
|
||||||
DefaultGravityZ=-980.000000
|
DefaultGravityZ=-980.000000
|
||||||
DefaultTerminalVelocity=4000.000000
|
DefaultTerminalVelocity=4000.000000
|
||||||
@ -17,12 +23,12 @@ DefaultFluidFriction=0.300000
|
|||||||
SimulateScratchMemorySize=262144
|
SimulateScratchMemorySize=262144
|
||||||
RagdollAggregateThreshold=4
|
RagdollAggregateThreshold=4
|
||||||
TriangleMeshTriangleMinAreaThreshold=5.000000
|
TriangleMeshTriangleMinAreaThreshold=5.000000
|
||||||
bEnableAsyncScene=False
|
|
||||||
bEnableShapeSharing=False
|
bEnableShapeSharing=False
|
||||||
bEnablePCM=True
|
bEnablePCM=True
|
||||||
bEnableStabilization=False
|
bEnableStabilization=False
|
||||||
bWarnMissingLocks=True
|
bWarnMissingLocks=True
|
||||||
bEnable2DPhysics=False
|
bEnable2DPhysics=False
|
||||||
|
PhysicErrorCorrection=(PingExtrapolation=0.100000,PingLimit=100.000000,ErrorPerLinearDifference=1.000000,ErrorPerAngularDifference=1.000000,MaxRestoredStateError=1.000000,MaxLinearHardSnapDistance=400.000000,PositionLerp=0.000000,AngleLerp=0.400000,LinearVelocityCoefficient=100.000000,AngularVelocityCoefficient=10.000000,ErrorAccumulationSeconds=0.500000,ErrorAccumulationDistanceSq=15.000000,ErrorAccumulationSimilarity=100.000000)
|
||||||
LockedAxis=Invalid
|
LockedAxis=Invalid
|
||||||
DefaultDegreesOfFreedom=Full3D
|
DefaultDegreesOfFreedom=Full3D
|
||||||
BounceThresholdVelocity=200.000000
|
BounceThresholdVelocity=200.000000
|
||||||
@ -39,6 +45,8 @@ bDefaultHasComplexCollision=True
|
|||||||
bSuppressFaceRemapTable=False
|
bSuppressFaceRemapTable=False
|
||||||
bSupportUVFromHitResults=False
|
bSupportUVFromHitResults=False
|
||||||
bDisableActiveActors=False
|
bDisableActiveActors=False
|
||||||
|
bDisableKinematicStaticPairs=False
|
||||||
|
bDisableKinematicKinematicPairs=False
|
||||||
bDisableCCD=False
|
bDisableCCD=False
|
||||||
bEnableEnhancedDeterminism=False
|
bEnableEnhancedDeterminism=False
|
||||||
MaxPhysicsDeltaTime=0.033333
|
MaxPhysicsDeltaTime=0.033333
|
||||||
@ -47,16 +55,7 @@ bSubsteppingAsync=False
|
|||||||
MaxSubstepDeltaTime=0.016667
|
MaxSubstepDeltaTime=0.016667
|
||||||
MaxSubsteps=6
|
MaxSubsteps=6
|
||||||
SyncSceneSmoothingFactor=0.000000
|
SyncSceneSmoothingFactor=0.000000
|
||||||
AsyncSceneSmoothingFactor=0.990000
|
|
||||||
InitialAverageFrameRate=0.016667
|
InitialAverageFrameRate=0.016667
|
||||||
PhysXTreeRebuildRate=10
|
PhysXTreeRebuildRate=10
|
||||||
|
DefaultBroadphaseSettings=(bUseMBPOnClient=False,bUseMBPOnServer=False,MBPBounds=(Min=(X=0.000000,Y=0.000000,Z=0.000000),Max=(X=0.000000,Y=0.000000,Z=0.000000),IsValid=0),MBPNumSubdivs=2)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[/Script/IOSRuntimeSettings.IOSRuntimeSettings]
|
|
||||||
bSupportsPortraitOrientation=False
|
|
||||||
bSupportsUpsideDownOrientation=False
|
|
||||||
bSupportsLandscapeLeftOrientation=True
|
|
||||||
PreferredLandscapeOrientation=LandscapeLeft
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
BIN
spine-ue4/Content/Test/raptor-widget.uasset
Normal file
BIN
spine-ue4/Content/Test/raptor-widget.uasset
Normal file
Binary file not shown.
Binary file not shown.
@ -37,7 +37,7 @@ class FSpineEditorPlugin: public ISpineEditorPlugin {
|
|||||||
virtual void ShutdownModule() override;
|
virtual void ShutdownModule() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
IMPLEMENT_MODULE(FSpineEditorPlugin, ISpineEditorPlugin)
|
IMPLEMENT_MODULE(FSpineEditorPlugin, SpineEditorPlugin)
|
||||||
|
|
||||||
void FSpineEditorPlugin::StartupModule () {
|
void FSpineEditorPlugin::StartupModule () {
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,6 +51,13 @@ void SSpineWidget::Construct(const FArguments& args) {
|
|||||||
|
|
||||||
void SSpineWidget::SetData(USpineWidget* Widget) {
|
void SSpineWidget::SetData(USpineWidget* Widget) {
|
||||||
this->widget = Widget;
|
this->widget = Widget;
|
||||||
|
if (widget && widget->skeleton && widget->Atlas) {
|
||||||
|
Skeleton *skeleton = widget->skeleton;
|
||||||
|
skeleton->setToSetupPose();
|
||||||
|
skeleton->updateWorldTransform();
|
||||||
|
Vector<float> scratchBuffer;
|
||||||
|
skeleton->getBounds(this->boundsMin.X, this->boundsMin.Y, this->boundsSize.X, this->boundsSize.Y, scratchBuffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setVertex(FSlateVertex* vertex, float x, float y, float u, float v, const FColor& color, const FVector2D& offset) {
|
static void setVertex(FSlateVertex* vertex, float x, float y, float u, float v, const FColor& color, const FVector2D& offset) {
|
||||||
@ -163,6 +170,12 @@ int32 SSpineWidget::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeo
|
|||||||
void SSpineWidget::Flush(int32 LayerId, FSlateWindowElementList& OutDrawElements, const FGeometry& AllottedGeometry, int &Idx, TArray<FVector> &Vertices, TArray<int32> &Indices, TArray<FVector2D> &Uvs, TArray<FColor> &Colors, TArray<FVector>& Colors2, UMaterialInstanceDynamic* Material) {
|
void SSpineWidget::Flush(int32 LayerId, FSlateWindowElementList& OutDrawElements, const FGeometry& AllottedGeometry, int &Idx, TArray<FVector> &Vertices, TArray<int32> &Indices, TArray<FVector2D> &Uvs, TArray<FColor> &Colors, TArray<FVector>& Colors2, UMaterialInstanceDynamic* Material) {
|
||||||
if (Vertices.Num() == 0) return;
|
if (Vertices.Num() == 0) return;
|
||||||
SSpineWidget* self = (SSpineWidget*)this;
|
SSpineWidget* self = (SSpineWidget*)this;
|
||||||
|
|
||||||
|
const FVector2D widgetSize = AllottedGeometry.GetDrawSize();
|
||||||
|
const float setupScale = (widgetSize / FVector2D(boundsSize.X, boundsSize.Y)).GetMin();
|
||||||
|
for (int i = 0; i < Vertices.Num(); i++) {
|
||||||
|
Vertices[i] = (Vertices[i] - FVector(boundsMin.X, -(boundsMin.Y + boundsSize.Y), 0)) * setupScale * widget->Scale;
|
||||||
|
}
|
||||||
|
|
||||||
self->renderData.IndexData.SetNumUninitialized(Indices.Num());
|
self->renderData.IndexData.SetNumUninitialized(Indices.Num());
|
||||||
uint32* indexData = (uint32*)renderData.IndexData.GetData();
|
uint32* indexData = (uint32*)renderData.IndexData.GetData();
|
||||||
@ -293,18 +306,6 @@ void SSpineWidget::UpdateMesh(int32 LayerId, FSlateWindowElementList& OutDrawEle
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (lastMaterial != material) {
|
if (lastMaterial != material) {
|
||||||
FBox VerticeBounds = FBox();
|
|
||||||
for (int i = 0; i < vertices.Num(); i++) {
|
|
||||||
VerticeBounds += vertices[i];
|
|
||||||
}
|
|
||||||
const FVector2D DrawSize = AllottedGeometry.GetDrawSize();
|
|
||||||
const FVector BoundMin = VerticeBounds.Min;
|
|
||||||
const FVector BoundSize = VerticeBounds.GetSize();
|
|
||||||
const float Scale = (DrawSize / FVector2D(BoundSize.X, BoundSize.Y)).GetMin();
|
|
||||||
|
|
||||||
for (int i = 0; i < vertices.Num(); i++) {
|
|
||||||
vertices[i] = (vertices[i] - BoundMin) * Scale;
|
|
||||||
}
|
|
||||||
Flush(LayerId, OutDrawElements, AllottedGeometry, meshSection, vertices, indices, uvs, colors, darkColors, lastMaterial);
|
Flush(LayerId, OutDrawElements, AllottedGeometry, meshSection, vertices, indices, uvs, colors, darkColors, lastMaterial);
|
||||||
lastMaterial = material;
|
lastMaterial = material;
|
||||||
idx = 0;
|
idx = 0;
|
||||||
@ -335,22 +336,7 @@ void SSpineWidget::UpdateMesh(int32 LayerId, FSlateWindowElementList& OutDrawEle
|
|||||||
|
|
||||||
clipper.clipEnd(*slot);
|
clipper.clipEnd(*slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
FBox VerticeBounds = FBox();
|
|
||||||
for (int i = 0; i < vertices.Num(); i++)
|
|
||||||
{
|
|
||||||
VerticeBounds += vertices[i];
|
|
||||||
}
|
|
||||||
const FVector2D DrawSize = AllottedGeometry.GetDrawSize();
|
|
||||||
const FVector BoundMin = VerticeBounds.Min;
|
|
||||||
const FVector BoundSize = VerticeBounds.GetSize();
|
|
||||||
const float Scale = (DrawSize / FVector2D(BoundSize.X, BoundSize.Y)).GetMin();
|
|
||||||
|
|
||||||
for (int i = 0; i < vertices.Num(); i++)
|
|
||||||
{
|
|
||||||
vertices[i] = (vertices[i] - BoundMin)*Scale;
|
|
||||||
}
|
|
||||||
|
|
||||||
Flush(LayerId, OutDrawElements, AllottedGeometry, meshSection, vertices, indices, uvs, colors, darkColors, lastMaterial);
|
Flush(LayerId, OutDrawElements, AllottedGeometry, meshSection, vertices, indices, uvs, colors, darkColors, lastMaterial);
|
||||||
clipper.clipEnd();
|
clipper.clipEnd();
|
||||||
}
|
}
|
||||||
@ -38,7 +38,41 @@
|
|||||||
|
|
||||||
using namespace spine;
|
using namespace spine;
|
||||||
|
|
||||||
void callback(AnimationState* state, spine::EventType type, TrackEntry* entry, Event* event);
|
void callbackWidget(AnimationState* state, spine::EventType type, TrackEntry* entry, Event* event) {
|
||||||
|
USpineWidget* component = (USpineWidget*)state->getRendererObject();
|
||||||
|
|
||||||
|
if (entry->getRendererObject()) {
|
||||||
|
UTrackEntry* uEntry = (UTrackEntry*)entry->getRendererObject();
|
||||||
|
if (type == EventType_Start) {
|
||||||
|
component->AnimationStart.Broadcast(uEntry);
|
||||||
|
uEntry->AnimationStart.Broadcast(uEntry);
|
||||||
|
}
|
||||||
|
else if (type == EventType_Interrupt) {
|
||||||
|
component->AnimationInterrupt.Broadcast(uEntry);
|
||||||
|
uEntry->AnimationInterrupt.Broadcast(uEntry);
|
||||||
|
}
|
||||||
|
else if (type == EventType_Event) {
|
||||||
|
FSpineEvent evt;
|
||||||
|
evt.SetEvent(event);
|
||||||
|
component->AnimationEvent.Broadcast(uEntry, evt);
|
||||||
|
uEntry->AnimationEvent.Broadcast(uEntry, evt);
|
||||||
|
}
|
||||||
|
else if (type == EventType_Complete) {
|
||||||
|
component->AnimationComplete.Broadcast(uEntry);
|
||||||
|
uEntry->AnimationComplete.Broadcast(uEntry);
|
||||||
|
}
|
||||||
|
else if (type == EventType_End) {
|
||||||
|
component->AnimationEnd.Broadcast(uEntry);
|
||||||
|
uEntry->AnimationEnd.Broadcast(uEntry);
|
||||||
|
}
|
||||||
|
else if (type == EventType_Dispose) {
|
||||||
|
component->AnimationDispose.Broadcast(uEntry);
|
||||||
|
uEntry->AnimationDispose.Broadcast(uEntry);
|
||||||
|
uEntry->SetTrackEntry(nullptr);
|
||||||
|
component->GCTrackEntry(uEntry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
USpineWidget::USpineWidget(const FObjectInitializer& ObjectInitializer): Super(ObjectInitializer) {
|
USpineWidget::USpineWidget(const FObjectInitializer& ObjectInitializer): Super(ObjectInitializer) {
|
||||||
static ConstructorHelpers::FObjectFinder<UMaterialInterface> NormalMaterialRef(TEXT("/SpinePlugin/UI_SpineUnlitNormalMaterial"));
|
static ConstructorHelpers::FObjectFinder<UMaterialInterface> NormalMaterialRef(TEXT("/SpinePlugin/UI_SpineUnlitNormalMaterial"));
|
||||||
@ -130,7 +164,7 @@ void USpineWidget::CheckState() {
|
|||||||
AnimationStateData* stateData = SkeletonData->GetAnimationStateData(Atlas->GetAtlas());
|
AnimationStateData* stateData = SkeletonData->GetAnimationStateData(Atlas->GetAtlas());
|
||||||
state = new (__FILE__, __LINE__) AnimationState(stateData);
|
state = new (__FILE__, __LINE__) AnimationState(stateData);
|
||||||
state->setRendererObject((void*)this);
|
state->setRendererObject((void*)this);
|
||||||
state->setListener(callback);
|
state->setListener(callbackWidget);
|
||||||
trackEntries.Empty();
|
trackEntries.Empty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -355,7 +389,8 @@ UTrackEntry* USpineWidget::SetAnimation(int trackIndex, FString animationName, b
|
|||||||
trackEntries.Add(uEntry);
|
trackEntries.Add(uEntry);
|
||||||
return uEntry;
|
return uEntry;
|
||||||
}
|
}
|
||||||
else return NewObject<UTrackEntry>();
|
else
|
||||||
|
return NewObject<UTrackEntry>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,7 +405,8 @@ UTrackEntry* USpineWidget::AddAnimation(int trackIndex, FString animationName, b
|
|||||||
trackEntries.Add(uEntry);
|
trackEntries.Add(uEntry);
|
||||||
return uEntry;
|
return uEntry;
|
||||||
}
|
}
|
||||||
else return NewObject<UTrackEntry>();
|
else
|
||||||
|
return NewObject<UTrackEntry>();
|
||||||
}
|
}
|
||||||
|
|
||||||
UTrackEntry* USpineWidget::SetEmptyAnimation(int trackIndex, float mixDuration) {
|
UTrackEntry* USpineWidget::SetEmptyAnimation(int trackIndex, float mixDuration) {
|
||||||
@ -382,7 +418,8 @@ UTrackEntry* USpineWidget::SetEmptyAnimation(int trackIndex, float mixDuration)
|
|||||||
trackEntries.Add(uEntry);
|
trackEntries.Add(uEntry);
|
||||||
return uEntry;
|
return uEntry;
|
||||||
}
|
}
|
||||||
else return NewObject<UTrackEntry>();
|
else
|
||||||
|
return NewObject<UTrackEntry>();
|
||||||
}
|
}
|
||||||
|
|
||||||
UTrackEntry* USpineWidget::AddEmptyAnimation(int trackIndex, float mixDuration, float delay) {
|
UTrackEntry* USpineWidget::AddEmptyAnimation(int trackIndex, float mixDuration, float delay) {
|
||||||
@ -394,7 +431,8 @@ UTrackEntry* USpineWidget::AddEmptyAnimation(int trackIndex, float mixDuration,
|
|||||||
trackEntries.Add(uEntry);
|
trackEntries.Add(uEntry);
|
||||||
return uEntry;
|
return uEntry;
|
||||||
}
|
}
|
||||||
else return NewObject<UTrackEntry>();
|
else
|
||||||
|
return NewObject<UTrackEntry>();
|
||||||
}
|
}
|
||||||
|
|
||||||
UTrackEntry* USpineWidget::GetCurrent(int trackIndex) {
|
UTrackEntry* USpineWidget::GetCurrent(int trackIndex) {
|
||||||
@ -411,7 +449,8 @@ UTrackEntry* USpineWidget::GetCurrent(int trackIndex) {
|
|||||||
return uEntry;
|
return uEntry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else return NewObject<UTrackEntry>();
|
else
|
||||||
|
return NewObject<UTrackEntry>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void USpineWidget::ClearTracks() {
|
void USpineWidget::ClearTracks() {
|
||||||
|
|||||||
@ -55,7 +55,8 @@ protected:
|
|||||||
|
|
||||||
void Flush(int32 LayerId, FSlateWindowElementList& OutDrawElements, const FGeometry& AllottedGeometry, int &Idx, TArray<FVector> &Vertices, TArray<int32> &Indices, TArray<FVector2D> &Uvs, TArray<FColor> &Colors, TArray<FVector> &Colors2, UMaterialInstanceDynamic* Material);
|
void Flush(int32 LayerId, FSlateWindowElementList& OutDrawElements, const FGeometry& AllottedGeometry, int &Idx, TArray<FVector> &Vertices, TArray<int32> &Indices, TArray<FVector2D> &Uvs, TArray<FColor> &Colors, TArray<FVector> &Colors2, UMaterialInstanceDynamic* Material);
|
||||||
|
|
||||||
USpineWidget* widget;
|
USpineWidget* widget;
|
||||||
|
|
||||||
FRenderData renderData;
|
FRenderData renderData;
|
||||||
|
FVector boundsMin;
|
||||||
|
FVector boundsSize;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -52,6 +52,8 @@ public:
|
|||||||
#if WITH_EDITOR
|
#if WITH_EDITOR
|
||||||
virtual const FText GetPaletteCategory() override;
|
virtual const FText GetPaletteCategory() override;
|
||||||
#endif
|
#endif
|
||||||
|
UPROPERTY(Category = Spine, EditAnywhere, BlueprintReadWrite)
|
||||||
|
float Scale = 1;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Spine)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Spine)
|
||||||
USpineAtlasAsset* Atlas;
|
USpineAtlasAsset* Atlas;
|
||||||
|
|||||||
@ -15,7 +15,7 @@ namespace UnrealBuildTool.Rules
|
|||||||
PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private"));
|
PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private"));
|
||||||
PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Public/spine-cpp/include"));
|
PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Public/spine-cpp/include"));
|
||||||
|
|
||||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "RHI", "RenderCore", "ShaderCore", "ProceduralMeshComponent", "UMG", "Slate", "SlateCore" });
|
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "ProceduralMeshComponent", "UMG", "Slate", "SlateCore" });
|
||||||
PublicDefinitions.Add("SPINE_UE4");
|
PublicDefinitions.Add("SPINE_UE4");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"FileVersion": 3,
|
"FileVersion": 3,
|
||||||
"EngineAssociation": "4.21",
|
"EngineAssociation": "4.22",
|
||||||
"Category": "",
|
"Category": "",
|
||||||
"Description": "",
|
"Description": "",
|
||||||
"Modules": [
|
"Modules": [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user