-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
Add prefab doc #2270
Add prefab doc #2270
Conversation
WalkthroughThis update introduces a comprehensive guide on Prefabs in game development, emphasizing their role as reusable templates for entities. It details the processes for creation, updating, disconnection, and deletion of Prefabs, alongside scripting instructions for instantiation. This resource aims to enhance developers' efficiency and management of game assets across various scenes. Changes
Poem
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this 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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- docs/zh/core/prefab.md (1 hunks)
Additional context used
Markdownlint
docs/zh/core/prefab.md
14-14: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time(MD001, heading-increment)
Additional comments not posted (4)
docs/zh/core/prefab.md (4)
8-13
: LGTM!The introduction section is clear and provides a good overview of prefabs and their benefits.
28-81
: LGTM!The editor usage section is clear and provides detailed instructions with helpful images.
71-74
: LGTM!The section on unlinking prefab instances is clear and provides detailed instructions with helpful images.
84-98
: LGTM!The section on using scripts to load and instantiate prefabs is clear and provides a helpful code example.
docs/zh/core/prefab.md
Outdated
|
||
如果要在场景中的多个位置或项目中的多个场景之间重用以特定方式配置的实体,比如非玩家角色 (NPC)、道具或景物,则应将此游戏对象转换为预制体。这种方式比简单复制和粘贴游戏对象更好,因为预制体可以保持所有副本同步。 | ||
|
||
#### 预制体的主要特点: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the heading level.
The heading level should increment by one level at a time.
- #### 预制体的主要特点:
+ ### 预制体的主要特点:
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.
#### 预制体的主要特点: | |
### 预制体的主要特点: |
Tools
Markdownlint
14-14: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time(MD001, heading-increment)
docs/zh/core/prefab.md
Outdated
|
||
### 加载预制体 | ||
预制体资产的引擎对象为[PrefabResource](/apis/loader/#PrefabResource})。 | ||
加载([资产的加载](/docs/assets-load))预制体后,使用[instantiate](/apis/loader/#PrefabResource-instantiate})方法可以生成prefab实例。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加载预制体资产可以得到 PrefabResource 对象,使用instantiate方法可以得到 Prefab 实例化后的 Entity 对象。
docs/zh/core/prefab.md
Outdated
![alt text](https://mdn.alipayobjects.com/huamei_3zduhr/afts/img/A*WC8ZTIv5MK4AAAAAAAAAAAAADsJ_AQ/original) | ||
|
||
### 解开预制体实例 | ||
如果我们想让一个预制体实例与预制体断开联系,使其不随着预制体更改而更改,我们可以将预制体实例解开 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果想让一个预制体实例与预制体断开联系,使其不随着预制体更改而更改,可以将预制体实例解开
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- docs/zh/core/prefab.md (1 hunks)
Additional comments not posted (7)
docs/zh/core/prefab.md (7)
8-12
: LGTM!The introduction section is clear and well-written.
14-14
: Fix the heading level.The heading level should increment by one level at a time.
- #### 预制体的主要特点: + ### 预制体的主要特点:
16-26
: LGTM!The content listing the main features of prefabs is clear and well-written.
28-86
: LGTM!The instructions on how to use prefabs in the editor are clear and well-written.
90-92
: Fix the documentation content.The documentation content for loading prefabs should be fixed.
- 预制体资产的引擎对象为[PrefabResource](/apis/loader/#PrefabResource})。 + 预制体资产的引擎对象为[PrefabResource](/apis/loader/#PrefabResource)。
91-93
: LGTM!The instructions on how to use prefabs in scripts are clear and well-written.
94-102
: LGTM!The code block example is clear and well-written.
Please check if the PR fulfills these requirements
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