// 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 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 }
// Start is called before the first frame update void Awake() { ini = false; string path = "combatHud/Envirorment"; damagePulse = 0f; damagePulseTimer = 0f; arrowTimer = 0f; warningColorLerp = 0f; warningLerpAlpha = 0f; threatStatus = ThreatStatus.Normal; visible = true; iconTranslateRange = 342.5f; hudColors = new hudColors(true); //lhudTimer = new hudTimer(); threatStuff = gameObject.transform.Find(path).gameObject; threatIcon = new List <GameObject>(); foreach (Transform transform in threatStuff.transform.Find("EnIcon").GetComponentsInChildren <Transform>()) { threatIcon.Add(transform.gameObject); //Debug.Log(transform.gameObject + "[" + threatIcon.Count + "]"); } arrowDown = threatStuff.transform.Find("EnIcon/EnarrowDown").gameObject.GetComponent <Image>(); arrowUp = threatStuff.transform.Find("EnIcon/EnarrowUp").gameObject.GetComponent <Image>(); threatWarning = threatStuff.transform.Find("EnIcon/warningText").gameObject.GetComponent <Text>(); threatBar = threatStuff.transform.Find("EnBarBack/EnBar").gameObject.GetComponent <hudEnergyBar>(); //threatBar.initBars(threatBar.gameObject.GetComponent<Image>(), threatBar.gameObject.transform.parent.Find("EnBarShadow").gameObject.GetComponent<Image>()); //Debug.Log(threatBar); hasArrows = arrowUp != null && arrowDown != null; threatIcon[0].GetComponent <Image>().color = hudColors.threatIconColor; threatIconTrans = threatIcon[0].transform; threatBar.SetFilledColor(hudColors.threatBarFilled); //Debug.Log(threatBar.GetFilledColor()); threatBar.SetShadowColor(hudColors.threatBarShadow); //Debug.Log(threatBar.GetShadowColor()); threatBar.SetEmptyColor(hudColors.threatBarEmpty); //Debug.Log(threatBar.GetEmptyColor()); threatBar.SetTesselation(1f); threatBar.SetMaxEnergy(100f); threatBar.SetFilledDrainSpeed(9999f); threatBar.SetShadowDrainSpeed(9999f); threatBar.SetShadowDrainDelay(0f); threatBar.SetIsAlwaysResetTimer(false); if (threatWarning) { threatWarning.color = hudColors.threatWarningFont; threatWarning.gameObject.GetComponent <Outline>().effectColor = hudColors.threatWarningOutline; } //localMat = new Material(threatWarning.material); //threatWarning.material = localMat; debugIniMaxEnergy = threatBar.GetMaxEnergy(); ini = true; }
//Material localMat; // Start is called before the first frame update void Awake() { rendertimings = 0; arrowTimer = 0f; missileWarningAlpha = 0f; latestStatus = invStatus.Normal; missileWarningPulse = 0f; missileIconAltDeplete = 0f; missileIconIncrement = 0f; visible = true; IconTranslateRange = 342.5f; hudColors = new hudColors(true); string path = "combatHud/Missiles"; //hudType = HudType; //missileCapacity = MissileCapacity; //numMissiles = NumMissiles; //missilesActive = MissilesActive; missileIcon = gameObject.transform.Find(path + "/MIcon").gameObject.GetComponent <Image>(); missileDigits = gameObject.transform.Find(path + "/MIcon/count").gameObject.GetComponent <Text>(); missileBar = gameObject.transform.Find(path + "/MBarBack/MBar").gameObject.GetComponent <hudEnergyBar>(); missileWarning = gameObject.transform.Find(path + "/MIcon/depleted").gameObject.GetComponent <Text>(); arrowUp = gameObject.transform.Find(path + "/MIcon/arrowUp").gameObject.GetComponent <Image>(); arrowDown = gameObject.transform.Find(path + "/MIcon/arrowDown").gameObject.GetComponent <Image>(); hasArrows = arrowUp && arrowDown; iconTransform = missileIcon.transform; missileDigits.color = hudColors.missileDigitsFont; missileDigits.gameObject.GetComponent <Outline>().effectColor = hudColors.missileDigitsOutline; missileIcon.color = hudColors.missileIconColorInactive; missileBar.SetEmptyColor(hudColors.missileBarEmpty); missileBar.SetFilledColor(hudColors.missileBarFilled); missileBar.SetShadowColor(hudColors.missileBarShadow); missileBar.SetTesselation(1f); missileBar.SetMaxEnergy(5f); missileBar.SetFilledDrainSpeed(99f); missileBar.SetShadowDrainSpeed(20f); missileBar.SetShadowDrainDelay(0.7f); missileBar.SetIsAlwaysResetTimer(true); rIconLerp = 1f; missIni = false; if (missileWarning) { missileWarning.color = hudColors.missileWarningFont; missileWarning.gameObject.GetComponent <Outline>().effectColor = hudColors.missileWarningOutline; } //localMat = new Material(missileDigits.material); //missileDigits.material = localMat; latestStatus = GetInvStatus(); }
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) { cHudColors = combatHudColors; cInitColors = combatInitColors; cBarColors = combatBarColors; } else { cHudColors = ballHudColors; cInitColors = ballInitColors; cBarColors = ballBarColors; } }