void checkBaskeballExited()//reminds user about the ring { TransparentBallScript x = TransparentBall.GetComponent <TransparentBallScript>(); bballExited = x.basketBallExit; if (bballExited == true && bballExitedCounter == 0) { dialogcontrol.playSound(dialogcontrol.d33ShowoffSkills); bballExitedCounter = 1; } }
void objectInteractIntro() { //AI eyes game object -ralph happyEye.SetActive(false); //disable happy eye normalEye.SetActive(true); //enable normal eye controller.SetActive(true); trigger.SetActive(true); controller.transform.eulerAngles = Vector3.Lerp(transform.eulerAngles, targetAngles, smooth * Time.deltaTime); transparentBallExit = TransparentBall.GetComponent <TransparentBallScript>(); objectExitedSphere = transparentBallExit.ExitTransparetSphere; if (LocalTimer > 1 && LocalTimer <= 20 && objectExitedSphere != true) { if (check == true) { //objectToolTip.GetComponent<VRTK_ObjectTooltip>().containerSize = new Vector2(130f, 35f); if (DualDialogCounter == 8)//Plays 3 audio clips after one another instructing user to interact with objects -ralph { audioTime1 = dialogcontrol.d15UserBubbleOut.length + LocalTimer; audioTime2 = dialogcontrol.d16TryItOut.length + audioTime1; audTime3 = audioTime2 + dialogcontrol.d17approachBubble.length; audTime4 = audTime3 + dialogcontrol.d32MoveOutOfSphere.length; if (loopCounter == 0) { objectToolTip.GetComponent <VRTK_ObjectTooltip>().UpdateText("Interact with objects\ninside the bubble"); dialogcontrol.waitPlaySound(dialogcontrol.d15UserBubbleOut); loopCounter = 1; } DualDialogCounter = 9; } if (DualDialogCounter == 9 && LocalTimer > audioTime1) { if (loopCounter == 1) { dialogcontrol.waitPlaySound(dialogcontrol.d16TryItOut); objectToolTip.GetComponent <VRTK_ObjectTooltip>().UpdateText("Try it out"); loopCounter = 2; } DualDialogCounter = 10; } if (DualDialogCounter == 10 && LocalTimer > audioTime2) { dialogcontrol.waitPlaySound(dialogcontrol.d17approachBubble); objectToolTip.GetComponent <VRTK_ObjectTooltip>().UpdateText("Reach out to the item"); DualDialogCounter = 11; } if (DualDialogCounter == 11 && LocalTimer > audTime3) { dialogcontrol.waitPlaySound(dialogcontrol.d32MoveOutOfSphere); objectToolTip.GetComponent <VRTK_ObjectTooltip>().UpdateText("Move out of sphere"); DualDialogCounter = 12; } if (DualDialogCounter == 12 && LocalTimer > audTime4) { check = false; DualDialogCounter = 13; } //AI caption -ralplh } triggerHint = true; } else if (LocalTimer > 28 && objectExitedSphere == false) { //AI eyes game objects -ralph normalEye.SetActive(false); //disale normal eye angryEye.SetActive(true); //enable angry eye if (check == false) { if (loopCounter > 3 && loopCounter % 2 == 0) { //////////////////User are you still there? } //objectToolTip.GetComponent<VRTK_ObjectTooltip>().containerSize = new Vector2(140f, 20f); objectToolTip.GetComponent <VRTK_ObjectTooltip>().UpdateText("Again, reach \nout to the items"); if (DualDialogCounter == 13)//AI voice remainds user to interact with objects -ralph { audioTime1 = dialogcontrol.d19AgainifyouMay.length + LocalTimer; audioTime2 = dialogcontrol.d17approachBubble.length + LocalTimer; audTime3 = audioTime1 + audioTime2; dialogcontrol.waitPlaySound(dialogcontrol.d19AgainifyouMay); DualDialogCounter = 14; } if (DualDialogCounter == 14 && LocalTimer > audioTime1)//AI voice instruct user to approach buble -ralph { //objectToolTip.GetComponent<VRTK_ObjectTooltip>().containerSize = new Vector2(135f, 30f); objectToolTip.GetComponent <VRTK_ObjectTooltip>().UpdateText("Press highlighted button"); dialogcontrol.waitPlaySound(dialogcontrol.d17approachBubble); DualDialogCounter = 15; } if (DualDialogCounter == 15 && LocalTimer > audTime3) { //DualDialogCounter = 13; check = true; DualDialogCounter = 7; LocalTimer = 0; } loopCounter++; } } else if (objectExitedSphere == true && objectExitedSphereCounter == 0) { if (bballExitedCounter == 0 && bballExited == false) { TransparentBallScript x = TransparentBall.GetComponent <TransparentBallScript>(); bballExited = x.basketBallExit; bballExitedCounter = 1; } //AI eyes game objects -ralph angryEye.SetActive(false); //disable angry eye normalEye.SetActive(false); //disable angry eye happyEye.SetActive(true); //enable angry eye if (localTimerReset == 0) { DualDialogCounter = 16; LocalTimer = 0; localTimerReset = 1; } triggerHint = false; controller.SetActive(false); //objectToolTip.GetComponent<VRTK_ObjectTooltip>().containerSize = new Vector2(140f, 40f); if (DualDialogCounter == 16) //AI voice cogratulates user -ralph { audioTime1 = dialogcontrol.d20GreatJob.length + LocalTimer; audioTime2 = dialogcontrol.d25Hatsoff.length + audioTime1; audTime3 = audioTime1 + audioTime2; audTime4 = audTime3 + dialogcontrol.d33ShowoffSkills.length; dialogcontrol.waitPlaySound(dialogcontrol.d20GreatJob); objectToolTip.GetComponent <VRTK_ObjectTooltip>().UpdateText("Props to you!"); DualDialogCounter = 17; } if (DualDialogCounter == 17 && LocalTimer > audioTime1) { dialogcontrol.waitPlaySound(dialogcontrol.d25Hatsoff); DualDialogCounter = 18; objectToolTip.GetComponent <VRTK_ObjectTooltip>().UpdateText("You've finished the basics!"); } if (DualDialogCounter == 18 && LocalTimer > audTime3 && bballExited == true) { dialogcontrol.waitPlaySound(dialogcontrol.d33ShowoffSkills); DualDialogCounter = 19; } if (DualDialogCounter == 18 && LocalTimer > audTime3 && bballExited == false) { objectExitedSphereCounter++; DualDialogCounter = 19; //objectToolTip.SetActive(false); objectExitedSphereCounter = 1; stage++; bballExitedCounter = 0; } if (DualDialogCounter == 19 && LocalTimer > audTime4 && bballExited == true) { objectExitedSphereCounter++; DualDialogCounter = 19; //objectToolTip.SetActive(false); objectExitedSphereCounter = 1; stage++; bballExitedCounter = 0; } } }