55 lines
1.6 KiB
C#
55 lines
1.6 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class BoatPanel : MonoBehaviour
|
|
{
|
|
public ControllBar ThrottleBar;
|
|
|
|
public ControllBar TurningBar;
|
|
|
|
public Image[] sitPointsImage;
|
|
|
|
public Color sitPointOccupyColor;
|
|
|
|
public Color sitPointNotOccupyColor;
|
|
|
|
public Text steringKeyInfoText;
|
|
|
|
[HideInInspector]
|
|
public Boat currntBoat;
|
|
|
|
private string startSteringLangText = "";
|
|
|
|
private string stopSteringLangText = "";
|
|
|
|
private string startSteringLangPadText = "";
|
|
|
|
private string stopSteringLangPadText = "";
|
|
|
|
private void Start()
|
|
{
|
|
startSteringLangText = LanguageManager.Instance.GetText("BOAT_START_STERING_KEY");
|
|
stopSteringLangText = LanguageManager.Instance.GetText("BOAT_STOP_STERING_KEY");
|
|
startSteringLangPadText = LanguageManager.Instance.GetText("PAD_X_BUTON") + "\n" + LanguageManager.Instance.GetText("BOAT_START_STERING_KEY");
|
|
stopSteringLangPadText = LanguageManager.Instance.GetText("PAD_X_BUTON") + "\n" + LanguageManager.Instance.GetText("BOAT_STOP_STERING_KEY");
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if ((bool)ThrottleBar && (bool)TurningBar && (bool)currntBoat && (bool)currntBoat.currentPlayerCharacter && !GameManager.Instance.ChechIfPlayerShouldBeStoppedFromDoingAnything())
|
|
{
|
|
ThrottleBar.value = currntBoat.boatEngine.currentTorquePercent;
|
|
TurningBar.value = currntBoat.boatEngine.currentTurningTorquePercent;
|
|
}
|
|
}
|
|
|
|
private void SitPointsController()
|
|
{
|
|
for (int i = 0; i < sitPointsImage.Length; i++)
|
|
{
|
|
sitPointsImage[i].color = sitPointNotOccupyColor;
|
|
}
|
|
sitPointsImage[currntBoat.currentSitPointIndex].color = sitPointOccupyColor;
|
|
}
|
|
}
|