private void UpdateGraphics(FlightControler controller) { if (boresight != null) { boresight.position = playerCam.WorldToScreenPoint(controller.BoresightPos); boresight.gameObject.SetActive(boresight.position.z > 1f); } if (mousePos != null) { mousePos.position = playerCam.WorldToScreenPoint(controller.MouseAimPos); mousePos.gameObject.SetActive(mousePos.position.z > 1f); } if (TextKMH != null) { float x = controller.aircraft.gameObject.GetComponent <Rigidbody>().velocity.magnitude * 3.6f; TextKMH.text = x.ToString() + " KM/H"; } if (SpeedSlider != null) { SpeedSlider.value = planeControler.speed; } if (WaitForBreak != null) { WaitForBreak.value = planeControler.HowLongAreStanding; } }
public void SetReferenceMouseFlight(FlightControler controller) { mouseFlight = controller; }