备份CatanBuilding瘦身独立工程
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a363511f60be37a4199a1a4ad0188b40
|
||||
folderAsset: yes
|
||||
timeCreated: 1511505394
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,116 @@
|
||||
The latest version of this documentation can also be found at the [spine-unity Runtime Documentation](http://esotericsoftware.com/spine-unity#Timeline-Extension-UPM-Package) webpage.
|
||||
|
||||
## Timeline Extension UPM Package
|
||||
|
||||

|
||||
|
||||
Timeline support is provided as a separate UPM (Unity Package Manager) package. See section [Optional Extension UPM Packages](#Optional-Extension-UPM-Packages) on how to download and install this package and section [Updating an Extension UPM Package](#Updating-an-Extension-UPM-Package) on how to update it.
|
||||
|
||||
### Spine-Unity Timeline Playables
|
||||
|
||||

|
||||
|
||||
Spine Timeline currently provides three types of Timeline Playables:
|
||||
- `SkeletonAnimation Track` *(animates `SkeletonAnimation`)*,
|
||||
- `SkeletonGraphic Track` *(animates `SkeletonGraphic`)*,
|
||||
- `Skeleton Flip Track` *(flips `SkeletonAnimation` or `SkeletonGraphic`)*.
|
||||
|
||||
> Note: Timeline tracks have been renamed in recent versions to improve readability.
|
||||
`SkeletonAnimation Track` was called `Spine AnimationState Track`,
|
||||
`SkeletonGraphic Track` was called `Spine AnimationState Graphic Track`,
|
||||
`Skeleton Flip Track` was called `Spine Skeleton Flip Track`.
|
||||
|
||||
**Limitations:** currently only [SkeletonAnimation](#SkeletonAnimation-Component) and [SkeletonGraphic](#SkeletonGraphic-Component) are supported. There is currently no Timeline support for [SkeletonMecanim](#SkeletonMecanim-Component).
|
||||
|
||||
#### SkeletonAnimation Track and SkeletonGraphic Track
|
||||
|
||||

|
||||
|
||||
These track types can be used to set animations at the AnimationState of the target `SkeletonAnimation` or `SkeletonGraphic`. Track type `SkeletonAnimation Track` is used for `SkeletonAnimation`, `SkeletonGraphic Track` for `SkeletonGraphic`.
|
||||
|
||||

|
||||
|
||||
**Parameters**
|
||||
- *Track Index.* The target AnimationState track index to set animations at. Do not forget to set this value accordingly when using multiple timeline tracks.
|
||||
> **Important Note:** Currently it is required to order the timeline tracks with base track at the top and overlay tracks below, otherwise the Editor Preview will display incorrect results.
|
||||
|
||||
- *Unscaled Time.* Whenever starting a new animation clip of this track, `SkeletonAnimation.UnscaledTime` (or `SkeletonGraphic.UnscaledTime` respectively) will be set to this value. This allows you to play back Timeline clips either in normal game time or unscaled game time. Note that `PlayableDirector.UpdateMethod` is ignored and replaced by this property, which allows more fine-granular control per Timeline track.
|
||||
|
||||
##### Spine Animation State Clip
|
||||
|
||||
You can add a `Spine Animation State Clip` to a `SkeletonAnimation Track` (or `SkeletonGraphic Track`) by dragging an `AnimationReferenceAsset` onto a Timeline track. See the [SkeletonData - Preview](#Preview) section on how to generate `AnimationReferenceAssets` for a `SkeletonDataAsset`.
|
||||
|
||||

|
||||
|
||||
**Parameters**
|
||||
*Clip Timing*
|
||||
- *Clip In.* An initial local start time offset applied when playing this animation. Can also be adjusted by dragging the left edge of the clip.
|
||||
- *Blend In Duration.* Blend transition duration used when `Use Blend Duration` is enabled and `Default Mix Duration` is disabled. Can be adjusted by moving the clip into the previous clip, resulting in a cross-fade triangle at the transition.
|
||||
- *Speed Multiplier.* Playback speed multiplier. When set to 2.0 it will play the animation twice as fast, when set to 0.5 half as fast.
|
||||
|
||||
*Spine Animation State Clip*
|
||||
- *Don't Pause with Director.* If set to true, the animation will continue playing when the Director is paused.
|
||||
- *Don't End with Clip.* Normally when empty space follows the clip on the timeline, the empty animation is set on the track. Set this parameter to true to continue playing the clip's animation instead.
|
||||
- *Clip End Mix Out Duration.* When `Don't End with Clip` is false, and the clip is followed by blank space or stopped, the empty animation is set with this `MixDuration`. When set to a value less than 0, the clip is paused instead.
|
||||
|
||||
*Mixing Setting*
|
||||
- *Default Mix Duration.* When disabled, the value under `Mix Duration` below is used for transitions from the previous animation to this animation. When enabled, it will use the setup `Mix Duration` value at the SkeletonData asset for the animation pair.
|
||||
- *Use Blend Duration.* When enabled, the value under `Mix Duration` will be synced with the timeline clip transition duration 'Ease In Duration'. Enable this value to adjust transition durations by moving the clip into the previous clip, resulting in a cross-fade triangle at the transition.
|
||||
- *Mix Duration.* When *Default Mix Duration* is disabled, this mix duration is used for transitions from the previous animation to this animation.
|
||||
- *Event Threshold.* See [TrackEntry.EventThreshold](http://esotericsoftware.com/spine-api-reference#TrackEntry-eventThreshold).
|
||||
- *Attachment Threshold.* See [TrackEntry.AttachmentThreshold](http://esotericsoftware.com/spine-api-reference#TrackEntry-attachmentThreshold).
|
||||
- *Draw Order Threshold.* See [TrackEntry.DrawOrderThreshold](http://esotericsoftware.com/spine-api-reference#TrackEntry-drawOrderThreshold).
|
||||
- *Alpha.* See [TrackEntry.Alpha](http://esotericsoftware.com/spine-api-reference#TrackEntry-alpha).
|
||||
|
||||
*Ignored Parameters*
|
||||
- *Ease Out Duration, Blend Curves*. These parameters are ignored and have no effect.
|
||||
|
||||
> Note: *Default Mix Duration* was previously called *Custom Duration* and inverted. This has been changed to improve readability.
|
||||
|
||||
**Usage**
|
||||
1. Add `SkeletonAnimationPlayableHandle` component to your SkeletonAnimation GameObject, or the `SkeletonGraphicPlayableHandle` in case of `SkeletonGraphic`.
|
||||
2. With an existing Unity Playable Director, and in the Unity Timeline window, right-click on an empty space on the left and choose `Spine` - `SkeletonAnimation Track`.
|
||||
3. Drag the SkeletonAnimation or SkeletonGraphic GameObject onto the empty reference property of the new Spine AnimationState Track.
|
||||
4. To add an animation at a track, drag the respective [`AnimationReferenceAsset`](#Preview) into the clips view (the right part of the Timeline panel) as you would with normal animation clips.
|
||||
|
||||
See spine-unity Runtime Documentation, [section Preview](#Preview) on how to create an `AnimationReferenceAsset` for each of your animations.
|
||||
|
||||
> **Note:** You can use the Duplicate function (`CTRL`/`CMD` + `D`) to duplicate selected clips in the clips view.
|
||||
|
||||
**Track Behavior**
|
||||
- `AnimationState.SetAnimation()` will be called at the beginning of every clip based on the `AnimationReferenceAsset`.
|
||||
- Clip durations matter since Timeline version 4.0.
|
||||
> Note: Behaviour of version 3.8 was that clip durations don't matter. Animations were not cleared when reaching empty space after a clip on the timeline.
|
||||
- Empty animation: If a clip has no `AnimationReferenceAsset` assigned, it will call `SetEmptyAnimation` instead.
|
||||
- Error handling: If the animation with the provided `AnimationReferenceAsset` is not found, it will do nothing (the previous animation will continue playing normally).
|
||||
- Animations playing before the timeline starts playing will not be interrupted until the first clip starts playing.
|
||||
- What happens at the end of clips and at the end of the timeline depends on clip settings. When `Don't End with Clip` is true, nothing happens at the clip's end. This means the effect of the last clip's `SetAnimation` call will persist until you issue other calls at the AnimationState. If `Don't End with Clip` is false, it will be mix out to the empty animation with duration `Clip End Mix Out Duration`, or paused when `Clip End Mix Out Duration` is less than 0.
|
||||
- Edit mode preview mixing may look different from Play Mode mixing. Please check in actual Play Mode to see the actual results. Please see the remark in the [Spine AnimationState Track](#Spine-AnimationState-Track) section on correct track ordering when previewing multiple overlaid tracks.
|
||||
|
||||
#### Skeleton Flip Track
|
||||
|
||||

|
||||
|
||||
This track type can be used to flip the skeleton of the target `SkeletonAnimation` or `SkeletonGraphic`.
|
||||
|
||||
##### Spine Skeleton Flip Clip
|
||||
|
||||

|
||||
|
||||
**Parameters**
|
||||
- *Flip X.* Flips the skeleton along the X axis during the extents of the clip.
|
||||
- *Flip Y.* Flips the skeleton along the Y axis during the extents of the clip.
|
||||
|
||||
**Usage**
|
||||
1. Add `SkeletonAnimationPlayableHandle` component to your SkeletonAnimation GameObject, or the `SkeletonGraphicPlayableHandle` in case of `SkeletonGraphic`.
|
||||
2. With an existing Unity Playable Director, and in the Unity Timeline window, right-click on an empty space on the left and choose `Spine` - `Skeleton Flip Track`.
|
||||
3. Drag the SkeletonAnimation or SkeletonGraphic GameObject onto the empty reference property of the new Spine Skeleton Flip Track.
|
||||
4. Right-click on the row in an empty space in the Timeline dopesheet and choose `Add Spine Skeleton Flip Clip`.
|
||||
5. Adjust the start and end times of the new clip, name it appropriately at the top of the Inspector, and choose the desired FlipX and FlipY values.
|
||||
|
||||
**Track Behavior**
|
||||
- The specified skeleton flip values will be applied for every frame within the duration of each track.
|
||||
- At the end of the timeline, the track will revert the skeleton flip to the flip values it captures when it starts playing that timeline.
|
||||
|
||||
#### Known Issues
|
||||
- The Console potentially logs an incorrect and harmless error `DrivenPropertyManager has failed to register property "m_Script" of object "Spine GameObject (spineboy-pro)" with driver "" because the property doesn't exist.`. This is a known issue on Unity's end. See more here: https://forum.unity.com/threads/default-playables-text-switcher-track-error.502903/
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 970f0962a0a79bf42bdedfc9ed439f56
|
||||
timeCreated: 1511505255
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 24 KiB |
@@ -0,0 +1,112 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab296920a52d8204ea35ed4385481be3
|
||||
timeCreated: 1511505440
|
||||
licenseType: Free
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Windows Store Apps
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 50 KiB |
@@ -0,0 +1,112 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca162358b7b05034cae4e25bfb8b98f8
|
||||
timeCreated: 1511508127
|
||||
licenseType: Free
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Windows Store Apps
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 14 KiB |
@@ -0,0 +1,94 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 04051f71b9b3db740a8d236ff80672e7
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 32 KiB |
@@ -0,0 +1,74 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d698a92ba07201b4eb9f99a6275f2b3b
|
||||
timeCreated: 1595514078
|
||||
licenseType: Pro
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 4
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 17 KiB |
@@ -0,0 +1,112 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 80e301d4353d83640bb50224021a8379
|
||||
timeCreated: 1511506555
|
||||
licenseType: Free
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Windows Store Apps
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 32 KiB |
@@ -0,0 +1,74 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e56f159fca97b5d4ab93f104e1cce135
|
||||
timeCreated: 1595514078
|
||||
licenseType: Pro
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 4
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 35 KiB |
@@ -0,0 +1,74 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 73e3829cc431d4f438368d3b284c3d03
|
||||
timeCreated: 1570476238
|
||||
licenseType: Free
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 4
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3cdbaf8cb2e511f4fa3b631af94fa18e
|
||||
folderAsset: yes
|
||||
timeCreated: 1527569538
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,115 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using Spine.Unity.Playables;
|
||||
using UnityEditor;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace Spine.Unity.Editor {
|
||||
|
||||
[CustomEditor(typeof(SpineAnimationStateClip))]
|
||||
[CanEditMultipleObjects]
|
||||
public class SpineAnimationStateClipInspector : UnityEditor.Editor {
|
||||
|
||||
protected SerializedProperty templateProp = null;
|
||||
|
||||
protected class ClipInfo {
|
||||
public TimelineClip timelineClip;
|
||||
public float previousBlendInDuration = -1.0f;
|
||||
public float unblendedMixDuration = 0.2f;
|
||||
}
|
||||
|
||||
protected ClipInfo[] clipInfo = null;
|
||||
|
||||
public void OnEnable () {
|
||||
templateProp = serializedObject.FindProperty("template");
|
||||
System.Array.Resize(ref clipInfo, targets.Length);
|
||||
for (int i = 0; i < targets.Length; ++i) {
|
||||
SpineAnimationStateClip clip = (SpineAnimationStateClip)targets[i];
|
||||
clipInfo[i] = new ClipInfo();
|
||||
clipInfo[i].timelineClip = FindTimelineClip(clip);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI () {
|
||||
serializedObject.Update();
|
||||
EditorGUILayout.PropertyField(templateProp);
|
||||
|
||||
for (int i = 0; i < targets.Length; ++i) {
|
||||
SpineAnimationStateClip targetClip = (SpineAnimationStateClip)targets[i];
|
||||
if (targetClip.template.useBlendDuration)
|
||||
AdjustMixDuration(targetClip, clipInfo[i]);
|
||||
}
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
protected void AdjustMixDuration (SpineAnimationStateClip targetClip, ClipInfo timelineClipInfo) {
|
||||
|
||||
if (timelineClipInfo == null)
|
||||
return;
|
||||
|
||||
TimelineClip timelineClip = timelineClipInfo.timelineClip;
|
||||
if (timelineClip == null)
|
||||
return;
|
||||
|
||||
float blendInDur = System.Math.Max((float)timelineClip.blendInDuration, (float)timelineClip.easeInDuration);
|
||||
bool isBlendingNow = blendInDur > 0;
|
||||
bool wasBlendingBefore = timelineClipInfo.previousBlendInDuration > 0;
|
||||
|
||||
if (isBlendingNow) {
|
||||
if (!wasBlendingBefore) {
|
||||
timelineClipInfo.unblendedMixDuration = targetClip.template.mixDuration;
|
||||
}
|
||||
targetClip.template.mixDuration = blendInDur;
|
||||
EditorUtility.SetDirty(targetClip);
|
||||
} else if (wasBlendingBefore) {
|
||||
targetClip.template.mixDuration = timelineClipInfo.unblendedMixDuration;
|
||||
EditorUtility.SetDirty(targetClip);
|
||||
}
|
||||
timelineClipInfo.previousBlendInDuration = blendInDur;
|
||||
}
|
||||
|
||||
protected TimelineClip FindTimelineClip (SpineAnimationStateClip targetClip) {
|
||||
string[] guids = AssetDatabase.FindAssets("t:TimelineAsset");
|
||||
foreach (string guid in guids) {
|
||||
TimelineAsset timeline = (TimelineAsset)AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guid), typeof(TimelineAsset));
|
||||
foreach (TrackAsset track in timeline.GetOutputTracks()) {
|
||||
foreach (TimelineClip clip in track.GetClips()) {
|
||||
if (clip.asset.GetType() == typeof(SpineAnimationStateClip) && object.ReferenceEquals(clip.asset, targetClip)) {
|
||||
return clip;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 95642d062fbcfda4e8d9262fa715b098
|
||||
timeCreated: 1570044805
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,138 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using Spine.Unity.Editor;
|
||||
using Spine.Unity.Playables;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
[CustomPropertyDrawer(typeof(SpineAnimationStateBehaviour))]
|
||||
public class SpineAnimationStateDrawer : PropertyDrawer {
|
||||
|
||||
public override float GetPropertyHeight (SerializedProperty property, GUIContent label) {
|
||||
const int fieldCount = 16;
|
||||
return fieldCount * EditorGUIUtility.singleLineHeight;
|
||||
}
|
||||
|
||||
public override void OnGUI (Rect position, SerializedProperty property, GUIContent label) {
|
||||
SerializedProperty animationReferenceProp = property.FindPropertyRelative("animationReference");
|
||||
SerializedProperty loopProp = property.FindPropertyRelative("loop");
|
||||
|
||||
SerializedProperty customDurationProp = property.FindPropertyRelative("customDuration");
|
||||
SerializedProperty useBlendDurationProp = property.FindPropertyRelative("useBlendDuration");
|
||||
SerializedProperty mixDurationProp = property.FindPropertyRelative("mixDuration");
|
||||
SerializedProperty holdPreviousProp = property.FindPropertyRelative("holdPrevious");
|
||||
SerializedProperty alphaProp = property.FindPropertyRelative("alpha");
|
||||
SerializedProperty dontPauseWithDirectorProp = property.FindPropertyRelative("dontPauseWithDirector");
|
||||
SerializedProperty dontEndWithClip = property.FindPropertyRelative("dontEndWithClip");
|
||||
SerializedProperty endMixOutDuration = property.FindPropertyRelative("endMixOutDuration");
|
||||
SerializedProperty eventProp = property.FindPropertyRelative("eventThreshold");
|
||||
SerializedProperty attachmentProp = property.FindPropertyRelative("attachmentThreshold");
|
||||
SerializedProperty drawOrderProp = property.FindPropertyRelative("drawOrderThreshold");
|
||||
|
||||
// initialize customDuration (inverse default mix duration) and useBlendDuration parameters according to preferences
|
||||
SerializedProperty isInitializedProp = property.FindPropertyRelative("isInitialized");
|
||||
if (!isInitializedProp.hasMultipleDifferentValues && isInitializedProp.boolValue == false) {
|
||||
customDurationProp.boolValue = !SpineEditorUtilities.Preferences.timelineDefaultMixDuration;
|
||||
useBlendDurationProp.boolValue = SpineEditorUtilities.Preferences.timelineUseBlendDuration;
|
||||
isInitializedProp.boolValue = true;
|
||||
}
|
||||
|
||||
Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
|
||||
|
||||
float lineHeightWithSpacing = EditorGUIUtility.singleLineHeight + 2f;
|
||||
|
||||
EditorGUI.PropertyField(singleFieldRect, animationReferenceProp);
|
||||
|
||||
singleFieldRect.y += lineHeightWithSpacing;
|
||||
EditorGUI.PropertyField(singleFieldRect, loopProp);
|
||||
|
||||
singleFieldRect.y += lineHeightWithSpacing;
|
||||
EditorGUI.PropertyField(singleFieldRect, dontPauseWithDirectorProp,
|
||||
new GUIContent("Don't Pause with Director",
|
||||
"If set to true, the animation will continue playing when the Director is paused."));
|
||||
|
||||
singleFieldRect.y += lineHeightWithSpacing;
|
||||
EditorGUI.PropertyField(singleFieldRect, dontEndWithClip,
|
||||
new GUIContent("Don't End with Clip",
|
||||
"Normally when empty space follows the clip on the timeline, the empty animation is set on the track. " +
|
||||
"Set this parameter to true to continue playing the clip's animation instead."));
|
||||
|
||||
singleFieldRect.y += lineHeightWithSpacing;
|
||||
|
||||
using (new EditorGUI.DisabledGroupScope(dontEndWithClip.boolValue == true)) {
|
||||
EditorGUI.PropertyField(singleFieldRect, endMixOutDuration,
|
||||
new GUIContent("Clip End Mix Out Duration",
|
||||
"When 'Don't End with Clip' is false, and the clip is followed by blank space or stopped, " +
|
||||
"the empty animation is set with this MixDuration. When set to a negative value, " +
|
||||
"the clip is paused instead."));
|
||||
}
|
||||
|
||||
singleFieldRect.y += lineHeightWithSpacing * 0.5f;
|
||||
|
||||
singleFieldRect.y += lineHeightWithSpacing;
|
||||
EditorGUI.LabelField(singleFieldRect, "Mixing Settings", EditorStyles.boldLabel);
|
||||
|
||||
singleFieldRect.y += lineHeightWithSpacing;
|
||||
customDurationProp.boolValue = !EditorGUI.Toggle(singleFieldRect,
|
||||
new GUIContent("Default Mix Duration",
|
||||
"Use the default mix duration as specified at the SkeletonDataAsset."),
|
||||
!customDurationProp.boolValue);
|
||||
|
||||
bool greyOutCustomDurations = (!customDurationProp.hasMultipleDifferentValues &&
|
||||
customDurationProp.boolValue == false);
|
||||
using (new EditorGUI.DisabledGroupScope(greyOutCustomDurations)) {
|
||||
singleFieldRect.y += lineHeightWithSpacing;
|
||||
EditorGUI.PropertyField(singleFieldRect, useBlendDurationProp);
|
||||
|
||||
singleFieldRect.y += lineHeightWithSpacing;
|
||||
|
||||
bool greyOutMixDuration = (!useBlendDurationProp.hasMultipleDifferentValues &&
|
||||
useBlendDurationProp.boolValue == true);
|
||||
using (new EditorGUI.DisabledGroupScope(greyOutMixDuration)) {
|
||||
EditorGUI.PropertyField(singleFieldRect, mixDurationProp);
|
||||
}
|
||||
}
|
||||
|
||||
singleFieldRect.y += lineHeightWithSpacing;
|
||||
EditorGUI.PropertyField(singleFieldRect, holdPreviousProp);
|
||||
|
||||
singleFieldRect.y += lineHeightWithSpacing;
|
||||
EditorGUI.PropertyField(singleFieldRect, eventProp);
|
||||
|
||||
singleFieldRect.y += lineHeightWithSpacing;
|
||||
EditorGUI.PropertyField(singleFieldRect, attachmentProp);
|
||||
|
||||
singleFieldRect.y += lineHeightWithSpacing;
|
||||
EditorGUI.PropertyField(singleFieldRect, drawOrderProp);
|
||||
|
||||
singleFieldRect.y += lineHeightWithSpacing;
|
||||
EditorGUI.PropertyField(singleFieldRect, alphaProp);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cba97e3d11d6d4d428fcfe1a7be16db0
|
||||
timeCreated: 1510816616
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,67 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using Spine.Unity.Playables;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Timeline;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace Spine.Unity.Editor {
|
||||
#if UNITY_2019_1_OR_NEWER
|
||||
[CustomTimelineEditor(typeof(SpineAnimationStateGraphicTrack))]
|
||||
[CanEditMultipleObjects]
|
||||
public class SpineAnimationStateGraphicTrackInspector : TrackEditor {
|
||||
|
||||
public override TrackDrawOptions GetTrackOptions (TrackAsset track, UnityEngine.Object binding) {
|
||||
TrackDrawOptions options = base.GetTrackOptions(track, binding);
|
||||
options.icon = SpineEditorUtilities.Icons.skeletonDataAssetIcon;
|
||||
options.trackColor = new Color(255 / 255.0f, 64 / 255.0f, 1 / 255.0f);
|
||||
return options;
|
||||
}
|
||||
}
|
||||
#else
|
||||
[CustomEditor(typeof(SpineAnimationStateGraphicTrack))]
|
||||
[CanEditMultipleObjects]
|
||||
public class SpineAnimationStateGraphicTrackInspector : UnityEditor.Editor {
|
||||
|
||||
protected SerializedProperty trackIndexProperty = null;
|
||||
|
||||
public void OnEnable () {
|
||||
trackIndexProperty = serializedObject.FindProperty("trackIndex");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI () {
|
||||
serializedObject.Update();
|
||||
EditorGUILayout.PropertyField(trackIndexProperty);
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1bd1fca227e65ae4fb9a54086eb5cfce
|
||||
timeCreated: 1595441224
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,67 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using Spine.Unity.Playables;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Timeline;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace Spine.Unity.Editor {
|
||||
#if UNITY_2019_1_OR_NEWER
|
||||
[CustomTimelineEditor(typeof(SpineAnimationStateTrack))]
|
||||
[CanEditMultipleObjects]
|
||||
public class SpineAnimationStateTrackInspector : TrackEditor {
|
||||
|
||||
public override TrackDrawOptions GetTrackOptions (TrackAsset track, UnityEngine.Object binding) {
|
||||
TrackDrawOptions options = base.GetTrackOptions(track, binding);
|
||||
options.icon = SpineEditorUtilities.Icons.skeletonDataAssetIcon;
|
||||
options.trackColor = new Color(255 / 255.0f, 64 / 255.0f, 1 / 255.0f);
|
||||
return options;
|
||||
}
|
||||
}
|
||||
#else
|
||||
[CustomEditor(typeof(SpineAnimationStateTrack))]
|
||||
[CanEditMultipleObjects]
|
||||
public class SpineAnimationStateTrackInspector : UnityEditor.Editor {
|
||||
|
||||
protected SerializedProperty trackIndexProperty = null;
|
||||
|
||||
public void OnEnable () {
|
||||
trackIndexProperty = serializedObject.FindProperty("trackIndex");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI () {
|
||||
serializedObject.Update();
|
||||
EditorGUILayout.PropertyField(trackIndexProperty);
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b7c44d5bdbe0db14d936722a800d757b
|
||||
timeCreated: 1575309732
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,69 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#if UNITY_2019_1_OR_NEWER
|
||||
#define TIMELINE_HAS_CLIPEDITOR_CLASS
|
||||
#endif
|
||||
|
||||
#if TIMELINE_HAS_CLIPEDITOR_CLASS
|
||||
|
||||
using Spine.Unity.Playables;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Timeline;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace Spine.Unity.Editor {
|
||||
|
||||
[CustomTimelineEditor(typeof(SpineSkeletonFlipClip))]
|
||||
public class SpineSkeletonFlipClipEditor : ClipEditor {
|
||||
|
||||
public override void OnCreate (TimelineClip clip, TrackAsset track, TimelineClip clonedFrom) {
|
||||
SetDisplayName(clip);
|
||||
}
|
||||
|
||||
public override void OnClipChanged (TimelineClip clip) {
|
||||
SetDisplayName(clip);
|
||||
}
|
||||
|
||||
protected void SetDisplayName (TimelineClip clip) {
|
||||
SpineSkeletonFlipClip flipClip = (SpineSkeletonFlipClip)clip.asset;
|
||||
if (flipClip != null) {
|
||||
bool flipX = false, flipY = false;
|
||||
SpineSkeletonFlipBehaviour settings = flipClip.template;
|
||||
if (settings != null) {
|
||||
flipX = settings.flipX;
|
||||
flipY = settings.flipY;
|
||||
}
|
||||
clip.displayName = "Flip" + (flipX ? " X" : "") + (flipY ? " Y" : "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // TIMELINE_HAS_CLIPEDITOR_CLASS
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9c2fd7cd6094bcc4291fb8ae1dbae1ab
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,51 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using Spine.Unity.Playables;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Spine.Unity.Editor {
|
||||
|
||||
[CustomEditor(typeof(SpineSkeletonFlipClip))]
|
||||
[CanEditMultipleObjects]
|
||||
public class SpineSkeletonFlipClipInspector : UnityEditor.Editor {
|
||||
|
||||
protected SerializedProperty templateProp = null;
|
||||
|
||||
public void OnEnable () {
|
||||
templateProp = serializedObject.FindProperty("template");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI () {
|
||||
serializedObject.Update();
|
||||
EditorGUILayout.PropertyField(templateProp);
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c6d7cdfbf1ccc0042b92586542f085a4
|
||||
timeCreated: 1570045635
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,51 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
[CustomPropertyDrawer(typeof(SpineSkeletonFlipBehaviour))]
|
||||
public class SpineSkeletonFlipDrawer : PropertyDrawer {
|
||||
public override float GetPropertyHeight (SerializedProperty property, GUIContent label) {
|
||||
int fieldCount = 2;
|
||||
return fieldCount * EditorGUIUtility.singleLineHeight;
|
||||
}
|
||||
|
||||
public override void OnGUI (Rect position, SerializedProperty property, GUIContent label) {
|
||||
SerializedProperty flipXProp = property.FindPropertyRelative("flipX");
|
||||
SerializedProperty flipYProp = property.FindPropertyRelative("flipY");
|
||||
|
||||
Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
|
||||
EditorGUI.PropertyField(singleFieldRect, flipXProp);
|
||||
|
||||
singleFieldRect.y += EditorGUIUtility.singleLineHeight;
|
||||
EditorGUI.PropertyField(singleFieldRect, flipYProp);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b8a0a5d3de45a5e48ae96aa414860d3c
|
||||
timeCreated: 1500876411
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,50 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using Spine.Unity.Playables;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Timeline;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace Spine.Unity.Editor {
|
||||
#if UNITY_2019_1_OR_NEWER
|
||||
[CustomTimelineEditor(typeof(SpineSkeletonFlipTrack))]
|
||||
[CanEditMultipleObjects]
|
||||
public class SpineSkeletonFlipTrackInspector : TrackEditor {
|
||||
|
||||
public override TrackDrawOptions GetTrackOptions (TrackAsset track, UnityEngine.Object binding) {
|
||||
TrackDrawOptions options = base.GetTrackOptions(track, binding);
|
||||
options.icon = SpineEditorUtilities.Icons.subMeshRenderer;
|
||||
options.trackColor = new Color(0.855f, 0.8623f, 0.87f);
|
||||
return options;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79b46a12efaac314eaf936caf1f3aee9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "spine-timeline-editor",
|
||||
"references": [
|
||||
"spine-unity",
|
||||
"spine-unity-editor",
|
||||
"spine-timeline",
|
||||
"Unity.Timeline",
|
||||
"Unity.Timeline.Editor"
|
||||
],
|
||||
"optionalUnityReferences": [],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": []
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1e7d09e628f0eb342b6a8ab5b3c0d487
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
26
LocalPackages/com.esotericsoftware.spine.timeline/LICENSE.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# Spine Runtimes License Agreement
|
||||
Last updated July 28, 2023. Replaces all prior versions.
|
||||
|
||||
Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
|
||||
Integration of the Spine Runtimes into software or otherwise creating
|
||||
derivative works of the Spine Runtimes is permitted under the terms and
|
||||
conditions of Section 2 of the Spine Editor License Agreement:
|
||||
http://esotericsoftware.com/spine-editor-license
|
||||
|
||||
Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
"Products"), provided that each user of the Products must obtain their own
|
||||
Spine Editor license and redistribution of the Products in any form must
|
||||
include this license and copyright notice.
|
||||
|
||||
THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c940982dfcc1724a93981844b99fa28
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e204f4f677edeef4aa2328ce87780b43
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ff79ab0c89530f24d8f60162bd4c1009
|
||||
folderAsset: yes
|
||||
timeCreated: 1507311562
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,70 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
//using UnityEngine.Playables;
|
||||
|
||||
using Spine;
|
||||
using Spine.Unity;
|
||||
using Spine.Unity.Playables;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Spine.Unity.Playables {
|
||||
|
||||
[AddComponentMenu("Spine/Playables/SkeletonAnimation Playable Handle (Playables)")]
|
||||
public class SkeletonAnimationPlayableHandle : SpinePlayableHandleBase {
|
||||
#region Inspector
|
||||
public SkeletonAnimation skeletonAnimation;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
void Reset () {
|
||||
InitializeReference();
|
||||
}
|
||||
|
||||
void OnValidate () {
|
||||
InitializeReference();
|
||||
}
|
||||
#endif
|
||||
|
||||
#endregion
|
||||
|
||||
public override Skeleton Skeleton { get { return skeletonAnimation.Skeleton; } }
|
||||
public override SkeletonData SkeletonData { get { return skeletonAnimation.Skeleton.Data; } }
|
||||
|
||||
void Awake () {
|
||||
InitializeReference();
|
||||
}
|
||||
|
||||
void InitializeReference () {
|
||||
if (skeletonAnimation == null)
|
||||
skeletonAnimation = GetComponent<SkeletonAnimation>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bd5f4cbc0a51cc24b86e5f70151bc0c3
|
||||
timeCreated: 1507311603
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,70 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
//using UnityEngine.Playables;
|
||||
|
||||
using Spine;
|
||||
using Spine.Unity;
|
||||
using Spine.Unity.Playables;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Spine.Unity.Playables {
|
||||
|
||||
[AddComponentMenu("Spine/Playables/SkeletonGraphic Playable Handle (Playables)")]
|
||||
public class SkeletonGraphicPlayableHandle : SpinePlayableHandleBase {
|
||||
#region Inspector
|
||||
public SkeletonGraphic skeletonGraphic;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
void Reset () {
|
||||
InitializeReference();
|
||||
}
|
||||
|
||||
void OnValidate () {
|
||||
InitializeReference();
|
||||
}
|
||||
#endif
|
||||
|
||||
#endregion
|
||||
|
||||
public override Skeleton Skeleton { get { return skeletonGraphic.Skeleton; } }
|
||||
public override SkeletonData SkeletonData { get { return skeletonGraphic.Skeleton.Data; } }
|
||||
|
||||
void Awake () {
|
||||
InitializeReference();
|
||||
}
|
||||
|
||||
void InitializeReference () {
|
||||
if (skeletonGraphic == null)
|
||||
skeletonGraphic = GetComponent<SkeletonGraphic>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51a0223d4dee020468302946c8ccd329
|
||||
timeCreated: 1595439279
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,58 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
//using UnityEngine.Playables;
|
||||
|
||||
namespace Spine.Unity.Playables {
|
||||
|
||||
public delegate void SpineEventDelegate (Spine.Event e);
|
||||
|
||||
/// <summary>Base class for Spine Playable Handle components, commonly for integrating with UnityEngine Timeline.</summary>
|
||||
public abstract class SpinePlayableHandleBase : MonoBehaviour {
|
||||
|
||||
/// <summary>Gets the SkeletonData of the targeted Spine component.</summary>
|
||||
public abstract SkeletonData SkeletonData { get; }
|
||||
|
||||
public abstract Skeleton Skeleton { get; }
|
||||
|
||||
/// <summary>Subscribe to this to handle user events played by the Unity playable</summary>
|
||||
public event SpineEventDelegate AnimationEvents;
|
||||
|
||||
public virtual void HandleEvents (ExposedList<Event> eventBuffer) {
|
||||
if (eventBuffer == null || AnimationEvents == null) return;
|
||||
for (int i = 0, n = eventBuffer.Count; i < n; i++)
|
||||
AnimationEvents.Invoke(eventBuffer.Items[i]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2dfbb56974b17984ca2534bc8185f665
|
||||
timeCreated: 1507311422
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 47adfa0aa094be548be25e178c1435d2
|
||||
folderAsset: yes
|
||||
timeCreated: 1510816616
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,77 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using Spine;
|
||||
using Spine.Unity;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace Spine.Unity.Playables {
|
||||
|
||||
using Animation = Spine.Animation;
|
||||
|
||||
[Serializable]
|
||||
public class SpineAnimationStateBehaviour : PlayableBehaviour {
|
||||
|
||||
[NonSerialized] public TimelineClip timelineClip;
|
||||
|
||||
public AnimationReferenceAsset animationReference;
|
||||
public bool loop;
|
||||
|
||||
// Mix Properties
|
||||
public bool customDuration = false;
|
||||
public bool useBlendDuration = true;
|
||||
[SerializeField]
|
||||
#pragma warning disable 414
|
||||
private bool isInitialized = false; // required to read preferences values from editor side.
|
||||
#pragma warning restore 414
|
||||
public float mixDuration = 0.1f;
|
||||
public bool holdPrevious = false;
|
||||
public bool dontPauseWithDirector = false;
|
||||
[UnityEngine.Serialization.FormerlySerializedAs("dontPauseOnStop")]
|
||||
public bool dontEndWithClip = false;
|
||||
public float endMixOutDuration = 0.1f;
|
||||
|
||||
[Range(0, 1f)]
|
||||
public float attachmentThreshold = 0.5f;
|
||||
|
||||
[Range(0, 1f)]
|
||||
public float eventThreshold = 0.5f;
|
||||
|
||||
[Range(0, 1f)]
|
||||
public float drawOrderThreshold = 0.5f;
|
||||
|
||||
[Range(0, 1f)]
|
||||
public float alpha = 1.0f;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 82bd6e7ec1121b5428c447b7bd16b042
|
||||
timeCreated: 1510816616
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,60 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace Spine.Unity.Playables {
|
||||
[Serializable]
|
||||
public class SpineAnimationStateClip : PlayableAsset, ITimelineClipAsset {
|
||||
public SpineAnimationStateBehaviour template = new SpineAnimationStateBehaviour();
|
||||
|
||||
public ClipCaps clipCaps { get { return ClipCaps.Blending | ClipCaps.ClipIn | ClipCaps.SpeedMultiplier | (template.loop ? ClipCaps.Looping : 0); } }
|
||||
[NonSerialized] public TimelineClip timelineClip;
|
||||
|
||||
public override Playable CreatePlayable (PlayableGraph graph, GameObject owner) {
|
||||
template.timelineClip = this.timelineClip;
|
||||
|
||||
var playable = ScriptPlayable<SpineAnimationStateBehaviour>.Create(graph, template);
|
||||
playable.GetBehaviour();
|
||||
return playable;
|
||||
}
|
||||
|
||||
public override double duration {
|
||||
get {
|
||||
if (template.animationReference == null || template.animationReference.Animation == null)
|
||||
return 0;
|
||||
return template.animationReference.Animation.Duration;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 585e20c924ba86a44926c850aa8e1d84
|
||||
timeCreated: 1510816616
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,70 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using System.ComponentModel;
|
||||
#endif
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace Spine.Unity.Playables {
|
||||
[TrackColor(255 / 255.0f, 64 / 255.0f, 1 / 255.0f)]
|
||||
[TrackClipType(typeof(SpineAnimationStateClip))]
|
||||
[TrackBindingType(typeof(SkeletonGraphic))]
|
||||
#if UNITY_EDITOR
|
||||
[DisplayName("Spine/SkeletonGraphic Track")]
|
||||
#endif
|
||||
public class SpineAnimationStateGraphicTrack : TrackAsset {
|
||||
public int trackIndex = 0;
|
||||
[Tooltip("Whenever starting a new animation clip of this track, " +
|
||||
"SkeletonGraphic.UnscaledTime will be set to this value. " +
|
||||
"This allows you to play back Timeline clips either in normal game time " +
|
||||
"or unscaled game time. Note that PlayableDirector.UpdateMethod " +
|
||||
"is ignored and replaced by this property, which allows more fine-granular " +
|
||||
"control per Timeline track.")]
|
||||
public bool unscaledTime = false;
|
||||
|
||||
public override Playable CreateTrackMixer (PlayableGraph graph, GameObject go, int inputCount) {
|
||||
IEnumerable<TimelineClip> clips = this.GetClips();
|
||||
foreach (TimelineClip clip in clips) {
|
||||
SpineAnimationStateClip animationStateClip = clip.asset as SpineAnimationStateClip;
|
||||
if (animationStateClip != null)
|
||||
animationStateClip.timelineClip = clip;
|
||||
}
|
||||
|
||||
var scriptPlayable = ScriptPlayable<SpineAnimationStateMixerBehaviour>.Create(graph, inputCount);
|
||||
SpineAnimationStateMixerBehaviour mixerBehaviour = scriptPlayable.GetBehaviour();
|
||||
mixerBehaviour.trackIndex = this.trackIndex;
|
||||
mixerBehaviour.unscaledTime = this.unscaledTime;
|
||||
return scriptPlayable;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 72a1f4f2e8b6c194bbdabda6998a77e1
|
||||
timeCreated: 1595440391
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,407 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#if UNITY_2019_1_OR_NEWER
|
||||
#define SPEED_INCLUDED_IN_CLIP_TIME
|
||||
#endif
|
||||
|
||||
#if UNITY_EDITOR
|
||||
#define SPINE_EDITMODEPOSE
|
||||
#endif
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace Spine.Unity.Playables {
|
||||
public class SpineAnimationStateMixerBehaviour : PlayableBehaviour {
|
||||
|
||||
float[] lastInputWeights;
|
||||
bool lastAnyClipPlaying = false;
|
||||
public int trackIndex;
|
||||
public bool unscaledTime;
|
||||
ScriptPlayable<SpineAnimationStateBehaviour>[] startingClips
|
||||
= new ScriptPlayable<SpineAnimationStateBehaviour>[2];
|
||||
|
||||
IAnimationStateComponent animationStateComponent;
|
||||
bool pauseWithDirector = true;
|
||||
bool endAtClipEnd = true;
|
||||
float endMixOutDuration = 0.1f;
|
||||
bool isPaused = false;
|
||||
TrackEntry pausedTrackEntry;
|
||||
float previousTimeScale = 1;
|
||||
float rootPlayableSpeed = 1;
|
||||
|
||||
TrackEntry timelineStartedTrackEntry;
|
||||
|
||||
public override void OnBehaviourPause (Playable playable, FrameData info) {
|
||||
if (pauseWithDirector) {
|
||||
if (!isPaused)
|
||||
HandlePause(playable);
|
||||
isPaused = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnGraphStop (Playable playable) {
|
||||
bool isStoppedNotPaused = playable.GetGraph().IsPlaying(); // end of track was reached or graph stopped.
|
||||
if (isStoppedNotPaused && endAtClipEnd)
|
||||
HandleClipEnd();
|
||||
}
|
||||
|
||||
public override void OnBehaviourPlay (Playable playable, FrameData info) {
|
||||
if (isPaused)
|
||||
HandleResume(playable);
|
||||
isPaused = false;
|
||||
}
|
||||
|
||||
protected void HandlePause (Playable playable) {
|
||||
if (animationStateComponent.IsNullOrDestroyed()) return;
|
||||
|
||||
TrackEntry current = animationStateComponent.AnimationState.GetCurrent(trackIndex);
|
||||
if (current != null && current == timelineStartedTrackEntry) {
|
||||
previousTimeScale = current.TimeScale;
|
||||
current.TimeScale = 0;
|
||||
pausedTrackEntry = current;
|
||||
}
|
||||
}
|
||||
|
||||
protected void HandleResume (Playable playable) {
|
||||
if (animationStateComponent.IsNullOrDestroyed()) return;
|
||||
|
||||
TrackEntry current = animationStateComponent.AnimationState.GetCurrent(trackIndex);
|
||||
if (current != null && current == pausedTrackEntry) {
|
||||
current.TimeScale = previousTimeScale;
|
||||
}
|
||||
}
|
||||
|
||||
protected void HandleClipEnd () {
|
||||
if (animationStateComponent.IsNullOrDestroyed()) return;
|
||||
|
||||
AnimationState state = animationStateComponent.AnimationState;
|
||||
if (endAtClipEnd &&
|
||||
timelineStartedTrackEntry != null &&
|
||||
timelineStartedTrackEntry == state.GetCurrent(trackIndex)) {
|
||||
|
||||
if (endMixOutDuration >= 0)
|
||||
state.SetEmptyAnimation(trackIndex, endMixOutDuration);
|
||||
else // pause if endMixOutDuration < 0
|
||||
timelineStartedTrackEntry.TimeScale = 0;
|
||||
timelineStartedTrackEntry = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void AdjustTrackEntryTimeScale (Playable playable, int input, TrackEntry currentTrackEntry) {
|
||||
if (currentTrackEntry == null)
|
||||
return;
|
||||
ScriptPlayable<SpineAnimationStateBehaviour> clipPlayable = (ScriptPlayable<SpineAnimationStateBehaviour>)playable.GetInput(input);
|
||||
float clipSpeed = (float)clipPlayable.GetSpeed();
|
||||
SpineAnimationStateBehaviour clipData = clipPlayable.GetBehaviour();
|
||||
if (clipData != null && clipData.animationReference != null
|
||||
&& currentTrackEntry.Animation == clipData.animationReference.Animation) {
|
||||
currentTrackEntry.TimeScale = clipSpeed * rootPlayableSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE: This function is called at runtime and edit time. Keep that in mind when setting the values of properties.
|
||||
public override void ProcessFrame (Playable playable, FrameData info, object playerData) {
|
||||
SkeletonAnimation skeletonAnimation = playerData as SkeletonAnimation;
|
||||
SkeletonGraphic skeletonGraphic = playerData as SkeletonGraphic;
|
||||
animationStateComponent = playerData as IAnimationStateComponent;
|
||||
ISkeletonComponent skeletonComponent = playerData as ISkeletonComponent;
|
||||
if (animationStateComponent.IsNullOrDestroyed() || skeletonComponent == null) return;
|
||||
|
||||
Skeleton skeleton = skeletonComponent.Skeleton;
|
||||
AnimationState state = animationStateComponent.AnimationState;
|
||||
|
||||
if (!Application.isPlaying) {
|
||||
#if SPINE_EDITMODEPOSE
|
||||
PreviewEditModePose(playable, skeletonComponent, animationStateComponent,
|
||||
skeletonAnimation, skeletonGraphic);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
int inputCount = playable.GetInputCount();
|
||||
float previousRootSpeed = rootPlayableSpeed;
|
||||
rootPlayableSpeed = GetRootPlayableSpeed(playable);
|
||||
bool rootSpeedChanged = previousRootSpeed != rootPlayableSpeed;
|
||||
|
||||
// Ensure correct buffer size.
|
||||
if (this.lastInputWeights == null || this.lastInputWeights.Length < inputCount) {
|
||||
this.lastInputWeights = new float[inputCount];
|
||||
|
||||
for (int i = 0; i < inputCount; i++)
|
||||
this.lastInputWeights[i] = default(float);
|
||||
}
|
||||
float[] lastInputWeights = this.lastInputWeights;
|
||||
int numStartingClips = 0;
|
||||
bool anyClipPlaying = false;
|
||||
|
||||
// Check all clips. If a clip that was weight 0 turned into weight 1, call SetAnimation.
|
||||
for (int i = 0; i < inputCount; i++) {
|
||||
float lastInputWeight = lastInputWeights[i];
|
||||
float inputWeight = playable.GetInputWeight(i);
|
||||
bool clipStarted = (inputWeight > 0) && (lastInputWeight == 0 || info.seekOccurred || info.timeLooped);
|
||||
if (inputWeight > 0)
|
||||
anyClipPlaying = true;
|
||||
lastInputWeights[i] = inputWeight;
|
||||
|
||||
if (clipStarted) {
|
||||
if (numStartingClips < 2) {
|
||||
ScriptPlayable<SpineAnimationStateBehaviour> clipPlayable = (ScriptPlayable<SpineAnimationStateBehaviour>)playable.GetInput(i);
|
||||
startingClips[numStartingClips++] = clipPlayable;
|
||||
}
|
||||
} else if (rootSpeedChanged) {
|
||||
TrackEntry currentEntry = state.GetCurrent(trackIndex);
|
||||
AdjustTrackEntryTimeScale(playable, i, currentEntry);
|
||||
}
|
||||
}
|
||||
// unfortunately order of clips can be wrong when two start at the same time, we have to sort clips
|
||||
if (numStartingClips == 2) {
|
||||
ScriptPlayable<SpineAnimationStateBehaviour> clipPlayable0 = startingClips[0];
|
||||
ScriptPlayable<SpineAnimationStateBehaviour> clipPlayable1 = startingClips[1];
|
||||
if (clipPlayable0.GetDuration() > clipPlayable1.GetDuration()) { // swap, clip 0 ends after clip 1
|
||||
startingClips[0] = clipPlayable1;
|
||||
startingClips[1] = clipPlayable0;
|
||||
}
|
||||
}
|
||||
|
||||
for (int j = 0; j < numStartingClips; ++j) {
|
||||
ScriptPlayable<SpineAnimationStateBehaviour> clipPlayable = startingClips[j];
|
||||
SpineAnimationStateBehaviour clipData = clipPlayable.GetBehaviour();
|
||||
pauseWithDirector = !clipData.dontPauseWithDirector;
|
||||
endAtClipEnd = !clipData.dontEndWithClip;
|
||||
endMixOutDuration = clipData.endMixOutDuration;
|
||||
|
||||
if (clipData.animationReference == null) {
|
||||
float mixDuration = clipData.customDuration ? GetCustomMixDuration(clipData) : state.Data.DefaultMix;
|
||||
state.SetEmptyAnimation(trackIndex, mixDuration);
|
||||
} else {
|
||||
if (clipData.animationReference.Animation != null) {
|
||||
animationStateComponent.UnscaledTime = this.unscaledTime;
|
||||
|
||||
TrackEntry currentEntry = state.GetCurrent(trackIndex);
|
||||
Spine.TrackEntry trackEntry;
|
||||
float customMixDuration = clipData.customDuration ? GetCustomMixDuration(clipData) : 0.0f;
|
||||
if (currentEntry == null && customMixDuration > 0) {
|
||||
state.SetEmptyAnimation(trackIndex, 0); // ease in requires empty animation
|
||||
trackEntry = state.AddAnimation(trackIndex, clipData.animationReference.Animation, clipData.loop, 0);
|
||||
} else
|
||||
trackEntry = state.SetAnimation(trackIndex, clipData.animationReference.Animation, clipData.loop);
|
||||
|
||||
float clipSpeed = (float)clipPlayable.GetSpeed();
|
||||
trackEntry.EventThreshold = clipData.eventThreshold;
|
||||
trackEntry.DrawOrderThreshold = clipData.drawOrderThreshold;
|
||||
#if SPEED_INCLUDED_IN_CLIP_TIME
|
||||
trackEntry.TrackTime = (float)clipPlayable.GetTime();
|
||||
#else
|
||||
trackEntry.TrackTime = (float)clipPlayable.GetTime() * rootPlayableSpeed * clipSpeed;
|
||||
#endif
|
||||
trackEntry.TimeScale = clipSpeed * rootPlayableSpeed;
|
||||
trackEntry.AttachmentThreshold = clipData.attachmentThreshold;
|
||||
trackEntry.HoldPrevious = clipData.holdPrevious;
|
||||
trackEntry.Alpha = clipData.alpha;
|
||||
|
||||
if (clipData.customDuration)
|
||||
trackEntry.MixDuration = customMixDuration / rootPlayableSpeed;
|
||||
|
||||
timelineStartedTrackEntry = trackEntry;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (numStartingClips > 0) {
|
||||
if (skeletonAnimation) {
|
||||
skeletonAnimation.Update(0);
|
||||
skeletonAnimation.LateUpdate();
|
||||
} else if (skeletonGraphic) {
|
||||
skeletonGraphic.Update(0);
|
||||
skeletonGraphic.LateUpdate();
|
||||
}
|
||||
}
|
||||
startingClips[0] = startingClips[1] = ScriptPlayable<SpineAnimationStateBehaviour>.Null;
|
||||
if (lastAnyClipPlaying && !anyClipPlaying)
|
||||
HandleClipEnd();
|
||||
this.lastAnyClipPlaying = anyClipPlaying;
|
||||
}
|
||||
|
||||
#if SPINE_EDITMODEPOSE
|
||||
/// <summary>Animation event callback for editor scripts when outside of play-mode.</summary>
|
||||
public static event AnimationState.TrackEntryEventDelegate EditorEvent;
|
||||
|
||||
AnimationState dummyAnimationState;
|
||||
ExposedList<Spine.Event> editorAnimationEvents = new ExposedList<Event>();
|
||||
|
||||
public void PreviewEditModePose (Playable playable,
|
||||
ISkeletonComponent skeletonComponent, IAnimationStateComponent animationStateComponent,
|
||||
SkeletonAnimation skeletonAnimation, SkeletonGraphic skeletonGraphic) {
|
||||
|
||||
if (Application.isPlaying) return;
|
||||
if (animationStateComponent.IsNullOrDestroyed() || skeletonComponent == null) return;
|
||||
editorAnimationEvents.Clear(false);
|
||||
|
||||
int inputCount = playable.GetInputCount();
|
||||
float rootSpeed = GetRootPlayableSpeed(playable);
|
||||
int lastNonZeroWeightTrack = -1;
|
||||
|
||||
for (int i = 0; i < inputCount; i++) {
|
||||
float inputWeight = playable.GetInputWeight(i);
|
||||
if (inputWeight > 0) lastNonZeroWeightTrack = i;
|
||||
}
|
||||
|
||||
if (lastNonZeroWeightTrack != -1) {
|
||||
ScriptPlayable<SpineAnimationStateBehaviour> inputPlayableClip =
|
||||
(ScriptPlayable<SpineAnimationStateBehaviour>)playable.GetInput(lastNonZeroWeightTrack);
|
||||
SpineAnimationStateBehaviour clipData = inputPlayableClip.GetBehaviour();
|
||||
|
||||
Skeleton skeleton = skeletonComponent.Skeleton;
|
||||
|
||||
bool skeletonDataMismatch = clipData.animationReference != null && clipData.animationReference.SkeletonDataAsset &&
|
||||
skeletonComponent.SkeletonDataAsset.GetSkeletonData(true) != clipData.animationReference.SkeletonDataAsset.GetSkeletonData(true);
|
||||
if (skeletonDataMismatch) {
|
||||
Debug.LogWarningFormat("SpineAnimationStateMixerBehaviour tried to apply an animation for the wrong skeleton. Expected {0}. Was {1}",
|
||||
skeletonComponent.SkeletonDataAsset, clipData.animationReference.SkeletonDataAsset);
|
||||
}
|
||||
|
||||
// Getting the from-animation here because it's required to get the mix information from AnimationStateData.
|
||||
Animation fromAnimation = null;
|
||||
float fromClipTime = 0;
|
||||
bool fromClipLoop = false;
|
||||
if (lastNonZeroWeightTrack != 0 && inputCount > 1) {
|
||||
var fromClip = (ScriptPlayable<SpineAnimationStateBehaviour>)playable.GetInput(lastNonZeroWeightTrack - 1);
|
||||
SpineAnimationStateBehaviour fromClipData = fromClip.GetBehaviour();
|
||||
fromAnimation = fromClipData.animationReference != null ? fromClipData.animationReference.Animation : null;
|
||||
#if SPEED_INCLUDED_IN_CLIP_TIME
|
||||
fromClipTime = (float)fromClip.GetTime();
|
||||
#else
|
||||
fromClipTime = (float)fromClip.GetTime() * (float)fromClip.GetSpeed() * rootSpeed;
|
||||
#endif
|
||||
fromClipLoop = fromClipData.loop;
|
||||
}
|
||||
|
||||
Animation toAnimation = clipData.animationReference != null ? clipData.animationReference.Animation : null;
|
||||
#if SPEED_INCLUDED_IN_CLIP_TIME
|
||||
float toClipTime = (float)inputPlayableClip.GetTime();
|
||||
#else
|
||||
float toClipTime = (float)inputPlayableClip.GetTime() * (float)inputPlayableClip.GetSpeed() * rootSpeed;
|
||||
#endif
|
||||
float mixDuration = clipData.mixDuration;
|
||||
|
||||
if (!clipData.customDuration && fromAnimation != null && toAnimation != null) {
|
||||
mixDuration = animationStateComponent.AnimationState.Data.GetMix(fromAnimation, toAnimation);
|
||||
}
|
||||
|
||||
if (trackIndex == 0)
|
||||
skeleton.SetToSetupPose();
|
||||
|
||||
// Approximate what AnimationState might do at runtime.
|
||||
if (fromAnimation != null && mixDuration > 0 && toClipTime < mixDuration) {
|
||||
dummyAnimationState = dummyAnimationState ?? new AnimationState(skeletonComponent.SkeletonDataAsset.GetAnimationStateData());
|
||||
|
||||
TrackEntry toEntry = dummyAnimationState.GetCurrent(0);
|
||||
TrackEntry fromEntry = toEntry != null ? toEntry.MixingFrom : null;
|
||||
bool isAnimationTransitionMatch = (toEntry != null && toEntry.Animation == toAnimation && fromEntry != null && fromEntry.Animation == fromAnimation);
|
||||
|
||||
if (!isAnimationTransitionMatch) {
|
||||
dummyAnimationState.ClearTracks();
|
||||
fromEntry = dummyAnimationState.SetAnimation(0, fromAnimation, fromClipLoop);
|
||||
fromEntry.AllowImmediateQueue();
|
||||
if (toAnimation != null) {
|
||||
toEntry = dummyAnimationState.SetAnimation(0, toAnimation, clipData.loop);
|
||||
toEntry.HoldPrevious = clipData.holdPrevious;
|
||||
toEntry.Alpha = clipData.alpha;
|
||||
}
|
||||
}
|
||||
|
||||
// Update track times.
|
||||
fromEntry.TrackTime = fromClipTime;
|
||||
if (toEntry != null) {
|
||||
toEntry.TrackTime = toClipTime;
|
||||
toEntry.MixTime = toClipTime;
|
||||
}
|
||||
|
||||
// Apply Pose
|
||||
dummyAnimationState.Event += EditorEvent;
|
||||
dummyAnimationState.Update(0);
|
||||
dummyAnimationState.Apply(skeleton);
|
||||
dummyAnimationState.Event -= EditorEvent;
|
||||
} else {
|
||||
if (toAnimation != null) {
|
||||
toAnimation.Apply(skeleton, 0, toClipTime, clipData.loop, editorAnimationEvents, clipData.alpha, MixBlend.Setup, MixDirection.In);
|
||||
if (EditorEvent != null) {
|
||||
foreach (Spine.Event e in editorAnimationEvents) {
|
||||
EditorEvent(null, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
skeleton.UpdateWorldTransform();
|
||||
if (skeletonAnimation) {
|
||||
skeletonAnimation.AfterAnimationApplied();
|
||||
skeletonAnimation.LateUpdate();
|
||||
} else if (skeletonGraphic) {
|
||||
skeletonGraphic.AfterAnimationApplied();
|
||||
skeletonGraphic.LateUpdate();
|
||||
}
|
||||
}
|
||||
// Do nothing outside of the first clip and the last clip.
|
||||
|
||||
}
|
||||
#endif
|
||||
float GetRootPlayableSpeed (Playable playable) {
|
||||
PlayableGraph graph = playable.GetGraph();
|
||||
int rootPlayableCount = graph.GetRootPlayableCount();
|
||||
if (rootPlayableCount == 1)
|
||||
return (float)graph.GetRootPlayable(0).GetSpeed();
|
||||
else {
|
||||
for (int rootIndex = 0; rootIndex < rootPlayableCount; ++rootIndex) {
|
||||
Playable rootPlayable = graph.GetRootPlayable(rootIndex);
|
||||
for (int i = 0, n = rootPlayable.GetInputCount(); i < n; ++i) {
|
||||
Playable playableChild = rootPlayable.GetInput(i);
|
||||
if (playableChild.Equals(playable)) {
|
||||
return (float)rootPlayable.GetSpeed();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
float GetCustomMixDuration (SpineAnimationStateBehaviour clipData) {
|
||||
if (clipData.useBlendDuration) {
|
||||
TimelineClip clip = clipData.timelineClip;
|
||||
return (float)Math.Max(clip.blendInDuration, clip.easeInDuration);
|
||||
} else {
|
||||
return clipData.mixDuration;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f61d2f4ac1c4ad044bf4ae6e63b0eca8
|
||||
timeCreated: 1510816616
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,70 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using System.ComponentModel;
|
||||
#endif
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace Spine.Unity.Playables {
|
||||
[TrackColor(255 / 255.0f, 64 / 255.0f, 1 / 255.0f)]
|
||||
[TrackClipType(typeof(SpineAnimationStateClip))]
|
||||
[TrackBindingType(typeof(SkeletonAnimation))]
|
||||
#if UNITY_EDITOR
|
||||
[DisplayName("Spine/SkeletonAnimation Track")]
|
||||
#endif
|
||||
public class SpineAnimationStateTrack : TrackAsset {
|
||||
public int trackIndex = 0;
|
||||
[Tooltip("Whenever starting a new animation clip of this track, " +
|
||||
"SkeletonAnimation.UnscaledTime will be set to this value. " +
|
||||
"This allows you to play back Timeline clips either in normal game time " +
|
||||
"or unscaled game time. Note that PlayableDirector.UpdateMethod " +
|
||||
"is ignored and replaced by this property, which allows more fine-granular " +
|
||||
"control per Timeline track.")]
|
||||
public bool unscaledTime = false;
|
||||
|
||||
public override Playable CreateTrackMixer (PlayableGraph graph, GameObject go, int inputCount) {
|
||||
IEnumerable<TimelineClip> clips = this.GetClips();
|
||||
foreach (TimelineClip clip in clips) {
|
||||
SpineAnimationStateClip animationStateClip = clip.asset as SpineAnimationStateClip;
|
||||
if (animationStateClip != null)
|
||||
animationStateClip.timelineClip = clip;
|
||||
}
|
||||
|
||||
var scriptPlayable = ScriptPlayable<SpineAnimationStateMixerBehaviour>.Create(graph, inputCount);
|
||||
SpineAnimationStateMixerBehaviour mixerBehaviour = scriptPlayable.GetBehaviour();
|
||||
mixerBehaviour.trackIndex = this.trackIndex;
|
||||
mixerBehaviour.unscaledTime = this.unscaledTime;
|
||||
return scriptPlayable;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dfabb056a779ae34b9ebd7de425c868b
|
||||
timeCreated: 1510816616
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3099d730dd2a9e349b3d918960cb42fa
|
||||
folderAsset: yes
|
||||
timeCreated: 1500876410
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,38 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
[Serializable]
|
||||
public class SpineSkeletonFlipBehaviour : PlayableBehaviour {
|
||||
public bool flipX, flipY;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3740378c8a8da8042991fbbe4b4a2094
|
||||
timeCreated: 1500876411
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,47 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
[Serializable]
|
||||
public class SpineSkeletonFlipClip : PlayableAsset, ITimelineClipAsset {
|
||||
public SpineSkeletonFlipBehaviour template = new SpineSkeletonFlipBehaviour();
|
||||
|
||||
public ClipCaps clipCaps {
|
||||
get { return ClipCaps.None; }
|
||||
}
|
||||
|
||||
public override Playable CreatePlayable (PlayableGraph graph, GameObject owner) {
|
||||
var playable = ScriptPlayable<SpineSkeletonFlipBehaviour>.Create(graph, template);
|
||||
return playable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0a29ac408b701f84c93882fb506759d1
|
||||
timeCreated: 1500876411
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,134 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
#define PLAYABLE_DIRECTOR_HAS_STOPPED_EVENT
|
||||
#endif
|
||||
|
||||
using Spine.Unity;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace Spine.Unity.Playables {
|
||||
public class SpineSkeletonFlipMixerBehaviour : PlayableBehaviour {
|
||||
float originalScaleX, originalScaleY;
|
||||
float baseScaleX, baseScaleY;
|
||||
|
||||
SpinePlayableHandleBase playableHandle;
|
||||
bool m_FirstFrameHappened;
|
||||
|
||||
#if PLAYABLE_DIRECTOR_HAS_STOPPED_EVENT
|
||||
PlayableDirector director = null;
|
||||
|
||||
public override void OnPlayableCreate (Playable playable) {
|
||||
director = playable.GetGraph().GetResolver() as PlayableDirector;
|
||||
if (director)
|
||||
director.stopped += OnDirectorStopped;
|
||||
}
|
||||
|
||||
public override void OnPlayableDestroy (Playable playable) {
|
||||
if (director)
|
||||
director.stopped -= OnDirectorStopped;
|
||||
|
||||
base.OnPlayableDestroy(playable);
|
||||
}
|
||||
|
||||
void OnDirectorStopped (PlayableDirector obj) {
|
||||
OnStop();
|
||||
}
|
||||
#else
|
||||
public override void OnGraphStop (Playable playable) {
|
||||
OnStop();
|
||||
}
|
||||
#endif
|
||||
|
||||
public override void ProcessFrame (Playable playable, FrameData info, object playerData) {
|
||||
playableHandle = playerData as SpinePlayableHandleBase;
|
||||
|
||||
if (playableHandle == null)
|
||||
return;
|
||||
|
||||
Skeleton skeleton = playableHandle.Skeleton;
|
||||
|
||||
if (!m_FirstFrameHappened) {
|
||||
originalScaleX = skeleton.ScaleX;
|
||||
originalScaleY = skeleton.ScaleY;
|
||||
baseScaleX = Mathf.Abs(originalScaleX);
|
||||
baseScaleY = Mathf.Abs(originalScaleY);
|
||||
m_FirstFrameHappened = true;
|
||||
}
|
||||
|
||||
int inputCount = playable.GetInputCount();
|
||||
|
||||
float totalWeight = 0f;
|
||||
float greatestWeight = 0f;
|
||||
int currentInputs = 0;
|
||||
|
||||
for (int i = 0; i < inputCount; i++) {
|
||||
float inputWeight = playable.GetInputWeight(i);
|
||||
ScriptPlayable<SpineSkeletonFlipBehaviour> inputPlayable = (ScriptPlayable<SpineSkeletonFlipBehaviour>)playable.GetInput(i);
|
||||
SpineSkeletonFlipBehaviour input = inputPlayable.GetBehaviour();
|
||||
|
||||
totalWeight += inputWeight;
|
||||
|
||||
if (inputWeight > greatestWeight) {
|
||||
SetSkeletonScaleFromFlip(skeleton, input.flipX, input.flipY);
|
||||
greatestWeight = inputWeight;
|
||||
}
|
||||
|
||||
if (!Mathf.Approximately(inputWeight, 0f))
|
||||
currentInputs++;
|
||||
}
|
||||
|
||||
if (currentInputs != 1 && 1f - totalWeight > greatestWeight) {
|
||||
skeleton.ScaleX = originalScaleX;
|
||||
skeleton.ScaleY = originalScaleY;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetSkeletonScaleFromFlip (Skeleton skeleton, bool flipX, bool flipY) {
|
||||
skeleton.ScaleX = flipX ? -baseScaleX : baseScaleX;
|
||||
skeleton.ScaleY = flipY ? -baseScaleY : baseScaleY;
|
||||
}
|
||||
|
||||
public void OnStop () {
|
||||
m_FirstFrameHappened = false;
|
||||
|
||||
if (playableHandle == null)
|
||||
return;
|
||||
|
||||
Skeleton skeleton = playableHandle.Skeleton;
|
||||
skeleton.ScaleX = originalScaleX;
|
||||
skeleton.ScaleY = originalScaleY;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f25dcf1fb34ab8643ac8734e57a9540f
|
||||
timeCreated: 1500876411
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,68 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
||||
* otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 THE
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using System.ComponentModel;
|
||||
#endif
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace Spine.Unity.Playables {
|
||||
|
||||
[TrackColor(0.855f, 0.8623f, 0.87f)]
|
||||
[TrackClipType(typeof(SpineSkeletonFlipClip))]
|
||||
[TrackBindingType(typeof(SpinePlayableHandleBase))]
|
||||
#if UNITY_EDITOR
|
||||
[DisplayName("Spine/Skeleton Flip Track")]
|
||||
#endif
|
||||
public class SpineSkeletonFlipTrack : TrackAsset {
|
||||
public override Playable CreateTrackMixer (PlayableGraph graph, GameObject go, int inputCount) {
|
||||
return ScriptPlayable<SpineSkeletonFlipMixerBehaviour>.Create(graph, inputCount);
|
||||
}
|
||||
|
||||
public override void GatherProperties (PlayableDirector director, IPropertyCollector driver) {
|
||||
#if UNITY_EDITOR
|
||||
SpinePlayableHandleBase trackBinding = director.GetGenericBinding(this) as SpinePlayableHandleBase;
|
||||
if (trackBinding == null)
|
||||
return;
|
||||
|
||||
UnityEditor.SerializedObject serializedObject = new UnityEditor.SerializedObject(trackBinding);
|
||||
UnityEditor.SerializedProperty iterator = serializedObject.GetIterator();
|
||||
while (iterator.NextVisible(true)) {
|
||||
if (iterator.hasVisibleChildren)
|
||||
continue;
|
||||
|
||||
driver.AddFromName<SpinePlayableHandleBase>(trackBinding.gameObject, iterator.propertyPath);
|
||||
}
|
||||
#endif
|
||||
base.GatherProperties(director, driver);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 82ac803eb1878814bba380a18b6b5d9d
|
||||
timeCreated: 1500876411
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "spine-timeline",
|
||||
"references": [
|
||||
"spine-unity",
|
||||
"spine-csharp",
|
||||
"Unity.Timeline"
|
||||
],
|
||||
"optionalUnityReferences": [],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": []
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d081815e631c29f46ab6f2ac745854df
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "com.esotericsoftware.spine.timeline",
|
||||
"displayName": "Spine Timeline Extensions",
|
||||
"description": "This plugin provides integration of spine-unity for the Unity Timeline.\n\nPrerequisites:\nIt requires a working installation of the spine-unity runtime (via the spine-unity unitypackage), version 4.1.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
|
||||
"version": "4.1.7",
|
||||
"unity": "2018.3",
|
||||
"author": {
|
||||
"name": "Esoteric Software",
|
||||
"email": "contact@esotericsoftware.com",
|
||||
"url": "http://esotericsoftware.com/"
|
||||
},
|
||||
"dependencies": {
|
||||
"com.unity.timeline": "1.2.10"
|
||||
},
|
||||
"keywords": [
|
||||
"spine",
|
||||
"timeline"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7d45acd6a5447f84db6c00a864838a10
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "com.esotericsoftware.spine.timeline",
|
||||
"displayName": "Spine Timeline Extensions",
|
||||
"description": "This plugin provides integration of spine-unity for the Unity Timeline.\n\nPrerequisites:\nIt requires a working installation of the spine-unity and spine-csharp runtimes as UPM packages (not as spine-unity unitypackage), version 4.1.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
|
||||
"version": "4.1.13",
|
||||
"unity": "2018.3",
|
||||
"author": {
|
||||
"name": "Esoteric Software",
|
||||
"email": "contact@esotericsoftware.com",
|
||||
"url": "http://esotericsoftware.com/"
|
||||
},
|
||||
"dependencies": {
|
||||
"com.unity.timeline": "1.2.10",
|
||||
"com.esotericsoftware.spine.spine-unity": "4.1.13"
|
||||
},
|
||||
"keywords": [
|
||||
"spine",
|
||||
"timeline"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 591b30eac7c750e4d8b4cf9d09a80351
|
||||
PackageManifestImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||