Пример #1
0
 public CameraPostUpdateSystem(PlayerContext playContext, VehicleContext vehicleContext, FreeMoveContext freeMoveContext)
 {
     _playerContext       = playContext;
     _vehicleContext      = vehicleContext;
     _freeMoveContext     = freeMoveContext;
     _baseCollisionLayers = UnityLayers.SceneCollidableLayerMask;
 }
Пример #2
0
 public CameraPreUpdateSystem(Contexts contexts, Motors m)
 {
     _vehicleContext  = contexts.vehicle;
     _freeMoveContext = contexts.freeMove;
     _contexts        = contexts;
     _motors          = m;
     _state           = new DummyCameraMotorState(m);
 }
Пример #3
0
 public ClientCameraPreUpdateSystem(VehicleContext vehicleContext, FreeMoveContext freeMoveContext, PlayerContext playerContext, Motors m)
 {
     _vehicleContext          = vehicleContext;
     _freeMoveContext         = freeMoveContext;
     _motors                  = m;
     _playerContext           = playerContext;
     _state                   = new DummyCameraMotorState(m);
     _subCameraMotorTypeArray = Enum.GetValues(typeof(SubCameraMotorType));
 }
Пример #4
0
 public CameraUpdateSystem(Contexts context, Motors m)
 {
     _context         = context;
     _vehicleContext  = context.vehicle;
     _freeMoveContext = context.freeMove;
     _playerContext   = context.player;
     _motors          = m;
     _state           = new DummyCameraMotorState(_motors);
     _dummyState      = new DummyCameraMotorState(_motors);
 }
Пример #5
0
 public ClientCameraPreUpdateSystem(Contexts contexts, Motors m)
 {
     _vehicleContext          = contexts.vehicle;
     _freeMoveContext         = contexts.freeMove;
     _motors                  = m;
     _playerContext           = contexts.player;
     _contexts                = contexts;
     _state                   = new DummyCameraMotorState(m);
     _subCameraMotorTypeArray = Enum.GetValues(typeof(SubCameraMotorType));
 }
Пример #6
0
 public FreeObjectCastLogic(
     FreeMoveContext freeMoveContext,
     PlayerContext playerContext,
     IUserCmdGenerator cmdGenerator,
     float distance) : base(playerContext, distance)
 {
     _userCmdGenerator = cmdGenerator;
     _freeMoveContext  = freeMoveContext;
     _playerContext    = playerContext;
 }
Пример #7
0
 public PickUpUiAdapter(PlayerContext player, SceneObjectContext sceneObject, MapObjectContext mapObject, SessionContext session, VehicleContext vehicle, FreeMoveContext freeMove, UserInputManager.Lib.UserInputManager userInputManager, UiContext uiContext)
 {
     this.player           = player;
     this.sceneObject      = sceneObject;
     this.mapObject        = mapObject;
     this.session          = session;
     this.vehicle          = vehicle;
     this.freeMove         = freeMove;
     this.userInputManager = userInputManager;
     this.uiContext        = uiContext;
 }
Пример #8
0
 public CameraPreUpdateSystem(VehicleContext vehicleContext, FreeMoveContext freeMoveContext, Motors m)
 {
     _vehicleContext  = vehicleContext;
     _freeMoveContext = freeMoveContext;
     _motors          = m;
     _state           = new DummyCameraMotorState(m);
     foreach (SubCameraMotorType value in Enum.GetValues(typeof(SubCameraMotorType)))
     {
         _subCameraMotorTypeArray.Add(value);
     }
 }
Пример #9
0
 public static FreeMoveEntity GetAirPlane(this PlayerEntity playerEntity, FreeMoveContext freeMoveContext)
 {
     foreach (var freeMoveEntity in freeMoveContext.GetEntities())
     {
         if (freeMoveEntity.hasFreeData && freeMoveEntity.hasPosition &&
             freeMoveEntity.freeData.Key.Equals("plane"))
         {
             return(freeMoveEntity);
         }
     }
     return(null);
 }
