Beispiel #1
0
        public virtual void Init()
        {
            if (_Instance != null)
            {
                return;
            }

            _Instance = this;

            PlayerControllers = new List <MCgPlayerController>();

            Pawns       = new List <MCgPawn>();
            PlayerPawns = new List <MCgPawn>();
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        public static MCgPlayerController GetLocalPlayerController(int index = 0)
        {
            MCgGameState gamestate = MCgGameInstance.Get().GameState;

            return(gamestate.PlayerControllers.Count > index ? gamestate.PlayerControllers[index] : null);
        }