Ejemplo n.º 1
0
        public virtual void Init()
        {
            if (_Instance != null)
            {
                return;
            }

            _Instance = this;

            PlayerControllers = new List <MCgPlayerController>();

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

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