Exemple #1
0
        protected void Start()
        {
            _movement = gameObject.GetComponent <IMovementInterface>();

            _navigation         = GameServiceProvider.CurrentInstance.GetService <INavigationServiceInterface>();
            _heuristicEvaluator = new HeuristicEvaluator
                                  (
                new List <IBestFitHeuristicInterface>
            {
                new ClosestNodeBestFitHeuristic(),
                new FurthestFromStartBestFitHeuristic(),
                new LowestCostBestFitHeuristic()
            }
                                  );
        }
        public LocomotionInputHandler(IMovementInterface inMovementInterface, IPlayerCameraInterface inCameraInterface, IHeldItemInterface inHeldItemInterface)
            : base()
        {
            MovementInterface = inMovementInterface;
            CameraInterface   = inCameraInterface;
            HeldItemInterface = inHeldItemInterface;

            AnalogResponses.Add(EInputKey.HorizontalAnalog, OnHorizontalInput);
            AnalogResponses.Add(EInputKey.VerticalAnalog, OnVerticalInput);
            AnalogResponses.Add(EInputKey.CameraHorizontal, OnCameraHorizontalInput);
            AnalogResponses.Add(EInputKey.CameraZoom, OnCameraZoomInput);

            ButtonResponses.Add(EInputKey.CameraZoomReset, OnCameraZoomReset);
            ButtonResponses.Add(EInputKey.SprintButton, OnSprintButton);
            ButtonResponses.Add(EInputKey.PrimaryHeldAction, OnPrimaryHeldAction);
            ButtonResponses.Add(EInputKey.SecondaryHeldAction, OnSecondaryHeldAction);
            ButtonResponses.Add(EInputKey.DropHeldItem, OnDropHeldItem);
        }
 public void SetMovementType(IMovementInterface strategy)
 {
     _strategy = strategy;
 }