public string FakePressPlay() { FakePressButton fakePressButton = GetPlayButton().GetComponent <FakePressButton>(); if (fakePressButton == null) { fakePressButton = GetPlayButton().gameObject.AddComponent <FakePressButton>(); } return(fakePressButton.PressButton()); }
public string FakePressRandomButton() { if (pressableButtons == null) { pressableButtons = GetComponentsInChildren <PressableButtonHoloLens2>(); } PressableButtonHoloLens2 button = pressableButtons[Random.Range(0, pressableButtons.Length)]; FakePressButton fbp = button.GetComponent <FakePressButton>(); if (fbp == null) { fbp = button.gameObject.AddComponent <FakePressButton>(); } return(fbp.PressButton()); }
string SpawnVariable() { string[] varNames = GetComponent <Exercise>().varNames; if (varNames.Length == 0) { return(""); } string varToSpawn = varNames[Random.Range(0, varNames.Length)]; FakePressButton fpb = MemoryManager.instance.GetVariables()[varToSpawn].GetComponent <FakePressButton>(); if (fpb == null) { fpb = MemoryManager.instance.GetVariables()[varToSpawn].gameObject.AddComponent <FakePressButton>(); } return(fpb.PressButton()); }