Science Manager and Galaxy merging

This commit is contained in:
mkadou
2023-06-20 20:24:53 +02:00
parent 0086c8705f
commit 05142dbb22
112 changed files with 5145 additions and 749 deletions

70
Assets/GameUI.cs Normal file
View File

@@ -0,0 +1,70 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.UI;
public class GameUI : MonoBehaviour
{
static public int PlayersNumber = 1;
static GameUI Instance;
public TMP_Dropdown dropdown; // Referenz auf das Dropdown-Objekt im Unity Inspector
void Awake()
{
if (Instance == null)
{
Instance = this;
DontDestroyOnLoad(gameObject);
}
else
{
Destroy(gameObject);
}
}
// Start is called before the first frame update
void Start()
{
dropdown.onValueChanged.AddListener(HandleDropdownValueChanged);
}
public void HandleInputData(int val)
{
if (val == 0)
{
Debug.Log("PlayersNumber = 1;");
PlayersNumber = 1;
}
if (val == 1)
{
Debug.Log("PlayersNumber = 2;");
PlayersNumber = 2;
}
if (val == 2)
{
Debug.Log("PlayersNumber = 4;");
PlayersNumber = 4;
}
if (val == 3)
{
Debug.Log("PlayersNumber = 8;");
PlayersNumber = 8;
}
if (val == 4)
{
Debug.Log("PlayersNumber = 16;");
PlayersNumber = 16;
}
}
void HandleDropdownValueChanged(int val)
{
HandleInputData(val);
}
// Update is called once per frame
void Update()
{
}
}