private void Update() { if (Input.GetKeyDown(KeyCode.E) && inZone && zone.ZoneEnabled) { OnDoorInteract?.Invoke(); } }
public static void InvokeDoorInteract(GameObject player, Door door, ref bool allow) { OnDoorInteract onDoorInteract = DoorInteractEvent; if (onDoorInteract == null) { return; } DoorInteractionEvent ev = new DoorInteractionEvent() { Player = Player.GetPlayer(player), Allow = allow, Door = door }; onDoorInteract?.Invoke(ref ev); allow = ev.Allow; }