Created
January 15, 2018 15:05
-
-
Save Leopotam/dcd00cb0c0052399452d6d538f55d3a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LeopotamGroup.Ecs.Ui.Components; | |
using UnityEngine; | |
namespace LeopotamGroup.Ecs.Ui.Tests { | |
public class TestUiEnterExitEventSystem : IEcsRunSystem { | |
[EcsWorld] | |
EcsWorld _world; | |
[EcsFilterInclude (typeof (EcsUiEnterEvent))] | |
EcsFilter _enterEvents; | |
[EcsFilterInclude (typeof (EcsUiExitEvent))] | |
EcsFilter _exitEvents; | |
public EcsRunSystemType GetRunSystemType () { | |
return EcsRunSystemType.Update; | |
} | |
public void Run () { | |
foreach (var entity in _enterEvents.Entities) { | |
var data = _world.GetComponent<EcsUiEnterEvent> (entity); | |
Debug.Log ("Cursor enter!", data.Sender); | |
} | |
foreach (var entity in _exitEvents.Entities) { | |
var data = _world.GetComponent<EcsUiExitEvent> (entity); | |
Debug.Log ("Cursor exit!", data.Sender); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment