Skip to content

Player.GUI

Wesley Haws edited this page Jan 2, 2017 · 17 revisions

##Player - GUI Setup


This process is quite lengthy but when complete should have the following:

  • Main Menu
  • Save/Loading
  • Input Editer
  • Death Screen
  • Inventory Menu
  • Health Bar
  • Incontestables Screen

GUI Button Layout Selection:

GUI Resolution and Quality Options:

GUI Mouse Options & Load Game:

###Table of Contents

####Hierarchy Setup


  1. Open the Prefabs > Core folder
  2. Make a prefabs/assets folder in your Unity project
  3. Add the GUI.prefab file to that folder
  4. Drop that prefab into your scene

If done correctly you should have a prefab with a bunch of broken links but its hierarchy setup like the following:

####Root Object Setup(GUI)


Important notes about this object:

Tag:GUIParent

Layer:UI

It uses the following scripts. Click the links for more information about each of them or look in the Script Docs:

####HealthBar


Tag: UIHealthbar

Layer: UI

Healthbar Hierarchy:

The only script is used by GUI > Healthbar > Mask > RedBar

####Inventory


Tag: UIInventory

Layer: UI

Hierarchy Setup:

The GUI > Inventory > Box gameobject is simply where I design my UI box. This can be completely removed if you like and isn't required for anything.

However, the "icons" and "text" gameobjects must be setup like this exactly! The "icons" and "text" gameobject are just holders. "icon1" - "icon5" all just have the UIImage component on them. "text1" - "text5" have a UIText and "InventoryText" Script on them. The inventory text's "Button To Show" should be set to the text number. So "text1" should have "Button To Show" set to "Inventory Slot 1" and 2 set to "Inventory Slot 2" etc.

Read more about the script here:

####ObjectivesList


Tag: ObjectivesList

Layer: UI

This gameobject only needs to have a blank UIText Component attached to it. This object should be enabled.

####PopUpText


Tag: PopUpText

Layer: UI

This gameobject needs to have a blank UIText Component attached to it and the "SyncObjectivesList" script. This object should be enabled. This object is used both to display the objectives list and additional action pop up text (called by other scripts).

Read about the "SyncObjectivesList" Script here:

####Conditionals


Hierarchy Setup:

Conditionals: No Special Setup

  • ScrollUI: No Special Setup
    • Scroll: UIImage (for paper scroll effects)
    • Text: UIText component
    • Close Hint: UIText Component, "DisplayBasedOn" script
    • Close Button: UIText Component, "ReplaceText" Script, "DisplayBasedOn" script

Read more about these scripts here:

Clone this wiki locally