Generator Sys - Setup
Last updated
Last updated
Make sure to have a "Generator_Canvas" object in your scene which will have all the UI elements. This will be a child of the "AK_CanvasContainer" if you've already imported it from the initial setup
Make sure you have the Generator_Canvas added
Add a "Generator Inventory Manager" prefab or script to an empty GameObject
See setup below
Add the Generator PBR model to your scene - Add the script
Set the tag to "InteractiveObject"
Set the layer to "Interact"
Add a "Box Collider"
Add the "AKItemController" script and set it to "GeneratorSys"
Add "GeneratorItemController" script and follow the settings below
The item type should be "Generator"
Add the Jerrycan PBR model from the prefabs folder
Follow the same steps as above but set the item type to: "Jerrycan"
Add a Fuel Barrel PBR model from the prefabs folder
Follow the same steps as above but set the item type to: "FuelBarrel"
See more setup details below
This object should be an empty GameObject and it will control everything that goes on for your flashlight system!
Add this script to either a Jerrycan / Fuel Barrel or Generator Itself - You can add a PBR Object to your scene
Make sure your object has a tag of "InteractiveObject" and a Layer of "Interact"
Add a "Box Collider" to your object
Add an "AKItemController" - Set the System Type to: "GeneratorSys"
Add a "GeneratorItemController" script to the object
Left Click to interact with a pickup
Press "TAB" to open the inventory
NOTE: "Show UI" on each object can show/hide the popout UI
These can be edited in the "Input Manager"
Current Fuel
The current amount of fuel you will have when the inventory canvas appears
Default: 0-100
Maximum Fuel
The maximum fuel your jerrycan can hold within the inventory
Default: 100
Has Jerrycan
Whether or not you actually have a jerrycan
FALSE
Fuel Fill UI
Add the “Jerrycan_Fill” image from the inventory canvas to this slot
Current Fuel Text
Add the “CurrentFuel” text UI to this slot from the inventory canvas
Maximum Fuel Text
Add the “MaximumFuel” text UI to this slot from the inventory canvas
Item Type
Either drop this to: Generator / Fuel Barrel / Jerrycan
Item Name
The name of your object, can be anything you like
Icon Image
The UI Sprite of the item, I have provided a selection
Item Fuel Amount
How much fuel is in the item at the current time
Item Max Fuel Amount
The maximum amount of fuel that can be held in an object
Show UI
Do you want to show the pop out UI?
Item Canvas
Item Name UI
The UI element for the name
Icon Image UI
The Icon Image UI Image
Fuel Amount UI
The Fuel Amount UI image
Max Fuel Amount UI
Max Fuel Amount UI Text
Fuel Gauge UI
The Gauge Image UI
Generator Controller
This is only required for a "Generator" item - This is to set the red light to green
ActivateGenerator Event
Added a 3D AudioSource on an emtpy gameobject and a script to turn on lights so you can add custom events