Skip to content

Instantly share code, notes, and snippets.

@opiyo
Created May 31, 2015 23:52
Show Gist options
  • Save opiyo/bb2948d1671f8ef7f4a6 to your computer and use it in GitHub Desktop.
Save opiyo/bb2948d1671f8ef7f4a6 to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
public class GameManager : MonoBehaviour {
public static GameManager instance = null;
public BoardManager boardScript;
//********** 開始 **********//
public int playerFoodPoints = 100; //プレイヤーの体力
//HideInInspector: public変数だけどInspectorで編集させない
//プレイヤーの順番か判定
[HideInInspector] public bool playersTurn = true;
//********** 終了 **********//
private int level = 3;
void Awake ()
{
if (instance == null) {
instance = this;
} else if (instance != this) {
Destroy(gameObject);
}
DontDestroyOnLoad(gameObject);
boardScript = GetComponent<BoardManager>();
InitGame();
}
void InitGame () {
boardScript.SetupScene(level);
}
//********** 開始 **********//
public void GameOver ()
{
//GameManagerを無効にする
enabled = false;
}
//********** 終了 **********//
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment