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