Detailed Setup

NOTE: You can get a quick start by adding the Generator_DemoScene_Prefab from the prefabs folder, this will have everything setup without any extra need for details below

Adding the Player Character & Raycast script:

  • Add an FPSController to your scene

    • Make sure your Main Camera has a GeneratorInteractor script attached

Make sure that your FPSController has a layer of Ignore Raycast - If you're having interaction issues

Adding Managers:

  • Add this set of managers from the prefabs or get the scripts from the folder (to your hierarchy or scene from the assets Prefabs folder)

    • InventoryManager

    • UIManager

    • AudioManager

    • InputManager

Inventory Manager Setup:

  • Look at the InventoryManager object and you will see the GeneratorInventory script attached and set references accordingly, and use values for your game.

Input Manager Setup:

  • Take a look at the InputManager object to change the settings as below:

You can choose the inputs to use in the system by selecting the dropdown.

Audio Manager Setup:

  • Take a look at the AudioManager object and set the 4 ScriptableObjects as below, see the detailed page for more details on this below:

UI Manager Setup:

  • Check out the UIManager object to set the general UI elements for the package:

All the general UI elements will be children of this object and can be found as named below.

In V1.4 it now uses a CanvasGroup and sets it from 0 to 1 to show and hide the canvas

Adding Interactive Items:

  • Place one or all of the Items from the prefabs folder into your scene, including a:

    • Jerrycan - Model

    • Generator - Model

    • FuelBarrel - Model

Jerrycan Setup:

  • The Jerrycan_Model - Collectable should have:

    • Box Collider

    • GenItem script attached (Set to Jerrycan)

All of this can go on the main jerrycan model object, as the others require separate colliders so we don't accidentally pick them up

You don't require the World Space UI elements, untick the Show UI box if you don't want it

Fuel Barrel Setup:

  • Now the FuelBarrel will need to have a collider as a child of this object as the collider is used to interact.

  • Then set the FuelBarrel - Model to have the same object and similar values as below.

    • Box Collider

    • GeneratorItem script (Setup to Fuel Barrel)

    • Disable the ShowUI (if you don't want the world space UI elements)

    • Do the same setup as above

Generator Setup:

  • Generator Object - This will also have a Generator which will need the

    • Box Collider

    • GeneratorItem script attached (Set to Generator)

Setting Up An Event:

You can press the + in the Event to create more options when you want something to happen when you activate the generator

Below is a sample script that runs the code on the UnityEvents when the generator is either activate or deactivated. This just turns emission on materials on/off, including some lights.

Last updated