Пример #10
0
 public CameraUpdateSystem(Contexts context, Motors m)
 {
     _context         = context;
     _vehicleContext  = context.vehicle;
     _freeMoveContext = context.freeMove;
     _playerContext   = context.player;
     _motors          = m;
     _state           = new DummyCameraMotorState(_motors);
     foreach (SubCameraMotorType value in Enum.GetValues(typeof(SubCameraMotorType)))
     {
         _subCameraMotorTypeArray.Add(value);
     }
 }
Пример #11
0
        public DrivePoseMotor(ECameraPoseMode modeId,
                              HashSet <ECameraPoseMode> excludes,
                              VehicleContext vehicleContext,
                              FreeMoveContext freeMoveContext,
                              Motors m
                              ) : base(m)
        {
            _modeId = (short)modeId;
            _motors = m;

            this.excludes = new HashSet <short>();
            foreach (var e in excludes)
            {
                this.excludes.Add((short)e);
            }

            _order = SingletonManager.Get <CameraConfigManager>().GetRoleConfig()
                     .GetCameraConfigItem((ECameraPoseMode)_modeId).Order;

            _motors.ActionManager.AddAction(CameraActionType.Enter, SubCameraMotorType.Pose, (int)modeId,
                                            (player, state) =>
            {
                if (player.IsOnVehicle())
                {
                    var vehicle = vehicleContext.GetEntityWithEntityKey(player.controlledVehicle.EntityKey);
                    player.controlledVehicle.CameraAnchorOffset    = vehicle.vehicleAssetInfo.CameraAnchorOffset;
                    player.controlledVehicle.CameraDistance        = vehicle.vehicleAssetInfo.CameraDistance;
                    player.controlledVehicle.CameraRotationDamping = vehicle.vehicleAssetInfo.CameraRotationDamping;
                }

                var cameraEulerAngle = player.cameraFinalOutputNew.EulerAngle;

                var carEulerAngle = player.cameraArchor.ArchorEulerAngle;

                var t           = cameraEulerAngle - carEulerAngle;
                state.FreeYaw   = t.y;
                state.FreePitch = t.x;
            });
            _motors.ActionManager.AddAction(CameraActionType.Leave, SubCameraMotorType.Pose, (int)modeId,
                                            (player, state) =>
            {
                var rotation             = player.cameraFinalOutputNew.EulerAngle;
                player.orientation.Yaw   = YawPitchUtility.Normalize(rotation.y);
                player.orientation.Pitch = YawPitchUtility.Normalize(rotation.x);

                state.LastFreePitch = 0;
                state.LastFreeYaw   = 0;
                state.FreeYaw       = 0f;
                state.FreePitch     = 0f;
            });
        }
Пример #12
0
        public CameraPostUpdateSystem(Contexts context) : base(context)
        {
            _playerContext       = context.player;
            _freeMoveContext     = context.freeMove;
            _baseCollisionLayers = UnityLayers.CameraCollidableLayerMask;

            _archoroffsetArm = new SpringArm();
            _postOffsetArm   = new SpringArm();
            _offsetArm       = new SpringArm();

            _archoroffsetArm.Set(0.2f, 0.2f, 5, _baseCollisionLayers);
            _postOffsetArm.Set(0.12f, 0.5f, 5, _baseCollisionLayers);
            _offsetArm.Set(0.1f, 0.02f, 5, _baseCollisionLayers);
        }
Пример #13
0
 public AirplanePoseMotor(ECameraPoseMode modeId, HashSet <ECameraPoseMode> excludes, VehicleContext vehicleContext, FreeMoveContext freeMoveContext, Motors m) :
     base(modeId, excludes, vehicleContext, freeMoveContext, m)
 {
 }
Пример #14
0
 public CameraUpdateArchorSystem(Contexts _contexts) : base(_contexts)
 {
     _playerContext   = _contexts.player;
     _freeMoveContext = _contexts.freeMove;
 }
