Ejemplo n.º 1
0
        // Update is called once per frame
        void Update()
        {
            if (Input.GetMouseButtonDown(0))
            {
                TypeEventSystem.Send(new A());
            }

            if (Input.GetMouseButtonDown(1))
            {
                TypeEventSystem.Send(new B());
            }

            if (Input.GetKeyDown(KeyCode.U))
            {
                TypeEventSystem.UnRegister <A>(ReceiveA);
                TypeEventSystem.UnRegister <B>(ReceiveB);
            }
        }
 public void Dispose()
 {
     TypeEventSystem.UnRegister <NotifyEvent>(Update);
 }