Esempio n. 1
0
    // at each physics update: //
    public override void physicsUpdate()
    {
        if (operations.isOperated() && !currentlySweeping)
        {
            beginSweepVia(operations.firstRelevantController());
        }
        else if
        (
            currentlySweeping &&
            (
                (isCancelable && operations.isOperated()) ||

                (limitSweepDuration && (timeSince(sweepStartingTime) > sweepDurationLimit)) ||

                MoonMotionBody.isWithinDistanceOf(currentTargetPosition, endingThresholdDistance) ||

                endIfOverswept.and(MoonMotionBody.isMoreDistantInSameDirectionalityAs(currentTargetPosition, sweepStartingPosition)) ||

                MoonMotionPlayer.isCollidedWith(sweepEndingLayerMask)
            )
        )
        {
            stopSweep();
        }

        if (currentlySweeping)
        {
            MoonMotionPlayer.applyMistargetedAttractionFrom
            (
                currentTargetPosition,
                controllerSweepingPosition,
                forceMagnitude
            );
        }
    }
Esempio n. 2
0
    // at each physics update: //
    public override void physicsUpdate()
    {
        if (operations.isOperated() && DashingTargeting.targetedObject)
        {
            beginDashTo(DashingTargeting.targetingRaycastHit);
        }
        else if
        (
            currentlyDashing &&
            (
                (isCancelable && !DashingTargeting.targetedObject && operations.isOperated()) ||

                endUponTargetCollision.and(MoonMotionPlayer.isCollidedWith(potentialCurrentTargetCollider)) ||

                MoonMotionPlayer.isCollidedWith(dashEndingLayerMask) ||

                endIfOverdashed.and(MoonMotionBody.isMoreDistantInSameDirectionalityAs(currentTargetPosition, dashStartingPosition)) ||

                MoonMotionBody.isWithinDistanceOf(currentTargetPosition, endingThresholdDistance)
            )
        )
        {
            stopDash();
        }

        if (currentlyDashing)
        {
            MoonMotionPlayer.applyMistargetedAttractionFrom
            (
                currentTargetPosition,
                dashStartingPosition,
                forceMagnitude
            );
        }
    }