This commit is contained in:
xzb 2023-10-11 13:22:14 +08:00
parent da71326643
commit 9d66798163
4 changed files with 32 additions and 2 deletions

22
component/Light.go Normal file
View File

@ -0,0 +1,22 @@
package component
import "joylink.club/ecs"
// LightDrive 灯驱动
type LightDrive struct {
Td bool
}
// 灯色标签
var (
LdTag = ecs.NewTag() //绿
HdTag = ecs.NewTag() //红
UdTag = ecs.NewTag() //黄
Bdtag = ecs.NewTag() //白
AdTag = ecs.NewTag() //蓝
)
// 组件
var (
LightDriveType = ecs.NewComponentType[LightDrive]()
)

5
entity/light.go Normal file
View File

@ -0,0 +1,5 @@
package entity
func NewLightEntity() {
}

View File

@ -43,9 +43,12 @@ func main() {
worldLog(sim, "===>>亮灯 .....")
fi.DriveSignal3XH1Dd(sim, IdSignal3XH1, true)
//
time.Sleep(1 * time.Second)
time.Sleep(2 * time.Second)
worldLog(sim, "===>>开通引导信号 .....")
fi.DriveSignal3XH1Yx(sim, IdSignal3XH1)
time.Sleep(2 * time.Second)
worldLog(sim, "===>>开通列车信号 .....")
fi.DriveSignal3XH1Lx(sim, IdSignal3XH1, true)
//
time.Sleep(3 * time.Second)
sim.Close()

@ -1 +1 @@
Subproject commit e7797346722a572814539d9a453789b89ffe6bf4
Subproject commit af605020f1bccf1f1b2ab5a4ae4966d1c6c9776c