using UnityEngine; using UnityEngine.UI; public class HelpNotifications : MonoBehaviour { public Text textContent; public string[] contentStageLanguageKey; private Image bgImage; private int currentIndexOfContent; private void Start() { bgImage = GetComponent(); } private void FixedUpdate() { if ((bool)FScriptsHandler.Instance.m_PlayerMain.currentRod) { currentIndexOfContent = 1; if ((bool)FScriptsHandler.Instance.m_PlayerMain.currentRod.fishingLine.currentLineHandler) { if ((bool)FScriptsHandler.Instance.m_PlayerMain.currentRod.LureHookWaterDisplacement) { if (FScriptsHandler.Instance.m_PlayerMain.currentRod.LureHookWaterDisplacement.IsInWater && FScriptsHandler.Instance.m_PlayerMain.currentRod.fishingLine.currentLineHandler.PhisicsLineOut > 5f) { currentIndexOfContent = 2; } } else { currentIndexOfContent = 6; } if ((bool)FScriptsHandler.Instance.m_PlayerMain.currentRod.takeFish) { currentIndexOfContent = 3; } if ((bool)FScriptsHandler.Instance.m_PlayerMain.currentRod.currentFish && FScriptsHandler.Instance.m_PlayerMain.currentRod.fishingLine.currentLineHandler.PhisicsLineOut == 0f) { currentIndexOfContent = 4; } if ((bool)FScriptsHandler.Instance.m_PlayerMain.currentRod.currentFish && FScriptsHandler.Instance.m_PlayerMain.currentRod.currentFish.isGetFish) { currentIndexOfContent = 5; } } } ShowHideContent(currentIndexOfContent); } private void ShowHideContent(int index = -1) { if (index == -1) { textContent.enabled = false; bgImage.enabled = false; } else { textContent.enabled = true; bgImage.enabled = true; textContent.text = LanguageManager.Instance.GetText(contentStageLanguageKey[index]); } } }