top of page

Urban City Champions

UCC Item Systems

Item Systems

To create the main item system within Urban City Champions I used Scriptable Objects (S.Os) within Unity to store the individual data that needed to be stored for each item. Then the individual  S.Os are attached to prefabs of the physical objects through an Item Functions script which can access the data stored there. To make this process easier I created a short-cut within the Unity creation menus (depicted below) that allows easy creation of the S.Os. While I did not create menu options for the prefabs I created a base prefab that can be used to create new prefabs or variations of the original prefab as needed. 


Item Scriptable Objects

To create the different types of items within the system I used inheritance to allow the children scripts to access the data within the parent script. The parent script (Item Objects) holds the variables that all of the items potentially need while the children (Food_Items, Blunt_Weapon_Item, Projectile_Weapon_Item) only add variables that their specific item types will need. The custom menu code is on these scripts to ensure that they are the types being created.

Item Functions

These are the scripts that control the actual functions of items. These are housed on the prefabs of the items based on which type of item they are. These scripts also limit the items to how long they are "alive" in the game without being picked up. Upon that timer (lifetime) reaching zero the item destroys itself. If their player collides with the item they call other scripts to either add health (Food Items) or to activate duration timers (Weapon Items), after which they destroy themselves. 

Spawning Items (Call Out Assist)

The spawning of the items is based on a timer and button input from the player. After a player presses the spawning button an item type list is randomly chosen and then an item is randomly chosen from the chosen type. After it is chosen the item is then instantiated into the world. This script also includes functions that handle the updating of slides within the UI; as well as functions that control pausing timers, reseting timers, and the random location to spawn the chosen item. 

UCC Round Management

Round Management

The main function for the Round Manager script is to control the Verses Room fighting rounds. The script uses Enums to create state to help distiguish what is going on in the round. For instance if the current state is pre-round then there is a small timer that counts down to when the round starts, which switches to the durringRound state when it reaches zero. This script also detects when the round is over when either both players reach zero health or when the timer roundTimer reaches zero. This script also controls the freezing of characters during pausing or the time between rounds as well as the resetting of each individual round. Lastly, this script tracks the amount of wins each player has and when the round limit is reach displays which player has won or if they tied. 

bottom of page