Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class BattleDialogueBox : MonoBehaviour
- {
- [SerializeField] GameObject actionSelector, magicSelector, magicDetails;
- [SerializeField] List<Text> actionText, magicText;
- [SerializeField] Text MPText;
- [SerializeField] Color highlightedColor;
- public void EnableActionSelector(bool enabled)
- {
- actionSelector.SetActive(enabled);
- }
- public void EnableMagicSelector(bool enabled)
- {
- magicSelector.SetActive(enabled);
- magicDetails.SetActive(enabled);
- }
- public void UpdateMagicSelection(int selectedSpell, Move move)
- {
- for(int i = 0; i < magicText.Count; ++i)
- {
- if (i == selectedSpell)
- actionText[i].color = highlightedColor;
- else
- actionText[i].color = Color.black;
- MPText.text = $"MP { move.MP}/{ move.Base.Mp}";
- }
- }
- public void UpdateActionSelection(int selectedAction)
- {
- for(int i = 0; i < actionText.Count; ++i)
- {
- if(i == selectedAction)
- actionText[i].color = highlightedColor;
- else
- actionText[i].color = Color.black;
- }
- }
- public void SetMagicNames(List<Move> moves)
- {
- for (int i = 0; i < magicText.Count; ++i)
- {
- if (i < moves.Count)
- magicText[i].text = moves[i].Base.Name;
- else
- magicText[i].text = "";
- }
- }
- }
Add Comment
Please, Sign In to add comment