27 lines
524 B
Go
27 lines
524 B
Go
package component
|
|
|
|
import "joylink.club/ecs"
|
|
|
|
// 两位置转换组件
|
|
type TwoPositionTransform struct {
|
|
Pos int // 当前位置百分比,[0, 10000],两位小数
|
|
Speed int
|
|
}
|
|
|
|
var TwoPositionTransformType = ecs.NewComponentType[TwoPositionTransform]()
|
|
|
|
// 仅有两状态的组件
|
|
type BitState struct {
|
|
Val bool
|
|
}
|
|
|
|
var BitStateType = ecs.NewComponentType[BitState]()
|
|
|
|
// 倒数组件
|
|
type CountDown struct {
|
|
Val int // 当前值
|
|
Dv int // 每次递减的值
|
|
}
|
|
|
|
var CountDownType = ecs.NewComponentType[CountDown]()
|