Example #1
0
        private void Events_OnTeleporting(Player nativePlayer, ref Vector3 position, ref float yaw, out bool cancel)
        {
            UnturnedPlayer player = GetUnturnedPlayer(nativePlayer);

            UnturnedPlayerTeleportingEvent @event = new UnturnedPlayerTeleportingEvent(player, position.ToSystemVector(), yaw);

            Emit(@event);

            position = @event.Position.ToUnityVector();
            yaw      = @event.Yaw;
            cancel   = @event.IsCancelled;
        }
Example #2
0
        private void Events_OnTeleporting(Player nativePlayer, ref Vector3 position, ref float yaw, ref bool cancel) // lgtm [cs/too-many-ref-parameters]
        {
            var player = GetUnturnedPlayer(nativePlayer) !;

            var @event = new UnturnedPlayerTeleportingEvent(player, position.ToSystemVector(), yaw)
            {
                IsCancelled = cancel
            };

            Emit(@event);

            position = @event.Position.ToUnityVector();
            yaw      = @event.Yaw;
            cancel   = @event.IsCancelled;
        }