TopDown Engine  v3.6
MoreMountains.TopDownEngine.PickableItem Class Reference

A simple class, meant to be extended, that will handle all the mechanics of a pickable thing : feedbacks, collision, pick consequences, etc More...

Inheritance diagram for MoreMountains.TopDownEngine.PickableItem:
MoreMountains.TopDownEngine.TopDownMonoBehaviour MoreMountains.Tools.MMMonoBehaviour MoreMountains.TopDownEngine.Coin MoreMountains.TopDownEngine.DamageOverTimeInterrupter MoreMountains.TopDownEngine.ExplodudesBombPicker MoreMountains.TopDownEngine.PickableAbility MoreMountains.TopDownEngine.PickableAction MoreMountains.TopDownEngine.PickableDamageResistance MoreMountains.TopDownEngine.PickableDash2D MoreMountains.TopDownEngine.PickableWeapon MoreMountains.TopDownEngine.Star MoreMountains.TopDownEngine.Stimpack

Public Member Functions

virtual void OnTriggerEnter (Collider collider)
 Triggered when something collides with the coin More...
 
virtual void OnTriggerEnter2D (Collider2D collider)
 Triggered when something collides with the coin More...
 
virtual void PickItem (GameObject picker)
 Check if the item is pickable and if yes, proceeds with triggering the effects and disabling the object More...
 

Public Attributes

MMFeedbacks PickedMMFeedbacks
 A feedback to play when the object gets picked. More...
 
bool DisableColliderOnPick = false
 if this is true, the picker's collider will be disabled on pick More...
 
bool DisableObjectOnPick = true
 if this is set to true, the object will be disabled when picked More...
 
float DisableDelay = 0f
 the duration (in seconds) after which to disable the object, instant if 0 More...
 
bool DisableModelOnPick = false
 if this is set to true, the object will be disabled when picked More...
 
bool DisableTargetObjectOnPick = false
 if this is set to true, the target object will be disabled when picked More...
 
GameObject TargetObjectToDisable
 the object to disable on pick if DisableTargetObjectOnPick is true More...
 
float TargetObjectDisableDelay = 1f
 the time in seconds before disabling the target if DisableTargetObjectOnPick is true More...
 
GameObject Model
 the visual representation of this picker More...
 
bool RequireCharacterComponent = true
 if this is true, this pickable item will only be pickable by objects with a Character component More...
 
bool RequirePlayerType = true
 if this is true, this pickable item will only be pickable by objects with a Character component of type player More...
 

Protected Member Functions

virtual void Start ()
 
virtual IEnumerator DisableTargetObjectCoroutine ()
 
virtual IEnumerator DisablePickerCoroutine ()
 
virtual bool CheckIfPickable ()
 Checks if the object is pickable. More...
 
virtual void Effects ()
 Triggers the various pick effects More...
 
virtual void Pick (GameObject picker)
 Override this to describe what happens when the object gets picked More...
 

Protected Attributes

Collider _collider
 
Collider2D _collider2D
 
GameObject _collidingObject
 
Character _character = null
 
bool _pickable = false
 
ItemPicker _itemPicker = null
 
WaitForSeconds _disableDelay
 

Detailed Description

A simple class, meant to be extended, that will handle all the mechanics of a pickable thing : feedbacks, collision, pick consequences, etc

Member Function Documentation

◆ CheckIfPickable()

virtual bool MoreMountains.TopDownEngine.PickableItem.CheckIfPickable ( )
protectedvirtual

Checks if the object is pickable.

Returns
true, if if pickable was checked, false otherwise.

Reimplemented in MoreMountains.TopDownEngine.PickableWeapon, MoreMountains.TopDownEngine.PickableAbility, and MoreMountains.TopDownEngine.PickableDash2D.

◆ DisablePickerCoroutine()

virtual IEnumerator MoreMountains.TopDownEngine.PickableItem.DisablePickerCoroutine ( )
protectedvirtual

