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


C# GameStatus类代码示例

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


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

示例1: getInstance

 public static GameStatus getInstance()
 {
     if (instance == null) {
         instance = GameObject.FindObjectOfType<GameStatus>();
     }
     return instance;
 }
开发者ID:louisfellows,项目名称:LD33,代码行数:7,代码来源:GameStatus.cs

示例2: Play

        /// <summary>
        /// Sets the status of a cell
        /// </summary>
        /// <param name="row">Row number of cell</param>
        /// <param name="column">Column number of cell</param>
        /// <param name="status">New status of cell</param>
        public void Play(int row, int column, CellStatus status)
        {
            if (row < MIN_ROW_COLUMN || row > MAX_ROW_COLUMN)
            {
                throw new ArgumentOutOfRangeException(nameof(row), $"'{nameof(row)}' should be between {MIN_ROW_COLUMN} and {MAX_ROW_COLUMN}");
            }

            if (column < MIN_ROW_COLUMN || column > MAX_ROW_COLUMN)
            {
                throw new ArgumentOutOfRangeException(nameof(column), $"'{nameof(column)}' should be between {MIN_ROW_COLUMN} and {MAX_ROW_COLUMN}");
            }

            if (status != CellStatus.X && status != CellStatus.O)
            {
                throw new ArgumentException(nameof(status), $"'{nameof(status)}' '{status}' is invalid");
            }

            if (_cells[row, column] != CellStatus.Unmarked)
            {
                throw new InvalidOperationException($"Cell with row={row} and column={column} is already marked");
            }

            _cells[row, column] = status;

            if (Status == GameStatus.New)
            {
                Status = GameStatus.InProgress;
            }

        }
开发者ID:DigitalGardener,项目名称:TicTacToe,代码行数:36,代码来源:Game.cs

示例3: Update

    // Update is called once per frame
    void Update()
    {
        switch (_currentGameStatus)
        {
            case GameStatus.Start:
                // 턴 시작
                _currentTurn++;     // 턴 증가
                _currentGameStatus = GameStatus.InGame;
                break;
            case GameStatus.InGame:
                // (임시) 인게임
                if (Input.GetMouseButtonDown(0))
                {
                    RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector3.forward);
                    if (hit.collider != null)
                    {

                    }
                }
                break;
            case GameStatus.End:
                // 턴 종료
                if (_currentTurn >= MaxTurn)
                    Debug.Log("턴 제한");
                else if (_resourcesManager.CurrentDebt <= _resourcesManager.CurrentGold)
                    Debug.Log("클리어");

                _currentGameStatus = GameStatus.Start;
                break;
            default:
                // 오류 처리
                break;
        }
    }
开发者ID:nuitcalme,项目名称:Exhausted,代码行数:35,代码来源:GameManager.cs

示例4: Awake

 protected override void Awake() {
     base.Awake();
     _gameStatus = GameStatus.Instance;
     Subscribe();
     UpdateRate = FrameUpdateFrequency.Normal;
     enabled = false;
 }
开发者ID:Maxii,项目名称:UnityEntry,代码行数:7,代码来源:GuiDateReadout.cs

示例5: Game

 public Game(int mapWidth, int mapHeight, int roadWidth, int roadHeigth, Point startPoint)
 {
     this._ball = new Ball(startPoint);
     this.GameMap = new GameMap(mapWidth, mapHeight, roadWidth, roadHeigth, startPoint, _ball);
     this.TotalScore = 0;
     this._status = GameStatus.ReadyToStart;
 }
开发者ID:songsinh88,项目名称:ZigZag-Game,代码行数:7,代码来源:Game.cs

示例6: GameOver

    public void GameOver()
    {
        if(currentGameStatus == GameStatus.Over)
            return;

        AD.SetActive(true);
        currentGameStatus = GameStatus.Over;
        startUI.GetComponent<Animator>().SetTrigger("Show");

        if(playerControl !=null){
            audioSource.clip = audioHit;
            if(playSound){
                audioSource.Play();
            }
            Destroy(playerControl);
        }

        PlayerPrefs.SetInt("BestScore",bestScore);

        GameObject[] enemys =  GameObject.FindGameObjectsWithTag("Enemy");
        foreach(GameObject en in enemys){
            Destroy(en);
        }

        if(enableGameCenter){
            Social.ReportScore(bestScore,gameCenterKey, result => {
            });
        }
    }
