public void UpdateHook(On.RoR2.UI.SkillIcon.orig_Update orig, SkillIcon self) { orig.Invoke(self); if (self.targetSkill && self.targetSkillSlot == SkillSlot.Primary) { if (self.targetSkill.characterBody.baseNameToken == "BANDIT2_BODY_NAME") { if (!modeLabel) { var pos = self.stockText.transform.position; modeLabel = CreateLabel( self.stockText.transform.parent, "ModeLabel", fireMode.ToString(), new Vector2(pos.x - 7.5f, pos.y + 20f) ); modeLabel.transform.rotation = self.stockText.transform.rotation; modeLabel.color = self.stockText.color; modeLabel.alignment = self.stockText.alignment; } modeLabel.SetText(fireMode.ToString()); } } }
public void UpdateHook(On.RoR2.UI.SkillIcon.orig_Update orig, SkillIcon self) { orig.Invoke(self); if (self.targetSkill && self.targetSkillSlot == SkillSlot.Primary) { if (self.targetSkill.characterBody.baseNameToken == "CAPTAIN_BODY_NAME") { self.stockText.gameObject.SetActive(true); self.stockText.fontSize = 12f; self.stockText.SetText(fireMode.ToString()); } } }
public void UpdateHook(On.RoR2.UI.SkillIcon.orig_Update orig, SkillIcon self) { orig.Invoke(self); if (self.targetSkill && self.targetSkillSlot == SkillSlot.Primary) { SurvivorIndex survivorIndex = SurvivorCatalog.GetSurvivorIndexFromBodyIndex(self.targetSkill.characterBody.bodyIndex); if (survivorIndex == SurvivorIndex.Captain) { self.stockText.gameObject.SetActive(true); self.stockText.fontSize = 12f; self.stockText.SetText(fireMode.ToString()); } } }