1489 lines
54 KiB
C#
1489 lines
54 KiB
C#
using System;
|
|
using System.Collections;
|
|
using BitStrap;
|
|
using Colorful;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class HUDManager : MonoBehaviour
|
|
{
|
|
public enum HUDState
|
|
{
|
|
GAME = 0,
|
|
PAUSE = 1
|
|
}
|
|
|
|
public enum PauseState
|
|
{
|
|
DEFAULT = 0,
|
|
OPTIONS = 1,
|
|
EQUIPMENT = 2,
|
|
TOURNAMENT_FINISH = 3
|
|
}
|
|
|
|
public enum GameState
|
|
{
|
|
NORMAL = 0,
|
|
FISHING = 1,
|
|
FISHING_NET = 2,
|
|
DRIVING_BOAT = 3,
|
|
WATCH_FISH = 4,
|
|
DRILLING = 5,
|
|
ICE_FISHING = 6,
|
|
ATTRACTOR = 7,
|
|
DEATH = 8,
|
|
AFTER_POO_PISS = 9,
|
|
EMPTY = 10
|
|
}
|
|
|
|
private static HUDManager instance;
|
|
|
|
[ReadOnly]
|
|
public HUDState currentHudState;
|
|
|
|
[ReadOnly]
|
|
public HUDState prevHudState;
|
|
|
|
[ReadOnly]
|
|
public PauseState currentPauseState;
|
|
|
|
[ReadOnly]
|
|
public PauseState prevPauseState;
|
|
|
|
[ReadOnly]
|
|
public GameState currentGameState;
|
|
|
|
[ReadOnly]
|
|
public GameState prevGameState;
|
|
|
|
[HideInInspector]
|
|
public GameController gameController;
|
|
|
|
[HideInInspector]
|
|
public FishingPlayer fishingPlayer;
|
|
|
|
[Header("Canvas")]
|
|
public Canvas hudCanvas;
|
|
|
|
public Canvas fishingCanvas;
|
|
|
|
public Canvas pauseCanvas;
|
|
|
|
public Canvas optionsCanvas;
|
|
|
|
public Canvas equipmentCanvas;
|
|
|
|
public Canvas pauseCommonCanvas;
|
|
|
|
public Canvas infoCanvas;
|
|
|
|
public Canvas tournamentCanvas;
|
|
|
|
public Canvas tournamentFinishCanvas;
|
|
|
|
public Canvas vrQuickMenuCanvas;
|
|
|
|
[Header("Info")]
|
|
public bool showInfo = true;
|
|
|
|
public Image infoBackground;
|
|
|
|
public Text infoText;
|
|
|
|
public Image infoBackgroundHide;
|
|
|
|
public Text infoHide;
|
|
|
|
public GameObject infoAll;
|
|
|
|
public GameObject infoWatchFish;
|
|
|
|
public GameObject infoWatchJunk;
|
|
|
|
public GameObject infoDeath;
|
|
|
|
public GameObject infoPooPiss;
|
|
|
|
public GameObject cursorDrilling;
|
|
|
|
public GameObject cursorEnterBoat;
|
|
|
|
public GameObject cursorChooseHole;
|
|
|
|
public GameObject cursorPullFish;
|
|
|
|
public GameObject cursorNetFish;
|
|
|
|
public GameObject cursorBoat;
|
|
|
|
public GameObject cursorRodStand;
|
|
|
|
public GameObject cursorRemotePlayerInfo;
|
|
|
|
public HUDWatchFish hudWatchFish;
|
|
|
|
public Text deathInfoBtn;
|
|
|
|
public Text pooPissInfo;
|
|
|
|
public GameObject infoFisheryExit;
|
|
|
|
public Text infoFisheryExitTimer;
|
|
|
|
[Header("Player Params")]
|
|
public EnergyBar foodBar;
|
|
|
|
public EnergyBar drunkBar;
|
|
|
|
public EnergyBar pissBar;
|
|
|
|
public EnergyBar pooBar;
|
|
|
|
public EnergyBar luckBar;
|
|
|
|
public EnergyBar strengthBar;
|
|
|
|
[Header("Objects")]
|
|
public HUDFishing hudFishing;
|
|
|
|
public HUDMultiplayer hudMultiplayer;
|
|
|
|
public HUDTournament hudTournament;
|
|
|
|
public HUDBaits hudBaits;
|
|
|
|
public RectTransform hudWeather;
|
|
|
|
public RectTransform hudFloatWidget;
|
|
|
|
public RectTransform hudFishingWidget;
|
|
|
|
public Camera guiCamera;
|
|
|
|
public GameObject drillingIconStart;
|
|
|
|
public GameObject drillingIconDrill;
|
|
|
|
public GameObject portButton;
|
|
|
|
private bool firstUpdate = true;
|
|
|
|
[Header("Radar")]
|
|
public GameObject minimapGui;
|
|
|
|
[HideInInspector]
|
|
public KGFMapSystem kgfMapSystem;
|
|
|
|
public KGFMapIcon fishMapIconPrefab;
|
|
|
|
public Image radarRotatingLine;
|
|
|
|
public RawImage radarVRBackgroundRaw;
|
|
|
|
public float radarRotateSpeed = 5f;
|
|
|
|
public float radarDetectOffset;
|
|
|
|
[ReadOnly]
|
|
public int radarDetectedCount;
|
|
|
|
[Header("x")]
|
|
public Image fadeDark;
|
|
|
|
public Text fishingMessageText;
|
|
|
|
private Coroutine messageCoroutine;
|
|
|
|
public Text fishingMessageWindowText;
|
|
|
|
public int hookSizeInfoCounter;
|
|
|
|
private bool isEndlessMessageActive;
|
|
|
|
public static HUDManager Instance
|
|
{
|
|
get
|
|
{
|
|
return instance;
|
|
}
|
|
}
|
|
|
|
private HUDManager()
|
|
{
|
|
}
|
|
|
|
private void Awake()
|
|
{
|
|
if (instance == null)
|
|
{
|
|
instance = this;
|
|
}
|
|
kgfMapSystem = UnityEngine.Object.FindObjectOfType<KGFMapSystem>();
|
|
base.transform.position = Vector3.zero;
|
|
fishingMessageText.transform.parent.gameObject.SetActive(false);
|
|
fishingMessageText.text = string.Empty;
|
|
ShowMessageWindow(false, string.Empty);
|
|
ShowVRQuickMenu(false);
|
|
if (VRManager.IsVROn())
|
|
{
|
|
if ((bool)GlobalSettings.Instance)
|
|
{
|
|
fadeDark = ((!GlobalSettings.Instance.levelsManager.GetCurrentFishery().iceLevel) ? GameController.Instance.normalPlayerVR.vrFadeImage : GameController.Instance.icePlayerVR.vrFadeImage);
|
|
}
|
|
else
|
|
{
|
|
fadeDark = ((!GameController.Instance.iceLevel) ? GameController.Instance.normalPlayerVR.vrFadeImage : GameController.Instance.icePlayerVR.vrFadeImage);
|
|
}
|
|
}
|
|
FadeDark(1f, 0f);
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
gameController = GameController.Instance;
|
|
ShowRadar(false);
|
|
if (gameController.iceLevel)
|
|
{
|
|
hudFishing.ShowThrowSlider(false);
|
|
hudFishing.ShowThrowSlider(false);
|
|
}
|
|
if ((bool)GlobalSettings.Instance)
|
|
{
|
|
ShowControls(GlobalSettings.Instance.playerSettings.showIngameControls);
|
|
}
|
|
else
|
|
{
|
|
ShowControls(false);
|
|
}
|
|
}
|
|
|
|
public void ResetHUD()
|
|
{
|
|
ChangeState(HUDState.GAME);
|
|
ChangeSubState(PauseState.DEFAULT);
|
|
ChangeSubState(GameState.NORMAL);
|
|
infoFisheryExit.SetActive(false);
|
|
portButton.SetActive(gameController.oceanLevel);
|
|
cursorDrilling.SetActive(false);
|
|
cursorEnterBoat.SetActive(false);
|
|
cursorChooseHole.SetActive(false);
|
|
cursorBoat.gameObject.SetActive(false);
|
|
cursorRodStand.SetActive(false);
|
|
ShowEnterBoatCursor(false);
|
|
ShowPullFishCursor(false);
|
|
ShowNetFishCursor(false);
|
|
ShowHudFishing(false);
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (gameController == null || !gameController.isInitialized || ((bool)BugReporter.Instance && BugReporter.Instance.isVisible) || ((bool)TutorialManager.Instance && (bool)TutorialManager.Instance.GetCurrentTutorial()))
|
|
{
|
|
return;
|
|
}
|
|
if (firstUpdate)
|
|
{
|
|
firstUpdate = false;
|
|
ChangeState(HUDState.GAME);
|
|
}
|
|
if (UtilitiesInput.GetButtonDown("PAUSE") && CanPause())
|
|
{
|
|
if (currentHudState == HUDState.GAME)
|
|
{
|
|
PauseGame(true);
|
|
}
|
|
else if (currentHudState == HUDState.PAUSE)
|
|
{
|
|
if (currentPauseState == PauseState.DEFAULT)
|
|
{
|
|
PauseGame(false);
|
|
}
|
|
else if (currentPauseState == PauseState.OPTIONS)
|
|
{
|
|
ShowOptions(false);
|
|
}
|
|
}
|
|
}
|
|
if (tournamentFinishCanvas.gameObject.activeSelf && VRManager.IsVROn())
|
|
{
|
|
if (OVRInput.GetDown(OVRInput.Button.Any) || OVRInput.GamepadGetAnyButtonDown())
|
|
{
|
|
ShowTournamentFinishScreen(false);
|
|
}
|
|
return;
|
|
}
|
|
if (currentHudState == HUDState.GAME && VRManager.IsVROn() && !VRManager.Instance.keyboardManager.gameObject.activeSelf && UtilitiesInput.GetButtonDown("VR_QUICK_MENU"))
|
|
{
|
|
ShowVRQuickMenu(!vrQuickMenuCanvas.gameObject.activeSelf);
|
|
}
|
|
if (!hudMultiplayer.isInInputMode)
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.I))
|
|
{
|
|
}
|
|
if (Input.GetKeyDown(KeyCode.O))
|
|
{
|
|
ShowControls(!showInfo);
|
|
}
|
|
if (infoWatchFish.activeSelf && VRManager.IsVROn())
|
|
{
|
|
if (UtilitiesInput.GetButtonDown("TEMP_SELL"))
|
|
{
|
|
WatchFishDecision(1);
|
|
}
|
|
else if (UtilitiesInput.GetButtonDown("TEMP_RELEASE"))
|
|
{
|
|
WatchFishDecision(2);
|
|
}
|
|
else if (UtilitiesInput.GetButtonDown("TEMP_KEEP"))
|
|
{
|
|
WatchFishDecision(5);
|
|
}
|
|
}
|
|
}
|
|
UpdateRadar();
|
|
}
|
|
|
|
public void ChangeState(HUDState newState)
|
|
{
|
|
if ((bool)fishingPlayer.postProcessingBehaviour_1 && !VRManager.IsVROn())
|
|
{
|
|
fishingPlayer.postProcessingBehaviour_1.enabled = newState == HUDState.GAME;
|
|
}
|
|
if (!gameController.isMultiplayer || !gameController.isTournament)
|
|
{
|
|
Time.timeScale = ((newState != HUDState.GAME) ? 0f : 1f);
|
|
}
|
|
fishingPlayer.Pause(newState == HUDState.PAUSE);
|
|
pauseCommonCanvas.gameObject.SetActive(newState == HUDState.PAUSE);
|
|
pauseCanvas.gameObject.SetActive(newState == HUDState.PAUSE);
|
|
hudCanvas.gameObject.SetActive(newState == HUDState.GAME);
|
|
infoCanvas.gameObject.SetActive(newState == HUDState.GAME);
|
|
fishingCanvas.gameObject.SetActive(newState == HUDState.GAME && (bool)fishingPlayer.currentHands && fishingPlayer.currentHands.baitWasThrown && !fishingPlayer.currentHands.fishingRod.isOnRodStand);
|
|
hudMultiplayer.gameObject.SetActive(gameController.isMultiplayer && newState == HUDState.GAME);
|
|
tournamentCanvas.gameObject.SetActive(newState == HUDState.GAME && gameController.isTournament);
|
|
if ((bool)kgfMapSystem)
|
|
{
|
|
kgfMapSystem.gameObject.SetActive(newState == HUDState.GAME);
|
|
}
|
|
if (newState == HUDState.GAME)
|
|
{
|
|
if ((bool)MapController.Instance && MapController.Instance.initialized)
|
|
{
|
|
MapController.Instance.ShowMap(false);
|
|
}
|
|
if ((bool)RadioManager.Instance)
|
|
{
|
|
RadioManager.Instance.ShowRadioWindow(false);
|
|
}
|
|
}
|
|
if (newState == HUDState.PAUSE)
|
|
{
|
|
ShowVRQuickMenu(false);
|
|
}
|
|
if ((bool)MenuManager.Instance)
|
|
{
|
|
pauseCommonCanvas.gameObject.SetActive(false);
|
|
pauseCanvas.gameObject.SetActive(false);
|
|
MenuManager.Instance.ShowDuringGame(newState == HUDState.PAUSE);
|
|
if (newState != HUDState.GAME)
|
|
{
|
|
}
|
|
}
|
|
else if (newState != HUDState.GAME && newState == HUDState.PAUSE)
|
|
{
|
|
ChangeSubState(PauseState.DEFAULT);
|
|
}
|
|
if ((fishingPlayer.currentState == FishingPlayer.PlayerState.DRILLING && fishingPlayer.drillingController.Drilling) || fishingPlayer.currentState == FishingPlayer.PlayerState.WATCH_FISH)
|
|
{
|
|
Cursor.visible = true;
|
|
Cursor.lockState = CursorLockMode.None;
|
|
}
|
|
else
|
|
{
|
|
Cursor.visible = newState != HUDState.GAME;
|
|
Cursor.lockState = ((newState == HUDState.GAME) ? CursorLockMode.Locked : CursorLockMode.None);
|
|
}
|
|
if ((bool)fishingPlayer.gaussianBlur)
|
|
{
|
|
fishingPlayer.gaussianBlur.enabled = newState == HUDState.PAUSE;
|
|
}
|
|
guiCamera.GetComponent<ChromaticAberration>().enabled = newState == HUDState.PAUSE;
|
|
AudioController.SetCategoryVolume("Gameplay", (newState != HUDState.GAME) ? 0f : 1f);
|
|
prevHudState = currentHudState;
|
|
currentHudState = newState;
|
|
if (newState != HUDState.PAUSE)
|
|
{
|
|
UpdateControls();
|
|
}
|
|
}
|
|
|
|
public void ChangeSubState(GameState newState)
|
|
{
|
|
switch (newState)
|
|
{
|
|
case GameState.FISHING:
|
|
hudFishing.RefreshSetting();
|
|
break;
|
|
case GameState.AFTER_POO_PISS:
|
|
Cursor.visible = true;
|
|
Cursor.lockState = CursorLockMode.None;
|
|
break;
|
|
}
|
|
prevGameState = currentGameState;
|
|
currentGameState = newState;
|
|
hudFishing.RefreshSetting();
|
|
UpdateInfo();
|
|
UpdateControls();
|
|
}
|
|
|
|
public void ChangeSubState(PauseState newState)
|
|
{
|
|
switch (newState)
|
|
{
|
|
case PauseState.DEFAULT:
|
|
pauseCanvas.gameObject.SetActive(true);
|
|
pauseCanvas.GetComponent<Animator>().SetBool("Open", true);
|
|
break;
|
|
case PauseState.OPTIONS:
|
|
optionsCanvas.gameObject.SetActive(true);
|
|
optionsCanvas.GetComponent<Animator>().SetBool("Open", true);
|
|
break;
|
|
case PauseState.EQUIPMENT:
|
|
equipmentCanvas.gameObject.SetActive(true);
|
|
equipmentCanvas.GetComponent<Animator>().SetBool("Open", true);
|
|
break;
|
|
case PauseState.TOURNAMENT_FINISH:
|
|
tournamentFinishCanvas.gameObject.SetActive(true);
|
|
tournamentFinishCanvas.GetComponent<Animator>().SetBool("Open", true);
|
|
break;
|
|
}
|
|
if (currentPauseState != newState)
|
|
{
|
|
if (currentPauseState == PauseState.DEFAULT)
|
|
{
|
|
pauseCanvas.GetComponent<Animator>().SetBool("Open", false);
|
|
StartCoroutine(MenuManager.HideState(pauseCanvas.GetComponent<Animator>()));
|
|
}
|
|
else if (currentPauseState == PauseState.OPTIONS)
|
|
{
|
|
optionsCanvas.GetComponent<Animator>().SetBool("Open", false);
|
|
StartCoroutine(MenuManager.HideState(optionsCanvas.GetComponent<Animator>()));
|
|
}
|
|
else if (currentPauseState == PauseState.EQUIPMENT)
|
|
{
|
|
equipmentCanvas.GetComponent<Animator>().SetBool("Open", false);
|
|
StartCoroutine(MenuManager.HideState(equipmentCanvas.GetComponent<Animator>()));
|
|
}
|
|
else if (currentPauseState == PauseState.TOURNAMENT_FINISH)
|
|
{
|
|
tournamentFinishCanvas.GetComponent<Animator>().SetBool("Open", false);
|
|
StartCoroutine(MenuManager.HideState(tournamentFinishCanvas.GetComponent<Animator>()));
|
|
}
|
|
}
|
|
prevPauseState = currentPauseState;
|
|
currentPauseState = newState;
|
|
}
|
|
|
|
public void ShowHudFishing(bool show)
|
|
{
|
|
fishingCanvas.gameObject.SetActive(show);
|
|
if (VRManager.Instance.IsVRReeling() && (bool)fishingPlayer && (bool)fishingPlayer.currentHands)
|
|
{
|
|
fishingPlayer.currentHands.currentUserReelSpeed = 0f;
|
|
hudFishing.UpdateReelSpeedNew(fishingPlayer.currentHands.currentUserReelSpeed);
|
|
UtilitiesInput.StopVibration(false);
|
|
}
|
|
}
|
|
|
|
public void ShowControls(bool show)
|
|
{
|
|
if (VRManager.IsVROn())
|
|
{
|
|
show = false;
|
|
}
|
|
showInfo = show;
|
|
infoAll.SetActive(showInfo);
|
|
if ((bool)GlobalSettings.Instance)
|
|
{
|
|
GlobalSettings.Instance.playerSettings.showIngameControls = showInfo;
|
|
}
|
|
infoHide.text = "O - " + ((!showInfo) ? Utilities.GetTranslation("HUD/SHOW_INFORMATION").ToUpper() : Utilities.GetTranslation("HUD/HIDE_INFORMATION").ToUpper());
|
|
UpdateControls();
|
|
}
|
|
|
|
public void UpdateInfo()
|
|
{
|
|
if (currentHudState == HUDState.GAME)
|
|
{
|
|
infoWatchFish.SetActive(currentGameState == GameState.WATCH_FISH && (bool)fishingPlayer.fish);
|
|
infoWatchJunk.SetActive(currentGameState == GameState.WATCH_FISH && (bool)fishingPlayer.junk);
|
|
cursorDrilling.SetActive(currentGameState == GameState.DRILLING);
|
|
infoDeath.SetActive(currentGameState == GameState.DEATH);
|
|
infoPooPiss.SetActive(currentGameState == GameState.AFTER_POO_PISS);
|
|
}
|
|
}
|
|
|
|
public void PauseGame(bool pause)
|
|
{
|
|
if (pause)
|
|
{
|
|
Pause();
|
|
}
|
|
else
|
|
{
|
|
Resume();
|
|
}
|
|
}
|
|
|
|
public void Pause()
|
|
{
|
|
ChangeState(HUDState.PAUSE);
|
|
}
|
|
|
|
public void Resume()
|
|
{
|
|
ChangeState(HUDState.GAME);
|
|
}
|
|
|
|
public bool CanPause()
|
|
{
|
|
return !tournamentFinishCanvas.gameObject.activeSelf && !VRManager.Instance.keyboardManager.gameObject.activeSelf && !infoWatchFish.activeSelf;
|
|
}
|
|
|
|
public void ShowInventory(bool show)
|
|
{
|
|
if (show)
|
|
{
|
|
PauseGame(true);
|
|
if ((bool)MenuManager.Instance)
|
|
{
|
|
MenuManager.Instance.ChangeState(MenuManager.MenuState.INVENTORY);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
PauseGame(false);
|
|
}
|
|
}
|
|
|
|
public void ShowOptions(bool show)
|
|
{
|
|
ChangeSubState(show ? PauseState.OPTIONS : PauseState.DEFAULT);
|
|
}
|
|
|
|
public void ShowEquipment(bool show)
|
|
{
|
|
ChangeSubState(show ? PauseState.EQUIPMENT : PauseState.DEFAULT);
|
|
}
|
|
|
|
public void ShowTournamentFinishScreen(bool show)
|
|
{
|
|
if (show && currentHudState == HUDState.PAUSE)
|
|
{
|
|
ChangeState(HUDState.GAME);
|
|
}
|
|
tournamentFinishCanvas.gameObject.SetActive(show);
|
|
tournamentFinishCanvas.GetComponent<Animator>().SetBool("Open", show);
|
|
hudTournament.gameObject.SetActive(false);
|
|
if (show || fishingPlayer.currentState != FishingPlayer.PlayerState.WATCH_FISH)
|
|
{
|
|
fishingPlayer.Pause(show);
|
|
Cursor.visible = show;
|
|
Cursor.lockState = ((!show) ? CursorLockMode.Locked : CursorLockMode.None);
|
|
}
|
|
Time.timeScale = ((!show) ? 1f : 0f);
|
|
if (VRManager.IsVROn())
|
|
{
|
|
tournamentFinishCanvas.GetComponent<RectTransform>().localScale = Vector3.one * 0.35f;
|
|
tournamentFinishCanvas.GetComponent<RectTransform>().localPosition = new Vector3(0f, 0f, -195f);
|
|
}
|
|
Debug.Log("ShowTournamentFinishScreen: " + show);
|
|
}
|
|
|
|
public void ShowEnterBoatCursor(bool show)
|
|
{
|
|
cursorEnterBoat.gameObject.SetActive(show);
|
|
}
|
|
|
|
public void ShowPullFishCursor(bool show)
|
|
{
|
|
cursorPullFish.gameObject.SetActive(show);
|
|
}
|
|
|
|
public void ShowNetFishCursor(bool show)
|
|
{
|
|
cursorNetFish.gameObject.SetActive(show);
|
|
}
|
|
|
|
public void ShowRodStandCursor(bool show)
|
|
{
|
|
cursorRodStand.gameObject.SetActive(show);
|
|
}
|
|
|
|
public void ShowRemotePlayerInfoCursor(bool show)
|
|
{
|
|
}
|
|
|
|
public void ChangeGameState(GameState newState)
|
|
{
|
|
if (currentHudState != HUDState.PAUSE)
|
|
{
|
|
ChangeSubState(newState);
|
|
}
|
|
}
|
|
|
|
public void ExitLevel()
|
|
{
|
|
Cursor.visible = true;
|
|
Cursor.lockState = CursorLockMode.None;
|
|
Time.timeScale = 1f;
|
|
if ((bool)fishingPlayer.currentHands.bait)
|
|
{
|
|
fishingPlayer.currentHands.bait.ReturnToEquipment();
|
|
}
|
|
GlobalSettings.Instance.levelsManager.Save();
|
|
if ((bool)gameController.fisheryEditorGame)
|
|
{
|
|
FisheryEditor.m_isComingBackFromGame = true;
|
|
LoadingManager.LoadScene("FisheryEditor");
|
|
}
|
|
else
|
|
{
|
|
LoadingManager.LoadScene("MainMenu");
|
|
}
|
|
}
|
|
|
|
public void RecoverAfterDeath()
|
|
{
|
|
gameController.fishingPlayer.RecoverAfterDeath();
|
|
ChangeGameState(GameState.EMPTY);
|
|
}
|
|
|
|
public void RecoverAfterPooPiss()
|
|
{
|
|
gameController.fishingPlayer.ufpsInput.AllowGameplayInput = true;
|
|
gameController.fishingPlayer.pissingLevelOverLimit = false;
|
|
Cursor.visible = false;
|
|
Cursor.lockState = CursorLockMode.Locked;
|
|
ChangeGameState(GameState.EMPTY);
|
|
}
|
|
|
|
public void PortReturn()
|
|
{
|
|
Cursor.visible = true;
|
|
Cursor.lockState = CursorLockMode.None;
|
|
Time.timeScale = 1f;
|
|
LoadingManager.LoadScene(gameController.harbourScene);
|
|
}
|
|
|
|
public void PlayerCaughtFish(Fish fish)
|
|
{
|
|
hudWatchFish.PlayerCaughtFish(fish);
|
|
if ((bool)AchievementManager.Instance)
|
|
{
|
|
AchievementManager.Instance.UpdateAchievement(AchievementManager.AchievementId.FISH_AMOUNT_01, 1);
|
|
AchievementManager.Instance.UpdateAchievement(AchievementManager.AchievementId.FISH_AMOUNT_02, 1);
|
|
AchievementManager.Instance.UpdateAchievement(AchievementManager.AchievementId.FISH_AMOUNT_03, 1);
|
|
AchievementManager.Instance.UpdateAchievement(AchievementManager.AchievementId.FISH_AMOUNT_04, 1);
|
|
AchievementManager.Instance.UpdateAchievement(AchievementManager.AchievementId.FISH_AMOUNT_05, 1);
|
|
AchievementManager.Instance.UpdateAchievement(AchievementManager.FishToAchievementID(fish.species), 1);
|
|
}
|
|
}
|
|
|
|
public void PlayerCaughtJunk(Junk junk)
|
|
{
|
|
hudWatchFish.PlayerCaughtJunk(junk);
|
|
if ((bool)AchievementManager.Instance)
|
|
{
|
|
AchievementManager.Instance.UpdateAchievement(AchievementManager.AchievementId.JUNK_AMOUNT_01, 1);
|
|
AchievementManager.Instance.UpdateAchievement(AchievementManager.AchievementId.JUNK_AMOUNT_02, 1);
|
|
AchievementManager.Instance.UpdateAchievement(AchievementManager.AchievementId.JUNK_AMOUNT_03, 1);
|
|
}
|
|
}
|
|
|
|
public void FadeDark(float value, float time, bool startInput = false)
|
|
{
|
|
if (time == 0f)
|
|
{
|
|
fadeDark.color = new Color(0f, 0f, 0f, value);
|
|
}
|
|
else if (startInput)
|
|
{
|
|
LeanTween.alpha(fadeDark.rectTransform, value, time).setOnComplete((Action)delegate
|
|
{
|
|
gameController.fishingPlayer.ufpsInput.MouseLookSensitivity = new Vector2(5f, 5f);
|
|
gameController.fishingPlayer.RefreshInputSettings();
|
|
}).setIgnoreTimeScale(true);
|
|
}
|
|
else
|
|
{
|
|
LeanTween.alpha(fadeDark.rectTransform, value, time).setIgnoreTimeScale(true);
|
|
}
|
|
}
|
|
|
|
public IEnumerator FadeOutIn(float time, float delay)
|
|
{
|
|
FadeDark(1f, time);
|
|
yield return new WaitForSeconds(delay);
|
|
FadeDark(0f, time);
|
|
}
|
|
|
|
public void WatchFishDecision(int decision)
|
|
{
|
|
if (fishingPlayer.fish == null)
|
|
{
|
|
Debug.LogError("WatchFishDecision fishingPlayer.fish == null");
|
|
}
|
|
if (decision == 1)
|
|
{
|
|
if ((bool)GlobalSettings.Instance && (bool)fishingPlayer.fish)
|
|
{
|
|
GlobalSettings.Instance.playerSettings.AddMoney(fishingPlayer.fish.GetMoneyPrize());
|
|
}
|
|
}
|
|
else if ((decision == 2 || decision == 5) && (bool)GlobalSettings.Instance && (bool)fishingPlayer.fish)
|
|
{
|
|
GlobalSettings.Instance.playerSettings.AddExperience(GlobalSettings.Instance.playerSettings.GetExpUpdated(Mathf.RoundToInt((float)fishingPlayer.fish.GetExpPrize() * 0.2f)));
|
|
}
|
|
float num = 1f;
|
|
gameController.hudManager.hudWatchFish.OnDecision(decision, num);
|
|
LeanTween.value(0f, 1f, num + 0.3f).setOnComplete((Action)delegate
|
|
{
|
|
if ((bool)fishingPlayer.fish && fishingPlayer.fish.watchStyle == Fish.WatchStyle.BOAT)
|
|
{
|
|
StartCoroutine(FadeOutIn(0.5f, 0.5f));
|
|
LeanTween.delayedCall(0.5f, (Action)delegate
|
|
{
|
|
gameController.fishingPlayer.WatchFishDecision(decision);
|
|
gameController.weatherLevelManager.UpdateWaterProfiles();
|
|
});
|
|
}
|
|
else
|
|
{
|
|
gameController.fishingPlayer.WatchFishDecision(decision);
|
|
}
|
|
});
|
|
}
|
|
|
|
public void ShowMessage(string message, float duration = 3.5f)
|
|
{
|
|
if (messageCoroutine != null)
|
|
{
|
|
StopCoroutine(messageCoroutine);
|
|
messageCoroutine = null;
|
|
}
|
|
if (duration < 0f)
|
|
{
|
|
ShowEndlessMessage(message);
|
|
}
|
|
else
|
|
{
|
|
messageCoroutine = StartCoroutine(ShowMessageCoroutine(message, duration));
|
|
}
|
|
}
|
|
|
|
private void ShowMessage(string message)
|
|
{
|
|
fishingMessageText.transform.parent.gameObject.SetActive(true);
|
|
fishingMessageText.text = Utilities.GetTranslation(message);
|
|
}
|
|
|
|
private IEnumerator ShowMessageCoroutine(string message, float time)
|
|
{
|
|
Debug.Log("MSG: " + message);
|
|
ShowMessage(message);
|
|
yield return new WaitForSeconds(time);
|
|
HideMessage();
|
|
}
|
|
|
|
public void HideMessage()
|
|
{
|
|
if (messageCoroutine != null)
|
|
{
|
|
StopCoroutine(messageCoroutine);
|
|
messageCoroutine = null;
|
|
}
|
|
fishingMessageText.transform.parent.gameObject.SetActive(false);
|
|
fishingMessageText.text = string.Empty;
|
|
}
|
|
|
|
private void ShowEndlessMessage(string message)
|
|
{
|
|
fishingMessageText.transform.parent.gameObject.SetActive(true);
|
|
fishingMessageText.text = Utilities.GetTranslation(message);
|
|
isEndlessMessageActive = true;
|
|
}
|
|
|
|
public void HideEndlessMessage()
|
|
{
|
|
if (isEndlessMessageActive)
|
|
{
|
|
fishingMessageText.transform.parent.gameObject.SetActive(false);
|
|
fishingMessageText.text = string.Empty;
|
|
isEndlessMessageActive = false;
|
|
}
|
|
}
|
|
|
|
public void ShowMessageWindow(bool show, string message = "")
|
|
{
|
|
fishingMessageWindowText.text = Utilities.GetTranslation(message);
|
|
fishingMessageWindowText.transform.parent.gameObject.SetActive(show);
|
|
}
|
|
|
|
public void UpdateLuckBar(float value)
|
|
{
|
|
luckBar.valueCurrent = Mathf.FloorToInt(value * 100f);
|
|
}
|
|
|
|
public void UpdateDrunkBar(float value)
|
|
{
|
|
drunkBar.valueCurrent = Mathf.FloorToInt(value * 100f);
|
|
}
|
|
|
|
public void UpdatePissBar(float value)
|
|
{
|
|
pissBar.valueCurrent = Mathf.FloorToInt(value * 100f);
|
|
}
|
|
|
|
public void UpdateFoodBar(float value)
|
|
{
|
|
foodBar.valueCurrent = Mathf.FloorToInt(value * 100f);
|
|
}
|
|
|
|
public void UpdatePooBar(float value)
|
|
{
|
|
pooBar.valueCurrent = Mathf.FloorToInt(value * 100f);
|
|
}
|
|
|
|
public void UpdateStrengthBar(float value)
|
|
{
|
|
strengthBar.valueCurrent = Mathf.FloorToInt(value * 100f);
|
|
}
|
|
|
|
public void ShowRadar(bool show)
|
|
{
|
|
minimapGui.SetActive(show);
|
|
kgfMapSystem.gameObject.SetActive(show);
|
|
kgfMapSystem.SetMinimapEnabled(show);
|
|
if (show)
|
|
{
|
|
AudioController.Play("RadarShow_01");
|
|
}
|
|
if (gameController.isTournament)
|
|
{
|
|
hudTournament.ShowPlayersParent(!show);
|
|
}
|
|
if (VRManager.IsVROn())
|
|
{
|
|
kgfMapSystem.itsCameraOutput.gameObject.SetActive(false);
|
|
}
|
|
}
|
|
|
|
public void UpdateRadar()
|
|
{
|
|
radarRotatingLine.rectTransform.Rotate(new Vector3(0f, 0f, radarRotateSpeed * Time.deltaTime));
|
|
}
|
|
|
|
public bool LineCrossingOver(GameObject EnemyToCheckIfLineIsCrossingOver)
|
|
{
|
|
Transform transform = kgfMapSystem.itsDataModuleMinimap.itsGlobalSettings.itsTarget.transform;
|
|
float num = radarRotatingLine.transform.localEulerAngles.z - transform.eulerAngles.y + radarDetectOffset;
|
|
num %= 360f;
|
|
if (Vector3.Distance(new Vector3(EnemyToCheckIfLineIsCrossingOver.transform.position.x, 0f, EnemyToCheckIfLineIsCrossingOver.transform.position.z), new Vector3(transform.position.x, 0f, transform.position.z)) < 3.5f)
|
|
{
|
|
return true;
|
|
}
|
|
if (Vector3.Dot((EnemyToCheckIfLineIsCrossingOver.transform.position - transform.position).normalized, new Vector3(Mathf.Cos(num / 360f * 6.28318f), 0f, Mathf.Sin(num / 360f * 6.28318f)).normalized) > 0.95f)
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public void UpdateControlsVR()
|
|
{
|
|
VRControllersManager.Instance.HideAllInfo();
|
|
if (!VRManager.useOculusSDK && VRControllersManager.Instance.GetVRController(OVRInput.Controller.RTouch) == VRControllersManager.Instance.touchRightController)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(OVRInput.Controller.RTouch, OVRInput.Button.PrimaryThumbstick, Utilities.GetTranslation("VR/QUICK_MENU"));
|
|
}
|
|
else
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("VR_QUICK_MENU"), Utilities.GetTranslation("VR/QUICK_MENU"));
|
|
}
|
|
if (fishingPlayer.vrPlayertUIInput.isOn)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRControllersManager.Instance.GetPrimaryController(), OVRInput.Button.PrimaryIndexTrigger, Utilities.GetTranslation("GUI/BTN_CHOOSE"));
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRControllersManager.Instance.GetSecondaryController(), OVRInput.Button.PrimaryIndexTrigger, Utilities.GetTranslation("GUI/BTN_CHOOSE"));
|
|
return;
|
|
}
|
|
if ((VRManager.Instance.playerWalkStyle == VRManager.PlayerWalkStyle.GAZE_TELEPORT || VRManager.Instance.playerWalkStyle == VRManager.PlayerWalkStyle.POINTER_TELEPORT) && fishingPlayer.currentState != FishingPlayer.PlayerState.WATCH_FISH && fishingPlayer.currentState != FishingPlayer.PlayerState.DRILLING && fishingPlayer.currentState != FishingPlayer.PlayerState.DRIVING_BOAT)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("VR_TELEPORT_GAZE"), Utilities.GetTranslation("HUD_CONTROLS/TELEPORT"));
|
|
}
|
|
if (currentGameState == GameState.NORMAL)
|
|
{
|
|
}
|
|
if (currentGameState == GameState.FISHING && !fishingPlayer.currentHands.fishingRod.isOnRodStand)
|
|
{
|
|
if (fishingPlayer.currentHands.baitWasThrown)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("RESET_THROW"), Utilities.GetTranslation("HUD_CONTROLS/RESET_ROD"));
|
|
if (!VRManager.Instance.IsVRReeling())
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("REEL_IN"), Utilities.GetTranslation("HUD_CONTROLS/REEL_IN"));
|
|
}
|
|
else if (fishingPlayer.currentHands.isFlyRig)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("VR_REEL_GRIP"), Utilities.GetTranslation("HUD_CONTROLS/HOLD"));
|
|
}
|
|
else if (VRManager.Instance.IsVRReelingGrip())
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("VR_REEL_GRIP"), Utilities.GetTranslation("VR/VR_REEL_GRIP"));
|
|
}
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("REEL_ARCH"), Utilities.GetTranslation("HUD_CONTROLS/REEL_ARCH"));
|
|
if (VRManager.Instance.IsVRHoldRod())
|
|
{
|
|
}
|
|
}
|
|
else if ((bool)fishingPlayer.currentHands.currentBoilie)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("BOILIE"), "(" + Utilities.GetTranslation("HUD_WATCH_FISH/RELEASE") + ") " + Utilities.GetTranslation("HUD_CONTROLS/THROW_BOILIE"));
|
|
}
|
|
else if (fishingPlayer.isHandsCameraVisible)
|
|
{
|
|
if (VRManager.Instance.IsVRHoldRod())
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("THROW_FAR"), "(" + Utilities.GetTranslation("HUD_CONTROLS/HOLD") + "/" + Utilities.GetTranslation("HUD_WATCH_FISH/RELEASE") + ") " + Utilities.GetTranslation("HUD_CONTROLS/THROW_BAIT"));
|
|
}
|
|
else
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("THROW_FAR"), Utilities.GetTranslation("HUD_CONTROLS/THROW_BAIT"));
|
|
}
|
|
if (!GlobalSettings.Instance || GlobalSettings.Instance.equipmentManager.HasBoilieEquiped())
|
|
{
|
|
if (VRManager.Instance.IsVRGroundBait())
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("BOILIE"), "(" + Utilities.GetTranslation("HUD_CONTROLS/HOLD") + ") " + Utilities.GetTranslation("EQUIPMENT/BOILIE"));
|
|
}
|
|
else
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("BOILIE"), Utilities.GetTranslation("HUD_CONTROLS/THROW_BOILIE"));
|
|
}
|
|
}
|
|
}
|
|
if (fishingPlayer.currentHands.baitWasThrown)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("DRAG_INC"), Utilities.GetTranslation("HUD_CONTROLS/DRAG") + "+");
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("DRAG_DEC"), Utilities.GetTranslation("HUD_CONTROLS/DRAG") + "-");
|
|
}
|
|
}
|
|
if (currentGameState == GameState.ICE_FISHING)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("STOP_FISHING"), Utilities.GetTranslation("HUD_CONTROLS/STOP_FISHING"));
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("RESET_THROW"), Utilities.GetTranslation("HUD_CONTROLS/RESET_ROD"));
|
|
if (!VRManager.Instance.IsVRReeling())
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("REEL_IN"), Utilities.GetTranslation("HUD_CONTROLS/REEL_IN"));
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("REEL_OUT"), Utilities.GetTranslation("HUD_CONTROLS/REEL_OUT"));
|
|
}
|
|
else if (VRManager.Instance.IsVRReelingGrip())
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("VR_REEL_GRIP"), Utilities.GetTranslation("VR/VR_REEL_GRIP"));
|
|
}
|
|
if (!GlobalSettings.Instance || GlobalSettings.Instance.equipmentManager.HasBoilieEquiped())
|
|
{
|
|
}
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("DRAG_INC"), Utilities.GetTranslation("HUD_CONTROLS/DRAG") + "+");
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("DRAG_DEC"), Utilities.GetTranslation("HUD_CONTROLS/DRAG") + "-");
|
|
}
|
|
if ((currentGameState == GameState.FISHING || currentGameState == GameState.ICE_FISHING) && fishingPlayer.currentHands.ThrowObjectOnWater() && fishingPlayer.underwaterCamera.HasProperHeight() && (!GlobalSettings.Instance || GlobalSettings.Instance.playerSettings.IsCasual()) && !fishingPlayer.grayscale.enabled && !fishingPlayer.currentHands.isGroundRig && !fishingPlayer.currentHands.fishingRod.isOnRodStand)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("UNDERWATER_CAMERA"), Utilities.GetTranslation("HUD_CONTROLS/CHANGE_CAMERA"));
|
|
}
|
|
if (currentGameState == GameState.FISHING_NET)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("RESET_THROW"), Utilities.GetTranslation("HUD_CONTROLS/RESET_ROD"));
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("NET_UP"), Utilities.GetTranslation("HUD_CONTROLS/NET_UP"));
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("NET_DOWN"), Utilities.GetTranslation("HUD_CONTROLS/NET_DOWN"));
|
|
}
|
|
if (currentGameState == GameState.FISHING && (bool)fishingPlayer.boatSimulator && (!fishingPlayer.currentHands.baitWasThrown || fishingPlayer.currentHands.fishingRod.isOnRodStand))
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("BOAT_DRIVE"), Utilities.GetTranslation("HUD_CONTROLS/DRIVE_BOAT"));
|
|
if (!gameController.oceanLevel)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("BOAT_EXIT"), Utilities.GetTranslation("HUD_CONTROLS/EXIT_BOAT"));
|
|
}
|
|
}
|
|
if (currentGameState == GameState.DRIVING_BOAT)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("BOAT_DRIVE_STOP"), Utilities.GetTranslation("HUD_CONTROLS/START_FISHING"));
|
|
if (!gameController.oceanLevel)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("BOAT_EXIT"), Utilities.GetTranslation("HUD_CONTROLS/EXIT_BOAT"));
|
|
}
|
|
if (fishingPlayer.boatSimulator.HasRodsOnPod())
|
|
{
|
|
}
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("VR_BOAT_THROTTLE_UP"), Utilities.GetTranslation("HUD_CONTROLS/FORWARD"));
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("VR_BOAT_THROTTLE_DOWN"), Utilities.GetTranslation("HUD_CONTROLS/BACKWARD"));
|
|
}
|
|
if ((currentGameState == GameState.DRIVING_BOAT && VRManager.Instance.IsVRDriveBoat() && !fishingPlayer.boatSimulator.isKayak) || currentGameState == GameState.ICE_FISHING)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRControllersManager.Instance.GetSecondaryController(), OVRInput.Button.PrimaryThumbstick, Utilities.GetTranslation("HUD_CONTROLS/MOVE"));
|
|
if (currentGameState == GameState.DRIVING_BOAT)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRControllersManager.Instance.GetPrimaryController(), OVRInput.Button.Up, Utilities.GetTranslation("HUD_CONTROLS/UP"));
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRControllersManager.Instance.GetPrimaryController(), OVRInput.Button.Down, Utilities.GetTranslation("HUD_CONTROLS/DOWN"));
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRControllersManager.Instance.GetPrimaryController(), OVRInput.Button.PrimaryHandTrigger, Utilities.GetTranslation("HUD_CONTROLS/HOLD"));
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRControllersManager.Instance.GetSecondaryController(), OVRInput.Button.PrimaryHandTrigger, Utilities.GetTranslation("HUD_CONTROLS/HOLD"));
|
|
}
|
|
}
|
|
if (currentGameState == GameState.NORMAL && gameController.iceLevel)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("TRY_DRILL"), Utilities.GetTranslation("HUD_CONTROLS/START_DRILL"));
|
|
}
|
|
if (currentGameState == GameState.DRILLING)
|
|
{
|
|
if (!fishingPlayer.drillingController.placeChosen)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("TRY_DRILL"), Utilities.GetTranslation("HUD_CONTROLS/STOP_DRILL"));
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("START_DRILL"), Utilities.GetTranslation("HUD_CONTROLS/START_DRILL"));
|
|
}
|
|
else
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("DRILLING"), Utilities.GetTranslation("HUD_CONTROLS/DRILLING"));
|
|
}
|
|
}
|
|
if ((bool)fishingPlayer.currentHands && (bool)FishingHands.rodStand && currentGameState == GameState.FISHING)
|
|
{
|
|
if (!FishingHands.rodStand.isBoatStand)
|
|
{
|
|
if (!FishingHands.rodStand.gameObject.activeSelf && !fishingPlayer.boatSimulator)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("ROD_STAND_PUT"), Utilities.GetTranslation("HUD_CONTROLS/ROD_POD_PUT"));
|
|
}
|
|
else if (FishingHands.rodStand.gameObject.activeSelf)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("ROD_STAND_TAKE"), Utilities.GetTranslation("HUD_CONTROLS/ROD_POD_TAKE"));
|
|
}
|
|
}
|
|
if (FishingHands.rodStand.gameObject.activeSelf && fishingPlayer.currentHands.baitWasThrown && !fishingPlayer.currentHands.fishingRod.isOnRodStand && (!fishingPlayer.fish || !fishingPlayer.fish.isJerked))
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("ROD_STAND_PUT_ROD"), Utilities.GetTranslation("HUD_CONTROLS/ROD_POD_PUT_ROD"));
|
|
}
|
|
}
|
|
if (fishingPlayer.currentState == FishingPlayer.PlayerState.WATCH_FISH || fishingPlayer.currentState == FishingPlayer.PlayerState.DEATH || fishingPlayer.isHunterVisionOn || fishingPlayer.underwaterCamera.isTurnedOn || !GlobalSettings.Instance || !GlobalSettings.Instance.skillsManager.GetSkill(SkillsManager.SkillType.HUNTER_VISION_1).isUnlocked || GlobalSettings.Instance.playerSettings.IsCasual())
|
|
{
|
|
}
|
|
if (currentGameState != GameState.ICE_FISHING)
|
|
{
|
|
}
|
|
if (currentGameState == GameState.WATCH_FISH)
|
|
{
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("TEMP_SELL"), Utilities.GetTranslation("HUD_WATCH_FISH/SELL"));
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("TEMP_RELEASE"), Utilities.GetTranslation("HUD_WATCH_FISH/RELEASE"));
|
|
VRControllersManager.Instance.UpdateButtonInfo(VRInputManager.Instance.FindAction("TEMP_KEEP"), Utilities.GetTranslation("HUD_WATCH_FISH/KEEP"));
|
|
}
|
|
}
|
|
|
|
public void UpdateControls()
|
|
{
|
|
if (fishingPlayer == null)
|
|
{
|
|
return;
|
|
}
|
|
if (VRManager.IsVROn() && (bool)VRControllersManager.Instance)
|
|
{
|
|
if (currentHudState == HUDState.GAME)
|
|
{
|
|
UpdateControlsVR();
|
|
}
|
|
return;
|
|
}
|
|
string text = string.Empty;
|
|
string text2;
|
|
if (currentGameState == GameState.NORMAL)
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetMoveControls() + " - " + Utilities.GetTranslation("HUD_CONTROLS/MOVE") + "\n";
|
|
}
|
|
if (currentGameState == GameState.FISHING)
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetMoveControls() + " - " + Utilities.GetTranslation("HUD_CONTROLS/MOVE") + "\n";
|
|
if (!fishingPlayer.currentHands.fishingRod.isOnRodStand)
|
|
{
|
|
text += "\n";
|
|
if (fishingPlayer.currentHands.baitWasThrown)
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("RESET_THROW") + " - " + Utilities.GetTranslation("HUD_CONTROLS/RESET_ROD") + "\n";
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("REEL_IN") + " - " + Utilities.GetTranslation("HUD_CONTROLS/REEL_IN") + "\n";
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("REEL_OUT") + " - " + Utilities.GetTranslation("HUD_CONTROLS/REEL_OUT") + "\n";
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("REEL_ARCH") + " - " + Utilities.GetTranslation("HUD_CONTROLS/REEL_ARCH") + "\n";
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("PUMP") + " - " + Utilities.GetTranslation("HUD_CONTROLS/JERK") + "/" + Utilities.GetTranslation("HUD_CONTROLS/PUMP") + "\n";
|
|
}
|
|
else
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("THROW_FAR") + " - " + Utilities.GetTranslation("HUD_CONTROLS/THROW_BAIT") + "\n";
|
|
if (fishingPlayer.fishingController.canThrowNear)
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("THROW_NEAR") + " - " + Utilities.GetTranslation("HUD_CONTROLS/THROW_NEAR") + "\n";
|
|
}
|
|
if (!GlobalSettings.Instance || GlobalSettings.Instance.equipmentManager.HasBoilieEquiped())
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("BOILIE") + " - " + Utilities.GetTranslation("HUD_CONTROLS/THROW_BOILIE") + "\n";
|
|
}
|
|
}
|
|
if (fishingPlayer.currentHands.baitWasThrown)
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("REEL_INC") + "/" + UtilitiesInput.GetActionKeyName("REEL_DEC") + " - " + Utilities.GetTranslation("HUD_CONTROLS/REEL_SPEED") + "\n";
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("DRAG_CHANGE") + " - " + Utilities.GetTranslation("HUD_CONTROLS/DRAG") + "\n";
|
|
}
|
|
}
|
|
}
|
|
if (currentGameState == GameState.ICE_FISHING)
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("STOP_FISHING") + " - " + Utilities.GetTranslation("HUD_CONTROLS/STOP_FISHING") + "\n";
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("RESET_THROW") + " - " + Utilities.GetTranslation("HUD_CONTROLS/RESET_ROD") + "\n";
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("REEL_IN") + " - " + Utilities.GetTranslation("HUD_CONTROLS/REEL_IN") + "\n";
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("REEL_OUT") + " - " + Utilities.GetTranslation("HUD_CONTROLS/REEL_OUT") + "\n";
|
|
if (!GlobalSettings.Instance || GlobalSettings.Instance.equipmentManager.HasBoilieEquiped())
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("BOILIE") + " - " + Utilities.GetTranslation("HUD_CONTROLS/THROW_BOILIE") + "\n";
|
|
}
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("REEL_INC") + "/" + UtilitiesInput.GetActionKeyName("REEL_DEC") + " - " + Utilities.GetTranslation("HUD_CONTROLS/REEL_SPEED") + "\n";
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("DRAG_CHANGE") + " - " + Utilities.GetTranslation("HUD_CONTROLS/DRAG") + "\n";
|
|
}
|
|
if ((currentGameState == GameState.FISHING || currentGameState == GameState.ICE_FISHING) && fishingPlayer.currentHands.ThrowObjectOnWater() && fishingPlayer.underwaterCamera.HasProperHeight() && (!GlobalSettings.Instance || GlobalSettings.Instance.playerSettings.IsCasual()) && !fishingPlayer.grayscale.enabled && !fishingPlayer.currentHands.isGroundRig && !fishingPlayer.currentHands.fishingRod.isOnRodStand)
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("UNDERWATER_CAMERA") + " - " + Utilities.GetTranslation("HUD_CONTROLS/CHANGE_CAMERA") + "\n";
|
|
}
|
|
if (currentGameState == GameState.FISHING_NET)
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetMoveControls() + " - " + Utilities.GetTranslation("HUD_CONTROLS/MOVE_NET") + "\n";
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("NET_UP") + "/" + UtilitiesInput.GetActionKeyName("NET_DOWN") + " - " + Utilities.GetTranslation("HUD_CONTROLS/MOVE_NET_UPDOWN") + "\n";
|
|
text += "\n";
|
|
}
|
|
if (currentGameState == GameState.FISHING && (bool)fishingPlayer.boatSimulator && (!fishingPlayer.currentHands.baitWasThrown || fishingPlayer.currentHands.fishingRod.isOnRodStand))
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("BOAT_DRIVE") + " - " + Utilities.GetTranslation("HUD_CONTROLS/DRIVE_BOAT") + "\n";
|
|
if (!gameController.oceanLevel)
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("BOAT_EXIT") + " - " + Utilities.GetTranslation("HUD_CONTROLS/EXIT_BOAT") + "\n";
|
|
}
|
|
}
|
|
if (currentGameState == GameState.DRIVING_BOAT)
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetMoveControls() + " - " + Utilities.GetTranslation("HUD_CONTROLS/DRIVE_BOAT") + "\n";
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("BOAT_DRIVE") + " - " + Utilities.GetTranslation("HUD_CONTROLS/START_FISHING") + "\n";
|
|
if (!gameController.oceanLevel)
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("BOAT_EXIT") + " - " + Utilities.GetTranslation("HUD_CONTROLS/EXIT_BOAT") + "\n";
|
|
}
|
|
if (fishingPlayer.boatSimulator.HasRodsOnPod())
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("RUN") + " - " + Utilities.GetTranslation("HUD_CONTROLS/SPEED_UP_BOAT") + "\n";
|
|
}
|
|
text += "\n";
|
|
}
|
|
if (currentGameState == GameState.NORMAL && gameController.iceLevel)
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("TRY_DRILL") + " - " + Utilities.GetTranslation("HUD_CONTROLS/START_DRILL") + "\n";
|
|
}
|
|
if (currentGameState == GameState.DRILLING && !fishingPlayer.drillingController.placeChosen)
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("TRY_DRILL") + " - " + Utilities.GetTranslation("HUD_CONTROLS/STOP_DRILL") + "\n";
|
|
}
|
|
if (currentGameState == GameState.ATTRACTOR)
|
|
{
|
|
}
|
|
if ((bool)fishingPlayer.currentHands && (bool)FishingHands.rodStand && currentGameState == GameState.FISHING)
|
|
{
|
|
if (!FishingHands.rodStand.isBoatStand)
|
|
{
|
|
text += "\n";
|
|
if (!FishingHands.rodStand.gameObject.activeSelf && !fishingPlayer.boatSimulator)
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("ROD_STAND_PUT") + " - " + Utilities.GetTranslation("HUD_CONTROLS/ROD_POD_PUT") + "\n";
|
|
}
|
|
else if (FishingHands.rodStand.gameObject.activeSelf)
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("ROD_STAND_TAKE") + " - " + Utilities.GetTranslation("HUD_CONTROLS/ROD_POD_TAKE") + "\n";
|
|
}
|
|
}
|
|
if (FishingHands.rodStand.gameObject.activeSelf && fishingPlayer.currentHands.baitWasThrown && !fishingPlayer.currentHands.fishingRod.isOnRodStand && (!fishingPlayer.fish || !fishingPlayer.fish.isJerked))
|
|
{
|
|
if (FishingHands.rodStand.isBoatStand)
|
|
{
|
|
text += "\n";
|
|
}
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("ROD_STAND_PUT_ROD") + " - " + Utilities.GetTranslation("HUD_CONTROLS/ROD_POD_PUT_ROD") + "\n";
|
|
}
|
|
text += "\n";
|
|
}
|
|
if (fishingPlayer.currentState != FishingPlayer.PlayerState.WATCH_FISH && fishingPlayer.currentState != FishingPlayer.PlayerState.DEATH && !fishingPlayer.isHunterVisionOn && !fishingPlayer.underwaterCamera.isTurnedOn && (!GlobalSettings.Instance || ((bool)GlobalSettings.Instance.skillsManager.GetSkill(SkillsManager.SkillType.HUNTER_VISION_1).isUnlocked && GlobalSettings.Instance.playerSettings.IsCasual())))
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("HUNTER_VISION") + " - " + Utilities.GetTranslation("HUD_CONTROLS/HUNTER_VISION") + "\n";
|
|
}
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("FLASHLIGHT") + " - " + Utilities.GetTranslation("HUD_CONTROLS/FLASHLIGHT") + "\n";
|
|
if (currentGameState != GameState.ICE_FISHING)
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("ZOOM") + " - " + Utilities.GetTranslation("HUD_CONTROLS/ZOOM") + "\n";
|
|
}
|
|
text += "\n";
|
|
if ((currentGameState == GameState.FISHING || currentGameState == GameState.ICE_FISHING) && !fishingPlayer.currentHands.baitWasThrown)
|
|
{
|
|
text = text + UtilitiesInput.GetActionKeyName("EQUIPMENT_SET_1") + ", ";
|
|
text = text + UtilitiesInput.GetActionKeyName("EQUIPMENT_SET_2") + ", ";
|
|
text = text + UtilitiesInput.GetActionKeyName("EQUIPMENT_SET_3") + ", ";
|
|
text = text + UtilitiesInput.GetActionKeyName("EQUIPMENT_SET_4") + ", ";
|
|
text += UtilitiesInput.GetActionKeyName("EQUIPMENT_SET_5");
|
|
text = text + " - " + Utilities.GetTranslation("GUI_HEADERS/EQUIPMENT").ToLower() + "\n";
|
|
}
|
|
if (!gameController.isTournament || !gameController.tournamentManager.tournamentActive)
|
|
{
|
|
text = text + "Ctrl + </> - " + Utilities.GetTranslation("HUD_CONTROLS/CHANGE_HOUR") + "\n";
|
|
}
|
|
if (!gameController.isTournament || !gameController.tournamentManager.tournamentActive)
|
|
{
|
|
text2 = text;
|
|
text = text2 + UtilitiesInput.GetActionKeyName("FREEZE_GAME") + " - " + Utilities.GetTranslation("GUI_HEADERS/PAUSE").ToLower() + "\n";
|
|
}
|
|
if (!gameController.oceanLevel && !fishingPlayer.boatSimulator && (currentGameState == GameState.NORMAL || currentGameState == GameState.FISHING))
|
|
{
|
|
text = text + "F9 - " + Utilities.GetTranslation("HUD_CONTROLS/RESET_PLAYER") + "\n";
|
|
}
|
|
text = text + "F5 - " + Utilities.GetTranslation("GUI/REPORT_BUG").ToLower();
|
|
if (GlobalSettings.Instance == null || ((bool)GlobalSettings.Instance && GlobalSettings.Instance.turnOnCheats))
|
|
{
|
|
text += "\nF11 - show/hide fish indicators";
|
|
}
|
|
infoText.text = text;
|
|
UpdateInfoSize();
|
|
LeanTween.delayedCall(0.1f, (Action)delegate
|
|
{
|
|
UpdateInfoSize();
|
|
});
|
|
}
|
|
|
|
public void UpdateInfoSize()
|
|
{
|
|
if (!(infoText == null))
|
|
{
|
|
infoBackground.rectTransform.sizeDelta = new Vector2(infoText.preferredWidth + 14f, infoText.preferredHeight + 11f);
|
|
infoBackgroundHide.rectTransform.sizeDelta = new Vector2(infoBackground.rectTransform.sizeDelta.x, infoBackgroundHide.rectTransform.sizeDelta.y);
|
|
infoHide.rectTransform.sizeDelta = new Vector2(infoBackground.rectTransform.sizeDelta.x - 7f, infoHide.rectTransform.sizeDelta.y);
|
|
}
|
|
}
|
|
|
|
public void InitializeVR()
|
|
{
|
|
if (!VRManager.IsVROn())
|
|
{
|
|
return;
|
|
}
|
|
guiCamera.gameObject.SetActive(false);
|
|
RectTransform rectTransform = null;
|
|
hudCanvas.GetComponent<CanvasScaler>().dynamicPixelsPerUnit = 5f;
|
|
infoCanvas.GetComponent<CanvasScaler>().dynamicPixelsPerUnit = 3f;
|
|
vrQuickMenuCanvas.GetComponent<CanvasScaler>().dynamicPixelsPerUnit = 3f;
|
|
hudMultiplayer.GetComponent<CanvasScaler>().dynamicPixelsPerUnit = 2f;
|
|
tournamentCanvas.GetComponent<CanvasScaler>().dynamicPixelsPerUnit = 2f;
|
|
fishingCanvas.GetComponent<CanvasScaler>().dynamicPixelsPerUnit = 2f;
|
|
base.transform.parent = fishingPlayer.vrHUDParent;
|
|
base.transform.localPosition = new Vector3(0f, 1.8f, 0.9f);
|
|
base.transform.localRotation = Quaternion.identity;
|
|
base.transform.localScale = Vector3.one * 0.002f;
|
|
hudWeather.localScale = Vector3.one * 1.25f;
|
|
hudWeather.transform.localPosition = new Vector3(0f, 255f, 0f);
|
|
hudWeather.transform.localEulerAngles = new Vector3(-25f, 0f, 0f);
|
|
rectTransform = hudBaits.GetComponent<RectTransform>();
|
|
RectTransform rectTransform2 = rectTransform;
|
|
Vector2 vector = (rectTransform.anchorMax = new Vector2(0.5f, 0.5f));
|
|
vector = (rectTransform.anchorMin = vector);
|
|
rectTransform2.pivot = vector;
|
|
rectTransform.localScale = Vector3.one * 2f;
|
|
rectTransform.localPosition = new Vector3(330f, 240f, -60f);
|
|
rectTransform.localEulerAngles = new Vector3(-15f, 20f, 0f);
|
|
hudFloatWidget.transform.parent = hudFloatWidget.transform.parent.parent;
|
|
RectTransform rectTransform3 = hudFloatWidget;
|
|
vector = new Vector2(0.5f, 0.5f);
|
|
hudFloatWidget.anchorMax = vector;
|
|
vector = vector;
|
|
hudFloatWidget.anchorMin = vector;
|
|
rectTransform3.pivot = vector;
|
|
hudFloatWidget.localScale = Vector3.one;
|
|
hudFloatWidget.localPosition = new Vector3(210f, 0f, 0f);
|
|
hudFloatWidget.localEulerAngles = new Vector3(0f, 20f, 0f);
|
|
RectTransform rectTransform4 = hudFishingWidget;
|
|
vector = new Vector2(0.5f, 0.5f);
|
|
hudFishingWidget.anchorMax = vector;
|
|
vector = vector;
|
|
hudFishingWidget.anchorMin = vector;
|
|
rectTransform4.pivot = vector;
|
|
rectTransform = hudTournament.GetComponent<RectTransform>();
|
|
RectTransform rectTransform5 = rectTransform;
|
|
vector = (rectTransform.anchorMax = new Vector2(0.5f, 0.5f));
|
|
vector = (rectTransform.anchorMin = vector);
|
|
rectTransform5.pivot = vector;
|
|
rectTransform.localScale = Vector3.one * 1.3f;
|
|
rectTransform.localPosition = new Vector3(-500f, -40f, -50f);
|
|
rectTransform.localEulerAngles = new Vector3(0f, -35f, 0f);
|
|
rectTransform = minimapGui.GetComponent<RectTransform>();
|
|
RectTransform rectTransform6 = rectTransform;
|
|
vector = (rectTransform.anchorMax = new Vector2(0.5f, 0.5f));
|
|
vector = (rectTransform.anchorMin = vector);
|
|
rectTransform6.pivot = vector;
|
|
rectTransform.localScale = Vector3.one * 1f;
|
|
rectTransform.localPosition = new Vector3(200f, -50f, 0f);
|
|
rectTransform.localEulerAngles = new Vector3(0f, 15f, 0f);
|
|
rectTransform = hudMultiplayer.chatParent.GetComponent<RectTransform>();
|
|
RectTransform rectTransform7 = rectTransform;
|
|
vector = (rectTransform.anchorMax = new Vector2(0.5f, 0.5f));
|
|
vector = (rectTransform.anchorMin = vector);
|
|
rectTransform7.pivot = vector;
|
|
rectTransform.localScale = Vector3.one * 1.4f;
|
|
rectTransform.localPosition = new Vector3(-520f, 150f, -200f);
|
|
rectTransform.localEulerAngles = new Vector3(-15f, -45f, 0f);
|
|
rectTransform = hudMultiplayer.steamUserWidget.transform.parent.GetComponent<RectTransform>();
|
|
RectTransform rectTransform8 = rectTransform;
|
|
vector = (rectTransform.anchorMax = new Vector2(0.5f, 0.5f));
|
|
vector = (rectTransform.anchorMin = vector);
|
|
rectTransform8.pivot = vector;
|
|
rectTransform.localScale = Vector3.one * 0.8f;
|
|
rectTransform.localPosition = new Vector3(75f, -100f, 0f);
|
|
rectTransform.localEulerAngles = new Vector3(0f, 0f, 0f);
|
|
rectTransform = hudFishing.throwStrengthBar.transform.parent.GetComponent<RectTransform>();
|
|
RectTransform rectTransform9 = rectTransform;
|
|
vector = (rectTransform.anchorMax = new Vector2(0.5f, 0.5f));
|
|
vector = (rectTransform.anchorMin = vector);
|
|
rectTransform9.pivot = vector;
|
|
rectTransform.localScale = Vector3.one;
|
|
rectTransform.localPosition = new Vector3(-0.4f, -270f, -50f);
|
|
rectTransform.localEulerAngles = new Vector3(40f, 0f, 0f);
|
|
rectTransform = hudFishing.tensionEnergyBar.transform.parent.GetComponent<RectTransform>();
|
|
RectTransform rectTransform10 = rectTransform;
|
|
vector = (rectTransform.anchorMax = new Vector2(0.5f, 0.5f));
|
|
vector = (rectTransform.anchorMin = vector);
|
|
rectTransform10.pivot = vector;
|
|
rectTransform.localScale = new Vector3(0.52f, 0.77f, 0.62f);
|
|
rectTransform.localPosition = new Vector3(0f, -295f, -72f);
|
|
rectTransform.localEulerAngles = new Vector3(40f, 0f, 0f);
|
|
rectTransform = hudFishing.tensionEnergyBarGauge.transform.parent.GetComponent<RectTransform>();
|
|
RectTransform rectTransform11 = rectTransform;
|
|
vector = (rectTransform.anchorMax = new Vector2(0.5f, 0.5f));
|
|
vector = (rectTransform.anchorMin = vector);
|
|
rectTransform11.pivot = vector;
|
|
rectTransform.localScale = Vector3.one * 0.75f;
|
|
rectTransform.localPosition = new Vector3(0f, -298f, -72f);
|
|
rectTransform.localEulerAngles = new Vector3(40f, 0f, 0f);
|
|
rectTransform = hudFishing.tensionEnergyBarGaugeShort.transform.parent.GetComponent<RectTransform>();
|
|
RectTransform rectTransform12 = rectTransform;
|
|
vector = (rectTransform.anchorMax = new Vector2(0.5f, 0.5f));
|
|
vector = (rectTransform.anchorMin = vector);
|
|
rectTransform12.pivot = vector;
|
|
rectTransform.localScale = Vector3.one * 0.5f;
|
|
rectTransform.localPosition = new Vector3(0f, -283f, -60f);
|
|
rectTransform.localEulerAngles = new Vector3(40f, 0f, 0f);
|
|
rectTransform = hudFishingWidget.transform.parent.GetComponent<RectTransform>();
|
|
RectTransform rectTransform13 = rectTransform;
|
|
vector = (rectTransform.anchorMax = new Vector2(0.5f, 0.5f));
|
|
vector = (rectTransform.anchorMin = vector);
|
|
rectTransform13.pivot = vector;
|
|
rectTransform.localPosition = new Vector3(0f, -180f, 0f);
|
|
rectTransform = hudFishingWidget.GetComponent<RectTransform>();
|
|
RectTransform rectTransform14 = rectTransform;
|
|
vector = (rectTransform.anchorMax = new Vector2(0.5f, 0.5f));
|
|
vector = (rectTransform.anchorMin = vector);
|
|
rectTransform14.pivot = vector;
|
|
rectTransform.localScale = Vector3.one * 0.7f;
|
|
rectTransform.localPosition = new Vector3(30f, -55f, -20f);
|
|
rectTransform.localEulerAngles = new Vector3(40f, 0f, 0f);
|
|
rectTransform = fishingMessageText.transform.parent.GetComponent<RectTransform>();
|
|
RectTransform rectTransform15 = rectTransform;
|
|
vector = (rectTransform.anchorMax = new Vector2(0.5f, 0.5f));
|
|
vector = (rectTransform.anchorMin = vector);
|
|
rectTransform15.pivot = vector;
|
|
rectTransform.localScale = Vector3.one * 1f;
|
|
rectTransform.localPosition = new Vector3(0f, -120f, 0f);
|
|
Canvas[] componentsInChildren = GetComponentsInChildren<Canvas>(true);
|
|
for (int i = 0; i < componentsInChildren.Length; i++)
|
|
{
|
|
componentsInChildren[i].renderMode = RenderMode.WorldSpace;
|
|
componentsInChildren[i].worldCamera = VRManager.Instance.eyeCenterTransform.GetComponent<Camera>();
|
|
rectTransform = componentsInChildren[i].GetComponent<RectTransform>();
|
|
rectTransform.anchoredPosition3D = Vector3.zero;
|
|
rectTransform.localRotation = Quaternion.identity;
|
|
OVRRaycaster oVRRaycaster = componentsInChildren[i].gameObject.AddComponent<OVRRaycaster>();
|
|
oVRRaycaster.pointer = VRManager.Instance.gazeInputParent.GetComponentInChildren<OVRGazePointer>(true).gameObject;
|
|
if (componentsInChildren[i] == vrQuickMenuCanvas)
|
|
{
|
|
oVRRaycaster.sortOrder = 10;
|
|
}
|
|
}
|
|
if ((bool)MapController.Instance)
|
|
{
|
|
Canvas component = MapController.Instance.GetComponent<Canvas>();
|
|
component.renderMode = RenderMode.WorldSpace;
|
|
component.worldCamera = VRManager.Instance.eyeCenterTransform.GetComponent<Camera>();
|
|
rectTransform = component.GetComponent<RectTransform>();
|
|
rectTransform.anchoredPosition3D = Vector3.zero;
|
|
rectTransform.localRotation = Quaternion.identity;
|
|
rectTransform.localScale = Vector3.one * 0.005f;
|
|
component.gameObject.AddComponent<OVRRaycaster>();
|
|
}
|
|
infoBackgroundHide.gameObject.SetActive(false);
|
|
VRManager.Instance.SetHUDSize(VRManager.Instance.hudSize, true);
|
|
}
|
|
|
|
public void ShowVRQuickMenu(bool show)
|
|
{
|
|
if ((bool)fishingPlayer)
|
|
{
|
|
fishingPlayer.vrPlayertUIInput.TurnOnUIController(show);
|
|
}
|
|
vrQuickMenuCanvas.gameObject.SetActive(show);
|
|
}
|
|
|
|
public void RecenterHUD()
|
|
{
|
|
base.transform.parent.eulerAngles = new Vector3(base.transform.parent.eulerAngles.x, fishingPlayer.ufpsCamera.transform.eulerAngles.y, base.transform.parent.eulerAngles.z);
|
|
}
|
|
}
|