Update README.md

This commit is contained in:
CortexCore
2023-06-19 00:43:24 +08:00
parent bf122c66dc
commit acdbe54f79

View File

@@ -192,6 +192,8 @@ public class MyService:Node
>
> > `Entity` 存放数据的基本实体
> > > `RotationComponent`存放数据的组件,例如角度偏移`Offset`和角度权重`Weight`等数据
***
### 创建基本组件
组件需要继承自`EntityComponent`或者`IEntityComponent`,这样`Entity`才能识别并注册组件
```csharp
@@ -224,10 +226,12 @@ public partial class RotationComponent : EntityComponent
}
}
```
***
### 创建服务
基于场景的服务,可直接放入场景中的节点即可
基于全局的服务,可在Godot.ProjectSettings.AutoLoad中添加自动加载
***
#### 非ECS服务
```csharp
public partial class RotationService:Node
@@ -254,6 +258,7 @@ public partial class RotationService:Node
}
}
```
***
#### 基于ECS的服务(System)
目前`IEntitiesService`的实例为`GodotEntitiesService`
```csharp