◆ DisableTargetObjectCoroutine()

virtual IEnumerator MoreMountains.TopDownEngine.PickableItem.DisableTargetObjectCoroutine ( )
protectedvirtual

◆ Effects()

virtual void MoreMountains.TopDownEngine.PickableItem.Effects ( )
protectedvirtual

Triggers the various pick effects

◆ OnTriggerEnter()

virtual void MoreMountains.TopDownEngine.PickableItem.OnTriggerEnter ( Collider  collider)
virtual

Triggered when something collides with the coin

Parameters
colliderOther.

◆ OnTriggerEnter2D()

virtual void MoreMountains.TopDownEngine.PickableItem.OnTriggerEnter2D ( Collider2D  collider)
virtual

Triggered when something collides with the coin

Parameters
colliderOther.

◆ Pick()

◆ PickItem()

virtual void MoreMountains.TopDownEngine.PickableItem.PickItem ( GameObject  picker)
virtual

Check if the item is pickable and if yes, proceeds with triggering the effects and disabling the object

◆ Start()

virtual void MoreMountains.TopDownEngine.PickableItem.Start ( )
protectedvirtual

Member Data Documentation

◆ _character

Character MoreMountains.TopDownEngine.PickableItem._character = null
protected

◆ _collider

Collider MoreMountains.TopDownEngine.PickableItem._collider
protected

◆ _collider2D

Collider2D MoreMountains.TopDownEngine.PickableItem._collider2D
protected

◆ _collidingObject

GameObject MoreMountains.TopDownEngine.PickableItem._collidingObject
protected

◆ _disableDelay

WaitForSeconds MoreMountains.TopDownEngine.PickableItem._disableDelay
protected

◆ _itemPicker

ItemPicker MoreMountains.TopDownEngine.PickableItem._itemPicker = null
protected

◆ _pickable

bool MoreMountains.TopDownEngine.PickableItem._pickable = false
protected

◆ DisableColliderOnPick

bool MoreMountains.TopDownEngine.PickableItem.DisableColliderOnPick = false

if this is true, the picker's collider will be disabled on pick

◆ DisableDelay

float MoreMountains.TopDownEngine.PickableItem.DisableDelay = 0f

the duration (in seconds) after which to disable the object, instant if 0

◆ DisableModelOnPick

bool MoreMountains.TopDownEngine.PickableItem.DisableModelOnPick = false

if this is set to true, the object will be disabled when picked

◆ DisableObjectOnPick

bool MoreMountains.TopDownEngine.PickableItem.DisableObjectOnPick = true

if this is set to true, the object will be disabled when picked

◆ DisableTargetObjectOnPick

bool MoreMountains.TopDownEngine.PickableItem.DisableTargetObjectOnPick = false

if this is set to true, the target object will be disabled when picked

◆ Model

GameObject MoreMountains.TopDownEngine.PickableItem.Model

the visual representation of this picker

◆ PickedMMFeedbacks

MMFeedbacks MoreMountains.TopDownEngine.PickableItem.PickedMMFeedbacks

A feedback to play when the object gets picked.

◆ RequireCharacterComponent

bool MoreMountains.TopDownEngine.PickableItem.RequireCharacterComponent = true

if this is true, this pickable item will only be pickable by objects with a Character component

◆ RequirePlayerType

bool MoreMountains.TopDownEngine.PickableItem.RequirePlayerType = true

if this is true, this pickable item will only be pickable by objects with a Character component of type player

◆ TargetObjectDisableDelay

float MoreMountains.TopDownEngine.PickableItem.TargetObjectDisableDelay = 1f

the time in seconds before disabling the target if DisableTargetObjectOnPick is true

◆ TargetObjectToDisable

GameObject MoreMountains.TopDownEngine.PickableItem.TargetObjectToDisable

the object to disable on pick if DisableTargetObjectOnPick is true


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