示例#1
0
        private void Ashore(PlayerEntity player, float inWaterDepth)
        {
            var syncTransform = player.RootGo().transform;

            syncTransform.position = new Vector3(player.position.Value.x,
                                                 player.position.Value.y + inWaterDepth - SwimPositionUnderWater,
                                                 player.position.Value.z);
            PlayerMoveSystem.SyncUpdateComponentPos(player, syncTransform.position);
            //_logger.InfoFormat("after ashore pos:{0}",player.position.Value.ToStringExt());
            player.stateInterface.State.Ashore();
        }
示例#2
0
        private void Swim(PlayerEntity player)
        {
            var syncTransform = player.RootGo().transform;

            syncTransform.position = new Vector3(player.position.Value.x,
                                                 SingletonManager.Get <MapConfigManager>().WaterSurfaceHeight(player.position.Value) - (AnimatorParametersHash.FirstPersonStandCameraHeight + HeightOffset),
                                                 player.position.Value.z);
            player.position.Value = syncTransform.position;

            PlayerMoveSystem.SyncUpdateComponentPos(player, syncTransform.position);
            player.stateInterface.State.Swim();
            player.triggerEvent.NeedUnmountWeapon = true;
            //   player.ModeController().CallBeforeAction(player.WeaponController(),EPlayerActionType.Swim);

            //_logger.InfoFormat("swim ashore pos:{0}",player.position.Value.ToStringExt());
        }