Пример #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;
        }
Пример #2
0
 private void OnDisable()
 {
     Eventor.Unsubscribe <OnTestEventNotified>(HandleTestEventRaised);
     Debug.Log("Unsubscribe");
 }
Пример #3
0
 private void OnEnable()
 {
     Eventor.Subscribe <OnTestEventNotified>(HandleTestEventRaised);
     Debug.Log("Subscribe");
 }