Game Manager
Adding Custom UI References
In the UHFPS Game Manager component located in the GAMEMANAGER object, you'll come across a section called Custom UI References. To include a new UI reference, simply press the Add button.

To utilize the UI references, assign a name that will be used to access the references. Once that's done, you can easily use the GraphicReferences field to obtain the UI references by their designated name.
Here is a code snippet to get the flashlight UI references:
private void Awake()
{
GameManager gameManager = GameManager.Instance;
var behaviours = gameManager.GraphicReferences.Value["Flashlight"];
CanvasGroup flashlightPanel = (CanvasGroup)behaviours[0];
Image batteryIcon = (Image)behaviours[1];
Image batteryFill = (Image)behaviours[2];
}
Adding Manager Modules

To create a new manager module, your new script needs to inherit from the ManagerModule class.
namespace UHFPS.Runtime
{
public class TestModule : ManagerModule
{
public override void OnAwake()
{
}
public override void OnStart()
{
}
public override void OnUpdate()
{
}
}
}
Write your code into the provided methods as you typically would. Keep in mind that the ManagerModule class is based on a ScriptableObject. This implies that you can't include variables with scene references.
Find the Manager Modules asset, which is located within the UHFPS Game Manager component.
Within the Manager Modules asset, click on the Add Module button and pick your newly created module. This action will generate a new Module asset and automatically integrate it into the Manager Modules.

To retrieve a Module reference from the game manager, just use the Module<T> method from the GameManager component.
private void Awake()
{
TestModule testModule = GameManager.Module<TestModule>();
}
Last updated