DataToggle - ORF-4450/PitScouting GitHub Wiki

ds

DataStorage

A reference to the Programmer-made script "DataStorage"

toggle

Toggle

A reference to the Unity-made script "Toggle"

UncheckedResponse

string

The output string when Toggle is false

CheckedResponse

string

The output string when Toggle is true

Functions

Start()

toggle

Sets toggle to the Toggle component on the gameObject

changeData()

changeData(object)

DataInputField

DataInputField calls it, unsure at this moment how it works.

if change is converted to string and equals changeBool (which is always false)

The end result is either turning toggle on or off dependent on the object argument

if it either does not equal false or the variables don't work in the if

It prints out a warning.

clearData()

Turns off the toggle, regardless of state

Update()

Every frame it calls addData in DataStorage with

key: name of the gameObject this script is on

value: checked or unchecked response based on toggle

overwrite: always true

DI: the object calling it