MCPcopy
hub / github.com/EngoEngine/engo / addCameraSystemOnce

Function addCameraSystemOnce

common/render.go:244–258  ·  view source on GitHub ↗
(w *ecs.World)

Source from the content-addressed store, hash-verified

242var cameraInitMutex sync.Mutex
243
244func addCameraSystemOnce(w *ecs.World) {
245 cameraInitMutex.Lock()
246 defer cameraInitMutex.Unlock()
247
248 camSystemAlreadyAdded := false
249 for _, system := range w.Systems() {
250 switch system.(type) {
251 case *CameraSystem:
252 camSystemAlreadyAdded = true
253 }
254 }
255 if !camSystemAlreadyAdded {
256 w.AddSystem(&CameraSystem{})
257 }
258}
259
260// Add adds an entity to the RenderSystem. The entity needs a basic, render, and space component to be added to the system.
261func (rs *RenderSystem) Add(basic *ecs.BasicEntity, render *RenderComponent, space *SpaceComponent) {

Callers 1

NewMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected