I am trying to block scroll input when a certain weapon is equipped. The weapon state has been set to Tool. I know this state is being switched on/off as the weapon is equipped/unequipped. I added the state to the "Equip Scroll" ability (blank preset). The state gets permanently set to "On" and is not following what my script indicates in the editor.
Code:
public class ToggleTool : MonoBehaviour
{
public bool tool;
void Start()
{
EventHandler.RegisterEvent<GameObject, string, bool>("OnStateChange", StateChange);
}
void StateChange(GameObject gObject, string state, bool isActive)
{
if(state == "Tool")
{
if(isActive)
{
tool = true;
}
else
{
tool = false;
}
}
}
}
Last edited: