private static void HealthBar_Awake(On.RoR2.UI.HealthBar.orig_Awake orig, HealthBar self) { healthBars.Add(self, new HealthBarInfo { healthBarObject = self.gameObject, healthBar = self }); orig(self); }
private void HealthBarAwakeAddon(On.RoR2.UI.HealthBar.orig_Awake orig, RoR2.UI.HealthBar self) { orig(self); var currentRect = self.gameObject.GetComponentsInChildren <RectTransform>(); if (currentRect != null && VanillaHPBarRef == null) { for (int i = 0; i < currentRect.Length; ++i) { if (currentRect[i].name == "HealthbarRoot") { VanillaHPBarRef = currentRect[i].gameObject; MainHPGlobeStart(); } } } }