2022-07-07 18:35:18 +03:00
|
|
|
using TMPro;
|
|
|
|
|
using UnityEngine;
|
2022-07-08 19:33:58 +03:00
|
|
|
using UnityEngine.UI;
|
2022-07-07 18:35:18 +03:00
|
|
|
|
|
|
|
|
public class CommandListButton : MonoBehaviour
|
|
|
|
|
{
|
2022-09-25 16:08:45 +03:00
|
|
|
[SerializeField] private CommandListMenu _commandListMenu = default;
|
|
|
|
|
[SerializeField] private TextMeshProUGUI _commandName = default;
|
|
|
|
|
[SerializeField] private Image _knockdownImage = default;
|
|
|
|
|
[SerializeField] private Image _reversalImage = default;
|
|
|
|
|
[SerializeField] private Image _projectileImage = default;
|
2022-07-08 19:33:58 +03:00
|
|
|
|
2022-09-25 16:08:45 +03:00
|
|
|
private ArcanaSO _arcanaCommand;
|
|
|
|
|
private AttackSO _attackCommand;
|
2022-07-07 18:35:18 +03:00
|
|
|
|
|
|
|
|
|
2022-09-25 16:08:45 +03:00
|
|
|
public void SetData(ArcanaSO command)
|
|
|
|
|
{
|
|
|
|
|
_arcanaCommand = command;
|
|
|
|
|
_commandName.text = _arcanaCommand.moveName;
|
|
|
|
|
_reversalImage.gameObject.SetActive(false);
|
|
|
|
|
_knockdownImage.gameObject.SetActive(false);
|
|
|
|
|
_projectileImage.gameObject.SetActive(false);
|
|
|
|
|
if (_arcanaCommand.reversal)
|
|
|
|
|
_reversalImage.gameObject.SetActive(true);
|
|
|
|
|
if (_arcanaCommand.causesKnockdown)
|
|
|
|
|
_knockdownImage.gameObject.SetActive(true);
|
|
|
|
|
if (_arcanaCommand.isProjectile)
|
|
|
|
|
_projectileImage.gameObject.SetActive(true);
|
|
|
|
|
}
|
2022-07-08 00:20:48 +03:00
|
|
|
|
2022-09-25 16:08:45 +03:00
|
|
|
public void SetData(AttackSO command)
|
|
|
|
|
{
|
|
|
|
|
_attackCommand = command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateShowcase()
|
|
|
|
|
{
|
2023-11-03 13:45:29 +02:00
|
|
|
if (_arcanaCommand)
|
|
|
|
|
_commandListMenu.SetCommandListShowcase(_arcanaCommand);
|
2022-09-25 16:08:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateShowcaseNormal()
|
|
|
|
|
{
|
|
|
|
|
_commandListMenu.SetCommandListShowcase(_attackCommand);
|
|
|
|
|
}
|
2022-07-07 18:35:18 +03:00
|
|
|
}
|