private void DamageTankPart(TankSection part, int healthChange) { var partState = gameState.tankState.tankSectionState.FirstOrDefault(x => x.tankSection == part); partState.health = Mathf.Clamp(partState.health + healthChange, 0, partState.maxHealth); gameState.tankState.hullHp = Mathf.Clamp(gameState.tankState.hullHp + healthChange, 0, gameState.tankState.maxHp); }
public void Initialize(TankSection tankSection, CrewMemberState crewMember) { TankSection = tankSection; sectionNameText.text = tankSection.ToString(); UpdateCrewState(crewMember); }
public static string GetPrettified(this TankSection tankSection) //TODO This should not be in code! { switch (tankSection) { case TankSection.DRIVER_SEAT: return("DRIVER SEAT"); case TankSection.MAIN_GUN: return("MAIN GUN"); case TankSection.SECONDARY_GUN: return("MACHINE GUN"); case TankSection.RECON_STATION: return("RECON STATION"); default: return("INVALID"); } }
public void SetupTankAbility(int slot, TankSection tankPart, TankAbility ability, Action <TankSectionAbility> onHoverAbility, Action <TankSectionAbility> onPressedAbility) { var tankSection = abilitySections.FirstOrDefault(x => x.TankSection == tankPart); tankSection.RegisterAbility(slot, ability, onHoverAbility, onPressedAbility); }
public void Initialize(TankSection tankSection) { TankSection = tankSection; }
internal void SetState(TankSection tankPart, int slot) { TankPart = tankPart; Slot = slot; }