|
@@ -39,8 +39,16 @@ namespace Spine.Unity {
|
|
|
|
|
|
public delegate void UpdateBonesDelegate (ISkeletonAnimation animated);
|
|
|
|
|
|
+ public interface ISpineComponent { }
|
|
|
+ public static class ISpineComponentExtensions {
|
|
|
+ public static bool IsNullOrDestroyed (this ISpineComponent component) {
|
|
|
+ if (component == null) return true;
|
|
|
+ return (UnityEngine.Object)component == null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>A Spine-Unity Component that animates a Skeleton but not necessarily with a Spine.AnimationState.</summary>
|
|
|
- public interface ISkeletonAnimation {
|
|
|
+ public interface ISkeletonAnimation : ISpineComponent {
|
|
|
event UpdateBonesDelegate UpdateLocal;
|
|
|
event UpdateBonesDelegate UpdateWorld;
|
|
|
event UpdateBonesDelegate UpdateComplete;
|
|
@@ -48,13 +56,13 @@ namespace Spine.Unity {
|
|
|
}
|
|
|
|
|
|
/// <summary>Holds a reference to a SkeletonDataAsset.</summary>
|
|
|
- public interface IHasSkeletonDataAsset {
|
|
|
+ public interface IHasSkeletonDataAsset : ISpineComponent {
|
|
|
/// <summary>Gets the SkeletonDataAsset of the Spine Component.</summary>
|
|
|
SkeletonDataAsset SkeletonDataAsset { get; }
|
|
|
}
|
|
|
|
|
|
/// <summary>A Spine-Unity Component that manages a Spine.Skeleton instance, instantiated from a SkeletonDataAsset.</summary>
|
|
|
- public interface ISkeletonComponent {
|
|
|
+ public interface ISkeletonComponent : ISpineComponent {
|
|
|
/// <summary>Gets the SkeletonDataAsset of the Spine Component.</summary>
|
|
|
//[System.Obsolete]
|
|
|
SkeletonDataAsset SkeletonDataAsset { get; }
|
|
@@ -64,18 +72,18 @@ namespace Spine.Unity {
|
|
|
}
|
|
|
|
|
|
/// <summary>A Spine-Unity Component that uses a Spine.AnimationState to animate its skeleton.</summary>
|
|
|
- public interface IAnimationStateComponent {
|
|
|
+ public interface IAnimationStateComponent : ISpineComponent {
|
|
|
/// <summary>Gets the Spine.AnimationState of the animated Spine Component. This is equivalent to SkeletonAnimation.state.</summary>
|
|
|
AnimationState AnimationState { get; }
|
|
|
}
|
|
|
|
|
|
/// <summary>A Spine-Unity Component that holds a reference to a SkeletonRenderer.</summary>
|
|
|
- public interface IHasSkeletonRenderer {
|
|
|
+ public interface IHasSkeletonRenderer : ISpineComponent {
|
|
|
SkeletonRenderer SkeletonRenderer { get; }
|
|
|
}
|
|
|
|
|
|
/// <summary>A Spine-Unity Component that holds a reference to an ISkeletonComponent.</summary>
|
|
|
- public interface IHasSkeletonComponent {
|
|
|
+ public interface IHasSkeletonComponent : ISpineComponent {
|
|
|
ISkeletonComponent SkeletonComponent { get; }
|
|
|
}
|
|
|
}
|