public void Start() { TestingEvents testingEvents=GetComponent<TestingEvent>(); testingEvents.OnSpacePressed +=Testing_OnSpacePressed; testingEvents.OnFloatEvent +=Testing_OnFloatEvent; testingEvents.OnActionEvent +=TestingEvents_OnActionEvent;
void Start() { _testingEvents = GetComponent <TestingEvents>(); _testingEvents.OnSpacePressed += TestingEvents_OnSpacePressed; }
// Start is called before the first frame update void Start() { TestingEvents testingEvents = GetComponent <TestingEvents>(); // get the reference to the publisher script testingEvents.OnSpacePressed += Subscriber_OnSpacePressed; // subscribe }