信号机实体添加SignalTag
This commit is contained in:
parent
4e26ee104f
commit
80bcb33db6
@ -5,6 +5,10 @@ import (
|
||||
"joylink.club/rtsssimulation/component/component_proto"
|
||||
)
|
||||
|
||||
var SignalTag = ecs.NewTag() //标记一个实体为信号机
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
// SignalLights 信号机灯位列表
|
||||
type SignalLights struct {
|
||||
Lights []*ecs.Entry
|
||||
|
@ -66,7 +66,7 @@ func LoadSignals(w ecs.World) error {
|
||||
func newSignalEntity(w ecs.World, uid string, worldData *component.WorldData) *ecs.Entry {
|
||||
entry, ok := worldData.EntityMap[uid]
|
||||
if !ok {
|
||||
entry = w.Entry(w.Create(component.UidType))
|
||||
entry = w.Entry(w.Create(component.UidType, component.SignalTag))
|
||||
component.UidType.SetValue(entry, component.Uid{Id: uid})
|
||||
worldData.EntityMap[uid] = entry
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user