Next: Photon Instantiator, Previous: Photon Field Sync, Up: Network [Contents][Index]
This generic Health implementation is fully compatible with all MultiGame systems and forms the basis for combat and death in your game worlds. It receives the ’ModifyHealth’ message with a floating point value. Make anything killable!
float
maxHPHow much health can we have?
Default value: 100.0f
bool
autodestructDo we destroy the object when health runs out?
Default value: true
GameObject[]
deathPrefabsWhat should we spawn when we die from HP loss?
Scrollbar
uIhealthBarIf using the Unity UI, create a scroll bar for the health and drop a reference to it here. The handle of the scrollbar is resized to show the health amount.
bool
showHealthBarGUIShould we show a legacy Unity GUI? NOTE: Not suitable for mobile devices.
Default value: false
GUISkin
guiSkinWhat skin should we use for the Legacy GUI
Rect
healthBarNormalized viewport rectangle describing the area of the health bar, values between 0 and 1
Default value: new Rect(.2f, .01f, .4f, .085f)
bool
autoHideShould we hide the health bar when health is full?
Default value: true
Color
barColorShould we color this bar to differentiate it from others?
Default value: Color.white
MessageManager.ManagedMessage
healthGoneMessageWhen we run out of health, what message should we send?
MessageManager.ManagedMessage
hitMessageWhen we are hit, what message should we send?
Kill this object immediately!
Change the health this object has
Argument: Amount to change the health by. Positive to increase, negative to decrease.
Change the maximum health this object can have
Argument: Amount to change the max health by. Positive to increase, negative to decrease.
float
maxHPHow much health can we have?
Default value: 100.0f
bool
autodestructDo we destroy the object when health runs out?
Default value: true
GameObject[]
deathPrefabsWhat should we spawn when we die from HP loss?
Scrollbar
uIhealthBarIf using the Unity UI, create a scroll bar for the health and drop a reference to it here. The handle of the scrollbar is resized to show the health amount.
bool
showHealthBarGUIShould we show a legacy Unity GUI? NOTE: Not suitable for mobile devices.
Default value: false
GUISkin
guiSkinWhat skin should we use for the Legacy GUI
Rect
healthBarNormalized viewport rectangle describing the area of the health bar, values between 0 and 1
Default value: new Rect(.2f, .01f, .4f, .085f)
bool
autoHideShould we hide the health bar when health is full?
Default value: true
Color
barColorShould we color this bar to differentiate it from others?
Default value: Color.white
MessageManager.ManagedMessage
healthGoneMessageWhen we run out of health, what message should we send?
MessageManager.ManagedMessage
hitMessageWhen we are hit, what message should we send?
Kill this object immediately!
Change the health this object has
Argument: Amount to change the health by. Positive to increase, negative to decrease.
Change the maximum health this object can have
Argument: Amount to change the max health by. Positive to increase, negative to decrease.
Next: Photon Instantiator, Previous: Photon Field Sync, Up: Network [Contents][Index]