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
|
public class PvAIModePopup : PopupBase
|
||||||
{
|
{
|
||||||
[Header("Buttons")]
|
[Header("Bot Selection Buttons")]
|
||||||
[SerializeField] private Button twoPlayerBtn;
|
[SerializeField] private Button twoPlayerBtn;
|
||||||
[SerializeField] private Button threePlayerBtn;
|
[SerializeField] private Button threePlayerBtn;
|
||||||
[SerializeField] private Button fourPlayerBtn;
|
[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 playBtn;
|
||||||
[SerializeField] private Button closeBtn;
|
[SerializeField] private Button closeBtn;
|
||||||
|
|
||||||
@ -32,6 +40,13 @@ public class PvAIModePopup : PopupBase
|
|||||||
fourPlayerBtn.onClick.AddListener(() => OnPlayerCountSelected(4));
|
fourPlayerBtn.onClick.AddListener(() => OnPlayerCountSelected(4));
|
||||||
playBtn.onClick.AddListener(OnClick_PlayButton);
|
playBtn.onClick.AddListener(OnClick_PlayButton);
|
||||||
closeBtn.onClick.AddListener(OnClick_CloseButton);
|
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()
|
private void OnDisable()
|
||||||
@ -72,4 +87,9 @@ public class PvAIModePopup : PopupBase
|
|||||||
soundManager?.PlayGameSoundClip(SoundType.ButtonClick);
|
soundManager?.PlayGameSoundClip(SoundType.ButtonClick);
|
||||||
Hide();
|
Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OnColorSelected(PlayerType type)
|
||||||
|
{
|
||||||
|
playerType = type;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,6 +58,11 @@ public class PvPModePopup : PopupBase
|
|||||||
switchBtn.onClick.AddListener(OnClick_SwitchBtn);
|
switchBtn.onClick.AddListener(OnClick_SwitchBtn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
OnClick_FourPlayerBtn();
|
||||||
|
}
|
||||||
|
|
||||||
private void OnDisable()
|
private void OnDisable()
|
||||||
{
|
{
|
||||||
twoPlayerBtn.onClick.RemoveListener(OnClick_TwoPlayerBtn);
|
twoPlayerBtn.onClick.RemoveListener(OnClick_TwoPlayerBtn);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user