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

Detailed Description

overlay element that display a bar for some character resource
when the resource gets damaged it shows the damage value for a configurable duration
like all OverlayElements it needs a UIDocument that actually gets displayed
check out the ManualResource scene in the AdventureManual project for an example

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

Inheritance diagram for AdventureCore.ResourceBarElement:
AdventureCore.ResourceBarBase

Public Member Functions

override void Show ()
 
override void Hide ()
 
override void SetDescription (string description)
 
override void Damage (DamageEvent damageEvent)
 
- Public Member Functions inherited from AdventureCore.ResourceBarBase
void SetResource (ResourcePool resourcePool, ResourceType resourceType)
 

Public Attributes

float MaximumReferenceWidth = 200f
 
UIDocument Document
 
string RootName = ""
 
string BarName = "Bar"
 
string HitBarName = "HitBar"
 
string ValueTextName = "Value"
 
string HitTextName = "Hit"
 
string DescriptionTextName = "Description"
 
string MaximumName = "Maximum"
 
string ShowByClass = ""
 
- Public Attributes inherited from AdventureCore.ResourceBarBase
Transform Target
 
string Format
 
string HitFormat
 
ResourceType ResourceType
 
ResourcePool ResourcePool
 
float HitDuration
 
bool Fade = true
 
bool ShowDamageColor
 
bool HideWhenEmpty
 
float MaximumReference
 
UnityEvent Damaged
 

Protected Member Functions

override void setup ()
 
override void onValueChanging (float value)
 
override void onValueChanged (float value)
 
override void onMaximumChanged (float value)
 
- Protected Member Functions inherited from AdventureCore.ResourceBarBase
virtual void Awake ()
 
virtual void Start ()
 
virtual void OnDestroy ()
 
virtual void attach ()
 
virtual void detach ()
 
string getValueText ()
 
string getHitText (DamageEvent damageEvent)
 

Additional Inherited Members

- Protected Attributes inherited from AdventureCore.ResourceBarBase
bool _isSetup
 
bool _isAttached
 
ResourceValue _resourceValue
 

Member Function Documentation

◆ Damage()

override void AdventureCore.ResourceBarElement.Damage ( DamageEvent damageEvent)
inlinevirtual

Reimplemented from AdventureCore.ResourceBarBase.

◆ Hide()

override void AdventureCore.ResourceBarElement.Hide ( )
inlinevirtual

Reimplemented from AdventureCore.ResourceBarBase.

◆ onMaximumChanged()

override void AdventureCore.ResourceBarElement.onMaximumChanged ( float value)
inlineprotectedvirtual

Reimplemented from AdventureCore.ResourceBarBase.

◆ onValueChanged()

override void AdventureCore.ResourceBarElement.onValueChanged ( float value)
inlineprotectedvirtual

Reimplemented from AdventureCore.ResourceBarBase.

◆ onValueChanging()

override void AdventureCore.ResourceBarElement.onValueChanging ( float value)
inlineprotectedvirtual

Reimplemented from AdventureCore.ResourceBarBase.

◆ SetDescription()

override void AdventureCore.ResourceBarElement.SetDescription ( string description)
inlinevirtual

Reimplemented from AdventureCore.ResourceBarBase.

◆ setup()

override void AdventureCore.ResourceBarElement.setup ( )
inlineprotectedvirtual

Reimplemented from AdventureCore.ResourceBarBase.

◆ Show()

override void AdventureCore.ResourceBarElement.Show ( )
inlinevirtual

Reimplemented from AdventureCore.ResourceBarBase.