void OnGUI() { GUI.backgroundColor = Color.red; GUILayout.BeginHorizontal(); { if (GUILayout.Button("Enable")) { gameObject.SetActive(true); } if (GUILayout.Button("Disable")) { gameObject.SetActive(false); } if (GUILayout.Button("Notify")) { Eventor.Notify(new OnTestEventNotified(999, "HotEvent Test")); } } GUILayout.EndHorizontal(); GUI.backgroundColor = Color.white; }
private void OnDisable() { Eventor.Unsubscribe <OnTestEventNotified>(HandleTestEventRaised); Debug.Log("Unsubscribe"); }
private void OnEnable() { Eventor.Subscribe <OnTestEventNotified>(HandleTestEventRaised); Debug.Log("Subscribe"); }