本文整理汇总了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;
}
示例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;
}
}
示例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;
}
}
示例4: Awake
protected override void Awake() {
base.Awake();
_gameStatus = GameStatus.Instance;
Subscribe();
UpdateRate = FrameUpdateFrequency.Normal;
enabled = false;
}
示例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;
}
示例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 => {
});
}
}
示例7: GoToStory
void GoToStory()
{
gameStatus = GameStatus.STORY;
timer = 20.0f;
startHolder.SetActive(false);
storyHolder.SetActive(true);
}
示例8: GameOver
public void GameOver()
{
state = GameStatus.End;
m_LevelController.OnGameOver();
m_UIManager.OnGameOver();
m_UIManager.gameOverPanel.SetFinalScore(score);
}
示例9: GotToGameover
void GotToGameover()
{
gameStatus = GameStatus.GAMEOVER;
gamePaused = true;
gameplayHolder.SetActive(false);
gameoverHolder.SetActive(true);
}
示例10: GameStatusUpdate
public GameStatusUpdate(Guid token, Guid gameToken, GameStatus status, IActorRef game,
string message = null)
: base(token, gameToken)
{
Status = status;
Game = game;
Message = message;
}
示例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);
}
示例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);
}
示例13: StartNewGame
public void StartNewGame()
{
//TODO: Go to "story" first
status = new GameStatus();
StartCoroutine(LoadAsync("Preperation"));
}
示例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;
}
示例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();
}