private static bool SetCharacterPositionOnVehicle(this PlayerEntity playerEntity, VehicleContext context)
        {
            var characterTransform = playerEntity.RootGo().transform;
            var character          = playerEntity.RootGo();

            if (null == characterTransform)
            {
                return(false);
            }
            bool on = playerEntity.IsOnVehicle();

            if (on)
            {
                var seat = playerEntity.GetVehicleSeatTransform(context);
                if (seat != null)
                {
                    _mount.MountCharacterToVehicleSeat(character, seat);
                    playerEntity.orientation.Pitch = 0;
                    playerEntity.orientation.Yaw   = 0;

                    EnablePassagerCollider(playerEntity, context);
                    return(true);
                }

                return(false);
            }

            EnablePassagerCollider(playerEntity, context);
            characterTransform.SetParent(null, false);
            return(true);
        }
        public void ExecuteUserCmd(IPlayerUserCmdGetter getter, IUserCmd cmd)
        {
            var playerEntities = _playerContext.GetEntities();
            var ownerEntity    = getter.OwnerEntity as PlayerEntity;

            for (var i = 0; i < playerEntities.Length; ++i)
            {
                var playerEntity = playerEntities[i];
                if (!playerEntity.IsOnVehicle())
                {
                    continue;
                }

                var seat = playerEntity.GetVehicleSeatTransform(_vehicleContext);
                if (null == seat)
                {
                    continue;
                }
                var characterTransform = playerEntity.RootGo().transform;
                var character          = playerEntity.RootGo();
                if (seat != characterTransform.parent)
                {
                    _mount.MountCharacterToVehicleSeat(character, seat);

                    // 切换座位,并且换到主驾驶位,设置IK
                    if (playerEntity.IsVehicleDriver())
                    {
                        var vehicle = _vehicleContext.GetEntityWithEntityKey(playerEntity.controlledVehicle.EntityKey);
                        playerEntity.SetSteeringWheelIK(vehicle);
                    }
                    else
                    {
                        playerEntity.EndSteeringWheelIK();
                    }
                }

                if (ownerEntity == playerEntity)
                {
                    playerEntity.position.Value  = characterTransform.position;
                    playerEntity.orientation.Yaw = characterTransform.rotation.eulerAngles.y;
                }
            }
        }