Generator Sys - Setup

Generator System - Video Setup

Generator Controller Main Setup

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

Basic Steps

  1. Make sure you have the Generator_Canvas added

  2. Add a "Generator Inventory Manager" prefab or script to an empty GameObject

    1. See setup below

  3. Add the Generator PBR model to your scene - Add the script

    1. Set the tag to "InteractiveObject"

    2. Set the layer to "Interact"

    3. Add a "Box Collider"

    4. Add the "AKItemController" script and set it to "GeneratorSys"

    5. Add "GeneratorItemController" script and follow the settings below

      1. The item type should be "Generator"

  4. Add the Jerrycan PBR model from the prefabs folder

    1. Follow the same steps as above but set the item type to: "Jerrycan"

  5. Add a Fuel Barrel PBR model from the prefabs folder

    1. Follow the same steps as above but set the item type to: "FuelBarrel"

See more setup details below

Inventory Controller Setup

This object should be an empty GameObject and it will control everything that goes on for your flashlight system!

Fuel Levels:

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

References:

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 Controller

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

Item Type:

Item Type

Either drop this to: Generator / Fuel Barrel / Jerrycan

Item Parameters:

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

UI On/Off:

Show UI

Do you want to show the pop out UI?

UI Elements - The World Space Canvas' attached to each object

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 - ONLY for the generator item

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

Default Controls

  • 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"

Last updated