修改继电器接口bug
This commit is contained in:
parent
6a6d0657ca
commit
6444007ba2
20
fi/relay.go
20
fi/relay.go
@ -49,18 +49,16 @@ func DriveRelayUp(w ecs.World, id string) {
|
||||
// 驱动继电器到落下位置
|
||||
func DriveRelayDown(w ecs.World, id string) {
|
||||
w.Execute(func() {
|
||||
w.Execute(func() {
|
||||
wd := entity.GetWorldData(w)
|
||||
entry, ok := wd.EntityMap[id]
|
||||
if ok {
|
||||
if entry.HasComponent(component.YjRelayTag) {
|
||||
driveYjRelay(w, entry, true, false)
|
||||
} else {
|
||||
driveWjRelay(w, entry, false)
|
||||
}
|
||||
wd := entity.GetWorldData(w)
|
||||
entry, ok := wd.EntityMap[id]
|
||||
if ok {
|
||||
if entry.HasComponent(component.YjRelayTag) {
|
||||
driveYjRelay(w, entry, true, false)
|
||||
} else {
|
||||
fmt.Printf("未找到id=%s的继电器\n", id)
|
||||
driveWjRelay(w, entry, false)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
fmt.Printf("未找到id=%s的继电器\n", id)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user