⛽
Generator System - Doc
  • Generator System - Introduction
  • ⭐Getting Started
    • Quick Start
    • Detailed Setup
  • ❓Support
    • FAQ
    • Power Event
    • System Namespace
    • Missing UI Text?
    • Adding Audio Clips
    • Where are the Inputs?
    • Adding New Sprites
  • 🌀Development
    • Patch Notes - V1.5
    • Roadmap
  • 📧Contacts
    • Contact Me
    • My Other Assets
Powered by GitBook
On this page
  • Adding the Player Character & Raycast script:
  • Adding Managers:
  • Inventory Manager Setup:
  • Input Manager Setup:
  • Audio Manager Setup:
  • UI Manager Setup:
  • Adding Interactive Items:
  • Jerrycan Setup:
  • Fuel Barrel Setup:
  • Generator Setup:
  • Setting Up An Event:

Was this helpful?

  1. Getting Started

Detailed Setup

PreviousQuick StartNextFAQ

Last updated 1 year ago

Was this helpful?

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.

Variable / Field
Description

Has Jerrycan

Should you already have a jerry can at the start?

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

ItemType

The type of item this object is

Fuel Parameters

Set this to any value you wish your jerrycan to hold, by default it is: 100.

Show UI

Choose whether you want to 3D world canvas UI to appear when hovering over the object. False for none or true, then you must add all the world space canvas elements attached to this object

Sound Effects

Add the ScriptableObjects effects that are you in the corresponding folder.

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)

Can Burn Fuel

This should be ticked if you wish for the generator to use fuel when it is full

Fill Rate

This is the speed that you can fill the generator

Burn Rate

The higher this value the faster the generator will use up the fuel

Can Rumble

This makes the generator vibrate when it is activated. More settings will appear if true

Rumble Speed & Intensity

How fast and how intense the rumble will be

Show UI

As before with the world space canvas

Generator Events

This is when the generator is activate or deactivated, it will run events of your choice. See below or the relevant page for more information

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.

⭐
Adding Audio Clips
Power Event