Пример #15
0
 public FreeMoveCleanupSystem(FreeMoveContext freeMoveContext)
 {
     _group = freeMoveContext.GetGroup(FreeMoveMatcher.AnyOf(FreeMoveMatcher.FlagDestroy));
 }
Пример #16
0
        public static Motors CraeteMotors(CameraConfig config, VehicleContext vehicle, FreeMoveContext freeMoveContext)
        {
            Motors motors = new Motors();

            var pose = motors.GetDict(SubCameraMotorType.Pose);

            pose[(int)ECameraPoseMode.Stand]       = new NormalPoseMotor(ECameraPoseMode.Stand, config.GerCameraConfigItem(ECameraConfigType.ThirdPerson), new HashSet <ECameraPoseMode>(CommonEnumEqualityComparer <ECameraPoseMode> .Instance), new ThirdPersonActice());
            pose[(int)ECameraPoseMode.Crouch]      = new NormalPoseMotor(ECameraPoseMode.Crouch, config.GerCameraConfigItem(ECameraConfigType.Crouch), new HashSet <ECameraPoseMode>(CommonEnumEqualityComparer <ECameraPoseMode> .Instance), new CrouchActice());
            pose[(int)ECameraPoseMode.Prone]       = new NormalPoseMotor(ECameraPoseMode.Prone, config.GerCameraConfigItem(ECameraConfigType.Prone), new HashSet <ECameraPoseMode>(CommonEnumEqualityComparer <ECameraPoseMode> .Instance), new ProneActice());
            pose[(int)ECameraPoseMode.Swim]        = new NormalPoseMotor(ECameraPoseMode.Swim, config.GerCameraConfigItem(ECameraConfigType.Swim), new HashSet <ECameraPoseMode>(CommonEnumEqualityComparer <ECameraPoseMode> .Instance), new SwimActice());
            pose[(int)ECameraPoseMode.Dying]       = new NormalPoseMotor(ECameraPoseMode.Dying, config.GerCameraConfigItem(ECameraConfigType.Dying), new HashSet <ECameraPoseMode>(CommonEnumEqualityComparer <ECameraPoseMode> .Instance), new DyingActice());
            pose[(int)ECameraPoseMode.Dead]        = new DeadPoseMotor(ECameraPoseMode.Dead, config.GerCameraConfigItem(ECameraConfigType.Dead), new HashSet <ECameraPoseMode>(CommonEnumEqualityComparer <ECameraPoseMode> .Instance), new DeadActice(), config.DeadConfig);
            pose[(int)ECameraPoseMode.Parachuting] = new NormalPoseMotor(ECameraPoseMode.Parachuting, config.GerCameraConfigItem(ECameraConfigType.Parachuting), new HashSet <ECameraPoseMode>(CommonEnumEqualityComparer <ECameraPoseMode> .Instance), new ParachutingActice(), 400);

            pose[(int)ECameraPoseMode.ParachutingOpen] = new NormalPoseMotor(ECameraPoseMode.ParachutingOpen, config.GerCameraConfigItem(ECameraConfigType.ParachutingOpen), new HashSet <ECameraPoseMode>(CommonEnumEqualityComparer <ECameraPoseMode> .Instance), new ParachutingOpenActice(), 300);

            pose[(int)ECameraPoseMode.Gliding]  = new GlidingPoseMotor(ECameraPoseMode.Gliding, config.GerCameraConfigItem(ECameraConfigType.Gliding), new HashSet <ECameraPoseMode>(CommonEnumEqualityComparer <ECameraPoseMode> .Instance), new GlidingActice());
            pose[(int)ECameraPoseMode.DriveCar] = new DrivePoseMotor(ECameraPoseMode.DriveCar, config.GerCameraConfigItem(ECameraConfigType.DriveCar), new HashSet <ECameraPoseMode>(CommonEnumEqualityComparer <ECameraPoseMode> .Instance), vehicle, freeMoveContext);
            pose[(int)ECameraPoseMode.AirPlane] = new AirplanePoseMotor(ECameraPoseMode.AirPlane, config.GerCameraConfigItem(ECameraConfigType.AirPlane), new HashSet <ECameraPoseMode>(CommonEnumEqualityComparer <ECameraPoseMode> .Instance), vehicle, freeMoveContext);

            pose[(int)ECameraPoseMode.Rescue] = new NormalPoseMotor(ECameraPoseMode.Rescue, config.GerCameraConfigItem(ECameraConfigType.Rescue), new HashSet <ECameraPoseMode>(CommonEnumEqualityComparer <ECameraPoseMode> .Instance), new RescueActive());

            var free = motors.GetDict(SubCameraMotorType.Free);

            free[(int)ECameraFreeMode.On]  = new FreeOnMotor();
            free[(int)ECameraFreeMode.Off] = new FreeOffMotor(config.FreeConfig.TransitionTime);

            var peek = motors.GetDict(SubCameraMotorType.Peek);

            peek[(int)ECameraPeekMode.Off]   = new PeekOffMotor(config.PeekConfig.TransitionTime);
            peek[(int)ECameraPeekMode.Left]  = new PeekOnMotor(false, config.PeekConfig);
            peek[(int)ECameraPeekMode.Right] = new PeekOnMotor(true, config.PeekConfig);

            var view = motors.GetDict(SubCameraMotorType.View);

            view[(int)ECameraViewMode.FirstPerson] = new FirstViewMotor();
            view[(int)ECameraViewMode.GunSight]    = new GunSightMotor();
            view[(int)ECameraViewMode.ThirdPerson] = new ThirdViewMotor();

            CameraActionManager.AddAction(CameraActionType.Enter, SubCameraMotorType.Pose,
                                          (int)ECameraConfigType.Parachuting, (player, state) =>
            {
                var cameraEulerAngle = player.cameraFinalOutputNew.EulerAngle;
                var carEulerAngle    = player.cameraArchor.ArchorEulerAngle;
                var t           = cameraEulerAngle - carEulerAngle;
                state.FreeYaw   = t.y;
                state.FreePitch = t.x;
            });

            return(motors);
        }
