Created
January 15, 2018 18:07
-
-
Save Leopotam/5da7e987ee73ce7978924ad5109f0851 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 System.Collections.Generic; | |
using LeopotamGroup.Ecs.Ui.Components; | |
using UnityEngine; | |
namespace LeopotamGroup.Ecs.Ui.Tests { | |
public class TestUiScrollViewEventSystem : EcsReactSystem { | |
[EcsWorld] | |
EcsWorld _world; | |
[EcsFilterInclude (typeof (EcsUiScrollViewEvent))] | |
EcsFilter _scrollViewEvents; | |
public override EcsFilter GetReactFilter () { | |
return _scrollViewEvents; | |
} | |
public override EcsReactSystemType GetReactSystemType () { | |
return EcsReactSystemType.OnAdd; | |
} | |
public override EcsRunSystemType GetRunSystemType () { | |
return EcsRunSystemType.Update; | |
} | |
public override void RunReact (List<int> entities) { | |
foreach (var entity in _scrollViewEvents.Entities) { | |
var data = _world.GetComponent<EcsUiScrollViewEvent> (entity); | |
Debug.LogFormat (data.Sender, "ScrollView changed: {0}", data.Value); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment