Loading...
Searching...
No Matches
AdventureCore.EffectPool Class Reference

Detailed Description

manages the effects that are active on a character
when an effect is added it is instantiated as a child of this behaviour
effects are persisted and restored when the game is loaded unless they have been added as external
external effects are useful for effects that are added by items or triggers which readd the effect when the game is loaded anyway

https://adventure.softleitner.com/manual/effect

Inheritance diagram for AdventureCore.EffectPool:
AdventureCore.ICharacterAssociator

Classes

struct  EffectData
 
struct  EffectValue
 

Public Member Functions

bool HasEffect (EffectType effectType)
 
EffectBase GetEffect (EffectType effectType)
 
EffectBase Add (string key, bool isExternal=false)
 
EffectBase Add (EffectType effectType, bool isExternal=false)
 
Add< T > (T prefab, bool isExternal=false)
 
bool Remove (string key)
 
bool Remove (EffectType effectType)
 
void Remove (EffectBase effect)
 
void ClearEffects ()
 
void Persist ()
 
EffectData GetData ()
 

Public Attributes

CharacterBase Character
 
EffectSet Effects
 
PersisterBase Persister
 
float PersistenceInterval = 1f
 
UnityEvent Changed
 
UnityEvent< EffectBaseAdded
 
UnityEvent< EffectBaseRemoved
 

Static Public Attributes

const string PERSISTENCE_SUB_KEY = "EFF"
 

Properties

CharacterBase AssociatedCharacter [get]
 character that owns or is otherwise associted with the object
 
IReadOnlyList< EffectBaseCurrentEffects [get]
 
- Properties inherited from AdventureCore.ICharacterAssociator

Member Function Documentation

◆ Add< T >()

T AdventureCore.EffectPool.Add< T > ( T prefab,
bool isExternal = false )
inline
Type Constraints
T :EffectBase 

Property Documentation

◆ AssociatedCharacter

CharacterBase AdventureCore.EffectPool.AssociatedCharacter
get

character that owns or is otherwise associted with the object

Implements AdventureCore.ICharacterAssociator.