Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.MustHaveItemCondition Class Reference

Condition which requires a specific item to be held. More...

Inheritance diagram for PlatformerPro.MustHaveItemCondition:
PlatformerPro.AdditionalCondition PlatformerPro.PlatformerProMonoBehaviour

Public Member Functions

override bool CheckCondition (Character character, object other)
 Checks the condition. For example a check when entering a trigger. More...
 
virtual bool CheckItem (Character character, string requiredItemType)
 Checks presence and amount of an item. More...
 
override void Activated (Character character, object other)
 Applies any activation effects. More...
 
- Public Member Functions inherited from PlatformerPro.AdditionalCondition
virtual bool CheckInverseCondition (Character character, object other)
 Checks the inverse condition. For example a check when leaving a trigger. More...
 
- Public Member Functions inherited from PlatformerPro.PlatformerProMonoBehaviour
virtual void Validate (PlatformerProMonoBehaviour myTarget)
 Override this method if you want to provide custom validation. The actual code should be surrounded by the if UNITY_EDITOR / endif directive. More...
 

Public Attributes

List< string > requiredItemTypes
 If this is not empty require the character to have an item with the matching type before triggering. More...
 
bool mustHaveAll
 If true character must have all items, if false any oe will do. More...
 
bool mustBeEquipped
 If true the item must be equipped. More...
 
int requiredItemCount = 1
 The number required. More...
 
int numberConsumed = 0
 The optional number of the item to consume when the effect is activated. More...
 
- Public Attributes inherited from PlatformerPro.AdditionalCondition
bool applyOnInverse
 If true condition will be applied on inverse (for example trigger exit as well as enter). More...
 

Additional Inherited Members

- Properties inherited from PlatformerPro.PlatformerProMonoBehaviour
virtual string Header [get]
 Gets the header string used to describe the component. More...
 
virtual string DocLink [get]
 Gets a link to documentation site. More...
 
virtual string VideoLink [get]
 Gets a link to a youtube video. More...
 
virtual string Deprecated [get]
 If non-null this component is deprecated. The string shows a message indicating how it should be replaced. More...
 

Detailed Description

Condition which requires a specific item to be held.

Member Function Documentation

◆ Activated()

override void PlatformerPro.MustHaveItemCondition.Activated ( Character  character,
object  other 
)
virtual

Applies any activation effects.

Parameters
characterCharacter.
otherOther object supporting the condition.

Reimplemented from PlatformerPro.AdditionalCondition.

◆ CheckCondition()

override bool PlatformerPro.MustHaveItemCondition.CheckCondition ( Character  character,
object  other 
)
virtual

Checks the condition. For example a check when entering a trigger.

Returns
true, if enter trigger was shoulded, false otherwise.
Parameters
characterCharacter.
otherOther.

Reimplemented from PlatformerPro.AdditionalCondition.

◆ CheckItem()

virtual bool PlatformerPro.MustHaveItemCondition.CheckItem ( Character  character,
string  requiredItemType 
)
virtual

Checks presence and amount of an item.

Returns
true, if item was present in desired amount, false otherwise.
Parameters
characterCharacter ref.
requiredItemTypeRequired item type to check.

Member Data Documentation

◆ mustBeEquipped

bool PlatformerPro.MustHaveItemCondition.mustBeEquipped

If true the item must be equipped.

◆ mustHaveAll

bool PlatformerPro.MustHaveItemCondition.mustHaveAll

If true character must have all items, if false any oe will do.

◆ numberConsumed

int PlatformerPro.MustHaveItemCondition.numberConsumed = 0

The optional number of the item to consume when the effect is activated.

◆ requiredItemCount

int PlatformerPro.MustHaveItemCondition.requiredItemCount = 1

The number required.

◆ requiredItemTypes

List<string> PlatformerPro.MustHaveItemCondition.requiredItemTypes

If this is not empty require the character to have an item with the matching type before triggering.


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