51 lines
1.9 KiB
C#
51 lines
1.9 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class TutorialCurrentObjective : MonoBehaviour
|
|
{
|
|
public Text titleText;
|
|
|
|
public Text descText;
|
|
|
|
private string lastLang;
|
|
|
|
private int lastLection;
|
|
|
|
private void Start()
|
|
{
|
|
lastLang = LanguageManager.Instance.currentLanguage;
|
|
lastLection = TutorialManager.Instance.acctualLessonIndex;
|
|
if (GameManager.Instance.controllerType == GameManager.ControllerType.GamePad)
|
|
{
|
|
SetCurrentObjectiveText(TutorialManager.Instance.lekcje[TutorialManager.Instance.acctualLessonIndex].GamePadtitleTranslateKey, TutorialManager.Instance.lekcje[TutorialManager.Instance.acctualLessonIndex].GamePadcontentTranslateKey);
|
|
}
|
|
else
|
|
{
|
|
SetCurrentObjectiveText(TutorialManager.Instance.lekcje[TutorialManager.Instance.acctualLessonIndex].titleTranslateKey, TutorialManager.Instance.lekcje[TutorialManager.Instance.acctualLessonIndex].contentTranslateKey);
|
|
}
|
|
}
|
|
|
|
public void SetCurrentObjectiveText(string titleKey, string contentKey)
|
|
{
|
|
titleText.text = LanguageManager.Instance.GetText(titleKey);
|
|
descText.text = LanguageManager.Instance.GetText(contentKey);
|
|
}
|
|
|
|
private void FixedUpdate()
|
|
{
|
|
if (lastLang != LanguageManager.Instance.currentLanguage || lastLection != TutorialManager.Instance.acctualLessonIndex)
|
|
{
|
|
if (GameManager.Instance.controllerType == GameManager.ControllerType.GamePad)
|
|
{
|
|
SetCurrentObjectiveText(TutorialManager.Instance.lekcje[TutorialManager.Instance.acctualLessonIndex].GamePadtitleTranslateKey, TutorialManager.Instance.lekcje[TutorialManager.Instance.acctualLessonIndex].GamePadcontentTranslateKey);
|
|
}
|
|
else
|
|
{
|
|
SetCurrentObjectiveText(TutorialManager.Instance.lekcje[TutorialManager.Instance.acctualLessonIndex].titleTranslateKey, TutorialManager.Instance.lekcje[TutorialManager.Instance.acctualLessonIndex].contentTranslateKey);
|
|
}
|
|
lastLang = LanguageManager.Instance.currentLanguage;
|
|
lastLection = TutorialManager.Instance.acctualLessonIndex;
|
|
}
|
|
}
|
|
}
|