There is also overhauled camera zoom behavior, an update to the match logic, tweaks to the main menu scene.
30 lines
633 B
C#
30 lines
633 B
C#
using System;
|
|
using Managers;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
public class JoinPrompt : MonoBehaviour
|
|
{
|
|
public int playerNumber;
|
|
[SerializeField]
|
|
private TextMeshProUGUI textMesh;
|
|
private Player player;
|
|
|
|
public void PromptInput(Player player)
|
|
{
|
|
this.player = player;
|
|
textMesh.text = $"{player.playerName} \n \n To join press\n any button";
|
|
ControlsManager.G.PlayerControlAssigned +=
|
|
(o, playerControl) => PromptFinished(playerControl);
|
|
}
|
|
|
|
public void PromptFinished(Tuple<int, UniqueControl> playerControl)
|
|
{
|
|
if (player.playerNumber != playerControl.Item1)
|
|
{
|
|
return;
|
|
}
|
|
gameObject.SetActive(false);
|
|
}
|
|
|
|
}
|