public void EventSystemBaseTestSimplePasses()
    {
        //Check that the event system is empty
        Assert.True(CEventSystem.Count == 0);

        //create an event, add it to the system, and check the count
        TestEventObject testEvent = new TestEventObject();

        CEventSystem.AddEventHandler(category.category, category.subcategory, testEvent);
        Assert.True(CEventSystem.Count == 1);

        //Check the state of the test class after broadcasting a set true, set false, and foo event
        Assert.True(!testEvent.State);
        CEventSystem.BroadcastEvent(category.category, category.subcategory, new SetTrueEvent());
        Assert.True(testEvent.State);
        CEventSystem.BroadcastEvent(category.category, category.subcategory, new SetFalseEvent());
        Assert.True(!testEvent.State);
        CEventSystem.BroadcastEvent(category.category, category.subcategory, new FooEvent());
        Assert.True(!testEvent.State);

        //remove the event, check the count of the system.
        CEventSystem.RemoveEventHandler(category.category, category.subcategory, testEvent);
        Assert.True(CEventSystem.Count == 0);
    }
Ejemplo n.º 2
0
 private void Awake()
 {
     CEventSystem.AddEventHandler(EventChannel.input, EventSubChannel.player1, this);
     CEventSystem.AddEventHandler(EventChannel.gameState, EventSubChannel.none, this);
     instance = this;
 }
Ejemplo n.º 3
0
 void Awake()
 {
     CEventSystem.AddEventHandler(EventChannel.gameState, EventSubChannel.none, this);
 }
Ejemplo n.º 4
0
 void Awake()
 {
     CEventSystem.AddEventHandler(EventChannel.gameState, EventSubChannel.none, this);
     //tween = gameObject.AddComponent<AsymtoticTweener>();
 }
Ejemplo n.º 5
0
 private void Awake()
 {
     CEventSystem.AddEventHandler(EventChannel.sound, EventSubChannel.none, this);
 }