DataCounter - ORF-4450/PitScouting GitHub Wiki

Variables

ds

DataStorage

DataStorage object to send data to.

prefix

string

Text to display in front of count when displayed. This does not get sent to DataStorage

suffix

string

Text to display after count when displayed. This does not get sent to DataStorage.

text

Text

Text component to the send current number to.

count

int

The current number to display. Can be changed via adjectCount()

Functions

Start()

Start()

If ds is null it prints a warning log and disables the gameObject with the script

otherwise it sets text to the Text component on the gameObject holding this script

FixedUpdate()

FixedUpdate()

Every frame it calls addData in DataStorage with

key: name of the gameObject this script is on

value: count converted to a string

overwrite: always true

DI: the object calling it

It also sets text to the prefix, count as a string, and suffix combined.

changeData()

changeData(object)

It takes the object argument, converts it to a string, and parses it to an int. It then sets count to the int value.

AdjustCount()

AdjustCount(int)

It takes the int argument and adds to it count

clearData()

clearData()

sets count to 0