More actions
Spacewarp>ShadowDev UniverseModel stuff |
Spacewarp>ShadowDev code blocks n stuff |
||
Line 1: | Line 1: | ||
the UniverseModel contains everything that the game knows about. | the UniverseModel contains everything that the game knows about. | ||
How to get a Vessel by name using UniverseModel <syntaxhighlight lang="csharp" line="1" start="0"> | |||
How to get a Vessel by name using UniverseModel | |||
VesselComponent vesselMovedComponent = GameManager.Instance.Game.UniverseModel.GetAllVessels().Where((vessel) => vessel.Name == "Vessel Name Here").First(); | VesselComponent vesselMovedComponent = GameManager.Instance.Game.UniverseModel.GetAllVessels().Where((vessel) => vessel.Name == "Vessel Name Here").First(); | ||
</syntaxhighlight> |
Revision as of 18:49, 31 May 2023
the UniverseModel contains everything that the game knows about.
How to get a Vessel by name using UniverseModel
VesselComponent vesselMovedComponent = GameManager.Instance.Game.UniverseModel.GetAllVessels().Where((vessel) => vessel.Name == "Vessel Name Here").First();