Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     GllobalEventEntity.Addlistener(GllobalEventType.Event0, Callback0);
     GllobalEventEntity.Addlistener(GllobalEventType.Event0, Callback2);
     GllobalEventEntity.Addlistener <int>(GllobalEventType.Event1, Callback1);
     GllobalEventEntity.Addlistener <int>(GllobalEventType.Event1, Callback4);
 }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.R))
        {
            Start();
        }
        if (Input.GetKeyDown(KeyCode.F1))
        {
            GllobalEventEntity.Dispatcher(GllobalEventType.Event0);
        }
        if (Input.GetKeyDown(KeyCode.F2))
        {
            GllobalEventEntity.Dispatcher <int>(GllobalEventType.Event1, 11);
        }
        if (Input.GetKeyDown(KeyCode.F3))
        {
            GllobalEventEntity.Removelistener(GllobalEventType.Event0, Callback2);

            GllobalEventEntity.Removelistener <int>(GllobalEventType.Event1, Callback4);
        }
    }