Created
May 31, 2015 23:52
-
-
Save opiyo/bb2948d1671f8ef7f4a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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