public void Initialize(StatUI s) { m_ui = s; s.m_stat = this; s.m_statname.text = m_name.ToUpper(); // UpdateValue (m_maxScore / 2); s.m_icon.texture = m_icon; }
protected override void Start() { base.Start(); statUI = GetComponentInChildren <StatUI>(); // StartTurnEvent += EvaluateAI; DamageEvent += statUI.UpdateDisplay; PlayerAttackEvent.RegisterListener(PlayerWeaponDisplay); }
// Start is called before the first frame update void Start() { isDataChanged = true; instance = this; if (statSet.activeSelf) { statSet.SetActive(false); } }
// Start is called before the first frame update void Start() { healthStatUI = GameObject.Find("PlayerHealthBar").GetComponent <StatUI>(); strengthStatUI = GameObject.Find("PlayerStrengthBar").GetComponent <StatUI>(); protectionStatUI = GameObject.Find("PlayerProtectionBar").GetComponent <StatUI>(); EquipmentManager.instance.onEquipmentChanged += OnEquipmentChanged; InitializeSliders(); //Set player health to be max on awake. this.IncreaseHealth(maxHealth); }
// Use this for initialization void Start() { ui = GameObject.Find("StatUI").GetComponent<StatUI>(); spawner = GameObject.Find("SpawnManager").GetComponent<SpawnManager>(); shooter = GameObject.Find("ProjectileManager").GetComponent<ProjectileManager>(); player = GameObject.Find("Player").GetComponent<Player>(); frontInd = transform.Find("LevelIndicator").GetComponent<Text>(); backInd = transform.Find("LevelIndicatorBack").GetComponent<Text>(); overlay = transform.Find("Overlay").gameObject; fadeImage = overlay.GetComponent<RawImage>(); player.reset(); StartCoroutine(startSequence()); }
// Use this for initialization void Start() { ui = GameObject.Find("StatUI").GetComponent <StatUI>(); spawner = GameObject.Find("SpawnManager").GetComponent <SpawnManager>(); shooter = GameObject.Find("ProjectileManager").GetComponent <ProjectileManager>(); player = GameObject.Find("Player").GetComponent <Player>(); frontInd = transform.Find("LevelIndicator").GetComponent <Text>(); backInd = transform.Find("LevelIndicatorBack").GetComponent <Text>(); overlay = transform.Find("Overlay").gameObject; fadeImage = overlay.GetComponent <RawImage>(); player.reset(); StartCoroutine(startSequence()); }
public void Start() { if (!DEBUG) { SaveLoadData.LoadGameData(); //give money for amount of time passed TimeSpan timePassed = DateTime.UtcNow - time.date_Last_Opened; money.current_Money += money.total_Value * timePassed.Minutes; } statUI = FindObjectOfType <StatUI>(); //start the passing of time time.StartCoroutine(time.PassYearsRealtime()); //start gaining money money.StartCoroutine(money.GainMoney()); }
void Awake() { spellBookButton = GetComponent <Button> (); spellBookButton.onClick.AddListener(delegate { GuiManager.instance.SpellBookObject.SetActive(true); RefreshSpellBookSpells(); if (CombatManager.instance != null && GameManager.instance.state == GameStatus.BATTLE) { CombatManager.instance.SelectedSpell = null; } }); GuiManager.instance.SpellBookObject.SetActive(true); abilityPanelUI = GuiManager.instance.SpellBookObject.GetComponentInChildren <AbilityPanelUI> (); statUI = GuiManager.instance.SpellBookObject.GetComponentInChildren <StatUI> (); statUI.Refresh(GameManager.instance.CurrentGame.playerTroop.hero.stats.GetStat(StatType.MANA)); GuiManager.instance.SpellBookObject.SetActive(false); }
public void SpawnStats() { foreach (var stat in stats) { // Spawn a UI element GameObject clone = Instantiate(statPrefab, statParent); clone.name = stat.name; // Update name of GameObject (for Hierarchy) // Set the text StatUI ui = clone.GetComponent <StatUI>(); stat.ui = ui; // Call minus in stat when button is pressed ui.minusButton.onClick.AddListener(stat.Minus); // Call plus in stat when button is pressed ui.plusButton.onClick.AddListener(stat.Plus); // Update the UI at start stat.UpdateUI(); } }
public override void OnActivate() { GameManager.instance.UpdatedPositionByResolution(); if (!GameManager.instance.m_demoMode) { // initialize player prefs related variables int help_Gameplay = PlayerPrefs.GetInt("Help_Gameplay"); int help_Phone = PlayerPrefs.GetInt("Help_Phone"); if (help_Gameplay == 1) { m_helpTapIconGameplayShown = true; } if (help_Phone == 1) { m_helpTapIconPhoneShown = true; } } // initialize stats foreach (Stat thisStat in m_statBank) { Stat s = (Stat)ScriptableObject.CreateInstance("Stat"); s.m_icon = thisStat.m_icon; s.m_losingStrings = thisStat.m_losingStrings; s.m_winningStrings = thisStat.m_winningStrings; s.m_name = thisStat.m_name; s.m_category = thisStat.m_category; // create stat UI objects, size based on current platform and screen size bool largeScreenFormat = false; #if UNITY_IOS float w = Screen.width; float h = Screen.height; if (w / h < 1.5f) { largeScreenFormat = true; } // if(UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPad1Gen || // UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPad2Gen || // UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPadMini3Gen || // UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPad4Gen || // UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPadAir1 || // UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPadAir2 || // UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPadMini1Gen || // UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPadMini2Gen || // UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPadMini3Gen || // UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPadMini4Gen || // UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPadPro10Inch1Gen || // UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPadPro1Gen || // UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPadUnknown) // { // largeScreenFormat = true; // } #else largeScreenFormat = true; #endif if (largeScreenFormat) { GameObject uiOBJ = (GameObject)Instantiate(m_statOBJ_LargeScreen, m_statPanel_LargeScreen); uiOBJ.transform.localScale = Vector3.one; StatUI st = (StatUI)uiOBJ.GetComponent <StatUI> (); s.Initialize(st); m_stats.Add(s); } else { GameObject uiOBJ = (GameObject)Instantiate(m_statOBJ, m_statPanel); uiOBJ.transform.localScale = Vector3.one; StatUI st = (StatUI)uiOBJ.GetComponent <StatUI> (); s.Initialize(st); m_stats.Add(s); } } // play curtain raise animation or skip if needed if (!GameManager.instance.m_skipIntro) { StartCoroutine(Intro()); } else { foreach (Stat s in m_stats) { s.UpdateValue(s.maxScore / 2); } m_introPanel.gameObject.SetActive(false); // m_titleText.gameObject.SetActive (true); UpdateTimeLine(); StartRound(); m_playerInputAllowed = true; } }
void Awake() { button = GetComponent <Button> (); available = false; manaUI = GetComponentInChildren <StatUI> (); }