//it is called when the play button is clicked public void Play() { hud = this; menuHUD.transform.gameObject.SetActive(false); gameHUD.transform.gameObject.SetActive(true); Board.board.StartGame(); }
public void Save() { HUD_Manager HUDScript = GetComponent <HUD_Manager>(); System.IO.File.WriteAllText("Assets/Asset Test/Saves/Save.txt", HUDScript.HealthAmount.ToString() + "\n" + HUDScript.ArmorAmount.ToString() + "\n" + HUDScript.Rank + "\n" + HUDScript.Reputation.ToString() + "\n" + HUDScript.Money.ToString()); }
private void Awake() { if (!HudManager) { HudManager = this; DontDestroyOnLoad(this); } }
// Singleton pattern void Awake() { if (instance == null) //Check if instance already exists instance = this; //if not, set instance to this else if (instance != this) //If instance already exists and it's not this: Destroy(gameObject); //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager. DontDestroyOnLoad(gameObject); //Sets this to not be destroyed when reloading scene }
void OnTriggerEnter(Collider other) { HUD_Manager hudmanager = other.gameObject.GetComponent <HUD_Manager>(); if (hudmanager != null) { hudmanager.UpdateHealth(AttackDamage); } }
//Static instance check private void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } }
void Start() { camera = GameObject.Find("Main Camera").GetComponent <CameraWork>(); hUD_Manager = GetComponent <HUD_Manager>(); hUD_Manager.enabled = false; for (int i = 0; i < transform.childCount; i++) { transform.GetChild(i).gameObject.SetActive(false); flag = false; } }
// Singleton pattern 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); }
// Singleton pattern void Awake() { if (instance == null) //Check if instance already exists { instance = this; //if not, set instance to this } else if (instance != this) //If instance already exists and it's not this: { Destroy(gameObject); //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager. } DontDestroyOnLoad(gameObject); //Sets this to not be destroyed when reloading scene }
// Singleton pattern 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); } }
// Start is called before the first frame update void Start() { instance = this; hud_manager = GameObject.Find("Game Management").GetComponent<HUD_Manager>(); foreach (Button button in GetComponentsInChildren<Button>()) { if (!button.name.Contains("Detail") && !button.name.Contains("Disband")) { squad_buttons.Add(button); } } beginpos = squad_buttons[0].transform.position; }
void Awake() { if (Instance == null) { Instance = this; rectTrans = GetComponent <RectTransform>(); dialogueBox.SetActive(false); nextLevelPanel.SetActive(false); DontDestroyOnLoad(gameObject); } else if (Instance != this) { Destroy(gameObject); } gameObject.SetActive(true); }
// Start is called before the first frame update void Start() { Doom_Shroom_St = GetComponent <Doom_Shroom_State>(); Doom_Shroom_An = GetComponent <Doom_Shroom_Animation>(); HUD = Doom_Shroom_St.HUD; switch (Global_Variable.Difficulty_Level) { case 2: Max_Health = Health_Hard; break; case 1: Max_Health = Health_Normal; break; default: Max_Health = Health_Easy; break; } Current_Health = Max_Health; }
// Start is called before the first frame update void Start() { Store_Janitor_An = GetComponent <Store_Janitor_Animation>(); Store_Janitor_St = GetComponent <Store_Janitor_States>(); Store_Janitor_At = GetComponent <Store_Janitor_Attack>(); HUD = Store_Janitor_St.HUD; switch (Global_Variable.Difficulty_Level) { case 2: Max_Health = Health_Hard; break; case 1: Max_Health = Health_Normal; break; default: Max_Health = Health_Easy; break; } Current_Health = Max_Health; }
// Start is called before the first frame update void Start() { Electricity_Manager_An = GetComponent <Electricity_Manager_Animation>(); Electricity_Manager_St = GetComponent <Electricity_Manager_State>(); HUD = Electricity_Manager_St.HUD; switch (Global_Variable.Difficulty_Level) { case 2: Max_Health = Health_Hard; break; case 1: Max_Health = Health_Normal; break; default: Max_Health = Health_Easy; break; } Current_Health = Max_Health; }
// Use this for initialization void Start() { hudmanager = GameObject.FindGameObjectWithTag("Player").GetComponent <HUD_Manager>(); }
void OnEnable() { SetPlayerNameOnUnitFrame(); hudManager = this; }
// Use this for initialization void Start() { HUD_Manager = GameObject.Find("Player").GetComponent <HUD_Manager> (); }
void Awake() { // get references main = this; myTransform = transform; myAnimator = GetComponent<Animator>(); myCamera = GameObject.Find("Gemini Camera").transform.Find("Camera").camera; myCameraTransform = GameObject.Find("Gemini Camera").transform; ScoreManager = GetComponent<Score_Manager>(); myHUD = myCameraTransform.GetComponent<HUD_Manager>(); myAlign = GetComponent<PlanetAlign>(); // settings joystickBitMask = 1<<LayerMask.NameToLayer("Joystick"); joystickCenter = myCamera.WorldToScreenPoint(GameObject.Find("Joystick").transform.position); // set up CreateCombos(); Texture[][] cosmicTextures = new Texture[3][]; cosmicTextures[0] = cosmicPower1; cosmicTextures[1] = cosmicPower2; cosmicTextures[2] = cosmicPower3; AttackMeter = new AttackMeter_Manager(this, cosmicButton, cosmicTextures, new int[] {50, 100, 150}, new string[] {"SpeedBoost", "KillAll", "HealthBoost"}); }