示例#1
0
        public PlayerController(Entity player)
        {
            this.player = player;
            engine      = Engine.instance;
            camera      = engine.mainCamera;

            inputState = EPlayerInputState.Normal;
            cursor     = new TileCursor(this);
            hud        = new HUD(this);
        }
示例#2
0
        public void ReInitController(Entity newPlayer)
        {
            player = newPlayer;
            foreach (var window in hud.windows)
            {
                window.CleanupWindow();
            }

            hud        = new HUD(this);
            inputState = EPlayerInputState.Normal;
        }
示例#3
0
        /// <summary>
        /// Sends the player controller into the new input state, changing the behaviour of the controller
        /// </summary>
        public void GotoInputState(EPlayerInputState newState)
        {
            if (newState == inputState)
            {
                return;
            }

            inputState = newState;

            // Update the cursor location to be the players location
            if (newState == EPlayerInputState.TileSelect)
            {
                cursor.position = player.position;
            }
        }