|
virtual void | Awake () |
| On Awake we initialize our magnet More...
|
|
virtual void | Initialization () |
| Grabs the collider2D and ensures it's set as trigger, initializes the speed More...
|
|
virtual void | OnTriggerEnter2D (Collider2D colliding) |
| When something enters our trigger, if it's a proper target, we start following it More...
|
|
virtual void | OnTriggerExit2D (Collider2D colliding) |
| When something exits our trigger, we stop following it More...
|
|
virtual void | OnTriggerEnter (Collider colliding) |
| When something enters our trigger, if it's a proper target, we start following it More...
|
|
virtual void | OnTriggerExit (Collider colliding) |
| When something exits our trigger, we stop following it More...
|
|
virtual void | OnTriggerEnterInternal (GameObject colliding) |
| Starts following an object we trigger with if conditions are met More...
|
|
virtual void | OnTriggerExitInternal (GameObject colliding) |
| Stops following an object we trigger with if conditions are met More...
|
|
virtual void | Update () |
| At update we follow our target More...
|
|
virtual void | FixedUpdate () |
| At fixed update we follow our target More...
|
|
virtual void | LateUpdate () |
| At late update we follow our target More...
|
|
virtual void | FollowTargetPosition () |
| Follows the target, lerping the position or not based on what's been defined in the inspector More...
|
|
◆ UpdateModes
the possible update modes
Enumerator |
---|
Update | |
FixedUpdate | |
LateUpdate | |
◆ Awake()
virtual void MoreMountains.CorgiEngine.Magnetic.Awake |
( |
| ) |
|
|
protectedvirtual |
On Awake we initialize our magnet
◆ FixedUpdate()
virtual void MoreMountains.CorgiEngine.Magnetic.FixedUpdate |
( |
| ) |
|
|
protectedvirtual |
At fixed update we follow our target
◆ FollowTargetPosition()
virtual void MoreMountains.CorgiEngine.Magnetic.FollowTargetPosition |
( |
| ) |
|
|
protectedvirtual |
Follows the target, lerping the position or not based on what's been defined in the inspector
◆ Initialization()
virtual void MoreMountains.CorgiEngine.Magnetic.Initialization |
( |
| ) |
|
|
protectedvirtual |
Grabs the collider2D and ensures it's set as trigger, initializes the speed
◆ LateUpdate()
virtual void MoreMountains.CorgiEngine.Magnetic.LateUpdate |
( |
| ) |
|
|
protectedvirtual |
At late update we follow our target
◆ OnTriggerEnter()
virtual void MoreMountains.CorgiEngine.Magnetic.OnTriggerEnter |
( |
Collider |
colliding | ) |
|
|
protectedvirtual |
When something enters our trigger, if it's a proper target, we start following it
- Parameters
-
◆ OnTriggerEnter2D()
virtual void MoreMountains.CorgiEngine.Magnetic.OnTriggerEnter2D |
( |
Collider2D |
colliding | ) |
|
|
protectedvirtual |
When something enters our trigger, if it's a proper target, we start following it
- Parameters
-
◆ OnTriggerEnterInternal()
virtual void MoreMountains.CorgiEngine.Magnetic.OnTriggerEnterInternal |
( |
GameObject |
colliding | ) |
|
|
protectedvirtual |
Starts following an object we trigger with if conditions are met
- Parameters
-
◆ OnTriggerExit()
virtual void MoreMountains.CorgiEngine.Magnetic.OnTriggerExit |
( |
Collider |
colliding | ) |
|
|
protectedvirtual |
When something exits our trigger, we stop following it
- Parameters
-
◆ OnTriggerExit2D()
virtual void MoreMountains.CorgiEngine.Magnetic.OnTriggerExit2D |
( |
Collider2D |
colliding | ) |
|
|
protectedvirtual |
When something exits our trigger, we stop following it
- Parameters
-
◆ OnTriggerExitInternal()
virtual void MoreMountains.CorgiEngine.Magnetic.OnTriggerExitInternal |
( |
GameObject |
colliding | ) |
|
|
protectedvirtual |
Stops following an object we trigger with if conditions are met
- Parameters
-
◆ SetTarget()
virtual void MoreMountains.CorgiEngine.Magnetic.SetTarget |
( |
Transform |
newTarget | ) |
|
|
virtual |
Sets a new target for this object to magnet towards
- Parameters
-
◆ StartFollowing()
virtual void MoreMountains.CorgiEngine.Magnetic.StartFollowing |
( |
| ) |
|
|
virtual |
Makes the object follow the target
◆ StopFollowing()
virtual void MoreMountains.CorgiEngine.Magnetic.StopFollowing |
( |
| ) |
|
|
virtual |
Prevents the object from following the target anymore
◆ Update()
virtual void MoreMountains.CorgiEngine.Magnetic.Update |
( |
| ) |
|
|
protectedvirtual |
At update we follow our target
◆ _collider2D
Collider2D MoreMountains.CorgiEngine.Magnetic._collider2D |
|
protected |
◆ _direction
Vector3 MoreMountains.CorgiEngine.Magnetic._direction |
|
protected |
◆ _lastTargetPosition
Vector3 MoreMountains.CorgiEngine.Magnetic._lastTargetPosition |
|
protected |
◆ _newPosition
Vector3 MoreMountains.CorgiEngine.Magnetic._newPosition |
|
protected |
◆ _newTargetPosition
Vector3 MoreMountains.CorgiEngine.Magnetic._newTargetPosition |
|
protected |
◆ _speed
float MoreMountains.CorgiEngine.Magnetic._speed |
|
protected |
◆ _velocity
Vector3 MoreMountains.CorgiEngine.Magnetic._velocity = Vector3.zero |
|
protected |
◆ CopyState
GameObject MoreMountains.CorgiEngine.Magnetic.CopyState |
an object this magnetic object should copy the active state on
◆ FollowAcceleration
float MoreMountains.CorgiEngine.Magnetic.FollowAcceleration = 0.75f |
the acceleration to apply to the object once it starts following
◆ FollowPosition
bool MoreMountains.CorgiEngine.Magnetic.FollowPosition = true |
whether or not the object is currently following its target's position
◆ FollowPositionSpeed
float MoreMountains.CorgiEngine.Magnetic.FollowPositionSpeed = 5f |
the speed at which to interpolate the follower's movement
◆ InterpolatePosition
bool MoreMountains.CorgiEngine.Magnetic.InterpolatePosition = true |
whether or not we need to interpolate the movement
◆ MagneticTypeID
int MoreMountains.CorgiEngine.Magnetic.MagneticTypeID = 0 |
a unique ID for this type of magnetic objects. This can then be used by a MagneticEnabler to target only that specific ID. An ID of 0 will be picked by all MagneticEnablers automatically.
◆ Offset
Vector3 MoreMountains.CorgiEngine.Magnetic.Offset |
the offset to apply to the followed target
◆ StartMagnetOnEnter
bool MoreMountains.CorgiEngine.Magnetic.StartMagnetOnEnter = true |
whether or not to start moving when something on the target layer mask enters this magnetic element's trigger
◆ StopMagnetOnExit
bool MoreMountains.CorgiEngine.Magnetic.StopMagnetOnExit = false |
whether or not to stop moving when something on the target layer mask exits this magnetic element's trigger
◆ Target
Transform MoreMountains.CorgiEngine.Magnetic.Target |
the target to follow, read only, for debug only
◆ TargetLayerMask
the layermask this magnetic element is attracted to
◆ UpdateMode
the update at which the movement happens
The documentation for this class was generated from the following file:
- Assets/CorgiEngine/Common/Scripts/Environment/Magnetic.cs