Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

UniverseModel: Difference between revisions

From Kerbal Space Program 2 Modding Wiki
Spacewarp>ShadowDev
UniverseModel stuff
 
m 4 revisions imported
 
(3 intermediate revisions by one other user not shown)
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">
VesselComponent vesselComponent = GameManager.Instance.Game.UniverseModel.GetAllVessels().Where((vessel) => vessel.Name == "Vessel Name Here").First();
</syntaxhighlight>


How to get a Vessel by name using UniverseModel
[[Category:Game systems]]
VesselComponent vesselMovedComponent = GameManager.Instance.Game.UniverseModel.GetAllVessels().Where((vessel) => vessel.Name == "Vessel Name Here").First();

Latest revision as of 17:46, 9 October 2024

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();