Skip to main content

OverTimeEffectData

class SoftKitty.OverTimeEffectData

OverTimeEffectData represents the runtime state of an over-time effect currently applied to an entity.

This data is created and managed automatically during gameplay.


Callbacks

public delegate void OverTimeEffectChangeEvent(string _uid, OverTimeEffectData _data, OverTimeEffectEventType _eventType);

Callback delegate invoked when the OverTimeEffect data changes.

Example

private Entity _player;
void Start(){
_player = GameManager.GetPlayer();
_player.RegisterOverTimeChangeCallback(OnOverTimeEffectChangeEvent);
}

public void OnOverTimeEffectChangeEvent(string _uid, OverTimeEffectData _data, OverTimeEffectEventType _eventType){
if (_eventType == OverTimeEffectEventType.Add) {
GameObject _prefab = GameManager.GetOverTimeEffect(_uid).GetCustomObject<GameObject>("vfx");
Instantiate(_prefab, mAnimator.GetBoneTransform(HumanBodyBones.UpperChest).transform);
}
}

void OnDestroy(){
_player.UnRegisterOverTimeChangeCallback(OnOverTimeEffectChangeEvent);
}


Properties

string uid

Links this runtime instance to its corresponding OverTimeEffect setting.


float timer

Remaining lifetime (in seconds) before the effect expires.


int layer

Current stack count of this effect.

Used for effects that support stacking, such as:

  • Poison
  • Burning
  • Bleeding

string dealer

UID of the entity that applied this effect.

This is commonly used for:

  • Damage attribution
  • Trigger conditions
  • Combat logs