Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.EventSystems;
- using UnityEngine.UI;
- public class MenuController : MonoBehaviour
- {
- [SerializeField] Button[] menuButtons;
- // [SerializeField] List<TextSlot> theButtons = new List<TextSlot>();
- [SerializeField] BattleSystem BS;
- [SerializeField] GameObject beastUI;
- private void Start()
- {
- ButtonInit();
- }
- private void Update()
- {
- }
- void ButtonInit()
- {
- Enter();
- menuButtons[0].onClick.AddListener(() =>
- {
- Debug.Log("Party clicked");
- StartCoroutine(BS.GoToPartyState());
- });
- menuButtons[1].onClick.AddListener(() => {
- Debug.Log("item clicked");
- StartCoroutine(BS.GoToInventoryState());
- });
- menuButtons[3].onClick.AddListener(() => {
- });
- menuButtons[4].onClick.AddListener(() => {
- });
- }
- public void Enter(int currentButton = 0)
- {
- EventSystem.current.SetSelectedGameObject(menuButtons[currentButton].gameObject);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement