Feel  4.3
The best way to improve your game's feel and make it extra juicy
MoreMountains.Feedbacks.MMF_Rigidbody2D Class Reference

this feedback will let you apply forces and torques (relative or not) to a Rigidbody More...

Inheritance diagram for MoreMountains.Feedbacks.MMF_Rigidbody2D:
MoreMountains.Feedbacks.MMF_Feedback

Public Types

enum  Modes { Modes.AddForce, Modes.AddRelativeForce, Modes.AddTorque }
 

Public Attributes

override bool HasAutomatedTargetAcquisition => true
 sets the inspector color for this feedback More...
 
Rigidbody2D TargetRigidbody2D
 the rigidbody to target on play More...
 
List< Rigidbody2D > ExtraTargetRigidbodies2D
 an extra list of rigidbodies to target on play More...
 
Modes Mode = Modes.AddForce
 the selected mode for this feedback More...
 
Vector2 MinForce
 the min force or torque to apply More...
 
Vector2 MaxForce
 the max force or torque to apply More...
 
float MinTorque
 the min torque to apply to this rigidbody on play More...
 
float MaxTorque
 the max torque to apply to this rigidbody on play More...
 
ForceMode2D AppliedForceMode = ForceMode2D.Impulse
 the force mode to apply More...
 
bool ResetVelocityOnPlay = false
 if this is true, the velocity of the rigidbody will be reset before applying the new force More...
 

Static Public Attributes

static bool FeedbackTypeAuthorized = true
 a static bool used to disable all feedbacks of this type at once More...
 

Protected Member Functions

override void AutomateTargetAcquisition ()
 A method meant to be implemented per feedback letting you specify what happens (usually setting a target) More...
 
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On Custom Play, we apply our force or torque to the target rigidbody More...
 
virtual void ApplyForce (Rigidbody2D rb, float feedbacksIntensity)
 Applies the computed force to the target rigidbody More...
 

Protected Attributes

Vector2 _force
 
float _torque
 

Additional Inherited Members

Detailed Description

this feedback will let you apply forces and torques (relative or not) to a Rigidbody

Member Enumeration Documentation

◆ Modes

Enumerator
AddForce 
AddRelativeForce 
AddTorque 

Member Function Documentation

◆ ApplyForce()

virtual void MoreMountains.Feedbacks.MMF_Rigidbody2D.ApplyForce ( Rigidbody2D  rb,
float  feedbacksIntensity 
)
protectedvirtual

Applies the computed force to the target rigidbody

Parameters
rb
feedbacksIntensity

◆ AutomateTargetAcquisition()

override void MoreMountains.Feedbacks.MMF_Rigidbody2D.AutomateTargetAcquisition ( )
protectedvirtual

A method meant to be implemented per feedback letting you specify what happens (usually setting a target)

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomPlayFeedback()

override void MoreMountains.Feedbacks.MMF_Rigidbody2D.CustomPlayFeedback ( Vector3  position,
float  feedbacksIntensity = 1.0f 
)
protectedvirtual

On Custom Play, we apply our force or torque to the target rigidbody

Parameters
position
feedbacksIntensity

Implements MoreMountains.Feedbacks.MMF_Feedback.

Member Data Documentation

◆ _force

Vector2 MoreMountains.Feedbacks.MMF_Rigidbody2D._force
protected

◆ _torque

float MoreMountains.Feedbacks.MMF_Rigidbody2D._torque
protected

◆ AppliedForceMode

ForceMode2D MoreMountains.Feedbacks.MMF_Rigidbody2D.AppliedForceMode = ForceMode2D.Impulse

the force mode to apply

◆ ExtraTargetRigidbodies2D

List<Rigidbody2D> MoreMountains.Feedbacks.MMF_Rigidbody2D.ExtraTargetRigidbodies2D

an extra list of rigidbodies to target on play

◆ FeedbackTypeAuthorized

bool MoreMountains.Feedbacks.MMF_Rigidbody2D.FeedbackTypeAuthorized = true
static

a static bool used to disable all feedbacks of this type at once

◆ HasAutomatedTargetAcquisition

override bool MoreMountains.Feedbacks.MMF_Rigidbody2D.HasAutomatedTargetAcquisition => true

sets the inspector color for this feedback

◆ MaxForce

Vector2 MoreMountains.Feedbacks.MMF_Rigidbody2D.MaxForce

the max force or torque to apply

◆ MaxTorque

float MoreMountains.Feedbacks.MMF_Rigidbody2D.MaxTorque

the max torque to apply to this rigidbody on play

◆ MinForce

Vector2 MoreMountains.Feedbacks.MMF_Rigidbody2D.MinForce

the min force or torque to apply

◆ MinTorque

float MoreMountains.Feedbacks.MMF_Rigidbody2D.MinTorque

the min torque to apply to this rigidbody on play

◆ Mode

Modes MoreMountains.Feedbacks.MMF_Rigidbody2D.Mode = Modes.AddForce

the selected mode for this feedback

◆ ResetVelocityOnPlay

bool MoreMountains.Feedbacks.MMF_Rigidbody2D.ResetVelocityOnPlay = false

if this is true, the velocity of the rigidbody will be reset before applying the new force

◆ TargetRigidbody2D

Rigidbody2D MoreMountains.Feedbacks.MMF_Rigidbody2D.TargetRigidbody2D

the rigidbody to target on play


The documentation for this class was generated from the following file: