void LateUpdate() { GameHandler.infoText info = GameHandler.Instance.PlaneInfo; infoText.text = "Throttle: " + info.throttle.ToString() + "\n" + "Speed: " + Mathf.Floor(info.speed * SPEED_MULTIPLIER).ToString() + "\n" + "ALT: " + Mathf.Floor(info.altitude).ToString() + "\n" + "Ammo: " + info.bullets + "\n" + "Bombs: " + info.bombs + "\n" + "Gear: " + boolToSwitch(!info.gear) + "\n" + "Brakes: " + boolToSwitch(!info.brakes) + "\n"; }
//Information about plane that will be taken by UI void updateInfo() { if (!plane.IsPlayer) { return; } GameHandler.infoText info = new GameHandler.infoText( propellerMotor.Throttle, plane.Bullets, plane.Bombs.Count, transform.position.y, planeRB.velocity.magnitude, gearCtrl.IsGearUp, !brakes); GameHandler.Instance.PlaneInfo = info; }