private void Awake() { networkedMatrix = GetComponent <NetworkedMatrix>(); matrix = GetComponentInChildren <Matrix>(); if (RequiresFuel) { shuttleFuelSystem = GetComponent <ShuttleFuelSystem>(); } }
private IEnumerator WaitForProvider() { while (Provider == null) { yield return(WaitFor.EndOfFrame); } Trigger = Provider.GetComponent <ShuttleConsole>(); Trigger.OnStateChange.AddListener(OnStateChange); MatrixMove.RegisterCoordReadoutScript(CoordReadout); MatrixMove.RegisterShuttleGuiScript(this); FuelSystemReference = matrixMove.ShuttleFuelSystem; //Not doing this for clients if (IsServer) { EntryList.Origin = MatrixMove; //Init listeners string temp = "1"; StartButton.SetValueServer(temp); MatrixMove.MatrixMoveEvents.OnStartMovementServer.AddListener(() => { // dont enable button when moving with RCS if (!matrixMove.rcsModeActive) { StartButton.SetValueServer("1"); } }); MatrixMove.MatrixMoveEvents.OnStopMovementServer.AddListener(() => { StartButton.SetValueServer("0"); HideWaypoint(); }); if (!Waypoint) { Waypoint = new GameObject($"{MatrixMove.gameObject.name}Waypoint"); } HideWaypoint(false); rulersColor = Rulers.Value; rayColor = RadarScanRay.Value; crosshairColor = Crosshair.Value; OnStateChange(State); } else { ClientToggleRcs(matrixMove.rcsModeActive); } }
private IEnumerator WaitForProvider() { while (Provider == null) { yield return(WaitFor.EndOfFrame); } shuttleConsole = Provider.GetComponent <ShuttleConsole>(); matrixMove = shuttleConsole.ShuttleMatrixMove; matrixMove.RegisterCoordReadoutScript(CoordReadout); matrixMove.RegisterShuttleGuiScript(this); shuttleFuelSystem = matrixMove.ShuttleFuelSystem; radarList = this["EntryList"] as RadarList; //Not doing this for clients if (IsServer) { shuttleConsole.GUItab = this; radarList.Origin = matrixMove; StartButton.SetValueServer("1"); //Init listeners matrixMove.MatrixMoveEvents.OnStartMovementServer.AddListener(OnStartMovementServer); matrixMove.MatrixMoveEvents.OnStopMovementServer.AddListener(OnStopMovementServer); if (!Waypoint) { Waypoint = new GameObject($"{matrixMove.gameObject.name}Waypoint"); } HideWaypoint(false); rulersColor = Rulers.Value; rayColor = RadarScanRay.Value; crosshairColor = Crosshair.Value; OnStateChange(shuttleConsole.shuttleConsoleState); } }
public void RegisterShuttleFuelSystem(ShuttleFuelSystem shuttleFuel) { shuttleFuelSystem = shuttleFuel; }