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