Пример #17
0
 public AirplanePoseMotor(ECameraPoseMode modeId, CameraConfigItem config, HashSet <ECameraPoseMode> excludes, VehicleContext vehicleContext, FreeMoveContext freeMoveContext) :
     base(modeId, config, excludes, vehicleContext, freeMoveContext)
 {
 }
Пример #18
0
 public FreeMoveAddSystem(FreeMoveContext sceneObjectContext) : base(sceneObjectContext)
 {
 }
Пример #19
0
 public FreeObjectCastLogic(FreeMoveContext freeMoveContext, PlayerContext playerContext, UserInputManager.Lib.UserInputManager userInputManager, float distance) : base(playerContext, distance)
 {
     _freeMoveContext  = freeMoveContext;
     _playerContext    = playerContext;
     _userInputManager = userInputManager;
 }
Пример #20
0
 public FreeMoveGameContext(FreeMoveContext context, Bin2D <IGameEntity> bin) : base(context, FreeMoveComponentsLookup.componentTypes, bin)
 {
     _context = context;
 }
 public FreeObjectCleanUpSystem(FreeMoveContext context)
 {
     _group = context.GetGroup(FreeMoveMatcher.AllOf(FreeMoveMatcher.FlagDestroy));
 }
Пример #22
0
 public FreeObjectLoadSystem(FreeMoveContext freeMove) : base(freeMove)
 {
 }
Пример #23
0
 public AirPlaneInitSystem(FreeMoveContext freeMoveContext) : base(freeMoveContext)
 {
     //_freeMovegroup = freeMoveContext.GetGroup(FreeMoveMatcher.FreeData);
 }