public PlayerPilotController(PlayerPilotModelView player, ShipModelView ship, TrackPath checkpoints, DirectionArrowModelView dirHUDArrow)
    {
        playerModelView = player;
        shipModelView   = ship;
        checkpointsPath = checkpoints;
        directionArrow  = dirHUDArrow;

        checkpointsPath.SetObjPosition(shipModelView.transform, ship, true, true);
        directionArrow.CheckpointDirection = checkpointsPath.GetNextGatePoint(shipModelView.transform);
        directionArrow.ShipDirection       = shipModelView.transform;

        playerModelView.OnMovingInput       += HandleMovingInput;
        InputControl.Instance.OnActionInput += HandleActionInput;

        playerModelView.OnTriggerCollision += HandleTriggerCollision;
    }
예제 #2
0
    private int runOutDirection = 2;  // TODO переделать этот костыль

    public EnemyPilotController(EnemyPilotModelView enemyPilot, ShipModelView ship, TrackPath checkpoints)
    {
        pilotModelView  = enemyPilot;
        shipModelView   = ship;
        checkpointsPath = checkpoints;



        checkpointsPath.SetObjPosition(ship.transform, shipModelView, true);
        currentAim = checkpointsPath.GetStartPosition();

        pilotModelView.ChechpointTarget    = currentAim.position;
        pilotModelView.OnMovingInput      += HandleMovingInput;
        pilotModelView.OnActionInput      += HandleActionInput;
        pilotModelView.OnTriggerCollision += HandleTriggerCollision;

        shipModelView.OnSecondaryAbilityChanged += HandleShipSecondaryAbilityChanged;
        SetAimAndOffset();
    }