You've already forked Darklings-FightingGame
mirror of
https://github.com/izzy2lost/Darklings-FightingGame.git
synced 2026-03-10 11:35:19 -07:00
100 lines
2.5 KiB
C#
100 lines
2.5 KiB
C#
using Demonics.UI;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.Video;
|
|
|
|
public class CommandListMenu : BaseMenu
|
|
{
|
|
[SerializeField] private TextMeshProUGUI _characterText = default;
|
|
[SerializeField] private TextMeshProUGUI _descriptionText = default;
|
|
[SerializeField] private VideoPlayer _showcaseVideo = default;
|
|
[SerializeField] private PauseMenu _pauseMenu = default;
|
|
[SerializeField] private CommandListButton[] _commandListButtons = default;
|
|
[SerializeField] private GameObject _knockdownImage = default;
|
|
[SerializeField] private GameObject _reversalImage = default;
|
|
[SerializeField] private GameObject _projectileImage = default;
|
|
|
|
private Player _playerOne;
|
|
private Player _playerTwo;
|
|
private Player _currentlyDisplayedPlayer;
|
|
|
|
|
|
void Awake()
|
|
{
|
|
_playerOne = GameManager.Instance.PlayerOne;
|
|
_playerTwo = GameManager.Instance.PlayerTwo;
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
if (Input.GetButtonDown(_pauseMenu.PauseControllerType + "UILeft")
|
|
|| Input.GetButtonDown(_pauseMenu.PauseControllerType + "UIRight"))
|
|
{
|
|
if (_playerOne == _currentlyDisplayedPlayer)
|
|
{
|
|
_currentlyDisplayedPlayer = _playerTwo;
|
|
}
|
|
else
|
|
{
|
|
_currentlyDisplayedPlayer = _playerOne;
|
|
}
|
|
SetCommandListData(_currentlyDisplayedPlayer.PlayerStats);
|
|
EventSystem.current.SetSelectedGameObject(null);
|
|
_startingOption.Select();
|
|
}
|
|
}
|
|
|
|
private void SetCommandListData(PlayerStatsSO playerStats)
|
|
{
|
|
_characterText.text = playerStats.characterName.ToString();
|
|
_commandListButtons[0].SetData(playerStats.m5Arcana);
|
|
_commandListButtons[1].SetData(playerStats.m2Arcana);
|
|
if (playerStats.jArcana != null)
|
|
{
|
|
_commandListButtons[2].SetData(playerStats.jArcana);
|
|
_commandListButtons[2].gameObject.SetActive(true);
|
|
}
|
|
else
|
|
{
|
|
_commandListButtons[2].gameObject.SetActive(false);
|
|
}
|
|
}
|
|
|
|
public void SetCommandListShowcase(ArcanaSO command)
|
|
{
|
|
_descriptionText.text = command.arcanaDescription;
|
|
_showcaseVideo.clip = command.arcanaVideo;
|
|
_showcaseVideo.Stop();
|
|
_showcaseVideo.Play();
|
|
_reversalImage.SetActive(false);
|
|
_knockdownImage.SetActive(false);
|
|
_projectileImage.SetActive(false);
|
|
if (command.reversal)
|
|
{
|
|
_reversalImage.SetActive(true);
|
|
}
|
|
if (command.causesKnockdown)
|
|
{
|
|
_knockdownImage.SetActive(true);
|
|
}
|
|
if (command.isProjectile)
|
|
{
|
|
_projectileImage.SetActive(true);
|
|
}
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
if (_pauseMenu.PlayerOnePaused)
|
|
{
|
|
_currentlyDisplayedPlayer = _playerOne;
|
|
}
|
|
else
|
|
{
|
|
_currentlyDisplayedPlayer = _playerTwo;
|
|
}
|
|
SetCommandListData(_currentlyDisplayedPlayer.PlayerStats);
|
|
}
|
|
}
|