当前位置: 首页>>代码示例>>C#>>正文


C# GameStateManager类代码示例

本文整理汇总了C#中GameStateManager的典型用法代码示例。如果您正苦于以下问题:C# GameStateManager类的具体用法?C# GameStateManager怎么用?C# GameStateManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GameStateManager类属于命名空间,在下文中一共展示了GameStateManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoseState

 public LoseState(DwarfGame game, GameStateManager stateManager, PlayState play)
     : base(game, "EconomyState", stateManager)
 {
     Input = new InputManager();
     PlayState = play;
     EnableScreensaver = false;
 }
开发者ID:scorvi,项目名称:dwarfcorp,代码行数:7,代码来源:LoseState.cs

示例2: OnNext

        public override void OnNext(GameStateManager value)
        {
            if (CurrentState == GameState.GamePause)
            {

            }
        }
开发者ID:Grutn,项目名称:TDT4240-X2,代码行数:7,代码来源:MoveController.cs

示例3: Start

    /// <summary>
    /// Start the Birb Client.
    /// </summary>
    /// <returns>Nothing right now.</returns>
    IEnumerator Start()
    {
        gameStateManager = GetComponent<GameStateManager>();
        Uri server = new Uri("ws://birb.herokuapp.com");
        Uri localhost = new Uri("ws://localhost:5000");
        socket = new WebSocket(server);
        callbacks = new Dictionary<BirbMessageCode, Callback>();
        yield return StartCoroutine(socket.Connect());
        int i = 0;

        // Testing
        //RunUnitTests();

        while (true)
        {
            string reply = socket.RecvString();
            if (reply != null)
            {
                Debug.Log("Received: " + reply);
                Process(reply);
            }
            if (socket.Error != null)
            {
                Debug.LogError("Error: " + socket.Error);
                break;
            }
            yield return 0;
        }
        socket.Close();
    }
开发者ID:UpBeet,项目名称:mating-ritual-client,代码行数:34,代码来源:BirbClient.cs

示例4: InitializeServer

        public void InitializeServer()
        {
            gameStateManager = new GameStateManager();

            //string ip = "147.87.243.27";
            serverConfig = new NetPeerConfiguration("pacman");
            //serverConfig.LocalAddress = IPAddress.Parse(ip);
            serverConfig.Port = 666;

            try
            {
                server = new NetServer(serverConfig);
                server.Start();
                networkManager = new ServerNetworkManager(server);
                WriteToLog("Server wurde gestartet...");
            }
            catch (Exception)
            {
                WriteToLog("Fehler! Server nicht gestartet...");
            }

            //networkManager = new NetworkManager(server);
            gameTime = new ServerGameTime();

            inputQueue = new SortedSet<Command>(new MovementComparer());
        }
开发者ID:Rosthouse,项目名称:Multi-Pac,代码行数:26,代码来源:FrmServer.cs

示例5: SnakeGame

 public SnakeGame()
 {
     Graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     _gameContentManager = new GameContentManager(Content);
     _gameStateManager = new GameStateManager(this, _gameContentManager);
 }
开发者ID:Zviada,项目名称:Snake,代码行数:7,代码来源:SnakeGame.cs

示例6: Game1

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);

            graphics.PreferredBackBufferWidth = 1366;
            graphics.PreferredBackBufferHeight = 768;

            Content.RootDirectory = "Content";

            sb = new SpriteBatch(GraphicsDevice);

            input = new InputHandler(this);

            this.Components.Add(input);

            celAnimationManager = new CelAnimationManager(this);
            this.Components.Add(celAnimationManager);

            GameManager = new GameStateManager(this);

            PlayingState = new PlayingState(this);
            PausedState = new PausedState(this);
            TitleState = new TitleIntroState(this);
            StartMenuState = new StartMenuState(this);
            EndState = new EndState(this);

            GameManager.ChangeState(TitleState.Value);
            //GameManager.ChangeState(PlayingState.Value);
        }
开发者ID:guorenxu,项目名称:FoodSpace,代码行数:29,代码来源:Game1.cs

示例7: MainMenuState

 public MainMenuState(DwarfGame game, GameStateManager stateManager)
     : base(game, "MainMenuState", stateManager)
 {
     ResourceLibrary library = new ResourceLibrary();
     IsGameRunning = false;
     MaintainState = false;
 }
开发者ID:scorvi,项目名称:dwarfcorp,代码行数:7,代码来源:MainMenuState.cs

示例8: StartState

 public StartState(GameStateManager gameManager)
 {
     manager = gameManager;
     manager.score = 0;
     manager.gameLevel = 1;
     manager.PlaySound(manager.bgm);
 }
开发者ID:LeafMountain,项目名称:KittyKuddlerz-Packitty,代码行数:7,代码来源:StartState.cs

示例9: InitialState

    public void InitialState()
    {
        GameStateManager gameStateManager  = new GameStateManager();

        //Start at GameMenu
        Assert.That(gameStateManager.isGameStateEqual(gameStateManager.getGameMenuState()));
    }
开发者ID:ChristopherElten,项目名称:1GAM-August,代码行数:7,代码来源:GameStateTests.cs

