FCV Engine 0.1
A tool and framework for tutorials in game development
Loading...
Searching...
No Matches
WeaponUI Class Reference

Manages the UI representation of weapon slots, including adding new slots, setting images, and handling weapon changes. More...

Inheritance diagram for WeaponUI:

Public Member Functions

void AddWeaponSlot (Weapon weapon, int key)
 Adds and sets up a weapon slot UI for the provided weapon.
 
void WeaponChanged (int index)
 Activates the border of the weapon slot at the given index and deactivates all other borders.
 

Private Member Functions

void SetupEventsAutomatically ()
 Sets up events for weapon actions from the WeaponController.
 
bool MethodSubscribed ([NotNull] UnityEventBase @event, string methodName)
 Checks if a Unity Event has a specific method subscribed.
 

Detailed Description

Manages the UI representation of weapon slots, including adding new slots, setting images, and handling weapon changes.

Definition at line 12 of file WeaponUI.cs.

Member Function Documentation

◆ AddWeaponSlot()

void AddWeaponSlot ( Weapon weapon,
int key )

Adds and sets up a weapon slot UI for the provided weapon.

Parameters
weaponWeapon to be added to UI.
keyThe key used to equip the weapon when changing weapons.

Definition at line 69 of file WeaponUI.cs.

◆ MethodSubscribed()

bool MethodSubscribed ( [NotNull] UnityEventBase @ event,
string methodName )
private

Checks if a Unity Event has a specific method subscribed.

Parameters
eventThe Unity event to check for a subscribed method.
methodNameThe name of the method to look for in the event's subscribers.
Returns
True if the method is subscribed to the event, false otherwise.

Definition at line 52 of file WeaponUI.cs.

◆ WeaponChanged()

void WeaponChanged ( int index)

Activates the border of the weapon slot at the given index and deactivates all other borders.

Parameters
indexIndex of the weapon slot to activate.

Definition at line 93 of file WeaponUI.cs.


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