Exemple #1
0
    // method: begin a sweep via the given sweeping controller //
    private void beginSweepVia(Controller sweepingController)
    {
        if (zeroVelocitiesBefore)
        {
            MoonMotionPlayer.zeroVelocities();
        }

        potentialSweepStartingTime          = time;
        potentialControllerSweepingPosition = sweepingController.position();
        potentialSweepStartingPosition      = MoonMotionBody.position;
        potentialCurrentTargetPosition      = sweepingController.position.positionAlong
                                              (
            (
                operations.firstOperatedOperation().inputs.has(Controller.Input.touchpad) ?
                sweepingController.relativeTouchpadDirectionWhereZeroesIsForward :
                sweepingController.forward()
            ).withVectralYZeroed(),
            sweepDistance
                                              );

        SkiingSettings.singleton.heldVersusToggled = false;
        if (togglesSkiing)
        {
            Skier.enableSkiing();
        }
    }
    // method: begin a dash to the given provided raycast hit //
    private void beginDashTo(object raycastHit_RaycastHitProvider)
    {
        if (zeroVelocitiesBefore)
        {
            MoonMotionPlayer.zeroVelocities();
        }

        if (temporarilyLockYPosition)
        {
            lastYPositionLockednessBeforeDashing = MoonMotionPlayer.positionYLockedness;
            MoonMotionPlayer.lockPositionY();
        }

        RaycastHit raycastHit = raycastHit_RaycastHitProvider.provideRaycastHit();

        potentialDashStartingPosition  = MoonMotionBody.position;
        potentialCurrentTargetPosition = raycastHit.position();
        potentialCurrentTargetCollider = raycastHit.collider;

        SkiingSettings.singleton.heldVersusToggled = false;
        if (togglesSkiing)
        {
            Skier.enableSkiing();
        }
    }
Exemple #3
0
    // method: stop the current sweep, if any //
    private void stopSweep()
    {
        SkiingSettings.singleton.heldVersusToggled = false;
        if (togglesSkiing)
        {
            Skier.disableSkiing();
        }

        potentialCurrentTargetPosition = null;

        if (zeroVelocitiesAfter)
        {
            MoonMotionPlayer.zeroVelocities();
        }
    }
    // method: stop the current dash, if any //
    private void stopDash()
    {
        SkiingSettings.singleton.heldVersusToggled = false;
        if (togglesSkiing)
        {
            Skier.disableSkiing();
        }

        potentialCurrentTargetPosition = null;

        if (temporarilyLockYPosition)
        {
            MoonMotionPlayer.setPositionYLockednessTo(lastYPositionLockednessBeforeDashing);
        }

        if (zeroVelocitiesAfter)
        {
            MoonMotionPlayer.zeroVelocities();
        }
    }