Added color selection to P v AI mode.
This commit is contained in:
parent
45699adcc8
commit
9afdacde72
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -4,10 +4,18 @@ using UnityEngine.UI;
|
||||
|
||||
public class PvAIModePopup : PopupBase
|
||||
{
|
||||
[Header("Buttons")]
|
||||
[Header("Bot Selection Buttons")]
|
||||
[SerializeField] private Button twoPlayerBtn;
|
||||
[SerializeField] private Button threePlayerBtn;
|
||||
[SerializeField] private Button fourPlayerBtn;
|
||||
|
||||
[Header("Color Selection Buttons")]
|
||||
[SerializeField] private Button redBtn;
|
||||
[SerializeField] private Button blueBtn;
|
||||
[SerializeField] private Button greyBtn;
|
||||
[SerializeField] private Button greenBtn;
|
||||
|
||||
[Header("Action Buttons")]
|
||||
[SerializeField] private Button playBtn;
|
||||
[SerializeField] private Button closeBtn;
|
||||
|
||||
@ -32,6 +40,13 @@ public class PvAIModePopup : PopupBase
|
||||
fourPlayerBtn.onClick.AddListener(() => OnPlayerCountSelected(4));
|
||||
playBtn.onClick.AddListener(OnClick_PlayButton);
|
||||
closeBtn.onClick.AddListener(OnClick_CloseButton);
|
||||
redBtn.onClick.AddListener(() => OnColorSelected(PlayerType.Player1));
|
||||
blueBtn.onClick.AddListener(() => OnColorSelected(PlayerType.Player2));
|
||||
greyBtn.onClick.AddListener(() => OnColorSelected(PlayerType.Player3));
|
||||
greenBtn.onClick.AddListener(() => OnColorSelected(PlayerType.Player4));
|
||||
|
||||
redBtn.Select();
|
||||
twoPlayerBtn.Select();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
@ -72,4 +87,9 @@ public class PvAIModePopup : PopupBase
|
||||
soundManager?.PlayGameSoundClip(SoundType.ButtonClick);
|
||||
Hide();
|
||||
}
|
||||
|
||||
public void OnColorSelected(PlayerType type)
|
||||
{
|
||||
playerType = type;
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,6 +58,11 @@ public class PvPModePopup : PopupBase
|
||||
switchBtn.onClick.AddListener(OnClick_SwitchBtn);
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
OnClick_FourPlayerBtn();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
twoPlayerBtn.onClick.RemoveListener(OnClick_TwoPlayerBtn);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user