开发者ID:GeforceLee,项目名称:Flappy2048,代码行数:29,代码来源:GameManager.cs

示例7: GoToStory

 void GoToStory()
 {
     gameStatus = GameStatus.STORY;
     timer = 20.0f;
     startHolder.SetActive(false);
     storyHolder.SetActive(true);
 }
开发者ID:MorcoFreeCode,项目名称:2014__Ludum-Dare-31,代码行数:7,代码来源:GameManager.cs

示例8: GameOver

 public void GameOver()
 {
     state = GameStatus.End;
     m_LevelController.OnGameOver();
     m_UIManager.OnGameOver();
     m_UIManager.gameOverPanel.SetFinalScore(score);
 }
开发者ID:woolparty,项目名称:DontEatMyFish,代码行数:7,代码来源:GameManager.cs

示例9: GotToGameover

 void GotToGameover()
 {
     gameStatus = GameStatus.GAMEOVER;
     gamePaused = true;
     gameplayHolder.SetActive(false);
     gameoverHolder.SetActive(true);
 }
开发者ID:MorcoFreeCode,项目名称:2014__Ludum-Dare-31,代码行数:7,代码来源:GameManager.cs

示例10: GameStatusUpdate

 public GameStatusUpdate(Guid token, Guid gameToken, GameStatus status, IActorRef game,
     string message = null)
     : base(token, gameToken)
 {
     Status = status;
     Game = game;
     Message = message;
 }
开发者ID:tpaananen,项目名称:AkkaBattleShip,代码行数:8,代码来源:GameMessages.cs

示例11: Game

 /// <summary>
 /// 
 /// </summary>
 /// <param name="eventManager"></param>
 public Game(EventManager eventManager)
 {
     this.gameStatus = GameStatus.Preparing;
     this.eventManager = eventManager;
     this.players = new ArrayList();
     this.players.Add(new Player(eventManager));
     this.map = new Map(eventManager);
 }
开发者ID:erin100280,项目名称:Zelda.NET,代码行数:12,代码来源:Game.cs

示例12: GameOver

    public void GameOver()
    {
        Final_Meter.text = string.Format("{0:N0} m", Meter);
        Final_Item.text = string.Format("{0}", Item);

        GS = GameStatus.End;
        Final_GUI.SetActive (true);
    }
开发者ID:Skim0082,项目名称:MobileGameProject,代码行数:8,代码来源:GameManager.cs

示例13: StartNewGame

    public void StartNewGame()
    {
        //TODO: Go to "story" first

        status = new GameStatus();

        StartCoroutine(LoadAsync("Preperation"));
    }
开发者ID:torybash,项目名称:DungeonRaiders,代码行数:8,代码来源:GameManager.cs

示例14: Game

 /// <summary>
 /// Creates a new game
 /// </summary>
 /// <param name="path">The path to the game</param>
 /// <param name="name">The name of the game</param>
 /// <param name="fileCount">The number of files in the game</param>
 /// <param name="status">The current status of the game</param>
 /// <param name="size">The total size of the game</param>
 public Game(string path, string name, long size, int fileCount, GameStatus status = GameStatus.Deactivated)
 {
     Path = path;
     Name = name;
     Size = size;
     FileCount = fileCount;
     Status = status;
 }
开发者ID:zlepper,项目名称:GameLoader,代码行数:16,代码来源:Game.cs

示例15: ShipNavigator

 /// <summary>
 /// Initializes a new instance of the <see cref="ShipNavigator"/> class.
 /// </summary>
 /// <param name="t">Ship Transform</param>
 /// <param name="data">Ship data.</param>
 public ShipNavigator(Transform t, ShipData data)
     : base(data) {
     _transform = t;
     _gameStatus = GameStatus.Instance;
     _generalSettings = GeneralSettings.Instance;
     _engineRoom = new EngineRoom(data, t.rigidbody);
     Subscribe();
 }
开发者ID:Maxii,项目名称:UnityEntry,代码行数:13,代码来源:ShipNavigator.cs


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