scripts
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000314 RID: 788
|
||||
public static class EventHandlerExtensions
|
||||
{
|
||||
// Token: 0x0600321C RID: 12828 RVA: 0x0004A844 File Offset: 0x00048A44
|
||||
public static void TakeCapture(this IEventHandler handler)
|
||||
{
|
||||
if (handler.panel != null)
|
||||
{
|
||||
handler.panel.dispatcher.TakeCapture(handler);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600321D RID: 12829 RVA: 0x0004A868 File Offset: 0x00048A68
|
||||
public static bool HasCapture(this IEventHandler handler)
|
||||
{
|
||||
return handler.panel != null && handler.panel.dispatcher.capture == handler;
|
||||
}
|
||||
|
||||
// Token: 0x0600321E RID: 12830 RVA: 0x0004A8A4 File Offset: 0x00048AA4
|
||||
public static void ReleaseCapture(this IEventHandler handler)
|
||||
{
|
||||
if (handler.panel != null)
|
||||
{
|
||||
handler.panel.dispatcher.ReleaseCapture(handler);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600321F RID: 12831 RVA: 0x0004A8C8 File Offset: 0x00048AC8
|
||||
public static void RemoveCapture(this IEventHandler handler)
|
||||
{
|
||||
if (handler.panel != null)
|
||||
{
|
||||
handler.panel.dispatcher.RemoveCapture();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003220 RID: 12832 RVA: 0x0004A8E8 File Offset: 0x00048AE8
|
||||
public static ScheduleBuilder Schedule(this IEventHandler handler, Action<TimerState> timerUpdateEvent)
|
||||
{
|
||||
ScheduleBuilder scheduleBuilder;
|
||||
if (handler.panel == null || handler.panel.scheduler == null)
|
||||
{
|
||||
Debug.LogError("Cannot schedule an event without a valid panel");
|
||||
scheduleBuilder = default(ScheduleBuilder);
|
||||
}
|
||||
else
|
||||
{
|
||||
scheduleBuilder = handler.panel.scheduler.Schedule(timerUpdateEvent, handler);
|
||||
}
|
||||
return scheduleBuilder;
|
||||
}
|
||||
|
||||
// Token: 0x06003221 RID: 12833 RVA: 0x0004A944 File Offset: 0x00048B44
|
||||
public static void Unschedule(this IEventHandler handler, Action<TimerState> timerUpdateEvent)
|
||||
{
|
||||
if (handler.panel == null || handler.panel.scheduler == null)
|
||||
{
|
||||
Debug.LogError("Cannot unschedule an event without a valid panel");
|
||||
}
|
||||
else
|
||||
{
|
||||
handler.panel.scheduler.Unschedule(timerUpdateEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user