Created
January 15, 2018 15:05
-
-
Save Leopotam/b2112ffcd2c82cd11f072b7ba6bc6b0f 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 TestUiInputEventSystem : IEcsRunSystem { | |
[EcsWorld] | |
EcsWorld _world; | |
[EcsFilterInclude (typeof (EcsUiInputChangeEvent))] | |
EcsFilter _inputChangeEvents; | |
[EcsFilterInclude (typeof (EcsUiInputEndEvent))] | |
EcsFilter _inputEndEvents; | |
public EcsRunSystemType GetRunSystemType () { | |
return EcsRunSystemType.Update; | |
} | |
public void Run () { | |
foreach (var entity in _inputChangeEvents.Entities) { | |
var data = _world.GetComponent<EcsUiInputChangeEvent> (entity); | |
Debug.LogFormat (data.Sender, "Input changed: {0}", data.Value); | |
} | |
foreach (var entity in _inputEndEvents.Entities) { | |
var data = _world.GetComponent<EcsUiInputEndEvent> (entity); | |
Debug.LogFormat (data.Sender, "Input end: {0}", data.Value); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment