// Use this for initialization void Start() { if (this.name == "barA") { //haptic = GameObject.Find("HapticSquareA").GetComponent<HapticSquare>(); //haptic.UpdateHaptics(HapticSquare.HapticType.BAR01); } //else if (this.name == "barB") //{ // haptic = GameObject.Find("HapticSquareB").GetComponent<HapticSquare>(); // haptic.UpdateHaptics(HapticSquare.HapticType.BAR02); //} //else if (this.name == "barC") //{ // haptic = GameObject.Find("HapticSquareC").GetComponent<HapticSquare>(); // haptic.UpdateHaptics(HapticSquare.HapticType.BAR03); //} //else if (this.name == "barD") //{ // haptic = GameObject.Find("HapticSquareD").GetComponent<HapticSquare>(); // haptic.UpdateHaptics(HapticSquare.HapticType.BAR04); //} //else if (this.name == "barE") //{ // haptic = GameObject.Find("HapticSquareE").GetComponent<HapticSquare>(); // haptic.UpdateHaptics(HapticSquare.HapticType.BAR11); //} //else if (this.name == "barF") //{ // haptic = GameObject.Find("HapticSquareF").GetComponent<HapticSquare>(); // haptic.UpdateHaptics(HapticSquare.HapticType.BAR13); //} //else if (this.name == "barG") //{ // haptic = GameObject.Find("HapticSquareG").GetComponent<HapticSquare>(); // haptic.UpdateHaptics(HapticSquare.HapticType.BAR33); //} else if (this.name == "barOnHigh") { haptic = GameObject.Find("HapticSquareX").GetComponent <HapticSquare>(); haptic.UpdateHaptics(HapticSquare.HapticType.BARA); } else if (this.name == "barOnMed") { haptic = GameObject.Find("HapticSquareY").GetComponent <HapticSquare>(); haptic.UpdateHaptics(HapticSquare.HapticType.BARB); } else if (this.name == "barOnLow") { haptic = GameObject.Find("HapticSquareZ").GetComponent <HapticSquare>(); haptic.UpdateHaptics(HapticSquare.HapticType.BARC); } }
// Use this for initialization void Start() { Debug.Log("executing touchevents script"); bunnyIsTapped = false; haptic1 = GameObject.Find("SquareHaptic1").GetComponent <HapticSquare>(); haptic1.DeactivateHaptic(); haptic3 = GameObject.Find("SquareHaptic3").GetComponent <HapticSquare>(); haptic3.DeactivateHaptic(); haptic5 = GameObject.Find("SquareHaptic5").GetComponent <HapticSquare>(); haptic5.DeactivateHaptic(); }
private void StartFormative() { Debug.Log("start circuit.cs for formative"); // circuits for testing different circuits with high, med, low current circuitSprite1 = Resources.Load <Sprite>("Sprites/Circuits/circuitA"); circuitSprite2 = Resources.Load <Sprite>("Sprites/Circuits/circuitA2"); circuitSprite3 = Resources.Load <Sprite>("Sprites/Circuits/circuitA3"); haptic = GameObject.Find("HapticSquare").GetComponent <HapticSquare>(); currentHapticType = HapticSquare.HapticType.NOISEHIGH; haptic.UpdateHaptics(currentHapticType); }
private void StartTasks() { thisPlayerLog = GameObject.Find("EventSystem").GetComponent <PlayerLog>(); hint = GameObject.Find("Hint"); hint.SetActive(false); confirmPage = GameObject.Find("Confirm Finish"); confirmPage.SetActive(false); Debug.Log("this circuit: " + GlobalVariables.thisTask); haptic = GameObject.Find("HapticSquare").GetComponent <HapticSquare>(); nextButton = GameObject.Find("Next Button"); finishButton = GameObject.Find("Finish Button"); buttonC1 = GameObject.Find("Circuit1 Button"); buttonC2 = GameObject.Find("Circuit2 Button"); buttonC3 = GameObject.Find("Circuit3 Button"); sliderR = GameObject.Find("SliderR"); finishButton.SetActive(false); buttonC1.SetActive(false); buttonC2.SetActive(false); buttonC3.SetActive(false); sliderR.SetActive(false); //set button sprites buttonC1Sprite = Resources.Load <Sprite>("Sprites/Buttons/circuit1"); buttonC1ClickedSprite = Resources.Load <Sprite>("Sprites/Buttons/circuit1clicked"); buttonC2Sprite = Resources.Load <Sprite>("Sprites/Buttons/circuit2"); buttonC2ClickedSprite = Resources.Load <Sprite>("Sprites/Buttons/circuit2clicked"); buttonC3Sprite = Resources.Load <Sprite>("Sprites/Buttons/circuit3"); buttonC3ClickedSprite = Resources.Load <Sprite>("Sprites/Buttons/circuit3clicked"); buttonReadSprite = Resources.Load <Sprite>("Sprites/Buttons/read"); buttonReadClickedSprite = Resources.Load <Sprite>("Sprites/Buttons/readclicked"); GlobalVariables.hintOn = false; switch (GlobalVariables.thisTask) { case 1: circuitSprite1 = Resources.Load <Sprite>("Sprites/Circuits/bg-circuit1"); taskSprite = Resources.Load <Sprite>("Sprites/Buttons/task1"); currentHapticType = HapticSquare.HapticType.STRIPEHIGHH; //quick solution for fixing a bug haptic.UpdateHaptics(currentHapticType); currentHapticType = HapticSquare.HapticType.STRIPEHIGHV; haptic.UpdateHaptics(currentHapticType); thisPlayerLog.AddEvent("=============================================\n" + "t = " + Time.time.ToString() + ", Start Task 1" + "\n============================================="); break; case 2: circuitSprite1 = Resources.Load <Sprite>("Sprites/Circuits/bg-circuit2"); taskSprite = Resources.Load <Sprite>("Sprites/Buttons/task2"); currentHapticType = HapticSquare.HapticType.STRIPEMEDH; //quick solution for fixing a bug haptic.UpdateHaptics(currentHapticType); currentHapticType = HapticSquare.HapticType.STRIPEMEDV; haptic.UpdateHaptics(currentHapticType); thisPlayerLog.AddEvent("=============================================\n" + "t = " + Time.time.ToString() + ", Start Task 2" + "\n============================================="); break; case 3: circuitSprite1 = Resources.Load <Sprite>("Sprites/Circuits/bg-circuit1"); taskSprite = Resources.Load <Sprite>("Sprites/Buttons/task3"); currentHapticType = HapticSquare.HapticType.STRIPEHIGHV; haptic.UpdateHaptics(currentHapticType); //activate C1 and C2 buttons buttonC1.SetActive(true); buttonC2.SetActive(true); thisPlayerLog.AddEvent("=============================================\n" + "t = " + Time.time.ToString() + ", Start Task 3" + "\n============================================="); break; case 4: circuitSprite1 = Resources.Load <Sprite>("Sprites/Circuits/bg-circuit1"); taskSprite = Resources.Load <Sprite>("Sprites/Buttons/task4"); currentHapticType = HapticSquare.HapticType.STRIPELOWH; //quick solution for fixing a bug haptic.UpdateHaptics(currentHapticType); currentHapticType = HapticSquare.HapticType.STRIPEHIGHV; haptic.UpdateHaptics(currentHapticType); //activate C1 and C2 buttons buttonC1.SetActive(true); buttonC2.SetActive(true); buttonC3.SetActive(true); thisPlayerLog.AddEvent("=============================================\n" + "t = " + Time.time.ToString() + ", Start Task 4" + "\n============================================="); break; case 5: circuitSprite1 = Resources.Load <Sprite>("Sprites/Circuits/bg-circuit4R1"); taskSprite = Resources.Load <Sprite>("Sprites/Buttons/task5"); currentHapticType = HapticSquare.HapticType.STRIPEMEDV; haptic.UpdateHaptics(currentHapticType); //activate slider sliderR.SetActive(true); //deactivate the back button nextButton.SetActive(false); finishButton.SetActive(true); thisPlayerLog.AddEvent("=============================================\n" + "t = " + Time.time.ToString() + ", Start Task 5" + "\n============================================="); break; } GlobalVariables.currentHapticType = currentHapticType; haptic.DeactivateHaptic(); GameObject bg = GameObject.Find("Background"); bg.GetComponent <Image>().sprite = circuitSprite1; //spriteR = bg.GetComponent<SpriteRenderer>(); //spriteR.sprite = circuitSprite1; GameObject taskLabel = GameObject.Find("Task Label"); taskLabel.GetComponent <Image>().sprite = taskSprite; //spriteR = taskLabel.GetComponent<SpriteRenderer>(); //spriteR.sprite = taskSprite; }
// Use this for initialization void Start() { hapticSquare = GetComponent <HapticSquare>(); //currentHapticType = hapticSquare.HapticType.CLICK; }
// Use this for initialization void Start() { haptic = GameObject.Find("HapticSquare").GetComponent <HapticSquare>(); thisPlayerLog = GameObject.Find("EventSystem").GetComponent <PlayerLog>(); }