Agent SkillsBesty0728/Unity-Skills › unity-dotween-design

unity-dotween-design

GitHub

为DOTween 1.3.015提供源码级设计规则,涵盖补间基础、序列构建、生命周期绑定及UniTask集成。用于编写、审查动画代码或排查陷阱,支持Unity 2018+。

SkillsForUnity/unity-skills~/skills/dotween-design/SKILL.md Besty0728/Unity-Skills

Trigger Scenarios

编写或审查DOTween动画代码 构建序列动画 绑定补间生命周期 排查补间陷阱 用户提及'补间'或'做个动画'

Install

npx skills add Besty0728/Unity-Skills --skill unity-dotween-design -g -y
More Options

Non-standard path

npx skills add https://github.com/Besty0728/Unity-Skills/tree/main/SkillsForUnity/unity-skills~/skills/dotween-design -g -y

Use without installing

npx skills use Besty0728/Unity-Skills@unity-dotween-design

指定 Agent (Claude Code)

npx skills add Besty0728/Unity-Skills --skill unity-dotween-design -a claude-code -g -y

安装 repo 全部 skill

npx skills add Besty0728/Unity-Skills --all -g -y

预览 repo 内 skill

npx skills add Besty0728/Unity-Skills --list

SKILL.md

Frontmatter
{
    "name": "unity-dotween-design",
    "description": "Source-anchored design rules for DOTween 1.3.015 (Unity 2018+) — tween\/sequence basics, ease curves, shortcuts, lifetime binding, callbacks, safe mode, and integration with UniTask\/Addressables. Use when writing or reviewing DOTween animation code, building sequences, binding tween lifetime to objects, or debugging tween pitfalls, even if the user just says \"补间\" or \"做个动画\". 为 DOTween 1.3.015(Unity 2018+)提供源码锚定的设计规则(补间\/序列基础、缓动曲线、快捷方法、生命周期绑定、回调、安全模式、与 UniTask\/Addressables 集成);当用户要编写或审查 DOTween 动画代码、构建序列动画、绑定补间生命周期或排查补间陷阱时使用。"
}

DOTween - Design Rules

Advisory module. Every rule is distilled from Demigiant DOTween source at:

  • 1.3.015 — bundled in _DOTween.Assembly/DOTween/ and bin/Modules/ module files (Unity 2018+)

Each rule cites a concrete file/line so the reasoning is auditable and the AI does not improvise against stale memory.

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

When to Load This Module

Load before writing or reviewing any of:

  • DOTween.Init(...) bootstrap, DOTweenSettings configuration, SetTweensCapacity adjustments
  • Any .DOMove / .DORotate / .DOScale / .DOColor / .DOFade / .DOShake* / .DOPath / .DOPunch* shortcut call
  • DOTween.Sequence() + .Append / .Join / .Insert / .Prepend / .AppendInterval / .PrependInterval / .AppendCallback
  • .SetEase / .SetDelay / .SetLoops / .SetAutoKill / .SetLink / .SetId / .SetTarget / .SetUpdate / .SetRelative / .SetRecyclable / .SetSpeedBased
  • .OnStart / .OnUpdate / .OnStepComplete / .OnComplete / .OnKill / .OnPlay / .OnPause / .OnRewind
  • .AsyncWaitForCompletion / .AsyncWaitForKill / .AsyncWaitForRewind / .AsyncWaitForElapsedLoops / .AsyncWaitForPosition
  • tween.ToUniTask(TweenCancelBehaviour, CancellationToken) (UniTask bridge)
  • DOTween.Kill(target, complete) / DOTween.KillAll() batch operations
  • Safe Mode debugging — useSafeMode, safeModeLogBehaviour, nestedTweenFailureBehaviour
  • DOTween Module generation (Audio / Physics / Physics2D / Sprite / UI / UnityUI / TextMeshPro)

Critical Rule Summary

