AGENT SKILL
UI 过渡动画预设
13-ui-transition-preset
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-04-12
- Stars
- ★ 0
- Forks
- 0
02 资源文件 9
- 参考文档README.md1.7 KB
- 参考文档references/app-development.md10.3 KB
- 参考文档references/extensions.md10.4 KB
- 参考文档references/themes.md10.1 KB
- 脚本scripts/.gitignore375 B
- 脚本scripts/requirements.txt452 B
- 脚本scripts/shopify_graphql.py12.4 KB
- 脚本scripts/shopify_init.py12.9 KB
- 脚本scripts/tests/test_shopify_init.py12.9 KB
03 SKILL.md 正文
13-ui-transition-preset
Status: ACTIVE AppliesTo: v2 Type: Data Specification
Purpose
UITransitionPreset은 UI 연출 데이터를 channel clip timeline으로 정의한다.
toast show/hide, panel show/hide, item add reaction 같은 전이를 preset으로 표현한다.
Target Code Path
framework-cs/upm/com.devian.foundation/Samples~/UIPackage/Runtime/Tween/UITransitionPreset.cs
framework-cs/upm/com.devian.foundation/Samples~/UIPackage/Runtime/Tween/UITransitionPresetAsset.cs
framework-cs/upm/com.devian.foundation/Samples~/UIPackage/Runtime/Tween/UI_TRANSITION_PRESET_ID.cs
Data Shape
[Serializable]
public struct UITransitionAlphaClip
{
public float StartTime;
public float Duration;
public UITweenEase Ease;
public float From;
public float To;
}
[Serializable]
public struct UITransitionMoveClip
{
public float StartTime;
public float Duration;
public UITweenEase Ease;
public Vector2 FromOffset;
public Vector2 ToOffset;
}
[Serializable]
public struct UITransitionScaleClip
{
public float StartTime;
public float Duration;
public UITweenEase Ease;
public Vector3 From;
public Vector3 To;
}
[Serializable]
public struct UITransitionPreferredSizeClip
{
public float StartTime;
public float Duration;
public UITweenEase Ease;
public Vector2 From;
public Vector2 To;
}
[Serializable]
public sealed class UITransitionPreset
{
public UITransitionAlphaClip[] AlphaClips;
public UITransitionMoveClip[] MoveClips;
public UITransitionScaleClip[] ScaleClips;
public UITransitionPreferredSizeClip[] PreferredSizeClips;
}
Rules
UITransitionPreset은 순수Serializabledata payload다.- editor authoring과 inspector 선택은
UITransitionPresetAsset : ScriptableObject를 사용한다. - asset이
AssetId를 상속하지는 않는다. 기존 패턴대로 asset과UI_TRANSITION_PRESET_IDwrapper를 분리한다. - runtime field는
UI_TRANSITION_PRESET_ID를 우선 사용하고, 필요시 direct asset ref를 보조적으로 허용한다. - show preset과 hide preset은 별도 preset으로 가진다.
- alpha / move / scale / preferred-size는 independent channel이다.
- 시간 오프셋은
Delay가 아니라 각 clip의StartTime으로 표현한다. - 첫 clip이 시작되기 전 구간에는 그 clip의
From*값이 channel 초기값으로 유지된다. - move clip은 절대 좌표가 아니라
UITransitionPlayer가 보관하는 anchoredPosition baseline 기준 offset으로 해석한다. - 반복 재생 시 이전 move tween의 종료 위치가 다음 play 기준점으로 누적되면 안 된다.
- preferred-size clip은 same-GO
LayoutElement.preferredWidth/preferredHeight절대값으로 해석한다. - clip이 배열에 존재하면 runtime 대상에 포함된다. 별도
Enabled게이트는 두지 않는다. - 같은 channel에서 clip이 겹치면 배열상 뒤에 선언된 clip이 우선한다.
- 구형 preset 대체 구조는 두지 않는다.
Asset Pattern
권장 구조:
[CreateAssetMenu(...)]
public sealed class UITransitionPresetAsset : ScriptableObject
{
public UITransitionPreset Preset;
}
[Serializable]
public sealed class UI_TRANSITION_PRESET_ID
{
public string Value;
}
UITransitionPresetAsset은CreateAssetMenu로 authoring asset을 만든다- runtime lookup은 기본적으로
Play(UI_TRANSITION_PRESET_ID id)경로를 사용한다 - editor play mode에서는 raw asset을 우선 찾고, runtime bundle cache는 fallback으로 사용한다
Easing
권장 easing:
public enum UITweenEase
{
Linear,
InQuad,
OutQuad,
InOutQuad
}