light sys
This commit is contained in:
parent
7cd8139a2f
commit
b1c5ac236d
@ -22,11 +22,7 @@ func (ls *LightSys) Update(w ecs.World) {
|
||||
//灯当前状态,true-灯丝有电流,false-灯丝没有电流
|
||||
state := component.BitStateType.Get(entry)
|
||||
//驱动灯亮或灭
|
||||
if drive.Td != state.Val {
|
||||
state.Val = drive.Td
|
||||
}
|
||||
//故障设置
|
||||
state.Val = state.Val && !ls.calculateFault(entry)
|
||||
state.Val = drive.Td && !ls.calculateFault(entry)
|
||||
})
|
||||
}
|
||||
func (ls *LightSys) calculateFault(entry *ecs.Entry) bool {
|
||||
|
Loading…
Reference in New Issue
Block a user