This repository has been archived on 2023-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
station_obscurum_unity/Assets/Scripts/Legacy/MainMenu/LobbyManager.cs
MarcoHampel f8590432ba Assemblies Made and Refactored Code Folders
Created assemblies for the new design code. Relocated legacy scripts into a legacy folder and made a "new_design" folder for new design.
2023-09-11 19:39:27 -04:00

55 lines
1.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace UI
{
public class LobbyManager : MonoBehaviour
{
[SerializeField]
private Animator[] lights;
[SerializeField]
private int playersInSession = 0;
public bool AddPlayer()
{
if (playersInSession>= lights.Length)
{
return false;
}
lights[playersInSession].SetBool("IsPowered", true);
playersInSession++;
return true;
}
public bool RemovePlayer()
{
if (playersInSession <=0)
{
return false;
}
playersInSession--;
lights[playersInSession].SetBool("IsPowered", false);
return true;
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyUp(KeyCode.LeftShift))
{
AddPlayer();
}else if(Input.GetKeyUp(KeyCode.RightShift))
{
RemovePlayer();
}
}
}
}