Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
 private void OnDisable()
 {
     Eventor.Unsubscribe <OnTestEventNotified>(HandleTestEventRaised);
     Debug.Log("Unsubscribe");
 }
Exemplo n.º 3
0
 private void OnEnable()
 {
     Eventor.Subscribe <OnTestEventNotified>(HandleTestEventRaised);
     Debug.Log("Subscribe");
 }