GameMode.Update C# (CSharp) Метод

Update() публичный Метод

public Update ( ) : void
Результат void
    public virtual void Update()
    {
    }

Usage Example

Пример #1
0
    void Update()
    {
        if (Application.isLoadingLevel == false && loading)
        {
            loading = false;
            LoadContent();
        }

        if (start)
        {
            if (_state == GameState.InGame)
            {
                //After countdown..
                _gameMode.Update();
            }
            start = false;
        }


        if (_state == GameState.InGame)
        {
            //After countdown..
            if (!_gameMode.GameEnd())
            {
                int displayMinutes = (int)(GameManager._gameMode.GetTimer() / 60.0f);
                int displaySeconds = (int)(GameManager._gameMode.GetTimer() % 60.0f);

                _timerUI.GetComponentInChildren <Text>().text = string.Format("{0}:{1:00}", displayMinutes, displaySeconds);
                _gameMode.Update();
            }
            else
            {
                GameObject _obj = (GameObject)Instantiate(FindObjectOfType <MenuManager>().WinBanner, Vector3.zero, Quaternion.identity);
                if (_gameMode.winnerActor != null)
                {
                    _obj.GetComponentInChildren <Text>().text = _gameMode.winnerActor.actorName + " wins!";
                }
                else
                {
                    _obj.GetComponentInChildren <Text>().text = "Tie!";
                }

                _state = GameState.Win;
            }
        }

        if (_state == GameState.Win)
        {
            if (GamepadInput.GamePad.GetButtonDown(GamepadInput.GamePad.Button.Start, GamepadInput.GamePad.Index.Any))
            {
                OnMenuScene();
                Application.LoadLevel(0);
            }
        }
    }
All Usage Examples Of GameMode::Update