Первый коммит
This commit is contained in:
38
Assets/Scripts/StartMenu/ScriptMenuChangeNumberPlayers.cs
Normal file
38
Assets/Scripts/StartMenu/ScriptMenuChangeNumberPlayers.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class ScriptMenuChangeNumberPlayers : MonoBehaviour
|
||||
{
|
||||
private TextMeshProUGUI text;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
text = gameObject.GetComponentInChildren<TextMeshProUGUI>();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (GameSetting.OnePlayer)
|
||||
{
|
||||
text.text = "One Player";
|
||||
}
|
||||
else
|
||||
{
|
||||
text.text = "Two Player";
|
||||
}
|
||||
}
|
||||
|
||||
public void ChageNumberPlayersScript()
|
||||
{
|
||||
if (GameSetting.OnePlayer)
|
||||
{
|
||||
GameSetting.OnePlayer = false;
|
||||
text.text = "Two Player";
|
||||
}
|
||||
else
|
||||
{
|
||||
GameSetting.OnePlayer = true;
|
||||
text.text = "One Player";
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user