Add this component to an object and it'll become carryable by a Character with the appropriate ability (CharacterGrabCarryAndThrow)
More...
|
virtual void | Grab (Transform targetParent) |
| Triggered when this objects starts being carried Attaches to the grabber, and sets state More...
|
|
virtual void | Throw (int direction, float forceMultiplier) |
| Triggered when this object gets thrown More...
|
|
Add this component to an object and it'll become carryable by a Character with the appropriate ability (CharacterGrabCarryAndThrow)
◆ CarryMethods
The possible ways this object can be carried :
- Parent : the object gets parented to the Character, optionnally under a specified transform
- Follow : the object uses an additional MMFollowTarget component (you'll need to add it) to smoothly follow the Character
◆ Awake()
virtual void MoreMountains.CorgiEngine.GrabCarryAndThrowObject.Awake |
( |
| ) |
|
|
protectedvirtual |
On Awake we initialize our object
◆ Grab()
virtual void MoreMountains.CorgiEngine.GrabCarryAndThrowObject.Grab |
( |
Transform |
targetParent | ) |
|
|
virtual |
Triggered when this objects starts being carried Attaches to the grabber, and sets state
- Parameters
-
◆ Initialization()
virtual void MoreMountains.CorgiEngine.GrabCarryAndThrowObject.Initialization |
( |
| ) |
|
|
protectedvirtual |
Grabs and stores components
◆ ResetCollisions()
virtual IEnumerator MoreMountains.CorgiEngine.GrabCarryAndThrowObject.ResetCollisions |
( |
| ) |
|
|
protectedvirtual |
An internal coroutine used to reset collisions after a throw
- Returns
◆ Throw()
virtual void MoreMountains.CorgiEngine.GrabCarryAndThrowObject.Throw |
( |
int |
direction, |
|
|
float |
forceMultiplier |
|
) |
| |
|
virtual |
Triggered when this object gets thrown
- Parameters
-
direction | |
forceMultiplier | |
◆ _followTarget
MMFollowTarget MoreMountains.CorgiEngine.GrabCarryAndThrowObject._followTarget |
|
protected |
◆ _originalLayer
int MoreMountains.CorgiEngine.GrabCarryAndThrowObject._originalLayer |
|
protected |
◆ _originalScale
Vector3 MoreMountains.CorgiEngine.GrabCarryAndThrowObject._originalScale |
|
protected |
◆ _rigidbody2D
Rigidbody2D MoreMountains.CorgiEngine.GrabCarryAndThrowObject._rigidbody2D |
|
protected |
◆ _throwColliderCooldownWaitForSeconds
WaitForSeconds MoreMountains.CorgiEngine.GrabCarryAndThrowObject._throwColliderCooldownWaitForSeconds |
|
protected |
◆ _throwVector
Vector2 MoreMountains.CorgiEngine.GrabCarryAndThrowObject._throwVector |
|
protected |
◆ Carried
bool MoreMountains.CorgiEngine.GrabCarryAndThrowObject.Carried = false |
whether this object is being carried this frame or not
◆ CarryingAnimationID
int MoreMountains.CorgiEngine.GrabCarryAndThrowObject.CarryingAnimationID = 0 |
an ID that will get passed to the Character's animator when this object is carried. Use it to differentiate objects to get different carry animations
◆ CarryLayerMask
string MoreMountains.CorgiEngine.GrabCarryAndThrowObject.CarryLayerMask = "Projectiles" |
the mask the object should be moved to while carried
◆ CarryMethod
the selected carry method
◆ CarryOffset
Vector3 MoreMountains.CorgiEngine.GrabCarryAndThrowObject.CarryOffset = Vector3.zero |
the offset to apply when attaching the object to the character
◆ Force
float MoreMountains.CorgiEngine.GrabCarryAndThrowObject.Force = 1f |
the force at which this object should be thrown
◆ ForceMode
ForceMode2D MoreMountains.CorgiEngine.GrabCarryAndThrowObject.ForceMode = ForceMode2D.Impulse |
the force mode to apply when throwing
◆ OnGrabbed
UnityEvent MoreMountains.CorgiEngine.GrabCarryAndThrowObject.OnGrabbed |
a UnityEvent triggered when the object gets grabbed
◆ OnThrown
UnityEvent MoreMountains.CorgiEngine.GrabCarryAndThrowObject.OnThrown |
a UnityEvent triggered when the object gets thrown
◆ Recoil
float MoreMountains.CorgiEngine.GrabCarryAndThrowObject.Recoil = 0f |
the recoil to apply to the throwing Character after a throw
◆ ThrowColliderCooldown
float MoreMountains.CorgiEngine.GrabCarryAndThrowObject.ThrowColliderCooldown = 0.2f |
the cooldown (in seconds) after which to reset the layer and scale of our object after a throw
◆ ThrowDirection
Vector2 MoreMountains.CorgiEngine.GrabCarryAndThrowObject.ThrowDirection = new Vector2(1f, 0.25f) |
the direction the object should be thrown in if the Character is facing right (x will be reversed for left facing throws)
The documentation for this class was generated from the following file: