Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: opt animator doc #2432

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

doc: opt animator doc #2432

wants to merge 4 commits into from

Conversation

luzhuang
Copy link
Contributor

@luzhuang luzhuang commented Nov 12, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

Other information:

Summary by CodeRabbit

  • New Features
    • Added new documentation files for animation blending, controlling animations by user input, animation transitions, playing animations in models, reusing animations, material animations, and text animations.
  • Improvements
    • Enhanced clarity and consistency in terminology across multiple documents, especially for Chinese-speaking users.
    • Expanded guidance on creating and exporting animation clips in Unity.
    • Improved structure and organization of existing documentation to facilitate user understanding.
  • Bug Fixes
    • Minor grammatical adjustments and formatting changes for better readability.

@luzhuang luzhuang added the documentation Improvements or additions to documentation label Nov 12, 2024
Copy link

coderabbitai bot commented Nov 12, 2024

Walkthrough

The pull request introduces significant updates to the animation documentation in Chinese, including new files and revisions for clarity and consistency. Key changes include the addition of a JSON object in the _meta.json file, the introduction of new tutorial documents for animation blending, control by input, and sprite animations, as well as extensive terminology updates across existing documentation to ensure uniformity in the translation of animation-related terms.

Changes

File Path Change Summary
docs/zh/animation/_meta.json Added new JSON object: {"examples": {"title": "指南和示例"}}
docs/zh/animation/animator.mdx Replaced "Animator" with "动画控制组件" and "AnimatorController" with "动画控制器" throughout. Updated sections for consistency.
docs/zh/animation/animatorController.mdx Added "简介" section and reformatted text for clarity. Introduced subsections detailing main components.
docs/zh/animation/clip-for-artist.md Expanded Unity section with detailed steps for creating and exporting animation clips.
docs/zh/animation/clip.mdx Enhanced clarity and consistency in terminology related to the animation system.
docs/zh/animation/examples/blending.mdx New document for multi-layer animation blending with step-by-step instructions.
docs/zh/animation/examples/controlAnimationByInput.mdx New tutorial on controlling animations via user input with detailed setup instructions.
docs/zh/animation/examples/crossFade.mdx New document outlining animation transitions with practical examples.
docs/zh/animation/examples/playAnimation.mdx New guide for playing animations in models, including detailed import and playback instructions.
docs/zh/animation/examples/reuseAnimation.mdx New document for reusing animations from one model on another with comprehensive steps.
docs/zh/animation/examples/sprite-sheet.mdx New guide for implementing 2D frame animations with detailed instructions and visuals.
docs/zh/animation/layer.mdx Updated terminology and expanded properties section for clarity.
docs/zh/animation/state-machine.mdx Updated terminology and improved descriptions of animation states and transitions.
docs/zh/animation/system.md Minor terminology update for "Animator" and reorganization of document order.
docs/zh/animation/sprite-sheet.md Deleted file containing outdated documentation on sprite animations.

Suggested labels

enhancement

Suggested reviewers

  • GuoLei1990
  • MrKou47

🐇 In the land of hops and bounds,
New guides and terms abound,
Animations dance with glee,
Clarity for all to see!
With layers and blends so bright,
Our docs now shine with light! ✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 0d8394a and 2766a6c.

📒 Files selected for processing (2)
  • docs/zh/animation/examples/material-animation.mdx (1 hunks)
  • docs/zh/animation/examples/sprite-sheet.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/zh/animation/examples/material-animation.mdx
  • docs/zh/animation/examples/sprite-sheet.mdx

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.78%. Comparing base (2b89197) to head (2766a6c).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2432      +/-   ##
==========================================
+ Coverage   69.41%   70.78%   +1.37%     
==========================================
  Files         524      524              
  Lines       27480    27487       +7     
  Branches     4111     4111              
==========================================
+ Hits        19075    19457     +382     
+ Misses       6900     6477     -423     
- Partials     1505     1553      +48     
Flag Coverage Δ
unittests 70.78% <ø> (+1.37%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (38)
docs/zh/animation/layer.mdx (2)

20-20: Consider improving the formatting of weight effect explanations

The parenthetical explanations about weight effects could be more prominent and easier to read. Consider restructuring as:

-叠加模式下,较高层的动画会在较低层动画的基础上叠加。这个模式下先计算动画关键帧的差异,将这些差异应用到较低层动画上,从而实现动画的叠加效果(随着权重的增加,不会减少下层对动画的影响), 它常用于在基础动作上添加细节或调整。
+叠加模式下,较高层的动画会在较低层动画的基础上叠加。这个模式下先计算动画关键帧的差异,将这些差异应用到较低层动画上,从而实现动画的叠加效果。
+
+**权重影响**:随着权重的增加,不会减少下层对动画的影响。
+
+它常用于在基础动作上添加细节或调整。

Similar restructuring can be applied to the override mode explanation.

Also applies to: 23-23

🧰 Tools
🪛 LanguageTool

[uncategorized] ~20-~20: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:重"地"增加
Context: ...动画关键帧的差异,将这些差异应用到较低层动画上,从而实现动画的叠加效果(随着权重的增加,不会减少下层对动画的影响), 它常用于在基础动作上添加细节或调整。例如,角...

(wb4)


40-49: Enhance image accessibility with descriptive alt text

The images effectively demonstrate the concepts, but their alt text could be more descriptive for better accessibility. Consider updating the alt text to describe what each image shows:

-![alt text](https://mdn.alipayobjects.com/huamei_3zduhr/afts/img/A*JyqiQ6kvqBcAAAAAAAAAAAAADsJ_AQ/original)
+![Animation layer settings showing Additive blending mode selection in the editor](https://mdn.alipayobjects.com/huamei_3zduhr/afts/img/A*JyqiQ6kvqBcAAAAAAAAAAAAADsJ_AQ/original)

Apply similar descriptive alt text to all images in the document.

Also applies to: 54-55

docs/zh/animation/animatorController.mdx (3)

7-18: LGTM! Consider adding version information.

The introduction and main components sections are well-structured with clear explanations and proper technical term highlighting. The content flows logically from basic concepts to more detailed components.

Consider adding version information at the top of the document to indicate when these features were introduced or last updated. This helps users understand the compatibility of these features with their engine version.


22-41: Enhance code example formatting and add prerequisites.

While the step-by-step instructions are clear and well-illustrated, there are two areas for improvement:

  1. Format the code example in step 6 as a proper code block:
-6. 至此你在导出的项目中就可以通过 `animator.play("New State")` 播放 `Idle` 动画了
+6. 至此你在导出的项目中就可以通过以下代码播放 `Idle` 动画:
+```typescript
+animator.play("New State");
+```
  1. Consider adding a prerequisites section before the steps to list required setup (e.g., engine version, required components).

Line range hint 58-71: Enhance code examples and clarify data reuse section.

The script usage section could benefit from the following improvements:

  1. Add more detailed comments to the data reuse example:
 const animator = model1.getComponent(Animator);
-// 获取动画模型的动画控制器
+// 确保 model1 的骨骼结构与 animationGLTF 相匹配
+// 从动画模型获取动画控制器
 animator.animatorController = animationGLTF.getComponent(Animator).animatorController;
-// 播放 animationGLTF 的动画
+// 使用复用的动画控制器播放动画
 animator.play("anim from animationGLTF");
  1. Consider restructuring the glTF auto-binding information into a separate "Automatic Configuration" section, as it's an important feature that users should be aware of upfront.
docs/zh/animation/examples/blending.mdx (1)

20-20: Consider making the model URL configurable.

The hardcoded URL for the model download (https://mdn.alipayobjects.com/...) could be problematic for maintenance. Consider:

  1. Moving it to a central configuration file
  2. Adding a version number or hash to the URL
  3. Including the file size and format information
docs/zh/animation/examples/crossFade.mdx (5)

1-7: Consider enhancing frontmatter metadata for better documentation organization.

Consider adding these metadata fields to improve SEO and documentation organization:

  • description: A brief summary of the content
  • keywords: Related search terms
  • sidebar_position: For documentation navigation

12-14: Enhance link text for better accessibility and user experience.

Consider making the link text more descriptive instead of using numbers:

-[1.播放模型中的动画](/docs/animation/examples/playAnimation/)
-[2.动画复用](/docs/animation/examples/reuseAnimation/)
+[入门:播放模型中的动画](/docs/animation/examples/playAnimation/)
+[进阶:动画复用](/docs/animation/examples/reuseAnimation/)

18-18: Consider using relative or configurable URLs for assets.

The sample model URL is hardcoded to mdn.alipayobjects.com. Consider:

  1. Using a relative path if the model can be included in the repository
  2. Using a configurable CDN URL from environment variables or configuration files

30-30: Add descriptive alt text to images for accessibility.

Images should include descriptive alt text to improve accessibility. For example:

-![image](https://mdn.alipayobjects.com/...)
+![Expanding the model asset to show animation clips](https://mdn.alipayobjects.com/...)

Also applies to: 34-34, 45-45, 51-51, 55-55, 60-60


32-32: Consider linking technical terms to their documentation.

Technical terms like "动画片段" and "动画控制器" should be consistently linked to their documentation pages when they first appear in the content.

Also applies to: 37-39

docs/zh/animation/examples/reuseAnimation.mdx (3)

34-36: Consider adding technical specifications for model compatibility.

While the Callout effectively warns about FBX to GLB/GLTF conversion, consider adding:

  • Supported GLB/GLTF versions
  • Maximum recommended file sizes
  • Required bone/skeleton structure for animation compatibility

45-47: Add note about animation compatibility considerations.

Consider adding a note about:

  • Which types of animations can be reused
  • Potential issues with bone hierarchy mismatches
  • Performance implications of animation reuse

68-89: Consider adding a troubleshooting section.

The usage instructions are clear, but consider adding a troubleshooting section covering:

  • Common issues when animations don't play
  • Solutions for mismatched bone hierarchies
  • Performance optimization tips
docs/zh/animation/animator.mdx (5)

19-19: Consider adding a note about read-only limitations.

The documentation clearly explains the component location and automatic binding. However, it would be helpful to explain what "read-only" means in practice and how users can work with or override it if needed.

Also applies to: 22-22, 26-26, 28-28


52-52: Consider adding error handling guidance.

While the explanation of automatic component addition is clear, it would be beneficial to document:

  1. What happens if the GLTF model doesn't contain animations
  2. How to handle cases where the animator component isn't found
  3. Error handling for invalid animation names in play()

77-77: Consider adding performance best practices.

The control methods are well documented. Consider adding:

  1. Performance implications of different control methods
  2. Best practices for managing multiple animations
  3. Memory considerations when dealing with many animation states

Also applies to: 87-87, 97-97


124-124: Consider documenting common pitfalls.

The state management documentation is clear. Consider adding:

  1. Common issues when using crossfade
  2. Timing considerations for state transitions
  3. Tips for debugging animation state issues

Also applies to: 134-134


157-157: Consider adding performance impact details.

While the culling behavior is well explained, it would be helpful to document:

  1. Performance benefits of using culling
  2. Memory implications
  3. Recommended culling strategies for different scenarios
docs/zh/animation/examples/playAnimation.mdx (3)

29-31: Consider enhancing the technical guidance.

The callout provides good guidance about FBX to GLB/GLTF conversion, but could be more helpful with additional technical details:

  • Recommended Blender export settings
  • Typical file size benchmarks
  • Common conversion issues to watch for

89-89: Clarify the purpose of setting Duration to 0.

Consider explaining why setting Duration to 0 is recommended and what impact it has on animation playback. This would help users make informed decisions about transition timing.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~89-~89: 您的意思是""过度"的"?
Context: ...连接到此动画状态并点击连线,并将Duration` 改为0(动画过渡的详细介绍请参考 [动画状态机](/docs/animation/state-m...

(DU3_DU4)


100-101: Improve the component location instructions.

The explanation about finding the Animation Controller Component in the entity hierarchy could be clearer. Consider restructuring it as:

  1. Open the model entity in the hierarchy
  2. Look for the first child entity
  3. Check the components panel for "动画控制组件"

This step-by-step approach would make it easier for users to follow.

docs/zh/animation/examples/controlAnimationByInput.mdx (3)

73-100: Consider enhancing the code example with better practices.

The code example could be improved in several ways:

  1. Add type safety for the animator property initialization
  2. Use constants for magic numbers
  3. Add error handling for animator initialization

Consider this improved version:

 import { Script, Animator, Keys } from '@galacean/engine';
+
+const SPEED = {
+  IDLE: 0,
+  WALK: 1,
+  RUN: 6
+} as const;
 
 export default class extends Script {
-  animator: Animator;
+  private animator: Animator | null = null;
 
   onStart() {
     this.animator = this.entity.getComponent(Animator);
+    if (!this.animator) {
+      console.error('Animator component not found');
+      return;
+    }
   }
 
   onUpdate(deltaTime: number) {
+    if (!this.animator) return;
+    
     const inputManager = this.engine.inputManager;
     if (inputManager.isKeyHeldDown(Keys.KeyW)) {
       if (inputManager.isKeyHeldDown(Keys.ShiftLeft)) {
-        this.animator.setParameterValue('speed', 6);
+        this.animator.setParameterValue('speed', SPEED.RUN);
       } else {
-        this.animator.setParameterValue('speed', 1);
+        this.animator.setParameterValue('speed', SPEED.WALK);
       }
     }
 
     if (inputManager.isKeyUp(Keys.KeyW)) {
-      this.animator.setParameterValue('speed', 0);
+      this.animator.setParameterValue('speed', SPEED.IDLE);
     }
   }
 }

110-113: Consider emphasizing the preview requirement more prominently.

This is a crucial difference from previous tutorials that could cause user confusion. Consider:

  1. Adding a warning or note callout
  2. Making this section visually distinct

Example improvement:

-### 5. 预览动画
-与之前的教程不同,因为本次我们为实体添加了脚本,仅点击预览动画按钮,脚本代码是不会生效的,我们需要点击项目预览(项目预览才会编译脚本文件)按钮来预览动画。
+### 5. 预览动画
+
+> ⚠️ **重要提示**
+> 与之前的教程不同,本次教程需要特别注意:
+> - 仅点击预览动画按钮,脚本代码**不会**生效
+> - 必须点击**项目预览**按钮(这样才会编译脚本文件)

136-136: Consider adding a summary section.

The tutorial would benefit from a concluding section that:

  1. Summarizes the key concepts learned
  2. Suggests next steps or related tutorials
  3. Provides troubleshooting tips for common issues

Example addition:

+## 总结
+
+在本教程中,我们学习了:
+- 如何使用参数控制动画状态切换
+- 如何通过脚本响应用户输入
+- 如何优化动画过渡效果
+
+### 常见问题
+
+1. 如果动画没有正确切换,请检查:
+   - 过渡条件是否正确设置
+   - 脚本是否正确绑定
+   - 是否使用了项目预览而不是动画预览
+
+### 下一步
+
+- 尝试添加更多的动画状态
+- 实现更复杂的输入控制逻辑
+- 探索动画混合的高级用法
docs/zh/animation/clip-for-artist.md (2)

103-103: Remove trailing empty line.

The added empty line at the end of the file is unnecessary.

-

Unity plugin needs to be hosted in a publicly accessible location

The Unity plugin is currently hosted on Yuque which requires authentication to access, making it inaccessible to public users. Since the repository already has an assets structure (docs/zh/assets/ for Chinese documentation), I recommend:

  • Move the Unity plugin to docs/zh/assets/unity-plugin.zip
  • Update the documentation link to point to this new location
  • Consider also adding it to docs/en/assets/ if there's an English version of the documentation
🔗 Analysis chain

Line range hint 49-49: Consider hosting the Unity plugin in the repository.

The Unity plugin link points to a Yuque attachment which might not be publicly accessible to all users. Consider:

  1. Hosting the plugin in the repository or
  2. Moving it to a more permanent, publicly accessible location

The curl request confirms that the Yuque link redirects to a login page (HTTP 302 Found with Location header pointing to /login), indicating that the Unity plugin is not publicly accessible without authentication. Let me check if there are any existing Unity-related files in the repository to suggest a suitable location.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the accessibility of the Unity plugin link

# Test if the link is publicly accessible
curl -I "https://www.yuque.com/attachments/yuque/0/2021/zip/381718/1622541632701-4f33e890-5295-4430-8798-d979b8df504f.zip"

Length of output: 2305


Script:

#!/bin/bash
# Check for Unity-related files and directories
fd -t f unity
fd -t d unity

# Check if there's a dedicated plugins or assets directory
fd -t d "plugin|asset"

Length of output: 113

docs/zh/animation/examples/sprite-sheet.mdx (2)

12-14: Ensure consistent link formatting

The documentation links have inconsistent trailing slashes:

  • Line 12: /docs/animation/examples/playAnimation/ (with trailing slash)
  • Line 14: /docs/animation/examples/reuseAnimation/ (with trailing slash)

For consistency with other links in the document (e.g., line 108: /docs/animation/animator/), ensure all documentation links follow the same pattern.


158-160: Remove unnecessary empty lines at the end of the file

Multiple empty lines at the end of the file should be removed to maintain clean formatting.

docs/zh/animation/clip.mdx (3)

82-82: Consider enhancing the frame animation reference

While the link to the frame animation documentation is helpful, consider adding a brief description of what users can expect to learn from the linked document.

-除了数值类型,Galacean 还支持引用类型的 `动画曲线` ,可以阅读[帧动画](/docs/animation/examples/sprite-sheet)文档来了解,如何制作帧动画。
+除了数值类型,Galacean 还支持引用类型的 `动画曲线` ,可以阅读[帧动画](/docs/animation/examples/sprite-sheet)文档来了解如何使用精灵表(sprite sheet)制作帧动画效果。

127-137: Consider adding best practices for child entity animations

While the documentation clearly explains how to animate child entities, it would be helpful to include:

  1. Best practices for organizing hierarchical animations
  2. Common use cases for child entity animations
  3. Performance considerations when animating multiple child entities

Line range hint 178-216: Consider enhancing code examples with comments

The code examples would be more educational with inline comments explaining:

  1. The purpose of each animation curve configuration
  2. The significance of time values
  3. The relationship between states and clips
 //custom rotate clip
 const rotateClip = new AnimationClip("rotate");
+// Create a new state in the first layer's state machine
 const rotateState =
   animator.animatorController.layers[0].stateMachine.addState("rotate");
 rotateState.clip = rotateClip;

+// Create a Vector3 curve for rotation animation (0° to 360° over 10 time units)
 const rotateCurve = new AnimationVector3Curve();
 const key1 = new Keyframe<Vector3>();
 key1.time = 0;
 key1.value = new Vector3(0, 0, 0);
docs/zh/animation/state-machine.mdx (6)

Line range hint 17-25: Consider enhancing the AnimatorState attributes table

The table would be more helpful with additional context and examples. For instance:

  • Add typical use cases for each WrapMode option
  • Include example values for Speed (e.g., 0.5 for slow motion, 2.0 for double speed)
  • Provide concrete examples for StartTime and EndTime usage scenarios

Line range hint 42-48: Consider adding visual examples for transition properties

The transition properties (Duration, Offset, ExitTime) would be clearer with visual timeline diagrams showing how these values affect the animation transition.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~45-~45: 您的意思是""过度"开始"?
Context: ...相对目标状态的归一化时间,默认值为 0 | | ExitTime | 起始状态过渡开始时间,时间为相对起始状态的归一化时间,默认值为 0.75 | | Solo...

(DU3_DU4)


[uncategorized] ~46-~46: 您的意思是""过度"成为"?
Context: ...态的归一化时间,默认值为 0.75 | | Solo | 使选定的动画过渡成为唯一活动的状态。其它动画过渡将被忽略。 | | Mute | 禁用选...

(DU3_DU4)


[uncategorized] ~48-~48: 您的意思是"开始"过度""?
Context: ...itions | 过渡通过的条件,如果有多个条件,只有所有条件都满足时,才会开始过渡。 | Solo 和 Mute 通常用于调试,用于帮助开发者更高效地测试和调试...

(DU3_DU4)


Line range hint 38-48: Maintain consistency in Chinese terminology for "transition"

The word "过渡" (transition) is used throughout the document. Consider using consistent terminology and adding English terms in parentheses for technical clarity, e.g., "过渡(Transition)".


Line range hint 134-154: Enhance the input handling example

The code example could be improved by:

  1. Adding error handling for undefined parameters
  2. Including comments about potential race conditions during initialization

Consider updating the example:

 onUpdate(deltaTime: number) {
   const inputManager = this.engine.inputManager;
+  // Ensure animator and parameters are properly initialized
+  if (!this.animator?.getParameter('speed')) {
+    console.warn('Animator or speed parameter not initialized');
+    return;
+  }

   if (inputManager.isKeyHeldDown(Keys.KeyW)) {
     this.animator.setParameterValue('speed', 1);
   }

119-122: Add cross-references to related animation concepts

The animation parameters section would benefit from links to:

  • Animation blending documentation
  • Performance considerations
  • Best practices for parameter management

Line range hint 209-276: Consider adding troubleshooting section for state machine scripts

The state machine scripts section would be more complete with:

  • Common pitfalls and solutions
  • Performance implications of script callbacks
  • Best practices for managing script lifecycle
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 2b89197 and ac5c679.

📒 Files selected for processing (15)
  • docs/zh/animation/_meta.json (1 hunks)
  • docs/zh/animation/animator.mdx (11 hunks)
  • docs/zh/animation/animatorController.mdx (3 hunks)
  • docs/zh/animation/clip-for-artist.md (1 hunks)
  • docs/zh/animation/clip.mdx (7 hunks)
  • docs/zh/animation/examples/blending.mdx (1 hunks)
  • docs/zh/animation/examples/controlAnimationByInput.mdx (1 hunks)
  • docs/zh/animation/examples/crossFade.mdx (1 hunks)
  • docs/zh/animation/examples/playAnimation.mdx (1 hunks)
  • docs/zh/animation/examples/reuseAnimation.mdx (1 hunks)
  • docs/zh/animation/examples/sprite-sheet.mdx (1 hunks)
  • docs/zh/animation/layer.mdx (2 hunks)
  • docs/zh/animation/sprite-sheet.md (0 hunks)
  • docs/zh/animation/state-machine.mdx (12 hunks)
  • docs/zh/animation/system.md (2 hunks)
💤 Files with no reviewable changes (1)
  • docs/zh/animation/sprite-sheet.md
✅ Files skipped from review due to trivial changes (1)
  • docs/zh/animation/_meta.json
🧰 Additional context used
🪛 LanguageTool
docs/zh/animation/examples/controlAnimationByInput.mdx

[uncategorized] ~22-~22: 您的意思是""过度"的"?
Context: ...AAAADkp5AQ/player.glb)。 2. 我们要有一个已编辑好动画过渡的 动画控制器 。请参考:[编辑动画控制器](/docs/animation...

(DU3_DU4)


[uncategorized] ~42-~42: 您的意思是"触发"过度""?
Context: ...ossFade/)),在之前的示例中,时间超过了 ExitTime 就会触发过渡。这里我们需要根据用户输入来触发过渡,所以我们需要添加一个 过渡条件 。 ...

(DU3_DU4)


[uncategorized] ~42-~42: 您的意思是"触发"过度""?
Context: ...,时间超过了 ExitTime 就会触发过渡。这里我们需要根据用户输入来触发过渡,所以我们需要添加一个 过渡条件 。 1. 在 动画状态机 中,选中从...

(DU3_DU4)


[uncategorized] ~121-~121: 您的意思是""过度"的"?
Context: ...entry切换到idle的,而entryidle的过渡的Duration是 0。想要从run过渡到idle` ,我...

(DU3_DU4)


[uncategorized] ~122-~122: 您的意思是"添加"过度""?
Context: ...连接到 idle。 同理想要从 run 过渡到 walk 也需要添加过渡。 ![2024-11-08 14.26.00.gif](https://md...

(DU3_DU4)

docs/zh/animation/examples/crossFade.mdx

[uncategorized] ~49-~49: 您的意思是""过度"的"?
Context: ...Animation/#3-编辑动画控制器) 2. 创建 动画过渡(关于动画过渡的详细介绍请参考 [动画状态机](/docs/animation/state-m...

(DU3_DU4)


[uncategorized] ~67-~67: 您的意思是"修改"过度""?
Context: ...t> ## 用户输入控制动画 上述方式主要是为了调试动画的过渡效果,你可以修改过渡的 Duration , ExitTime , Offset 等参数...

(DU3_DU4)


[uncategorized] ~67-~67: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:合适"地"过渡
Context: ...ocs/animation/state-machine/) 文档),来调整到合适的过渡效果。 实际项目中,动画一般不会像本示例一样自动切换,大多数情况需要结合用...

(wb4)

docs/zh/animation/examples/playAnimation.mdx

[uncategorized] ~89-~89: 您的意思是""过度"的"?
Context: ...连接到此动画状态并点击连线,并将Duration` 改为0(动画过渡的详细介绍请参考 [动画状态机](/docs/animation/state-m...

(DU3_DU4)

docs/zh/animation/examples/reuseAnimation.mdx

[uncategorized] ~63-~63: 您的意思是""过度"的"?
Context: ...到此 动画状态 并点击连线将 Duration 改为 0(动画状态及动画过渡的详细介绍请参考 [动画状态机](/docs/animation/state-m...

(DU3_DU4)

docs/zh/animation/layer.mdx

[uncategorized] ~20-~20: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:重"地"增加
Context: ...动画关键帧的差异,将这些差异应用到较低层动画上,从而实现动画的叠加效果(随着权重的增加,不会减少下层对动画的影响), 它常用于在基础动作上添加细节或调整。例如,角...

(wb4)


[uncategorized] ~23-~23: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:重"地"增加
Context: ...意味着在最终的动画输出中,较高层的动画会优先显示并替代较低层的动画效果(随着权重的增加,减少下层对动画的影响)。它常用于动画的分层控制。例如,你可能需要对不同身体...

(wb4)

docs/zh/animation/state-machine.mdx

[uncategorized] ~48-~48: 您的意思是"开始"过度""?
Context: ...itions | 过渡通过的条件,如果有多个条件,只有所有条件都满足时,才会开始过渡。 | Solo 和 Mute 通常用于调试,用于帮助开发者更高效地测试和调试...

(DU3_DU4)


[uncategorized] ~72-~72: 您的意思是"要"过度""?
Context: ...'Idle'); ``` ### 动画过渡 #### 编辑器使用 将两个想要过渡的 动画状态 连接即可实现动画过渡的效果, 点击两个 `动画状态` 间的连线...

(DU3_DU4)


[uncategorized] ~72-~72: 您的意思是""过度"的"?
Context: ...画过渡 #### 编辑器使用 将两个想要过渡的 动画状态 连接即可实现动画过渡的效果, 点击两个 动画状态 间的连线,可以修改动画过渡的参数调整效果。 ...

(DU3_DU4)


[uncategorized] ~72-~72: 您的意思是""过度"的"?
Context: ...连接即可实现动画过渡的效果, 点击两个动画状态` 间的连线,可以修改动画过渡的参数调整效果。 ![alt text](https://mdn.alipay...

(DU3_DU4)


[uncategorized] ~103-~103: 您的意思是""过度"添加"?
Context: ...k动画时都会在播放一半时开始过渡到run` 动画。 ##### 为动画过渡添加条件 你可以通过 [animatorStateTransition.addC...

(DU3_DU4)


[uncategorized] ~276-~276: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:最终"地"表现
Context: ...## 多层动画状态机混合 每个 动画层 都有一个 动画状态机 ,动画最终的表现由多个 动画层 进行混合而成,如何使用 动画层 可以参考[动画层](...

(wb4)

🔇 Additional comments (22)
docs/zh/animation/layer.mdx (3)

9-17: Documentation structure and cross-references look good!

The introduction section effectively explains animation layers with proper API references and cross-links. The properties table is well-organized and the new StateMachine entry enhances the documentation completeness.


29-29: Clear explanation with practical example!

The mixing weight explanation effectively combines theoretical knowledge with a practical example, making it easy to understand.


Line range hint 1-55: Verify terminology consistency across animation documentation

While the terminology in this document is consistent internally, let's verify it matches other animation-related documentation.

✅ Verification successful

Terminology is consistent across animation documentation

The search results confirm consistent usage of key animation terminology (动画层/动画控制器/动画状态机) across all Chinese animation documentation. The terms are used with the same meaning and context throughout, with proper cross-referencing between related concepts.

Key observations:

  • 动画层 (Animation Layer) consistently refers to the organization unit within animation controllers
  • 动画控制器 (Animation Controller) is consistently used for the main animation management component
  • 动画状态机 (Animation State Machine) maintains consistent meaning for state-based animation control
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for consistent terminology usage across animation docs
echo "Checking terminology consistency..."
rg -i "动画层|动画控制器|动画状态机" docs/zh/animation/

Length of output: 12400

🧰 Tools
🪛 LanguageTool

[uncategorized] ~20-~20: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:重"地"增加
Context: ...动画关键帧的差异,将这些差异应用到较低层动画上,从而实现动画的叠加效果(随着权重的增加,不会减少下层对动画的影响), 它常用于在基础动作上添加细节或调整。例如,角...

(wb4)


[uncategorized] ~23-~23: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:重"地"增加
Context: ...意味着在最终的动画输出中,较高层的动画会优先显示并替代较低层的动画效果(随着权重的增加,减少下层对动画的影响)。它常用于动画的分层控制。例如,你可能需要对不同身体...

(wb4)

docs/zh/animation/examples/blending.mdx (3)

1-7: LGTM! Well-structured frontmatter.

The metadata is properly formatted and provides clear categorization for the documentation.


29-71: LGTM! Well-structured and clear documentation.

The content is:

  • Well-organized with clear sections
  • Uses consistent formatting for technical terms
  • Provides clear step-by-step instructions
  • Includes visual aids for better understanding

1-71: Verify terminology consistency across documentation.

Let's ensure the technical terms used in this document are consistent with other animation documentation files.

✅ Verification successful

Based on the search results, I can see comprehensive usage of animation-related terminology across the Chinese documentation. The key terms used in the review file (blending.mdx) are consistently used across other documentation files:

  • "动画层" (Animation Layer)
  • "动画状态" (Animation State)
  • "动画控制器" (Animation Controller)
  • "动画片段" (Animation Clip)

These terms appear consistently in multiple documentation files including system.md, state-machine.mdx, layer.mdx, clip.mdx, and others. The terminology is used in the same context and with the same meaning across all files.

Terminology is consistent across animation documentation.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for consistency in animation-related terms across documentation

# Search for animation-related terms to verify consistency
echo "Checking terminology consistency..."
rg -i "动画层|动画状态|动画控制器|动画片段" docs/zh/animation/

Length of output: 17806

docs/zh/animation/system.md (3)

Line range hint 1-67: Documentation changes look good!

The changes improve documentation clarity through:

  1. Reorganized structure with updated ordering
  2. Simplified and standardized terminology

36-36: Verify terminology consistency

The term for Animator has been simplified from "动画控制器组件" to "动画控制组件". This aligns with the documentation standardization effort, but we should verify consistency across all related documentation.


2-2: Verify documentation ordering

The order has been changed from 6 to 7. Please ensure this reordering aligns with the overall documentation structure and navigation flow.

✅ Verification successful

Documentation order change is appropriate

Based on the verification results, the order change from 6 to 7 for system.md aligns well with the existing documentation structure:

  • Overview (order: 0)
  • Clip (order: 1)
  • AnimatorController (order: 2)
  • Animator (order: 3)
  • State Machine (order: 4)
  • Layer (order: 5)
  • System (order: 7)
  • Clip for Artist (order: 8)

The order sequence is logical, progressing from basic concepts to more advanced topics, with system documentation appropriately placed near the end before the artist-specific content.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check the ordering of other animation documentation files
# to ensure consistent navigation flow

# Look for other _meta.json files in the animation docs directory
find docs/zh/animation -name "_meta.json" -type f -exec cat {} \;

# Look for other markdown files with 'order' in frontmatter
find docs/zh/animation -name "*.md" -type f -exec awk '/^---/{p=1;next}/^---/{p=0}p' {} \;

Length of output: 3474


Script:

#!/bin/bash
# Let's try a different approach to check the documentation ordering

# First, let's check if there's a _meta.json in the docs/zh/animation directory
find docs/zh/animation -name "_meta.json" -type f

# Then, let's look for all markdown files in the animation directory and extract their order frontmatter
for file in $(find docs/zh/animation -name "*.md" -o -name "*.mdx"); do
  echo "=== $file ==="
  head -n 5 "$file" | grep "order:"
done

Length of output: 3541


Script:

#!/bin/bash
# Let's check the _meta.json content to understand the documentation structure
cat docs/zh/animation/_meta.json

Length of output: 79

docs/zh/animation/examples/reuseAnimation.mdx (3)

1-7: LGTM! Frontmatter is well-structured.

The metadata is properly formatted and includes all necessary fields.


9-12: LGTM! Clear introduction with proper prerequisites.

The introduction effectively explains the purpose and provides a link to prerequisite documentation.


49-66: LGTM! Clear instructions with helpful visuals.

The step-by-step guide is well-documented with appropriate screenshots and GIFs.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~63-~63: 您的意思是""过度"的"?
Context: ...到此 动画状态 并点击连线将 Duration 改为 0(动画状态及动画过渡的详细介绍请参考 [动画状态机](/docs/animation/state-m...

(DU3_DU4)

docs/zh/animation/animator.mdx (2)

9-9: LGTM! Clear and consistent terminology.

The introduction effectively explains the Animator component's purpose while maintaining proper cross-references to API documentation.


33-33: LGTM! Clear instructions with visual aids.

The documentation effectively guides users through the component creation process with clear instructions and supporting screenshots.

Also applies to: 37-37

docs/zh/animation/examples/playAnimation.mdx (2)

1-7: LGTM! Well-structured frontmatter.

The metadata is complete and follows documentation standards.


1-112: LGTM! Well-structured and comprehensive documentation.

The documentation effectively guides users through the animation playback process with:

  • Clear step-by-step instructions
  • Helpful visual aids
  • Appropriate cross-references to detailed documentation
🧰 Tools
🪛 LanguageTool

[uncategorized] ~89-~89: 您的意思是""过度"的"?
Context: ...连接到此动画状态并点击连线,并将Duration` 改为0(动画过渡的详细介绍请参考 [动画状态机](/docs/animation/state-m...

(DU3_DU4)

docs/zh/animation/examples/controlAnimationByInput.mdx (1)

1-7: LGTM! Well-structured metadata section.

The metadata provides clear categorization and follows MDX documentation standards.

docs/zh/animation/clip-for-artist.md (1)

Line range hint 1-102: LGTM! Documentation is comprehensive and well-structured.

The documentation provides clear, detailed instructions for creating animation clips in both Blender and Unity. The step-by-step guide is technically accurate and includes helpful screenshots.

docs/zh/animation/examples/sprite-sheet.mdx (2)

1-7: LGTM! Frontmatter is well-structured.

The metadata fields are properly formatted and provide clear categorization for the documentation.


1-160: Overall documentation is well-structured and comprehensive

The documentation effectively guides users through the sprite sheet animation process with:

  • Clear step-by-step instructions
  • Helpful visual aids
  • Well-organized sections
  • Proper explanations of concepts

The minor formatting issues noted above don't impact the overall quality and usefulness of the guide.

docs/zh/animation/clip.mdx (2)

8-8: LGTM: Improved technical term formatting

The addition of backticks around technical terms like 动画片段 enhances readability and maintains consistency with technical documentation standards.

Also applies to: 10-10


51-53: LGTM: Enhanced keyframe explanation

The added explanation clearly describes how keyframe values are captured and stored, which helps users better understand the animation workflow.

Comment on lines +25 to +27
![image-1](https://mdn.alipayobjects.com/huamei_3zduhr/afts/img/A*dsGnQ4JIC7MAAAAAAAAAAAAADsJ_AQ/original)

![image](https://mdn.alipayobjects.com/huamei_3zduhr/afts/img/A*1x7zS7WqTasAAAAAAAAAAAAADsJ_AQ/original)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance image accessibility and maintainability.

The image references could be improved in several ways:

  1. Add meaningful alt text for accessibility
  2. Use consistent naming patterns for images
  3. Consider using relative paths or asset references instead of absolute URLs

Example improvement:

-![image-1](https://mdn.alipayobjects.com/huamei_3zduhr/afts/img/A*dsGnQ4JIC7MAAAAAAAAAAAAADsJ_AQ/original)
+![Animation controller interface showing the layers panel](../assets/animation-blending/controller-interface.png)

Also applies to: 36-36, 42-42, 46-46, 53-53, 57-57, 65-65, 70-70

Comment on lines +66 to +69
## 用户输入控制动画
上述方式主要是为了调试动画的过渡效果,你可以修改过渡的 `Duration` , `ExitTime` , `Offset` 等参数(详细介绍请参考 [动画状态机](/docs/animation/state-machine/) 文档),来调整到合适的过渡效果。

实际项目中,动画一般不会像本示例一样自动切换,大多数情况需要结合用户输入来控制动画的切换,具体可以参考:[用户输入控制动画](/docs/animation/examples/controlAnimationByInput) 文档
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance the user input control section.

The final section about user input control ends abruptly with just a link. Consider:

  1. Adding a brief example or code snippet
  2. Explaining the key differences between automatic transitions and user-controlled transitions
  3. Providing a summary of what users will learn in the linked document
🧰 Tools
🪛 LanguageTool

[uncategorized] ~67-~67: 您的意思是"修改"过度""?
Context: ...t> ## 用户输入控制动画 上述方式主要是为了调试动画的过渡效果,你可以修改过渡的 Duration , ExitTime , Offset 等参数...

(DU3_DU4)


[uncategorized] ~67-~67: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:合适"地"过渡
Context: ...ocs/animation/state-machine/) 文档),来调整到合适的过渡效果。 实际项目中,动画一般不会像本示例一样自动切换,大多数情况需要结合用...

(wb4)


<Callout type="info">
上述的准备工作包含:
1. 为你选择的 `实体` 创建一个 `动画控制组件` ([详细介绍](/docs/animation/animator/)),以及创建一个 `动画控制器` ([详细介绍]((/docs/animation/animatorController/))) 资产。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix broken link formatting

The link to the animator controller documentation has incorrect formatting with double parentheses:

-2. `动画控制器` ([详细介绍]((/docs/animation/animatorController/))) 资产。
+2. `动画控制器` ([详细介绍](/docs/animation/animatorController/)) 资产。

Committable suggestion skipped: line range outside the PR's diff.

docs/zh/animation/animator.mdx Show resolved Hide resolved
docs/zh/animation/animator.mdx Outdated Show resolved Hide resolved
docs/zh/animation/animatorController.mdx Show resolved Hide resolved
docs/zh/animation/clip.mdx Show resolved Hide resolved
docs/zh/animation/clip.mdx Outdated Show resolved Hide resolved
docs/zh/animation/layer.mdx Outdated Show resolved Hide resolved
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (17)
docs/zh/animation/layer.mdx (2)

19-24: Minor grammatical refinement needed

The explanation is technically accurate and the screenshot is helpful. Consider revising the parenthetical phrase for better grammar:

-随着权重的增加,不会减少下层对动画的影响
+随着权重的增加,也不会减少下层对动画的影响
🧰 Tools
🪛 LanguageTool

[uncategorized] ~19-~19: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:重"地"增加
Context: ...动画关键帧的差异,将这些差异应用到较低层动画上,从而实现动画的叠加效果(随着权重的增加,不会减少下层对动画的影响), 它常用于在基础动作上添加细节或调整。例如,角...

(wb4)


27-36: Minor grammatical refinement needed

The explanation and screenshot effectively demonstrate the override mode. Consider revising the parenthetical phrase for better grammar:

-随着权重的增加,减少下层对动画的影响
+随着权重的增加,会减少下层对动画的影响
🧰 Tools
🪛 LanguageTool

[uncategorized] ~27-~27: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:重"地"增加
Context: ...意味着在最终的动画输出中,较高层的动画会优先显示并替代较低层的动画效果(随着权重的增加,减少下层对动画的影响)。它常用于动画的分层控制。例如,你可能需要对不同身体...

(wb4)

docs/zh/animation/animatorController.mdx (2)

26-26: Standardize image references for consistency

The image references use inconsistent formats:

  • Some use relative paths (e.g., 1.jpg)
  • Others use full URLs
  • Some use descriptive names (e.g., image9)

Consider standardizing all image references to use consistent naming and paths.

Also applies to: 31-31, 35-35, 39-39, 47-47


Line range hint 71-83: Enhance code examples with detailed comments

Consider adding explanatory comments to the code examples to help users understand each step better. For example:

 // 获取动画模型的动画控制器
 animator.animatorController = animationGLTF.getComponent(Animator).animatorController;
+// 确保模型的骨骼层级结构和命名与原始模型相匹配
+// 使用相同的动画控制器可以节省内存
 // 播放 animationGLTF 的动画
 animator.play("anim from animationGLTF");
docs/zh/animation/examples/text-animation.mdx (3)

9-15: Maintain consistent link formats throughout the document.

The link format /docs/animation/clip differs from the format used in other links like /docs/animation/examples/playAnimation/. Consider standardizing the link format for better maintainability.


47-47: Fix duplicate forward slash in documentation link.

There's a duplicate forward slash in the link to the animator controller documentation:

-2. `动画控制器` 内会包含一个 `动画状态`,并且 `动画状态` 会自动绑定你选择的 `动画片段`,并连接到 `entry` 节点上(关于 `entry` 节点的详细介绍请参考 [动画状态机](/docs/animation/state-machine/) 文档)。
+2. `动画控制器` 内会包含一个 `动画状态`,并且 `动画状态` 会自动绑定你选择的 `动画片段`,并连接到 `entry` 节点上(关于 `entry` 节点的详细介绍请参考 [动画状态机](/docs/animation/state-machine) 文档)。

85-90: Remove extra empty lines at the end of the file.

Keep only one empty line at the end of the file, following common documentation conventions.

docs/zh/animation/examples/material-animation.mdx (4)

9-15: Consider enhancing the introduction with more context.

Consider adding:

  • A brief description of what material animation is
  • Expected outcome or final result
  • Time estimation for completing the tutorial

21-21: Fix grammatical error in the sentence.

The sentence contains a redundant "需要":

-除此以外,因为默认的 `材质` 是只读的,所以需要我们还需要创建一个 `材质`。
+除此以外,因为默认的 `材质` 是只读的,所以我们需要创建一个 `材质`。

91-96: Remove unnecessary empty lines at the end of the file.

Multiple empty lines at the end of the file should be removed to maintain cleaner documentation.


62-62: Fix broken link in the Callout component.

The link to the animator controller documentation contains a double parenthesis:

-2. `动画控制器` 内会包含一个 `动画状态`,并且 `动画状态` 会自动绑定你选择的 `动画片段`,并连接到 `entry` 节点上(关于 `entry` 节点的详细介绍请参考 [动画状态机](/docs/animation/state-machine/) 文档)。
+2. `动画控制器` 内会包含一个 `动画状态`,并且 `动画状态` 会自动绑定你选择的 `动画片段`,并连接到 `entry` 节点上(关于 `entry` 节点的详细介绍请参考 [动画状态机](/docs/animation/state-machine) 文档)。
docs/zh/animation/animator.mdx (3)

Line range hint 14-16: Maintain consistent terminology in the parameter table

For consistency with the rest of the documentation, consider updating "AnimatorController" to "动画控制器" in the parameter table.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~92-~92: 1.动词被副词修饰时,助词应该用‘得’;2.省略宾语时,助词应该用‘的’;可能造成歧义。您的意思是不是:播放"得"越快
Context: ...属性来控制动画的播放速度。 speed  默认值为 1.0 ,值越大播放的越快,越小播放的越慢。当值为负数时,进行倒播。 ```typescript a...

(wb4)


[uncategorized] ~92-~92: 1.动词被副词修饰时,助词应该用‘得’;2.省略宾语时,助词应该用‘的’;可能造成歧义。您的意思是不是:播放"得"越慢
Context: ...播放速度。 speed  默认值为 1.0 ,值越大播放的越快,越小播放的越慢。当值为负数时,进行倒播。 ```typescript animator....

(wb4)


90-93: Improve grammar in the speed control description

The sentence structure needs adjustment for better clarity:

  • "值越大播放的越快" should be "值越大播放得越快"
  • "越小播放的越慢" should be "越小播放得越慢"

These changes will make the text more grammatically correct and easier to understand.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~92-~92: 1.动词被副词修饰时,助词应该用‘得’;2.省略宾语时,助词应该用‘的’;可能造成歧义。您的意思是不是:播放"得"越快
Context: ...属性来控制动画的播放速度。 speed  默认值为 1.0 ,值越大播放的越快,越小播放的越慢。当值为负数时,进行倒播。 ```typescript a...

(wb4)


[uncategorized] ~92-~92: 1.动词被副词修饰时,助词应该用‘得’;2.省略宾语时,助词应该用‘的’;可能造成歧义。您的意思是不是:播放"得"越慢
Context: ...播放速度。 speed  默认值为 1.0 ,值越大播放的越快,越小播放的越慢。当值为负数时,进行倒播。 ```typescript animator....

(wb4)


67-72: Consider adding error handling to the code examples

The current example assumes the Animator component exists. Consider adding null checks and error handling:

 export default class extends Script {
   onStart() {
     const animator = this.entity.getComponent(Animator);
+    if (!animator) {
+      console.warn("Animator component not found");
+      return;
+    }
     animator.play("State Name");
   }
 }
docs/zh/animation/examples/sprite-sheet.mdx (3)

9-15: Consider enhancing the introduction

The introduction could be more comprehensive by:

  1. Briefly explaining what a 2D frame animation is
  2. Mentioning the expected outcome or benefits
  3. Adding an estimated time to complete the tutorial

82-83: Maintain consistency in technical terminology

Consider standardizing the translation of technical terms. For example:

  • "动画片段" (Animation Clip) should be consistently formatted with backticks when used as a technical term
  • "精灵" (Sprite) should follow the same formatting convention throughout the document

154-157: Remove unnecessary empty lines

The file ends with multiple empty lines that can be removed to maintain cleaner documentation.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between ac5c679 and 0d8394a.

📒 Files selected for processing (7)
  • docs/zh/animation/animator.mdx (6 hunks)
  • docs/zh/animation/animatorController.mdx (3 hunks)
  • docs/zh/animation/clip.mdx (5 hunks)
  • docs/zh/animation/examples/material-animation.mdx (1 hunks)
  • docs/zh/animation/examples/sprite-sheet.mdx (1 hunks)
  • docs/zh/animation/examples/text-animation.mdx (1 hunks)
  • docs/zh/animation/layer.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/zh/animation/clip.mdx
🧰 Additional context used
🪛 LanguageTool
docs/zh/animation/animator.mdx

[uncategorized] ~92-~92: 1.动词被副词修饰时,助词应该用‘得’;2.省略宾语时,助词应该用‘的’;可能造成歧义。您的意思是不是:播放"得"越快
Context: ...属性来控制动画的播放速度。 speed  默认值为 1.0 ,值越大播放的越快,越小播放的越慢。当值为负数时,进行倒播。 ```typescript a...

(wb4)


[uncategorized] ~92-~92: 1.动词被副词修饰时,助词应该用‘得’;2.省略宾语时,助词应该用‘的’;可能造成歧义。您的意思是不是:播放"得"越慢
Context: ...播放速度。 speed  默认值为 1.0 ,值越大播放的越快,越小播放的越慢。当值为负数时,进行倒播。 ```typescript animator....

(wb4)


[uncategorized] ~127-~127: 您的意思是""过度"指定"?
Context: ...State("xxx"); state.speed = 0; ``` ### 过渡指定动画状态 你可以使用 [animator.crossfade](/apis...

(DU3_DU4)

docs/zh/animation/layer.mdx

[uncategorized] ~19-~19: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:重"地"增加
Context: ...动画关键帧的差异,将这些差异应用到较低层动画上,从而实现动画的叠加效果(随着权重的增加,不会减少下层对动画的影响), 它常用于在基础动作上添加细节或调整。例如,角...

(wb4)


[uncategorized] ~27-~27: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:重"地"增加
Context: ...意味着在最终的动画输出中,较高层的动画会优先显示并替代较低层的动画效果(随着权重的增加,减少下层对动画的影响)。它常用于动画的分层控制。例如,你可能需要对不同身体...

(wb4)

🔇 Additional comments (7)
docs/zh/animation/layer.mdx (2)

8-16: LGTM! Clear and well-structured introduction

The introduction effectively explains animation layers and their relationship with other components. The properties table is comprehensive and well-organized, with the new StateMachine entry providing valuable cross-referencing.


40-48: LGTM! Clear explanation of blend weights

The blend weight section is well-structured with clear explanations and effective visual demonstration. The callout about the first layer's weight is particularly helpful for users.

docs/zh/animation/animatorController.mdx (2)

7-18: Well-structured introduction and components section!

The introduction and main components sections are clearly organized with:

  • Proper technical term formatting using backticks
  • Clear hierarchical structure
  • Helpful cross-references to detailed documentation

22-47: Consider enhancing with screen recordings

As suggested in the previous review, consider adding screen recordings for the step-by-step process. This would make it easier for users to follow the workflow, especially for complex operations in the editor.

docs/zh/animation/examples/text-animation.mdx (2)

1-7: LGTM! Well-structured frontmatter.

The metadata is properly formatted and contains all necessary fields for documentation organization.


1-84: Well-written and comprehensive documentation!

The documentation successfully achieves its goal of teaching text animation concepts with:

  • Clear step-by-step instructions
  • Helpful visual aids
  • Good use of cross-references to related documentation
  • Proper use of technical terminology
docs/zh/animation/examples/sprite-sheet.mdx (1)

108-108: Fix broken link formatting

The link formatting issue with double parentheses was previously identified and still needs to be addressed.


![2024-11-20 17.43.50.gif](<https://mdn.alipayobjects.com/huamei_3zduhr/afts/img/A*mQOgR6L3NjYAAAAAAAAAAAAADsJ_AQ/original>)

这样我们的文字放大 `动画片段` 就制作完成了,你也可以尝试其他 `文本渲染器` 的属性,比如 `颜色`,`字体` 等。关于动画编辑器的更多操作,请参考 [动画片段](/docs/animation/clip) 文档。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix incorrect reference to text animation.

The line mentions "文字放大" (text enlargement) which is incorrect in the context of material animation. Consider replacing with:

-这样我们的文字放大 `动画片段` 就制作完成了,你也可以尝试其他 `文本渲染器` 的属性,比如 `颜色`,`字体` 等。
+这样我们的材质颜色 `动画片段` 就制作完成了,你也可以尝试其他 `材质` 的属性,比如 `透明度`,`纹理` 等。
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
这样我们的文字放大 `动画片段` 就制作完成了,你也可以尝试其他 `文本渲染器` 的属性,比如 `颜色``字体` 等。关于动画编辑器的更多操作,请参考 [动画片段](/docs/animation/clip) 文档。
这样我们的材质颜色 `动画片段` 就制作完成了,你也可以尝试其他 `材质` 的属性,比如 `透明度``纹理` 等。关于动画编辑器的更多操作,请参考 [动画片段](/docs/animation/clip) 文档。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants