public void playAnimation() { soundManager = gameObject.GetComponent<PG_SoundManager>(); animation.Play(); if(soundManager!=null){ soundManager.playInstructionSound(new string[]{PG_Constants._soundclipPath +PG_Constants._rollingShapes}); //Debug.Log("rolling shapes: "+PG_Constants._soundclipPath +PG_Constants._rollingShapes); } //else Debug.Log("soundManager is null"); }
public void playAnimation() { soundManager = gameObject.GetComponent <PG_SoundManager>(); animation.Play(); if (soundManager != null) { soundManager.playInstructionSound(new string[] { PG_Constants._soundclipPath + PG_Constants._rollingShapes }); //Debug.Log("rolling shapes: "+PG_Constants._soundclipPath +PG_Constants._rollingShapes); } //else Debug.Log("soundManager is null"); }
void playHopAnim() { if (hopAnimFrames.Count > 0) { setCurrentFrame((int)hopAnimFrames[count]); count++; if (count == hopAnimFrames.Count) { count = 0; if (soundManager != null) { soundManager.playInstructionSound(new string[] { PG_Constants._soundclipPath + PG_Constants._introClips + PG_Constants._jump }); } hopAnimCount++; if (hopAnimCount == 3) { count = 0; ickyState = ickyAnimStates.icky_landToWater; } } } }
// --------- Finger taps void FingerGestures_OnFingerTap(int fingerIndex, Vector2 fingerPos, int tapCount) { GameObject selection = PickObject(fingerPos); if (!enableTouchesFlag || selection == null) { return; } // Debug.Log("in finger tap..."); if (selection.name == "pg_olly" && jumpCount == 0) { int _tickle = Random.Range(1, 4); soundManager.currentClips = new System.Collections.Generic.List <UnityEngine.AudioClip>(); soundManager.playInstructionSound(new string[] { PG_Constants._soundclipPath + PG_Constants._tickle + string.Format("olly_tap_{0}", _tickle) }); if (ollyAnimationsSR.ollyState != ollyAnimationStates.olly_tickle) { PG_OllyAnimations.changeTexture = true; } ollyAnimationsSR.ollyState = ollyAnimationStates.olly_tickle; return; } else if (selection.name == "bubble_referent" || selection.name == "cross_tick_sign" || selection.name == "referent_hint" || selection.name == "referent_shape") { soundManager.currentClips = new System.Collections.Generic.List <UnityEngine.AudioClip>(); soundManager.playInstructionSound(questionInstructionVO); } else if (selection.name == "pg_icky") { int _tickle = Random.Range(1, 5); soundManager.currentClips = new System.Collections.Generic.List <UnityEngine.AudioClip>(); soundManager.playInstructionSound(new string[] { PG_Constants._soundclipPath + PG_Constants._tickle + string.Format("icky_tickle_{0}", _tickle) }); if (ickyAnimationsSR.ickyState != ickyAnimStates.icky_tickle) { PG_IckyAnimations.changeTexture = true; } ickyAnimationsSR.ickyState = ickyAnimStates.icky_tickle; return; } if (selection != null) { shapeStatController = selection.GetComponent <PG_ShapeStatController>(); //StopAllCoroutines(); } if (shapeStatController != null && shapeStatController.getAnswerShape() && dragFingerIndex == -1) { dragFingerIndex = fingerIndex; decideForTappedDraggedShape(selection); if ((int)currentMode == (int)GameModes.mode_counting) { countModeShapeNumber++; GameObject countingNumber = GameObject.Instantiate(GO_countingNumber) as GameObject; countingNumber.transform.parent = camera.transform; if (countingNumber != null) { countingPOPUPController = countingNumber.GetComponent <PG_CountingPopUpController>(); } if (countingPOPUPController != null) { countingPOPUPController.showCountingNumber(countModeShapeNumber); } string shapeClipName = null; string shapeName = pgDataManager.getQuestionTitle(); if (countModeShapeNumber == 1) { shapeClipName = "word_" + shapeName.ToLower(); } else { shapeClipName = "word_" + shapeName.ToLower() + "s"; } soundManager.currentClips = new System.Collections.Generic.List <UnityEngine.AudioClip>(); soundManager.playInstructionSound(new string[] { PG_Constants._soundclipPath + PG_Constants._counting + string.Format("number_{0}", countModeShapeNumber), PG_Constants._soundclipPath + PG_Constants._basicShapes + shapeClipName }); } else { soundManager.currentClips = new System.Collections.Generic.List <UnityEngine.AudioClip>(); soundManager.playSucess(); } //StartCoroutine(playQuestionInstructionVO(10F)); } else if (shapeStatController != null && !shapeStatController.getAnswerShape() && dragFingerIndex == -1) { shapeStatController.shapeWrongTapAnimation(); // start wrong animation with VO totalWrongAttempts++; //StartCoroutine(playQuestionInstructionVO(5F)); if (ollyAnimationsSR.ollyState != ollyAnimationStates.olly_wrongAnswer) { PG_OllyAnimations.changeTexture = true; ollyAnimationsSR.ollyLastStat = ollyAnimationsSR.ollyState; } ollyAnimationsSR.ollyState = ollyAnimationStates.olly_wrongAnswer; soundManager.currentClips = new System.Collections.Generic.List <UnityEngine.AudioClip>(); soundManager.playWrongSound(); cross_tick_sign.transform.renderer.material.mainTexture = Resources.Load(PG_Constants._wrongTick) as Texture; cross_tick_sign.transform.renderer.enabled = true; StartCoroutine(unhideCrossSign(0.5F)); if (dragFingerIndex == fingerIndex && isRightShapeDragged && answerShapeDrag != null) { decideForTappedDraggedShape(answerShapeDrag); } // shapeStatController.shapeWrongTapAnimation(); // start wrong animation with VO // totalWrongAttempts++; // //StartCoroutine(playQuestionInstructionVO(5F)); // if(ollyAnimationsSR.ollyState!=ollyAnimationStates.olly_wrongAnswer){ // PG_OllyAnimations.changeTexture = true; // ollyAnimationsSR.ollyLastStat = ollyAnimationsSR.ollyState; // } // ollyAnimationsSR.ollyState = ollyAnimationStates.olly_wrongAnswer; // soundManager.currentClips = new System.Collections.Generic.List<UnityEngine.AudioClip>(); // soundManager.playWrongSound(); // cross_tick_sign.transform.renderer.material.mainTexture=Resources.Load(PG_Constants._wrongTick) as Texture; // cross_tick_sign.transform.renderer.enabled=true; // //StartCoroutine(unhideCrossSign(0.5F)); } }