// hudEnergyBar.CalculateMode calculateMode; // float healthP; // Start is called before the first frame update void Start() { bossIni = false; alpha = 1f; fader = 0f; curEnergy = 0f; maxEnergy = 0f; visible = false; hudColors = new hudChangingColors.hudColors(true); EnergyBarColors = hudColors.getVisorEnergyBarColors(); root = gameObject.transform.Find("bossHud").gameObject; bossBar = root.transform.Find("BossHealth/BossBar").gameObject.GetComponent <hudEnergyBar>(); textBoss = root.transform.Find("BossFrame/bossName").gameObject.GetComponent <Text>(); textBossSub = textBoss.transform.GetChild(0).GetComponent <Text>(); rootChildren = new List <GameObject>(); foreach (Transform child in root.transform.GetComponentsInChildren <Transform>(true)) { if (child != root.transform) { rootChildren.Add(child.gameObject); //Debug.Log(child.name); } } bossBar.SetTesselation(0.2f); //calculateMode = hudEnergyBar.CalculateMode.automatic; //bossBar.SetFilledDrainSpeed(0f); //test bossBar.SetFilledColor(EnergyBarColors.filled); bossBar.SetShadowColor(EnergyBarColors.shadow); bossBar.SetEmptyColor(EnergyBarColors.empty); }
//float healthP; //hudEnergyBar.CalculateMode calculateMode; private void Start() { hudColors = new hudChangingColors.hudColors(true); initColors = hudColors.getVisorEnergyInitColors(); barColors = hudColors.getVisorEnergyBarColors(); }
void updateItems(hudTypes hud) { if (hud == hudTypes.combat) { //string path = "combatHud"; //cEnergyDigits = gameObject.transform.Find(path + "/EnergyBar/healthDigits").gameObject.GetComponent<Text>(); //List<Transform> tempList = new List<Transform>(); //tempList.AddRange(gameObject.transform.Find(path).GetComponentsInChildren<Transform>()); //foreach (Transform item in tempList) //{ // if (item.name.StartsWith("EnergyTankBack")) // { // cEmptyTanks.Add(item.gameObject.GetComponent<Image>()); // } // else if (item.name.StartsWith("EnergyTank") && !item.name.Contains("Back")) // { // cFilledTanks.Add(item.gameObject.GetComponent<Image>()); // } //} //cEnergyWarning = gameObject.transform.Find(path + "/EnergyBar/EnergyWarning").gameObject.GetComponent<Text>(); //cEnergyBar = gameObject.transform.Find("combatVisor/basewidget_energystuff/energybart01_energybar/HealthBack/HealthBar").gameObject.GetComponent<hudEnergyBar>(); cEnergyDigits = combatEnergyDigits; cEmptyTanks = combatEmptyTanks; cFilledTanks = combatFilledTanks; cEnergyWarning = combatEnergyWarning; cEnergyBar = combatEnergyBar; } else { //string path = "ballHUD"; //cEnergyDigits = gameObject.transform.Find(path + "/Text/healthText").gameObject.GetComponent<Text>(); //List<Transform> tempList = new List<Transform>(); //tempList.AddRange(gameObject.transform.Find(path + "/EnergyTanks").GetComponentsInChildren<Transform>()); //foreach (Transform item in tempList) //{ // if (item.name.StartsWith("empty")) // { // cEmptyTanks.Add(item.gameObject.GetComponent<Image>()); // } // else if (item.name.StartsWith("fill") && !item.name.Contains("empty")) // { // cFilledTanks.Add(item.gameObject.GetComponent<Image>()); // } //} //cEnergyWarning = gameObject.transform.Find(path + "/Text/EnergyWarning").gameObject.GetComponent<Text>(); //cEnergyBar = gameObject.transform.Find(path + "/healthBar/background/healthBar").gameObject.GetComponent<hudEnergyBar>(); cEnergyDigits = ballEnergyDigits; cEnergyBar = ballEnergyBar; cEmptyTanks = ballEmptyTanks; cFilledTanks = ballFilledTanks; cEnergyWarning = ballEnergyWarning; } if (hud == hudTypes.combat) { initColors = hudColors.getVisorEnergyInitColors(true); barColors = hudColors.getVisorEnergyBarColors(true); } else { initColors = hudColors.getVisorEnergyInitColors(false); barColors = hudColors.getVisorEnergyBarColors(false); } }