Files
ichni_Creator_Studio/Document/console.md
TRAfoer 1b5084626d TimeLine大改
Signed-off-by: TRAfoer <lhf190@outlook.com>
2025-07-18 18:43:09 +08:00

128 lines
3.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 更新版 Console 文档
## Console概要
Editor内有console系统用于执行某些方便的操作。
在编辑界面内按 **`** 键Esc键下方可以唤出console输入框输入完成后按Enter键执行指令。
输入框支持上下文历史记录,按上下箭头可浏览历史指令。
输入格式:
- **func "abc123" 1 2 [0,1,2]**
- 或 **func(1,2,3,"a",[1,2,3])**
- 字符串需双引号包裹(`"abc123"`
- 向量需中括号包裹(`[0,0,1]`
执行失败时会在Log Window显示错误信息。部分指令依赖Inspector窗口当前选中对象请提前选择目标对象。
---
## 命令列表
### 基础操作
```csharp
tp(Vector3 pos)
```
- 将场景相机移动到指定坐标
- 示例:`tp [10,5,0]`
```csharp
tp()
```
- 将场景相机移动到当前选中对象的位置
- 需在Inspector中选中对象
```csharp
ReName(string message)
```
- 重命名当前选中对象
- 示例:`ReName "NewTrackName"`
### 路径生成
```csharp
Lgp(int loop, Vector3 start, Vector3 end)
```
- 在选中的Track上生成线性路径节点
- 参数:
- `loop`:生成节点数量
- `start`:起始坐标
- `end`:结束坐标
- 示例:`Lgp 10 [0,0,0] [5,0,5]`
```csharp
Spiral(int loop, Vector3 center, float r, float h, int pointsPerTurn, string axis = "y")
Spiral(int loop, Vector3 center, float r, float h, int pointsPerTurn, Vector3 dir)
```
- 在选中的Track上生成螺旋路径节点
- 参数:
- `loop`:总节点数
- `center`:螺旋中心点
- `r`:螺旋半径
- `h`:螺旋高度
- `pointsPerTurn`:每圈节点数
- `axis`:主轴方向("x"/"y"/"z"
- `dir`:自定义方向向量
- 示例:`Spiral 20 [0,0,0] 3 10 8 "z"`
### 数据处理
```csharp
SamplerImport(string inputData)
```
- 导入采样器格式的音符数据
- 数据格式:`(动作类型, 轨道ID, 时间戳, X值, [Hold持续时间])`
- 支持动作类型Tap, Stay, Hold, Flick
- 示例:`SamplerImport "(Tap, Track1, 12.5, 3.2)"`
### 音符操作
```csharp
SetNoteHLInGame(bool forceSetOff = false, bool SameTheme = false)
```
- 全局高亮重复时间点的音符
- 参数:
- `forceSetOff`:是否先关闭所有高亮
- `SameTheme`:是否要求音符类型相同
```csharp
SetNoteHLInElement(bool forceSetOff = false, bool SameTheme = false)
```
- 在当前元素内高亮重复时间点的音符
- 参数同上
```csharp
AttachNoteInNearestTrail()
```
- 将轨道上的音符吸附到最近的轨迹线
- 需选中Track对象
### 动画操作
```csharp
swapDisplacement()
```
- 反转位移动画方向(正负值互换)
- 需选中Displacement元素
```csharp
swapSwirl()
```
- 反转旋转动画方向
- 需选中Swirl元素
```csharp
swapScale()
```
- 反转缩放动画方向
- 需选中Scale元素
### 对象管理
```csharp
DelSameInParent()
```
- 删除父对象中所有同类型的兄弟元素(包括自身)
- 示例:删除当前选中类型的所有同级对象
---
## 其他
更多功能持续开发中。使用console时可参考编辑器内的自动补全提示和参数类型检查功能。