//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); } }