void KerbalNavBall(KerbalEVA kerbal) { if (kerbal != null) { Debug.Log("FlightTriggers.KerbalNavBall", "Loading CustomNavBall for Kerbal = " + kerbal); CustomNavBall evaNavBall = kerbal?.gameObject?.AddOrGetComponent <CustomNavBall>(); if (evaNavBall != null) { evaNavBall.OnStart(); } DestroyImmediate(evaNavBall); } }
public override void OnLoad(ConfigNode node) { if (HighLogic.LoadedScene == GameScenes.LOADING) { ConfigNode NavBallNode = node.GetNode("NavBall"); CustomNavBall NavBall = gameObject.AddOrGetComponent <CustomNavBall>(); NavBallInfo info = new NavBallInfo(new ConfigNode(), NavBallNode ?? new ConfigNode()); NavBall.Pick(info, name: part.name); if (!DataBase.ContainsKey(part.name)) { DataBase.Add(part.name, NavBall); } } }
void Awake() { Stock = gameObject.AddOrGetComponent <CustomNavBall>(); Instance = Instantiate(FlightUIModeController.Instance.gameObject.GetChild("NavballFrame")); Instance.gameObject.SetActive(false); }