This file contains hidden or 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 Unity.Entities; | |
public class ExampleClickSystem : ComponentSystem | |
{ | |
protected override void OnUpdate() | |
{ | |
Entities.ForEach((ref PointerEvent pointerEvent) => | |
{ | |
if (pointerEvent.EventType != PointerEventType.Click) | |
return; |
This file contains hidden or 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 Unity.Entities; | |
using UnityEngine; | |
using UnityEngine.EventSystems; | |
public class PointerPublisherBehaviour : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler, IPointerClickHandler, IDragHandler | |
{ | |
public GameObjectEntity gameObjectEntity; | |
EntityEventSystem eventSystem; | |
EntityEventSystem EventSystem => eventSystem ?? (eventSystem = World.Active.GetExistingManager<EntityEventSystem>()); |
This file contains hidden or 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
public struct PointerEvent : IComponentData | |
{ | |
public Entity Entity; | |
public PointerEventType EventType; | |
public PointerEvent(Entity entity, PointerEventType eventType) | |
{ | |
Entity = entity; | |
EventType = eventType; | |
} |