本文整理汇总了C#中BoardManager类的典型用法代码示例。如果您正苦于以下问题:C# BoardManager类的具体用法?C# BoardManager怎么用?C# BoardManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BoardManager类属于命名空间,在下文中一共展示了BoardManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Awake
//Awake is always called before any Start functions
public void Awake()
{
//Check if instance already exists
if (instance == null)
//if not, set instance to this
instance = this;
//If instance already exists and it's not this:
else if (instance != this)
//Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
Destroy(gameObject);
//Sets this to not be destroyed when reloading scene
DontDestroyOnLoad(gameObject);
//Assign enemies to a new List of Enemy objects.
enemies = new List<Enemy>();
//Get a component reference to the attached BoardManager script
boardScript = GetComponent<BoardManager>();
//Call the InitGame function to initialize the first level
if (!firtTimeLoad) {
InitGame();
}
//Call the canva menuPrincipale for the first time loading the scene
if (firtTimeLoad) {
menuprincipal = (GameObject)Instantiate(Resources.Load("Prefabs/CanvasMenuPrincipal"));
menuprincipal.SetActive (true);
firtTimeLoad = false;
}
}
示例2: OnEnable
void OnEnable()
{
Debug.Log("Enable");
boardScript = GetComponent<BoardManager>();
enemiesMoving = false;
InitGame();
}
示例3: Start
// Use this for initialization
void Start()
{
bM_script = GameObject.Find("BoardManager").GetComponent<BoardManager>();
change = false;
Debug.Log("AddArrow");
bM_script.ArrowList.Add(gameObject);
}
示例4: init
public void init(int tileType, BoardManager board) {
this.board = board;
turnCount = 0;
tileObj = GameObject.CreatePrimitive(PrimitiveType.Quad);
tileMod = tileObj.AddComponent<TileModel>();
tileMod.init(this, type);
}
示例5: Start
// Use this for initialization
void Start()
{
bM = GameObject.Find("BoardManager");
bM_script = bM.GetComponent<BoardManager>();
bM_script.CountDownList.Add(gameObject);
bM_script.CleanUpList.Add(gameObject);
}
示例6: Awake
//Awake is always called before any Start functions
void Awake()
{
//Check if instance already exists
if (instance == null)
//if not, set instance to this
instance = this;
//If instance already exists and it's not this:
else if (instance != this)
//Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
Destroy(gameObject);
//Sets this to not be destroyed when reloading scene
DontDestroyOnLoad(gameObject);
//Assign enemies to a new List of Enemy objects.
//enemies = new List<Enemy>();
//transform.name.Replace("(clone)", "").Trim();
//Get a component reference to the attached BoardManager script
boardScript = GetComponent<BoardManager>();
//Call the InitGame function to initialize the first level
InitGame();
////////////my test for block
//CreateLevelFromJavatoXml block = new CreateLevelFromJavatoXml();
}
示例7: Awake
private int level = 1; //Current level number, expressed in game as "Day 1".
#endregion Fields
#region Methods
//Awake is always called before any Start functions
void Awake()
{
//Sets this to not be destroyed when reloading scene
DontDestroyOnLoad (gameObject);
//Check if instance already exists
if (instance == null) {
//if not, set instance to this
instance = gameObject.GetComponent<GameManager>();
}
//If instance already exists and it's not this:
else if (instance != gameObject.GetComponent<GameManager>())
{
//Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
Destroy (gameObject);
}
//Get a component reference to the attached BoardManager script
boardScript = GetComponent<BoardManager> ();
//Call the InitGame function to initialize the first level
if (shouldCreatePlayers)
{
InitGame();
}
}
示例8: Awake
void Awake()
{
sound= GetComponent<AudioSource>();
bSoundOn= GameObject.Find ("sound_on").GetComponent<Button>();
bSoundOff= GameObject.Find ("sound_off").GetComponent<Button>();
if (PlayerPrefs.GetInt ("mute", 0) == 0) {
bSoundOff.gameObject.SetActive (false);
} else {
bSoundOn.gameObject.SetActive (false);
}
mute = PlayerPrefs.GetInt ("mute")==1;
if (mute)
sound.mute = true;
blackTransparent = new Color32 (40,40,40,0);
white= new Color32 (255,255,255,255);
boardScript=GetComponent<BoardManager>();
boardScript.createBoard (8);
boardScript.InstatiatePolygons (15,1,4);
//StartCoroutine("initialize");
title.position = new Vector3 (title.position.x,title.position.y-(Screen.height/4)+50);
}
示例9: Awake
// Use this for initialization
void Awake()
{
if (instance == null) instance = this;
else if (instance != null) Destroy(gameObject);
DontDestroyOnLoad (gameObject);
boardScript = GetComponent<BoardManager> ();
InitGame ();
}
示例10: Start
void Start()
{
boardManagerScript = FindObjectOfType<BoardManager>();
pickUp = (GameObject)Resources.Load("Prefabs/Pick Ups/Temporary"); // Change from temp Prefab in future.
pickUpList = new List<PickUpItem>();
totalPickUps = 0;
createPickUps();
}
示例11: Awake
void Awake()
{
currentState = Config.STARTED;
if (instance == null)
instance = this;
else if (instance != this)
Destroy (gameObject);
boardScript = GetComponent<BoardManager> ();
}
示例12: Awake
void Awake () {
if (instance == null) {
instance = this;
} else if (instance != this) {
Destroy(gameObject);
}
DontDestroyOnLoad(gameObject);
boardManager = GetComponent<BoardManager>();
InitGame();
}
示例13: Start
void Start () {
gameManager = GameObject.FindGameObjectWithTag ("GameManager") as GameObject;
if (gameManager == null) {
Debug.LogError("Tag GameManager object with the GameManager tag");
}
boardManager = gameManager.GetComponent<BoardManager> ();
uiManager = gameManager.GetComponent<UIManager> ();
}
示例14: Awake
void Awake()
{
// Enforce singleton-ness
if (instance == null)
instance = this;
else if (instance != this)
Destroy (gameObject);
boardManager = GetComponent<BoardManager> ();
boardManager.SetupScene ();
}
示例15: initGame
void initGame() {
boardScript = GetComponent<BoardManager>();
doingSetup = true;
//levelImage = GameObject.Find ("levelImage");
//levelText = GameObject.Find ("levelText").GetComponent<Text>();
//levelText.text = "Day " + level;
//levelImage.SetActive (true);
//Invoke("hideLevelImage", levelStartDelay);
boardScript.setupScene(level);
}