Question by
Von_Dutch · Nov 11, 2015 at 01:07 AM ·
eventsystemeventsevent-handling
Using two events
I've created my first event button called jump that make the player jump and it works because the debug log shows. I've created a second button called strike and all I want to do is show a debug.log when pressed. the jump works and the strike doesn't am I doing this correct?
void OnEnable() { EventManager.OnClicked += jump; EventManager.OnClicked += strike; }
void OnDisable()
{
EventManager.OnClicked -= jump;
EventManager.OnClicked -= strike;
}
public void strike()
{
if (Input.GetButtonDown ("Fire1")) {
attack = true;
Debug.Log ("attack");
attack = false;
}
}
Comment
Your answer
Follow this Question
Related Questions
Help with Unity Events 0 Answers
Way to assign event fields in created at runtime scriptable object (ScriptableObject Architecture) 0 Answers
How do I keep methods being called until the current one has finished running 0 Answers
IPointerEnterHandler calls immediately after IPointerExitHandler 0 Answers
multiple buttons not working 0 Answers