Skip to content

Instantly share code, notes, and snippets.

@Leopotam
Created January 15, 2018 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Leopotam/5da7e987ee73ce7978924ad5109f0851 to your computer and use it in GitHub Desktop.
Save Leopotam/5da7e987ee73ce7978924ad5109f0851 to your computer and use it in GitHub Desktop.
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