public TriggerHandlerService() { NwTrigger?trigger = NwObject.FindObjectsWithTag <NwTrigger>("mytrigger").FirstOrDefault(); if (trigger != null) { trigger.OnEnter += OnTriggerEnter; } }
public TriggerHandlerService(NativeEventService eventService) { NwTrigger trigger = NwObject.FindObjectsWithTag <NwTrigger>("mytrigger").FirstOrDefault(); eventService.Subscribe <NwTrigger, TriggerEvents.OnEnter>(trigger, OnTriggerEnter); }