Space-Smash-Out/Assets/Scripts/UI/JoinPrompt.cs
Jakob Feldmann 94863a7eb5 feat: free fly arena, 4-player support, 4-player arena, test-scene option etc.
There is also overhauled camera zoom behavior, an update to the match logic,
tweaks to the main menu scene.
2024-05-05 17:53:56 +02:00

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);
}
}