void Awake() { // Enforce singleton-ness if (instance == null) instance = this; else if (instance != this) Destroy (gameObject); boardManager = GetComponent<BoardManager> (); boardManager.SetupScene (); }
void InitGame() { if (instance != null) { instance.enemies.Clear(); } else { enemies.Clear(); } FloorNumberText = GameObject.Find("FloorNumberText").GetComponent <Text>(); FloorNumberText.text = "Floor " + level; PlayerLevelText = GameObject.Find("PlayerLevelText").GetComponent <Text>(); PlayerLevelText.text = "Level " + playerLevel; HealthText = GameObject.Find("HealthText").GetComponent <Text>(); HealthText.text = "Health: " + playerCurrentHealth; StaminaText = GameObject.Find("StaminaText").GetComponent <Text>(); StaminaText.text = "Stamina: " + playerCurrentStamina; ScoreText = GameObject.Find("ScoreText").GetComponent <Text>(); ScoreText.text = "Score: " + playerPoints; levelWalls = boardScript.SetupScene(level); PlayerObject = GameObject.FindWithTag("Player"); PlayerObject.transform.position = BoardManager.entrance; DontDestroyOnLoad(FloorNumberText); DontDestroyOnLoad(PlayerLevelText); DontDestroyOnLoad(HealthText); DontDestroyOnLoad(StaminaText); DontDestroyOnLoad(ScoreText); occupiedSpots.Clear(); }
void InitGame() { doingSetup = true; #if !(UNITY_STANDALONE || UNITY_WEBGL) Text restartButtonText = GameObject.Find("LevelText").GetComponent <Text>(); restartButtonText.text = "Touch me to Restart"; #endif levelImage = GameObject.Find("LevelImage"); restartButton = GameObject.Find("RestartButton"); levelText = GameObject.Find("LevelText").GetComponent <Text>(); levelText.text = "Day " + level; restartButton.SetActive(false); levelImage.SetActive(true); enemies.Clear(); boardScript.SetupScene(level); Invoke("HideLevelImage", levelStartDelay); }
void InitGame() { doingSetup = true; levelImage = GameObject.Find("LevelImage"); levelText = GameObject.Find("LevelText").GetComponent <Text>(); levelText.text = "Day " + level; levelImage.SetActive(true); Invoke("HideLevelImage", levelStartDelay); enemies.Clear(); boardScript.SetupScene(level); }
//Initializes the game for each level. void InitGame() { //Get a reference to our image LevelImage by finding it by name. // levelImage = GameObject.Find("LevelImage"); //Get a reference to our text LevelText's text component by finding it by name and calling GetComponent. // levelText = GameObject.Find("LevelText").GetComponent<Text>(); //Set the text of levelText to the string "Day" and append the current level number. // levelText.text = "Day " + level; //Set levelImage to active blocking player's view of the game board during setup. // levelImage.SetActive(true); //Call the HideLevelImage function with a delay in seconds of levelStartDelay. // Invoke("HideLevelImage", levelStartDelay); //Clear any Enemy objects in our List to prepare for next level. // enemies.Clear(); //Call the SetupScene function of the BoardManager script, pass it current level number. boardScript.SetupScene(level); }
//Initializes the game for each level. void InitGame() { //While doingSetup is true the player can't move, prevent player from moving while title card is up. doingSetup = true; //Get a reference to our image LevelImage by finding it by name. levelImage = GameObject.Find("LevelImage"); //Get a reference to our text LevelText's text component by finding it by name and calling GetComponent. levelText = GameObject.Find("LevelText").GetComponent <Text>(); //Set the text of levelText to the string "Day" and append the current level number. levelText.text = "Floor " + level; //Set levelImage to active blocking player's view of the game board during setup. levelImage.SetActive(true); //Call the HideLevelImage function with a delay in seconds of levelStartDelay. Invoke("HideLevelImage", levelStartDelay); //Call the SetupScene function of the BoardManager script, pass it current level number. boardScript.SetupScene(level); }
//Initializes the game for each level. void InitGame() { //While doingSetup is true the player can't move, prevent player from moving while title card is up. doingSetup = true; //Get a reference to our image LevelImage by finding it by name. levelImage = GameObject.Find("LevelImage"); //Get a reference to our text LevelText's text component by finding it by name and calling GetComponent. levelText = GameObject.Find("LevelText").GetComponent <Text>(); //Set the text of levelText to the string "Day" and append the current level number. levelText.text = "Day " + level; //Set levelImage to active blocking player's view of the game board during setup. levelImage.SetActive(true); //Call the HideLevelImage function with a delay in seconds of levelStartDelay. Invoke("HideLevelImage", levelStartDelay); //Clear any Enemy objects in our List to prepare for next level. enemies.Clear(); //0:Slushie 1:Squip 2:Green/Red MntDew 3:MntDew/Squip if (playerFoodPoints > 200) { itemSet = 2; } else { itemSet = 3; } //Call the SetupScene function of the BoardManager script, pass it current level number. boardScript.SetupScene(level, itemSet); }
//Initializes the game for each level. void InitGame() { //While doingSetup is true the player can't move, prevent player from moving while title card is up. doingSetup = true; //Get a reference to our image LevelImage by finding it by name. levelImage = GameObject.Find("LevelImage"); //Get a reference to our text LevelText's text component by finding it by name and calling GetComponent. questText = GameObject.Find("QuestText").GetComponent <Text> (); //Get a reference to the inventory canvas. slideOutCanvas = GameObject.FindGameObjectWithTag("InventoryCanvas"); //Get reference to the inventory script. inventory = GameObject.FindGameObjectWithTag("Inventory").GetComponent <Inventory> (); //Set the text of levelText to the string "Quest" and append the current level number. questText.text = "Quest: " + level; //Set levelImage to active blocking player's view of the game board during setup. levelImage.SetActive(true); //Set inventory canvas to active to instantiate the inventory. slideOutCanvas.SetActive(true); //Call the HideLevelImage function with a delay in seconds of levelStartDelay. Invoke("HideLevelImage", levelStartDelay); //Clear any Enemy objects in our List to prepare for next level. enemies.Clear(); //Call the SetupScene function of the BoardManager script, pass it current level number. boardScript.SetupScene(level); // refrence the player in the scene _player = FindObjectOfType <Player>(); }
//Initializes the game for each level. void InitGame() { Debug.Log("InitGame"); //While doingSetup is true the player can't move, prevent player from moving while title card is up. doingSetup = true; money = 0; karma = 1.00f; //Get a reference to our image LevelImage by finding it by name. levelImage = GameObject.Find("LevelImage"); //Get a reference to our text LevelText's text component by finding it by name and calling GetComponent. levelText = GameObject.Find("LevelText").GetComponent <Text>(); //Set the text of levelText to the string "Day" and append the current level number. levelText.text = "Get Ready !!"; moneyText = GameObject.Find("MoneyText").GetComponent <Text>(); moneyText.text = "Money: " + money + "$"; karmaText = GameObject.Find("KarmaText").GetComponent <Text>(); karmaText.text = "Karma: " + karma.ToString("f2") + "%"; //Set levelImage to active blocking player's view of the game board during setup. levelImage.SetActive(true); //Call the HideLevelImage function with a delay in seconds of levelStartDelay. Invoke("HideLevelImage", levelStartDelay); //Clear any Enemy objects in our List to prepare for next level. enemies.Clear(); housings.Clear(); //Call the SetupScene function of the BoardManager script, pass it current level number. boardScript.SetupScene(level); fireSpawnerScript.StartFires(); }
public void InitGame() { doingSetup = true; shownLevel = level; if (level > PlayerPrefs.GetInt("HighScore")) { PlayerPrefs.SetInt("HighScore", level); } firstTime.SetActive(false); enemy1.SetActive(false); enemy2.SetActive(false); enemy3.SetActive(false); fire.SetActive(false); walls.SetActive(false); restartButton = GameObject.Find("RestartButton"); exitButton = GameObject.Find("ExitButton"); levelImage = GameObject.Find("LevelImage"); levelText = GameObject.Find("LevelText").GetComponent <Text>(); highScore = GameObject.Find("HighScore"); highScore.SetActive(false); restartButton.SetActive(false); exitButton.SetActive(false); levelText.text = "level " + level; levelImage.SetActive(true); Invoke("HideLevelImage", levelStartDelay); enemies.Clear(); fires.Clear(); boardScript.SetupScene(level); }
void InitGame() { doingSetup = true; boardScript.SetupScene(); }
//Initializes the game for each level. void InitGame() { //Call the SetupScene function of the BoardManager script, pass it current level number. boardScript.SetupScene(level); }
void InitGame() { BoardManager.SetupScene(level); }
void InitGame() { boardScript.SetupScene(1); }
void InitGame() { boardScript.SetupScene(level); }
public void InitGame() { boardManagerScript.SetupScene(level); }
void initGame() { boardScript.SetupScene(lvl); }
//Initializes the game for each level. void InitGame() { enemies.Clear(); //ボードスクリプトを呼び出す。 boardScript.SetupScene(level); }
void InitGame() { BoardScript.SetupScene(Level); }
// Called when the node enters the scene tree for the first time. public override void _Ready() { _BoardManager = (BoardManager)GetTree().GetNodesInGroup("BoardManager")[0]; //como el script esta en el nodo lo busco de esta manera _BoardManager.SetupScene(1); }
public void InitGame() { boardScript.SetupScene(level, wordGen, board, theme, this); }
void InitGame() { enemies.Clear(); boardScript.SetupScene(level); }
void InitGame() { //RegisterFactories(); boardScript.SetupScene(level); }
using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Collections.Generic; using UnityEngine.UI; public class GameManager : MonoBehaviour { public float levelStartDelay = 2f; public float turnDelay = .1f; public static GameManager instance = null; public BoardManager boardScript; public int playerFoodPoints = 100; [HideInInspector] public bool playersTurn = true; private Text levelText; private GameObject levelImage; private int level = 1; private List<Enemy> enemies; private bool enemiesMoving; private bool doingSetup; // Use this for initialization void Awake () { if(instance == null) instance=this; else if( instance != this) Destroy(gameObject); DontDestroyOnLoad(gameObject); enemies = new List<Enemy> (); boardScript = GetComponent<BoardManager>(); InitGame(); } private void OnLevelWasLoaded(int index){ level++; InitGame (); } void InitGame(){ doingSetup = true; levelImage = GameObject.Find ("LevelImage"); levelText = GameObject.Find ("LevelText").GetComponent<Text> (); levelText.text = "Day" + level; levelImage.SetActive (true); Invoke ("HideLevelImage", levelStartDelay); enemies.Clear (); boardScript.SetupScene(level); } private void HideLevelImage(){ levelImage.SetActive (false); doingSetup = false; } public void GameOver(){ levelText.text = "After " + level + " days, you starved."; levelImage.SetActive (true); enabled = false; } // Update is called once per frame void Update () { if (playersTurn || enemiesMoving || doingSetup) return; StartCoroutine (MoveEnemies ()); } IEnumerator MoveEnemies(){ enemiesMoving = true; yield return new WaitForSeconds (turnDelay); if (enemies.Count == 0) { yield return new WaitForSeconds (turnDelay); } for (int i = 0; i < enemies.Count; i++) { enemies [i].MoveEnemy (); yield return new WaitForSeconds (enemies [i].moveTime); } playersTurn = true; enemiesMoving = false; } public void AddEnemyToList(Enemy script){ enemies.Add (script); } }
void InitGame() { NotificationSystem.start(); boardScript.SetupScene(level); }
/// <summary> /// Initialize BoardManager and game components /// </summary> private void InitGame() { BoardScript.SetupScene(level); }
void InitGame() //Starts the game. { enemies.Clear(); //Clears enemy list boardScript.SetupScene(level); //Call the SetupScene function of the BoardManager script. }
public void InitGame() { boardScript.SetupScene(); }
public void LevelChange(int levelSelectIndex) { boardScript.SetupScene(levelSelectIndex + 1); }
//Initializes the map. void InitGame() { //Call the SetupScene function of the BoardManager script boardScript.SetupScene(); }
private void InitGame() { boardManager.SetupScene(gameData.level); }