Example #1
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.E) && inZone && zone.ZoneEnabled)
     {
         OnDoorInteract?.Invoke();
     }
 }
Example #2
0
        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;
        }