Dead on Arrival

Programmer


  • Programmed and coded inventory system using Scriptable Objects.

  • Co-Developed Finite State Machine for Enemy A.I.

  • Programmed/Coded and designed UI for the “Monster Tracker” Tool.

  • Programmed and Coded placement system for “Rig” Tool.

  • Team: 5

  • Unity / C#

Inventory System

Implementation

Interactable.cs

An Interface class containing various data types acting as attributes for every interactable object:

  • ItemData — Item Scriptable Object

  • Interact — Class specific method

  • Use — Class specific method

  • Pickable — Boolean to determine if the player can obtain an object

  • ActionText — Displayed when cursor is over object

Scriptable Objects

Each Scriptable Object holds data for a pickable object:

  • Item ID - Numerical representation of object

  • Item Name - String

  • Item Prefab - Game object

  • Equipped Position - Object position when equipped

  • Equipped Rotation - Object rotation when equipped

Execution

PlayerInteract.cs

  • When the Player hovers over an object, their ActionText will display.

  • If the object is “pickable,” invokes AddToInventory method in ItemHolder.cs otherwise invoke it’s implemented Interact method.

ItemHolder.cs

  • Holds a list of game objects.

  • Uses the S.O. data to add item to list, set the objects position/rotation, and modifies object’s component settings.

  • Displays the current item using the mouse wheel.

  • Uses S.O. data to remove/drop the item from the Player’s inventory.

Code Snippet(s)

ItemHolder.cs

Rig Placement System

Implementation

Physical Game Objects:

  • RigParentPickable — A compact form of the “Rig” that the Player can obtain.

  • RigParentFull — When the “Rig” is placed.

  • RigParentPreview — Visual representation of RigParentFull

  • RigAdapter — The valid location of the “Rig”

Rig.cs

  • Handles Raycast collision and “Rig” preview.

Execution

  • When the “Rig” is the current item, the Player can press the Interact button again and the placement process will start.

  • A colored RigParentPreview will display once the Raycast hits the floor, categorized in the “Metal” layer mask.

    • Red — Invalid Placement

    • Green — Valid placement

  • Once the Raycast hits the RigAdapter’s collider, the Player can Interact once more and the “Rig” will be placed.

Code Snippet(s)

Tracker Tool

Implementation

Proximitysensor.cs

  • Utilizes a for-loop to set the active state of each Bar Image (U.I. Element).

  • Contains a large if-statement to decide how many Bars will display.

Execution

  • Uses Vector3 Distance Formula to calculate the distance between the Tracker and Enemy.