# Rule Source anchor
1 DOTween.Init(recycleAllByDefault, useSafeMode, logBehaviour) returns IDOTweenInit for fluent .SetCapacity(...). If not called explicitly, Auto-init runs on first tween creation (AutoInit at DOTween.cs:236). DOTween.Version = "1.3.015" is exposed as a const. DOTween.cs:38,227,236,243
2 Every tween is driven by a single [DOTween] GameObject MonoBehaviour (DOTweenComponent) marked DontDestroyOnLoad. It is created on first init and survives scene loads. Don't destroy it — DOTween.Clear(destroy: true) is the only supported teardown. DOTweenComponent.cs:268-270, DOTween.cs:311
3 Default autoKill = true: tween is killed on completion. After kill, calls like .Restart() / .Kill() / .Complete() are no-ops (Safe Mode) or NullReferenceException (Safe Mode off). Use .SetAutoKill(false) to keep tween alive for replay. DOTween.cs useSafeMode:49, TweenSettingsExtensions.cs:39,49
4 Safe Mode is ON by default (useSafeMode = true). Target destroyed while tween plays → Safe Mode catches the exception and logs per safeModeLogBehaviour (default: Warning). Disable Safe Mode to locate missing-link bugs during development. DOTween.cs:49,51
5 SetLink(gameObject, LinkBehaviour) binds tween lifecycle to a GameObject. Default LinkBehaviour.KillOnDestroy. Without SetLink, tween continues running after target is destroyed and relies on Safe Mode for protection. TweenSettingsExtensions.cs:91,103, LinkBehaviour.cs
6 SetTarget(object target) is required for DOTween.Kill(target) / DOTween.KillAll(target) grouping. Shortcut extensions (.DOMove, .DOFade, etc.) set target automatically; manual DOTween.To(...) does NOT. TweenSettingsExtensions.cs:116, DOTween.cs:884,892
7 Sequence.Append(t) runs after previous. Sequence.Join(t) runs in parallel with previous. Sequence.Insert(float atPosition, t) inserts at absolute time. Sequence.Prepend(t) pushes to front, shifting existing. TweenSettingsExtensions.cs:499,508,517,528
8 AsyncWaitForCompletion / AsyncWaitForKill / AsyncWaitForRewind live in DOTweenModuleUnityVersion.cs (MODULE file, gated by `UNITY_2018_1_OR_NEWER && (NET_4_6
9 UniTask bridge tween.ToUniTask(TweenCancelBehaviour, CancellationToken) lives in UniTask's External/DOTween/ extensions and is the recommended await path over AsyncWaitForCompletion. TweenCancelBehaviour has 9 values (Kill / Complete / CancelAwait / KillAndCancelAwait / ...). UniTask DOTweenAsyncExtensions.cs:14-27,54
10 Ease enum has 38 entries (36 user-facing + 2 reserved INTERNAL_*): Unset / Linear + In/Out/InOut variants of Sine/Quad/Cubic/Quart/Quint/Expo/Circ/Elastic/Back/Bounce (10 × 3 = 30 math eases) + Flash / InFlash / OutFlash / InOutFlash. INTERNAL_Zero and INTERNAL_Custom are auto-assigned by DOTween for zero-duration and AnimationCurve-based tweens. Ease.cs:9-53

Sub-doc Routing

Sub-doc When to read
BASICS.md DOTween.Init, driver GameObject, DOTweenSettings asset, Modules architecture, Safe Mode, tween capacity
TWEEN.md Tween base class, Tweener vs Sequence, autoKill, Play/Pause/Rewind/Restart/Kill/Complete/Goto lifecycle
SEQUENCE.md Sequence.Append / Join / Insert / Prepend / AppendInterval / PrependInterval / AppendCallback / InsertCallback, nesting, loop composition
SHORTCUTS.md .DOMove / DOLocalMove / DOAnchorPos / DORotate / DOScale / DOColor / DOFade / DOPath / DOJump / DOPunch / DOShake* cheat sheet by target type
EASE.md Full Ease enum, SetEase overloads (Ease / amplitude+period / AnimationCurve / EaseFunction), Flash family, Elastic/Back overshoot
LIFETIME.md SetAutoKill / SetLink / SetRecyclable / SetId / SetTarget / DOTween.Kill / DOTween.KillAll, Safe Mode, tween pool capacity
INTEGRATION.md DOTween + UniTask (ToUniTask), DOTween + Coroutine (WaitForCompletion), DOTween + Addressables lifetime, DOTween + Netcode deterministic replay
PITFALLS.md 30 concrete hallucination / runtime pitfalls (missing target, stale tween handle, OnComplete not firing on infinite loop, Safe Mode hiding bugs, etc.)

Routing to Other Modules

  • Async integration (ToUniTask, AsyncWaitForCompletion) → load unitask-design and async
  • UI animation (uGUI / UIToolkit) choice between DOTween and native animators → load inspector
  • Architecture / performance review of tween-heavy scenes → load performance
  • Asmdef layout for DOTween consumers (DOTween.asmdef, DOTween Modules asmdef) → load asmdef
  • Addressables-loaded prefab tween lifetime (bundle unload vs tween running) → load addressables-design

Version Scope

Targets DOTween 1.3.015 (the Pro/Free source bundled in _DOTween.Assembly/). Version is exposed as the const DOTween.Version = "1.3.015" at DOTween.cs:38.

Earlier 1.2.x versions are source-compatible for most APIs. Key differences:

  • Modules system (UI / TMP / Physics / etc.) requires post-1.2.0 source and the Utility Panel scanner.
  • SetLink was added in 1.2.x series; LinkBehaviour.KillOnDestroy vs KillOnDisable variants in later 1.2/1.3.
  • TweenCancelBehaviour (UniTask bridge) shipped separately via the UniTask package.

When in doubt, read the cited source — not your memory.

Version History

  • ec9f870 Current 2026-07-05 14:39

Same Skill Collection

SkillsForUnity/unity-skills~/skills/adr/SKILL.md
SkillsForUnity/unity-skills~/skills/animator/SKILL.md
SkillsForUnity/unity-skills~/skills/architecture/SKILL.md
SkillsForUnity/unity-skills~/skills/asmdef/SKILL.md
SkillsForUnity/unity-skills~/skills/asset/SKILL.md
SkillsForUnity/unity-skills~/skills/async/SKILL.md
SkillsForUnity/unity-skills~/skills/batch/SKILL.md
SkillsForUnity/unity-skills~/skills/blueprints/SKILL.md
SkillsForUnity/unity-skills~/skills/bookmark/SKILL.md
SkillsForUnity/unity-skills~/skills/camera/SKILL.md
SkillsForUnity/unity-skills~/skills/cinemachine/SKILL.md
SkillsForUnity/unity-skills~/skills/cleaner/SKILL.md
SkillsForUnity/unity-skills~/skills/component/SKILL.md
SkillsForUnity/unity-skills~/skills/console/SKILL.md
SkillsForUnity/unity-skills~/skills/debug/SKILL.md
SkillsForUnity/unity-skills~/skills/decal/SKILL.md
SkillsForUnity/unity-skills~/skills/dotween/SKILL.md
SkillsForUnity/unity-skills~/skills/editor/SKILL.md
SkillsForUnity/unity-skills~/skills/event/SKILL.md
SkillsForUnity/unity-skills~/skills/gameobject/SKILL.md
SkillsForUnity/unity-skills~/skills/graphics/SKILL.md
SkillsForUnity/unity-skills~/skills/history/SKILL.md
SkillsForUnity/unity-skills~/skills/importer/SKILL.md
SkillsForUnity/unity-skills~/skills/inspector/SKILL.md
SkillsForUnity/unity-skills~/skills/light/SKILL.md
SkillsForUnity/unity-skills~/skills/material/SKILL.md
SkillsForUnity/unity-skills~/skills/navmesh/SKILL.md
SkillsForUnity/unity-skills~/skills/netcode-design/SKILL.md
SkillsForUnity/unity-skills~/skills/netcode/SKILL.md
SkillsForUnity/unity-skills~/skills/optimization/SKILL.md
SkillsForUnity/unity-skills~/skills/package/SKILL.md
SkillsForUnity/unity-skills~/skills/patterns/SKILL.md
SkillsForUnity/unity-skills~/skills/perception/SKILL.md
SkillsForUnity/unity-skills~/skills/performance/SKILL.md
SkillsForUnity/unity-skills~/skills/physics/SKILL.md
SkillsForUnity/unity-skills~/skills/postprocess/SKILL.md
SkillsForUnity/unity-skills~/skills/prefab/SKILL.md
SkillsForUnity/unity-skills~/skills/probuilder/SKILL.md
SkillsForUnity/unity-skills~/skills/profiler/SKILL.md
SkillsForUnity/unity-skills~/skills/project-scout/SKILL.md
SkillsForUnity/unity-skills~/skills/project/SKILL.md
SkillsForUnity/unity-skills~/skills/sample/SKILL.md
SkillsForUnity/unity-skills~/skills/scene-contracts/SKILL.md
SkillsForUnity/unity-skills~/skills/scene/SKILL.md
SkillsForUnity/unity-skills~/skills/script-roles/SKILL.md
SkillsForUnity/unity-skills~/skills/script/SKILL.md
SkillsForUnity/unity-skills~/skills/scriptableobject/SKILL.md
SkillsForUnity/unity-skills~/skills/scriptdesign/SKILL.md
SkillsForUnity/unity-skills~/skills/shader/SKILL.md
SkillsForUnity/unity-skills~/skills/shadergraph/SKILL.md
SkillsForUnity/unity-skills~/skills/SKILL.md
SkillsForUnity/unity-skills~/skills/smart/SKILL.md
SkillsForUnity/unity-skills~/skills/terrain/SKILL.md
SkillsForUnity/unity-skills~/skills/test/SKILL.md
SkillsForUnity/unity-skills~/skills/testability/SKILL.md
SkillsForUnity/unity-skills~/skills/timeline/SKILL.md
SkillsForUnity/unity-skills~/skills/ui/SKILL.md
SkillsForUnity/unity-skills~/skills/uitoolkit/SKILL.md
SkillsForUnity/unity-skills~/skills/urp/SKILL.md
SkillsForUnity/unity-skills~/skills/validation/SKILL.md
SkillsForUnity/unity-skills~/skills/volume/SKILL.md
SkillsForUnity/unity-skills~/skills/workflow/SKILL.md
SkillsForUnity/unity-skills~/skills/xr/SKILL.md
SkillsForUnity/unity-skills~/skills/yooasset-design/SKILL.md
SkillsForUnity/unity-skills~/skills/yooasset/SKILL.md
SkillsForUnity/unity-skills~/SKILL.md
SkillsForUnity/unity-skills~/skills/addressables-design/SKILL.md
SkillsForUnity/unity-skills~/skills/shadergraph-design/SKILL.md
SkillsForUnity/unity-skills~/skills/unitask-design/SKILL.md
SkillsForUnity/unity-skills~/skills/yaml-editing/SKILL.md

Metadata

Files
0
Version
ec9f870
Hash
b26827e6
Indexed
2026-07-05 14:39

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-08 19:14
浙ICP备14020137号-1 $bản đồ khách truy cập$