I have a menu with multiple functions and settings so I am using the below code to switch methods via state, but something is going wrong with the math except when I associate the method with an input, so I know there’s something wrong with the OnClick.AddListener I am using. Here’s a video
switch(currentBattleState){
case (BattleStates.PLAYERCHOICE):
// Seupt Battle Function
Button1.SetActive(true);
Button1text.text = "WaterPunch";
Button1b.onClick.AddListener(() => Attack());
//----------------------------------------------------------
if (Input.GetKeyDown(KeyCode.W))
{
Attack();
}
//-----------------------------------------------------------
public void Attack()
{
enemyHealth.battleEHealth -= 2 + (3 * levelUp.currentPlayerLevel);
}