Esempio n. 1
0
        void OnGUI()
        {
            if (GUI.Button(new Rect(10, 10, 200, 50), "Event1 Fire"))
            {
                UIEventMgr <EventTestEnum> .FireEvent(EventTestEnum.TestEnum);
            }
            if (GUI.Button(new Rect(10, 70, 200, 50), "Event1 Remove"))
            {
                UIEventMgr <EventTestEnum> .RemoveEvent(EventTestEnum.TestEnum, OnEvent1);
            }

            if (GUI.Button(new Rect(10, 130, 200, 50), "Event2 Fire"))
            {
                UIEventMgr <EventTestEnum> .FireEvent <int>(EventTestEnum.TestEnum, 12345);
            }
            if (GUI.Button(new Rect(10, 200, 200, 50), "Event2 Remove"))
            {
                UIEventMgr <EventTestEnum> .RemoveEvent <int>(EventTestEnum.TestEnum, OnEvent2);
            }
        }
Esempio n. 2
0
        void Start()
        {
            UIEventMgr <EventTestEnum> .AddEvent(EventTestEnum.TestEnum, OnEvent1);

            UIEventMgr <EventTestEnum> .AddEvent <int>(EventTestEnum.TestEnum, OnEvent2);
        }