7月31日同步更新

This commit is contained in:
MCNeteaseDevs
2025-07-31 17:53:14 +08:00
parent f5c6bdba2e
commit cf061270d3
799 changed files with 27437 additions and 494 deletions

View File

@@ -0,0 +1,157 @@
---
sidebarDepth: 1
---
# 坐标变换Transform
## 概述
- 继承关系
```mermaid
classDiagram
GameObject <|-- Transform
link GameObject "../../../../mcguide/20-玩法开发/14-预设玩法编程/13-PresetAPI/%E9%A2%84%E8%AE%BE%E5%AF%B9%E8%B1%A1/%E9%80%9A%E7%94%A8/%E6%B8%B8%E6%88%8F%E5%AF%B9%E8%B1%A1GameObject.html"
Transform: 坐标变换
GameObject: 游戏对象
GameObject: (点击跳转)
```
- 描述
坐标变换,包含位置、旋转和缩放
- 成员变量
| 变量名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| pos | tuple(float,float,float) | 位置变换 |
| rotation | tuple(float,float,float) | 旋转变换 |
| scale | tuple(float,float,float) | 缩放变换 |
## 索引
| 接口 | <div style="width: 3em"></div> | 描述 |
| --- | --- | --- |
| [AddOffset](#addoffset) | <span style="display:inline;color:#7575f9">客户端</span>/<span style="display:inline;color:#ff5555">服务端</span> | 给坐标变换位置增加偏移量 |
| [AddRotation](#addrotation) | <span style="display:inline;color:#7575f9">客户端</span>/<span style="display:inline;color:#ff5555">服务端</span> | 给坐标变换旋转增加偏移量 |
| [AddScale](#addscale) | <span style="display:inline;color:#7575f9">客户端</span>/<span style="display:inline;color:#ff5555">服务端</span> | 给坐标变换缩放增加偏移量 |
| [AddTransform](#addtransform) | <span style="display:inline;color:#7575f9">客户端</span>/<span style="display:inline;color:#ff5555">服务端</span> | 给坐标变换增加偏移量 |
| [GetMatrix](#getmatrix) | <span style="display:inline;color:#7575f9">客户端</span>/<span style="display:inline;color:#ff5555">服务端</span> | 获取坐标变换矩阵 |
## AddOffset
<span style="display:inline;color:#7575f9">客户端</span>/<span style="display:inline;color:#ff5555">服务端</span>
method in Preset.Model.Transform.Transform
- 描述
给坐标变换位置增加偏移量
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| offset | tuple(float,float,float) | 变换位置 |
- 返回值
## AddRotation
<span style="display:inline;color:#7575f9">客户端</span>/<span style="display:inline;color:#ff5555">服务端</span>
method in Preset.Model.Transform.Transform
- 描述
给坐标变换旋转增加偏移量
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| rotation | tuple(float,float,float) | 变换旋转 |
- 返回值
## AddScale
<span style="display:inline;color:#7575f9">客户端</span>/<span style="display:inline;color:#ff5555">服务端</span>
method in Preset.Model.Transform.Transform
- 描述
给坐标变换缩放增加偏移量
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| scale | tuple(float,float,float) | 变换缩放 |
- 返回值
## AddTransform
<span style="display:inline;color:#7575f9">客户端</span>/<span style="display:inline;color:#ff5555">服务端</span>
method in Preset.Model.Transform.Transform
- 描述
给坐标变换增加偏移量
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| transform | Transform | 坐标变换 |
- 返回值
## GetMatrix
<span style="display:inline;color:#7575f9">客户端</span>/<span style="display:inline;color:#ff5555">服务端</span>
method in Preset.Model.Transform.Transform
- 描述
获取坐标变换矩阵
- 参数
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| Matrix | 坐标变换矩阵 |

View File

@@ -0,0 +1,81 @@
---
sidebarDepth: 1
---
# 游戏对象GameObject
## 概述
- 描述
GameObject游戏对象是所有预设对象的基类即API文档中Preset API - 预设对象下的所有类都继承自GameObject。
- 成员变量
| 变量名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| id | int | 对象ID |
| classType | str | 对象类名 |
| isClient | bool | 对象运行于客户端还是服务端 |
## 索引
| 接口 | <div style="width: 3em"></div> | 描述 |
| --- | --- | --- |
| [LoadFile](#loadfile) | <span style="display:inline;color:#7575f9">客户端</span>/<span style="display:inline;color:#ff5555">服务端</span> | 加载指定路径的非python脚本文件内容如配置文件 |
| [fromDict](#fromdict) | <span style="display:inline;color:#7575f9">客户端</span>/<span style="display:inline;color:#ff5555">服务端</span> | 将字典根据classType字段转换为对应类型的对象该类型必须使用@registerGenericClass装饰 |
## LoadFile
<span style="display:inline;color:#7575f9">客户端</span>/<span style="display:inline;color:#ff5555">服务端</span>
method in Preset.Model.GameObject.GameObject
- 描述
加载指定路径的非python脚本文件内容如配置文件
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| path | str | 指定相对路径 |
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| str | 文件内容 |
## fromDict
<span style="display:inline;color:#7575f9">客户端</span>/<span style="display:inline;color:#ff5555">服务端</span>
method in Preset.Model.GameObject.type
- 描述
将字典根据classType字段转换为对应类型的对象该类型必须使用@registerGenericClass装饰
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| data | dict | 要转换的字典 |
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| GameObject或dict | 转换成功返回对象,否则返回字典本身 |

View File

@@ -0,0 +1,36 @@
---
sidebarDepth: 1
---
# 素材数据BoxData
## 概述
- 继承关系
```mermaid
classDiagram
TransformObject <|-- BoxData
link TransformObject "../../../../mcguide/20-玩法开发/14-预设玩法编程/13-PresetAPI/%E9%A2%84%E8%AE%BE%E5%AF%B9%E8%B1%A1/%E9%80%9A%E7%94%A8/%E5%8F%98%E6%8D%A2%E5%AF%B9%E8%B1%A1TransformObject.html"
GameObject <|-- TransformObject
link GameObject "../../../../mcguide/20-玩法开发/14-预设玩法编程/13-PresetAPI/%E9%A2%84%E8%AE%BE%E5%AF%B9%E8%B1%A1/%E9%80%9A%E7%94%A8/%E6%B8%B8%E6%88%8F%E5%AF%B9%E8%B1%A1GameObject.html"
BoxData: 素材数据
GameObject: 游戏对象
GameObject: (点击跳转)
TransformObject: 变换对象
TransformObject: (点击跳转)
```
- 描述
BoxData素材数据与素材类似可以挂接在预设下使用。BoxData在编辑器中不会实际生成可以重叠放置。
- 成员变量
| 变量名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| filePath | str | 素材相对于BoxData目录的相对路径 |