private void Update() { if (Input.GetKeyDown(KeyCode.A)) { // Create parameter to pass to the event EventParam medicine = new EventParam(); // Choose specific type from different params in struct and assign value medicine.param1 = "Ibuprofen"; // Trigger event by passing event name and parameter EventManagerParam.TriggerEvent(GameEvent.UNLOCK_DRAWER, medicine); } }
protected void RetrieveButton() { //((/*Medical*/Medicine)currentResult).Quantity--; //SEE IF QUANTITY IS ABOUT HOW MANY PILLS IN A BOX, OR IF ITS ABOUT HOW MANY BOXES WITH PILLS. BIT CONFUSING WITH XML Medicine result2 = (Medicine)currentResult; if (result2.ToResult() == Tracker.medicine.ToResult()) { Tracker.correctMedicineRetrieved = true; } else { Debug.Log("Correct medicine is " + Tracker.medicine.mName + " but retrieved " + result2.mName); Tracker.wrongMedicines++; } EventParam medicine = new EventParam(); medicine.param1 = /*currentResult.Name;*/ ((Medicine)currentResult).Name; EventManagerParam.TriggerEvent(GameEvent.UNLOCK_DRAWER, medicine); }
void OnDisable() { EventManagerParam.StopListening(GameEvent.UNLOCK_DRAWER, medicineSelectedListener); }