This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
angels-and-demons/Angels and Demons/Assets/Scripts/PlayerManager.cs

44 lines
1 KiB
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerManager : MonoBehaviour
{
// Private players variable, used to keep track of which player has which spaces.
// Should later be defined as a struct in a separate namespace.
private static int[] players = new int[2];
// Function call to return what the indexed player's space choice is.
public static int getPlayer(int n)
{
return players[n];
}
/* Function called at the beginning of a game to set the player spaces
* and reset the turn counter.
*
* This function should later be called by a manager script of some
* kind that handles menu navigation/logistics between games and other
* activity outside of the main game.
*/
public static void StartGame(int playerchoice)
{
players[0] = playerchoice;
switch(playerchoice)
{
case 1:
players[1] = 2;
break;
case 2:
players[1] = 1;
break;
default:
Debug.Log("Invalid Player Choice!");
return;
}
GameManager.ResetTurn();
}
}