From f7940d122393b39f86db24984ef8e3cc726c1d84 Mon Sep 17 00:00:00 2001 From: ww-rm Date: Tue, 27 May 2025 19:10:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Spine/README.md | 82 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/Spine/README.md b/Spine/README.md index f7899bd..fde2add 100644 --- a/Spine/README.md +++ b/Spine/README.md @@ -1,3 +1,83 @@ # Spine -这个库封装了与 Spine 有关的底层功能. +这个库封装了与 Spine 有关的底层功能, 下图给出主要关系. + +```mermaid +classDiagram +direction TB + +namespace Spine.SpineWrappers { + class ISkeleton { <> } + class IAnimationState { <> } + class ISpineObjectData { <> } + class SpineObjectData { + <> + +CreateSkeleton() ISkeleton + +CreateAnimationState() IAnimationState + } +} + +namespace Spine.Implementations.SpineWrappers.V38 { + class Skeleton38 + class AnimationState38 + class SpineObjectData38 +} + +namespace Spine { + class SpineObject { + +ISpineObjectData Data + +ISkeleton Skeleton + +IAnimationState AnimationState + +SpineObject(skelPath, atlasPath = null, version = null) + } +} + +ISpineObjectData <|.. SpineObjectData + +Skeleton38 <.. SpineObjectData38 +AnimationState38 <.. SpineObjectData38 + +ISkeleton <|.. Skeleton38 +IAnimationState <|.. AnimationState38 +SpineObjectData <|-- SpineObjectData38 + +SpineObjectData38 <.. SpineObject + +``` + +```mermaid +classDiagram +direction LR + +namespace Spine.Exporters { + class BaseExporter { + <> + +Export(output, params spines) + } + + class VideoExporter { + <> + +Export(output, ct, params spines) + } + + class FrameExporter + class FrameSequenceExporter + class FFmpegVideoExporter + class CustomFFmpegExporter +} + +BaseExporter <|-- FrameExporter +BaseExporter <|-- VideoExporter +VideoExporter <|-- FrameSequenceExporter +VideoExporter <|-- FFmpegVideoExporter +VideoExporter <|-- CustomFFmpegExporter + +``` + +## 如何扩展渲染支持的版本 + +在命名空间 `Spine.Implementations.SpineWrappers` 下, 增加扩展版本的子命名空间, 例如 `V38`. + +随后实现 `SpineObjectData38`, 并继承自 `Spine.SpineWrappers.SpineObjectData`. + +并在实现类上使用特性注解 `[SpineImplementation(3, 8)]`.