public void playEatingAnimation(float xPos, NF_IckyAnimationStates state) { ickyStates = state; if (xPos < transform.position.x) { shouldFlipHop = true; } else { shouldFlipHop = false; } if (ickyStates == NF_IckyAnimationStates.icky_jumping) { Vector3 pos = transform.position; pos.x = xPos; currentFrame = 0; iTween.MoveTo(gameObject, iTween.Hash("position", pos, "time", 18.0f / 50.0f, "easetype", iTween.EaseType.linear)); } else if (ickyStates == NF_IckyAnimationStates.icky_angleJumpNEat) { playSoundClip(); Vector3 pos = transform.position; pos.y = pos.y + 95; this.transform.position = pos; pos.x = xPos; currentFrame = 0; iTween.MoveTo(gameObject, iTween.Hash("position", pos, "delay", 15.0f / 50.0f, "time", 6.0f / 50.0f, "easetype", iTween.EaseType.linear)); } }
public void setInitialStateOfIcky() { fps = 30; currentFrame = 0; isAnimating = true; ickyStates = NF_IckyAnimationStates.icky_idle; createAnimations(); }
void intro_HopAnimation_3(float xPos) { NF_SoundManager.playSFX(voiceOversIcky[14]); ickyStates = NF_IckyAnimationStates.icky_hop; createAnimations(); Vector3 pos = transform.position; pos.x = xPos; currentFrame = 0; iTween.MoveTo(gameObject, iTween.Hash("position", pos, "time", 18.0f / 50.0f, "onComplete", "switchToIdle", "oncompletetarget", gameObject, "easetype", iTween.EaseType.linear)); }
void intro_HopAnimation_1(float xPos) { ickyStates = NF_IckyAnimationStates.icky_hop; createAnimations(); Vector3 pos = transform.position; pos.x = xPos; currentFrame = 0; iTween.MoveTo(gameObject, iTween.Hash("position", pos, "delay", 0.5f, "time", 18.0f / 50.0f, "easetype", iTween.EaseType.linear)); iTween.RotateTo(gameObject, iTween.Hash("Quartenion", new Vector3(0, 0, 0), "delay", 0.5f, "time", 25.0f / 50.0f, "onComplete", "intro_HopAnimation_2", "oncompletetarget", gameObject, "oncompleteparams", -250.0f)); }
public void setIckyPosition_HopAnimation(float xPos, NF_IckyAnimationStates state) { if (xPos < transform.position.x) { shouldFlipHop = true; } else { shouldFlipHop = false; } ickyStates = state; Vector3 pos = transform.position; pos.x = xPos; currentFrame = 0; iTween.MoveTo(gameObject, iTween.Hash("position", pos, "time", 18.0f / 50.0f, "easetype", iTween.EaseType.linear)); //NF_SoundManager.playSFX(voiceOversIcky[14]); }
public void playIcky_Animations() { NF_InputController IC = (NF_InputController)Camera.mainCamera.GetComponentInChildren <NF_InputController>(); if (ickyStates == NF_IckyAnimationStates.unknown || ickyStates == NF_IckyAnimationStates.icky_reseting) { IC.enableTouches(); renderer.material.mainTexture = ickyImage; transform.localScale = new Vector3(140, 165, 1); colCount = 1; rowCount = 1; colNumber = 0; rowNumber = 0; totalCells = 1; fps = 30; setCurrentFrame(0); } else if (ickyStates == NF_IckyAnimationStates.icky_weeping) { IC.disableTouches(); renderer.material.mainTexture = weepingSheet; transform.localScale = new Vector3(166, 126, 1); colCount = 2; rowCount = 1; colNumber = 0; rowNumber = 0; totalCells = 2; fps = 30; if (weepingFrames == null || weepingFrames.Count == 0) { createAnimations(); } setCurrentFrame((int)weepingFrames[0]); weepingFrames.RemoveAt(0); if (weepingFrames.Count == 0) { ickyStates = NF_IckyAnimationStates.unknown; createAnimations(); callLoadNextQuestion(); } } else if (ickyStates == NF_IckyAnimationStates.icky_weeping2) { IC.disableTouches(); renderer.material.mainTexture = weepingSheet; transform.localScale = new Vector3(166, 126, 1); colCount = 2; rowCount = 1; colNumber = 0; rowNumber = 0; totalCells = 2; fps = 30; if (weepingFrames == null || weepingFrames.Count == 0) { createAnimations(); } setCurrentFrame((int)weepingFrames[0]); weepingFrames.RemoveAt(0); if (weepingFrames.Count == 0) { currentFrame = 0; fps = 30; ickyStates = NF_IckyAnimationStates.unknown; createAnimations(); callLoadNextQuestion(); } } else if (ickyStates == NF_IckyAnimationStates.icky_giggle) { IC.disableTouches(); renderer.material.mainTexture = giggleSheet; transform.localScale = new Vector3(135, 148, 1); colCount = 8; rowCount = 3; colNumber = 0; rowNumber = 0; totalCells = 23; fps = 30; if (giggleFrames == null || giggleFrames.Count == 0) { createAnimations(); } setCurrentFrame((int)giggleFrames[0]); giggleFrames.RemoveAt(0); if (giggleFrames.Count == 0) { currentFrame = 0; fps = 30; ickyStates = NF_IckyAnimationStates.icky_idle; createAnimations(); } } else if (ickyStates == NF_IckyAnimationStates.icky_celebration) { IC.disableTouches(); renderer.material.mainTexture = celebrationSheet; transform.localScale = new Vector3(200, 175, 1); colCount = 8; rowCount = 7; colNumber = 0; rowNumber = 0; totalCells = 53; fps = 30; if (celebrationFrames == null || celebrationFrames.Count == 0) { createAnimations(); } setCurrentFrame((int)celebrationFrames[0]); celebrationFrames.RemoveAt(0); if (celebrationFrames.Count == 0) { fps = 30; currentFrame = 0; ickyStates = NF_IckyAnimationStates.icky_idle; createAnimations(); } } else if (ickyStates == NF_IckyAnimationStates.icky_want) { IC.enableTouches(); renderer.material.mainTexture = wantSheet; transform.localScale = new Vector3(145, 160, 1); colCount = 5; rowCount = 5; colNumber = 0; rowNumber = 0; totalCells = 25; fps = 30; if (wantFrames == null || wantFrames.Count == 0) { createAnimations(); } setCurrentFrame((int)wantFrames[0]); wantFrames.RemoveAt(0); if (wantFrames.Count == 0) { currentFrame = 0; fps = 30; ickyStates = NF_IckyAnimationStates.icky_idle; createAnimations(); } } else if (ickyStates == NF_IckyAnimationStates.icky_idle) { IC.enableTouches(); renderer.material.mainTexture = idleSheet; transform.localScale = new Vector3(140, 165, 1); colCount = 10; rowCount = 6; colNumber = 0; rowNumber = 0; totalCells = 59; fps = 30; if (idleFrames == null || idleFrames.Count == 0) { createAnimations(); } setCurrentFrame((int)idleFrames[0]); idleFrames.RemoveAt(0); if (idleFrames.Count == 0) { currentFrame = 0; fps = 30; ickyStates = NF_IckyAnimationStates.icky_want; createAnimations(); } } else if (ickyStates == NF_IckyAnimationStates.icky_eating) { IC.disableTouches(); renderer.material.mainTexture = eating1Sheet; transform.localScale = new Vector3(150, 158, 1); colCount = 8; rowCount = 7; colNumber = 0; rowNumber = 0; totalCells = 53; fps = 50; if (eating1Frames == null || eating1Frames.Count == 0) { createAnimations(); } setCurrentFrame((int)eating1Frames[0]); eating1Frames.RemoveAt(0); if (eating1Frames.Count == 0) { if (IC._totalAnswersCount > 0) { setIckyPosition_HopAnimation(0.0f, NF_IckyAnimationStates.icky_hop); } else { if (shouldPlayCelebration) { shouldPlayCelebration = false; ickyStates = NF_IckyAnimationStates.icky_celebration; playSoundClip(); } else { ickyStates = NF_IckyAnimationStates.icky_idle; } fps = 30; currentFrame = 0; createAnimations(); } } } else if (ickyStates == NF_IckyAnimationStates.icky_wrongAns) { renderer.material.mainTexture = wrongSheet; transform.localScale = new Vector3(115, 145, 1); colCount = 8; rowCount = 2; colNumber = 0; rowNumber = 0; totalCells = 24; fps = 30; if (wrongFrames == null || wrongFrames.Count == 0) { createAnimations(); } setCurrentFrame((int)wrongFrames[0]); wrongFrames.RemoveAt(0); if (wrongFrames.Count == 0) { IC.disableTouches(); fps = 30; currentFrame = 0; ickyStates = NF_IckyAnimationStates.icky_idle; createAnimations(); } } else if (ickyStates == NF_IckyAnimationStates.icky_jumping) { IC.disableTouches(); renderer.material.mainTexture = jump1Sheet; if (shouldFlipHop) { transform.localScale = new Vector3(-180, 250, 1); } else { transform.localScale = new Vector3(180, 250, 1); } colCount = 6; rowCount = 3; colNumber = 0; rowNumber = 0; totalCells = 18; fps = 50; if (jump1Frames == null || jump1Frames.Count == 0) { createAnimations(); } setCurrentFrame((int)jump1Frames[0]); jump1Frames.RemoveAt(0); if (jump1Frames.Count == 0) { fps = 30; currentFrame = 0; ickyStates = NF_IckyAnimationStates.icky_eating; playSoundClip(); createAnimations(); } } else if (ickyStates == NF_IckyAnimationStates.icky_bouncing) { IC.disableTouches(); renderer.material.mainTexture = bouncingSheet; if (shouldFlipHop) { transform.localScale = new Vector3(-125, 165, 1); } else { transform.localScale = new Vector3(125, 165, 1); } colCount = 6; rowCount = 4; colNumber = 0; rowNumber = 0; totalCells = 22; fps = 50; if (jump1Frames == null || jump1Frames.Count == 0) { createAnimations(); } setCurrentFrame((int)jump1Frames[0]); jump1Frames.RemoveAt(0); if (jump1Frames.Count == 0) { fps = 30; currentFrame = 0; ickyStates = NF_IckyAnimationStates.icky_eating; playSoundClip(); createAnimations(); } } else if (ickyStates == NF_IckyAnimationStates.icky_angleJumpNEat) { IC.disableTouches(); renderer.material.mainTexture = angleJumpNEatSheet; if (shouldFlipHop) { transform.localScale = new Vector3(-165, 355, 1); } else { transform.localScale = new Vector3(165, 335, 1); } colCount = 9; rowCount = 6; colNumber = 0; rowNumber = 0; totalCells = 51; fps = 50; if (angleJumpFrames == null || angleJumpFrames.Count == 0) { createAnimations(); } setCurrentFrame((int)angleJumpFrames[0]); angleJumpFrames.RemoveAt(0); if (angleJumpFrames.Count == 0) { Vector3 newPos = this.transform.position; newPos.y = newPos.y - 95; this.transform.position = newPos; transform.localScale = new Vector3(140, 165, 1); NF_QuestionLoader questionLoader1 = GameObject.Find("Question").GetComponent <NF_QuestionLoader>(); questionLoader1.moveToIckyPosition(); NF_GameController gameController = (NF_GameController)Camera.mainCamera.GetComponentInChildren <NF_GameController>(); gameController.thoughtBubbleFadeIn(); fps = 30; currentFrame = 0; if (shouldPlayCelebration) { shouldPlayCelebration = false; ickyStates = NF_IckyAnimationStates.icky_celebration; playSoundClip(); } else { ickyStates = NF_IckyAnimationStates.icky_idle; } createAnimations(); } } else if (ickyStates == NF_IckyAnimationStates.icky_hop || ickyStates == NF_IckyAnimationStates.icky_bounceNEat) { IC.disableTouches(); renderer.material.mainTexture = jump1Sheet; if (shouldFlipHop) { transform.localScale = new Vector3(-180, 250, 1); } else { transform.localScale = new Vector3(180, 250, 1); } colCount = 6; rowCount = 3; colNumber = 0; rowNumber = 0; totalCells = 18; fps = 50; if (jump1Frames == null || jump1Frames.Count == 0) { createAnimations(); } setCurrentFrame((int)jump1Frames[0]); jump1Frames.RemoveAt(0); if (jump1Frames.Count == 0) { if (ickyStates == NF_IckyAnimationStates.icky_hop) { NF_QuestionLoader questionLoader1 = GameObject.Find("Question").GetComponent <NF_QuestionLoader>(); questionLoader1.moveToIckyPosition(); NF_GameController gameController = (NF_GameController)Camera.mainCamera.GetComponentInChildren <NF_GameController>(); gameController.thoughtBubbleFadeIn(); fps = 30; currentFrame = 0; ickyStates = NF_IckyAnimationStates.icky_idle; createAnimations(); } else { fps = 30; currentFrame = 0; ickyStates = NF_IckyAnimationStates.icky_bouncing; NF_SoundManager.playSFX(voiceOversIcky[14]); playSoundClip(); createAnimations(); } } } }
void switchToIdle() { NF_SoundManager.playSFX(voiceOversIcky[14]); ickyStates = NF_IckyAnimationStates.icky_idle; }