private static void HandleCoreTypeRegistered(UTinyRegistryEventType @event, IRegistryObject obj) { if (!(obj is UTinyType) || null == obj?.Registry) { return; } var type = (UTinyType)obj; UTinyEventDispatcher.AddListener <UTinyType.Reference, IEnumerable <UTinyEntity> >((UTinyType.Reference)type, ProcessDependency); }
private static void Register() { UTinyEventDispatcher.AddListener <UTinyRegistryEventType, IRegistryObject>(UTinyRegistryEventType.Registered, HandleCoreTypeRegistered); }
public static void AddListener<TEvent, TValue>(TEvent type, UTinyEventHandler<TEvent, TValue> @event) where TEvent : struct where TValue : class { UTinyEventDispatcher<TEvent>.AddListener(type, @event); }
private static void RegisterChangeHandlers() { UTinyEventDispatcher <ChangeSource> .AddListener <object>(ChangeSource.DataModel, HandleDataModelChange); UTinyEventDispatcher <ChangeSource> .AddListener <object>(ChangeSource.SceneGraph, HandleSceneGraphChange); }