SetSceneByName does a lookup for the `Scene` where its `Type()` equals `name`, and then sets it as current `Scene`
(name string, forceNewWorld bool)
| 131 | |
| 132 | // SetSceneByName does a lookup for the `Scene` where its `Type()` equals `name`, and then sets it as current `Scene` |
| 133 | func SetSceneByName(name string, forceNewWorld bool) error { |
| 134 | sceneMutex.RLock() |
| 135 | scene, ok := scenes[name] |
| 136 | sceneMutex.RUnlock() |
| 137 | if !ok { |
| 138 | return fmt.Errorf("scene not registered: %s", name) |
| 139 | } |
| 140 | |
| 141 | SetScene(scene.scene, forceNewWorld) |
| 142 | |
| 143 | return nil |
| 144 | } |