public virtual void Init() { if (_Instance != null) { return; } _Instance = this; PlayerControllers = new List <MCgPlayerController>(); Pawns = new List <MCgPawn>(); PlayerPawns = new List <MCgPawn>(); }
public virtual MCgPawn GetMyPawn() { if (LinkedPawn != null) { return(LinkedPawn); } MCgGameState gameState = MCgGameState.Get(); foreach (MCgPawn pawn in gameState.Pawns) { if (pawn.PlayerState == this) { LinkedPawn = pawn; } } return(LinkedPawn); }
public static MCgPlayerController GetLocalPlayerController(int index = 0) { MCgGameState gamestate = MCgGameInstance.Get().GameState; return(gamestate.PlayerControllers.Count > index ? gamestate.PlayerControllers[index] : null); }