示例10: Start

    public void Start()
    {
        //Grab mainObject prefab to access managers effectively
        mainObject = GameObject.FindGameObjectsWithTag("MainObject")[0];
        if (GameObject.FindGameObjectsWithTag("MainObject").Length > 1)
        {
            GameObject[] mainObjectList = GameObject.FindGameObjectsWithTag("MainObject");
            for (int i = 0; i < mainObjectList.Length; ++i)
            {
                if (mainObjectList[i].GetComponent<GameStateManager>().objectSaved)
                    mainObject = mainObjectList[i];
            }
        }

        // Notice, these are attached to the MainObject
        gameStateManagerRef = mainObject.GetComponent<GameStateManager>();
        animationManagerRef = gameStateManagerRef.GetAnimationManager();
        inputManagerRef = gameStateManagerRef.GetInputManager();
        worldCollisionRef = gameStateManagerRef.GetWorldCollision();

        // This script is attached to the player, so we use 'gameObject' here
        controllerRef = gameObject.GetComponent<TWCharacterController>();

        paperObject = GameObject.FindGameObjectWithTag("background");
    }
开发者ID:dindras234,项目名称:TearableWorld10-19-2015,代码行数:25,代码来源:PlayerCollisions.cs

示例11: BuildLevel

        public void BuildLevel(ref GameStateManager gamestatemanager, string path)
        {
            XmlDocument xmlDocument = new XmlDocument();
            xmlDocument.Load(path);

            XPathNavigator navigator = xmlDocument.CreateNavigator();

            XPathExpression xpath = navigator.Compile("/Level/Structure/Layer");

            XPathNodeIterator iterator = navigator.Select(xpath);

            Dictionary<string, Queue<string>> dependencyMap = new Dictionary<string,Queue<string>>();

            try
            {
                while(iterator.MoveNext())
                {
                    XPathNavigator element = iterator.Current;
                    LoadLayer(element, ref dependencyMap);
                }
            }
            catch(XPathException xpe)
            {

            }
        }
开发者ID:Rosthouse,项目名称:JumpNRun,代码行数:26,代码来源:LevelBuilder.cs

示例12: Update

    // Update is called once per frame
    void Update()
    {
        if (GameObject.FindGameObjectsWithTag("MainObject").Length > 1)
        {
            GameObject[] list = GameObject.FindGameObjectsWithTag("MainObject");
            for (int i = 0; i < list.Length; ++i)
            {
                if (!list[i].GetComponent<GameStateManager>().objectSaved)
                    GameObject.Destroy(list[i]);

                else
                    gameStateManagerRef = list[i].GetComponent<GameStateManager>();
            }
        }

        if (gameStateManagerRef.GetScreenManager().GetCurrentScreenArea() != ScreenAreas.LevelComplete)
        {
            if (levelCompleteText)
            {
                levelCompleteText.GetComponent<GUIText>().enabled = false;
            }

            if (swipeToContinueText)
            {
                swipeToContinueText.GetComponent<GUIText>().enabled = false;
            }
        }
    }
开发者ID:dindras234,项目名称:TearableWorld10-19-2015,代码行数:29,代码来源:SceneTransistion.cs

示例13: Start

    // Use this for initialization
    void Start()
    {
        gameStateManagerRef = GameObject.FindGameObjectWithTag("MainObject").GetComponent<GameStateManager>();

        GameObject levelCompleteGUI = GameObject.FindGameObjectWithTag("EndLevelObject");
        GameObject blackFadeElement = GameObject.FindGameObjectWithTag("BlackFade");
        levelCompleteText = GameObject.FindGameObjectWithTag("LevelCompleteText");
        swipeToContinueText = GameObject.FindGameObjectWithTag("SwipeToContinueText");

        if (levelCompleteGUI)
        {
            levelCompleteGUI.GetComponent<GUITexture>().enabled = false;
            levelCompleteGUI.GetComponent<Camera>().enabled = false;
            levelCompleteGUI.GetComponent<GUILayer>().enabled = false;
        }

        if (blackFadeElement)
        {
            blackFadeElement.GetComponent<GUITexture>().enabled = false;
            blackFadeElement.GetComponent<Camera>().enabled = false;
            blackFadeElement.GetComponent<GUILayer>().enabled = false;
        }

        if (levelCompleteText)
        {
            levelCompleteText.GetComponent<GUIText>().enabled = false;
        }

        if (swipeToContinueText)
        {
            swipeToContinueText.GetComponent<GUIText>().enabled = false;
        }
    }
开发者ID:dindras234,项目名称:TearableWorld10-19-2015,代码行数:34,代码来源:SceneTransistion.cs

示例14: Start

    // Use this for initialization
    void Start()
    {
        // Define state to name mapping for animations
        state_to_name.Add(0, "Idle");
        state_to_name.Add(1, "Walk");
        state_to_name.Add(2, "Charge");
        state_to_name.Add(3, "Grenade");
        state_to_name.Add(4, "Jump");
        state_to_name.Add(5, "Scared");
        state_to_name.Add(6, "Touch");
        state_to_name.Add(7, "Whisper");

        GameState = FindObjectOfType<GameStateManager>();

        if (GameState == null)
        {
            Debug.Log("GameStateManager missing! Abort!");
            this.enabled = false;
            return;
        }
        else
        {
            MainPlayer = gameObject.GetComponent<Player>();
            PlayerPhysics = gameObject.GetComponent<Rigidbody2D>();
            PlayerCollider = gameObject.GetComponent<BoxCollider2D>();
            PlayerAnimator = gameObject.GetComponent<Animator>();
            if (MainPlayer != null && PlayerPhysics != null)
            {
                PlayerNumber = (int)XboxInput;
                //No setup anymore!
            }
        }

    }
开发者ID:DoubleDeez,项目名称:heirloom,代码行数:35,代码来源:InputController.cs

示例15: GameState

        public GameState(Game game, GameStateManager manager)
            : base(game)
        {
            _stateManager = manager;

            _childComponents = new List<GameComponent>();
            _tag = this;
        }
开发者ID:jrdoughty,项目名称:DungeonMaker,代码行数:8,代码来源:GameState.cs


注:本文中的GameStateManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。