// Update is called once per frame void Update() { if (!VitaParticleGazeScript.bVitaSoulCanGaze) { VitaParticleScript.FollowObj(); } }
// Update is called once per frame void Update() { if (!VitaParticleGazeScript.bVitaSoulCanGaze) { VitaParticleScript.FollowObj(); } ////water wheel rotate if (WaterWheelScript._bSkillOneTrigger && WaterWheelScript._bIsRotate == false && PlayerSkill.CURRENTSKILL == 1) { Splash.Play(); WaterWheelScript.PlayWaterWheelRotate(); PlantScript.GrowUp(); } /// ////Boat if ((BoatTriggerScript._bSkillOneTrigger && PlayerSkill.CURRENTSKILL == 1) || BoatMoveScript._bIsMove == true) { BoatMoveScript.BoatFloating(); } //// ////Candle if (TriggerCandleScript._bSkillOneTrigger && isCloudDestory == false && PlayerSkill.CURRENTSKILL == 1) { CloudToDestroy.GetComponentInChildren <testCloud>().FadeOutAndDestory(TriggerCandleScript.GetComponent <Transform>().position); isCloudDestory = true; } //// ////RopeWay if (RopewayTriggerScript._bSkillOneTrigger && RopewayScript._bRopewayMoving == false && PlayerSkill.CURRENTSKILL == 1) { RopewayScript.RopewayDown(); } //// ////Candle-2 if (TriggerCandleScript2._bSkillOneTrigger && isCloudDestory2 == false && PlayerSkill.CURRENTSKILL == 1) { CloudToDestroy2.GetComponentInChildren <testCloud>().FadeOutAndDestory(TriggerCandleScript2.GetComponent <Transform>().position); isCloudDestory2 = true; } }
// Update is called once per frame void Update() { if (!VitaParticleGazeScript.bVitaSoulCanGaze) { VitaParticleScript.FollowObj(); } ///take key if (GameObject.Find("Key")) { if (KeyScript._bTouchKey && KeyScript._bTakeKey == false) { KeyScript.FadeOutKey(); KeyScript._bTakeKey = true; } } ///take skill if (GameObject.Find("Box")) { if (BoxScript._bTouchBox && KeyScript._bTakeKey && BoxScript._bTakeSkill == false) { BoxScript.FadeOutBox(); BoxScript._bTakeSkill = true; } } //clear rock -> water drop -> plant grow if (!GameObject.Find("Rock3")) { Splash.Play(); PlantScript.GrowUp(); } /// }
// Update is called once per frame void Update() { //////////////////////////////偷吃步 if (!bVitaSoulCanGaze) { VitaParticleScript.FollowObj(); } if (Input.GetButtonDown("skillOne") || Input.GetButtonDown("skillTwo")) { bVitaSoulCanGaze = false; VitaParticleGazeScript.bVitaSoulCanGaze = bVitaSoulCanGaze; //start prompt VitaParticleScript.PromptFadeIn(); FadeInUI(); DelayCanGaze(1.8f); //wait for raise hand time } //count to 2.0f can't gaze if (bVitaSoulCanGaze) { VitaSoulCanGazeTimer += Time.deltaTime; if (VitaSoulCanGazeTimer > 6.5f) { bVitaSoulCanGaze = false; VitaParticleGazeScript.bVitaSoulCanGaze = bVitaSoulCanGaze; VitaParticleScript.StopSkillAfterTime(0.0f); //reset particle VitaSoulCanGazeTimer = 0.0f; FadeOutUI(); VitaParticleScript.animator.SetBool("StartSkill", false); VitaSoulRenderer.color = new Color(VitaSoulRenderer.color.r, VitaSoulRenderer.color.g, VitaSoulRenderer.color.b, 1f); //StopCoroutine(coroutine); } } //////////////////////////////偷吃步 //Vita touch magicWound => Light up Vita if (magicLightScript.LightUpVita) { VitaParticleScript.LightUpVita(magicLightScript.magicLt.color); VitaParticleScript.SkillNUM = PlayerSkill.CURRENTSKILL; VitaParticleScript.animator.SetBool("StartSkill", true); //FadingVitaSoul(); // start vita soul fading magicLightScript.LightUpVita = false; // stop light } //Wall Disolve for (int i = 0; i < 3; i++) { if (VitaParticleScript.SkillNUM == 2 && WallDisolveScript[i].canDisolve) { WallDisolveScript[i].FadeOut(); } } }
// Update is called once per frame void Update() { //wait for scene transition if (AnimatorCount == 0) { StartCoroutine(AfterSceneTransistion()); PlayerMovementScript.canMove = false; } //player move in scene if (AnimatorCount == 1) { VitaMovementScript.FollowObj(); PlayerTrans.position = PlayerTrans.position + new Vector3(5.0f * Time.deltaTime, 0.0f, 0.0f); PlayerAni.SetFloat("Speed", 1.0f); StartCoroutine(PlayerMoveInScene()); } //player can move and wait to trigger else if (AnimatorCount == 2) { VitaMovementScript.FollowObj(); if (PlayerTriggerScript.bTrigger) //if trigger StoryTrigger { AnimatorCount++; } } //set player's and vita's position else if (AnimatorCount == 3) { PlayerMovementScript.canMove = false; PlayerTrans.position = PlayerTrans.position + new Vector3(TransSpeed * Time.deltaTime, 0.0f, 0.0f); if (VitaTrans.position.x <= -2.35f) { VitaTrans.position = VitaTrans.position + new Vector3(TransSpeed * Time.deltaTime, 0.0f, 0.0f); } if (PlayerTrans.position.x >= 1.29f) { PlayerMovementScript.TurnFace(); PlayerAni.SetFloat("Speed", 0.0f); //stop runing animator AnimatorCount++; } } //start dialogue else if (AnimatorCount == 4) { Dialogue.name = "薇妲"; Dialogue.sentences = new string[2]; Dialogue.sentences[0] = "欸?"; Dialogue.sentences[1] = "這裡是哪裡呀?太酷了吧"; CGMoveScript.SetRecTransformX(62.98596f); FindObjectOfType <DialogueManager>().StartDialogue(Dialogue, VitaCV); AnimatorCount++; } else if (AnimatorCount == 5 && DialogueManager.bFinishDialogue) { Dialogue.name = "莉妲"; Dialogue.sentences = new string[1]; Dialogue.sentences[0] = "是爺爺的密室嗎?"; CGMoveScript.SetRecTransformX(145.7859f); FindObjectOfType <DialogueManager>().StartDialogue(Dialogue, PlayerCV); AnimatorCount++; } else if (AnimatorCount == 6 && DialogueManager.bFinishDialogue) { Dialogue.name = "薇妲"; Dialogue.sentences = new string[1]; CGMoveScript.SetRecTransformX(62.98596f); Dialogue.sentences[0] = "哇啊!我們快來探險!莉妲你看!那是什麼?"; FindObjectOfType <DialogueManager>().StartDialogue(Dialogue, VitaCV); AnimatorCount++; } else if (AnimatorCount == 7 && DialogueManager.bFinishDialogue) { Dialogue.name = "莉妲"; Dialogue.sentences = new string[1]; Dialogue.sentences[0] = "不要亂碰!要是弄壞就糟了"; CGMoveScript.SetRecTransformX(145.7859f); FindObjectOfType <DialogueManager>().StartDialogue(Dialogue, PlayerCV); AnimatorCount++; } else if (AnimatorCount == 8 && DialogueManager.bFinishDialogue) { Dialogue.name = "薇妲"; Dialogue.sentences = new string[1]; Dialogue.sentences[0] = "欸?來不及了"; CGMoveScript.SetRecTransformX(62.98596f); FindObjectOfType <DialogueManager>().StartDialogue(Dialogue, VitaCV); AnimatorCount++; } else if (AnimatorCount == 9 && DialogueManager.bFinishDialogue) { StartCoroutine(WaitToNextAnimate(1.0f)); } //open box + MagicWoundAnimate else if (AnimatorCount == 10) { BoxRenderer.sprite = Box_close; MagicWoundScript.MagicWoundAnimate(); AnimatorCount++; } //wait next animation else if (AnimatorCount == 11 && MagicWoundScript.bfinishShine) { StartCoroutine(WaitToNextAnimate(1.0f)); } //set vita disappear else if (AnimatorCount == 12 && MagicWoundScript.bfinishShine) { Vita.SetActive(false); Dialogue.name = "薇妲"; Dialogue.sentences = new string[1]; Dialogue.sentences[0] = "阿!!!!"; CGMoveScript.SetRecTransformX(62.98596f); FindObjectOfType <DialogueManager>().StartDialogue(Dialogue, VitaCV); AnimatorCount++; } //set Dialogue else if (AnimatorCount == 13 && DialogueManager.bFinishDialogue) { Dialogue.name = "莉妲"; Dialogue.sentences = new string[1]; Dialogue.sentences[0] = "薇妲!!!"; CGMoveScript.SetRecTransformX(145.7859f); FindObjectOfType <DialogueManager>().StartDialogue(Dialogue, PlayerCV); AnimatorCount++; } else if (AnimatorCount == 14 && DialogueManager.bFinishDialogue) { MagicWoundScript.MagicWoundFadeOutShine(); AnimatorCount++; } //wait next animation else if (AnimatorCount == 15 && MagicWoundScript.bfinishFadeOut) { StartCoroutine(WaitToNextAnimate(0.5f)); } //magicWound fallDown set else if (AnimatorCount == 16) { MagicWound.GetComponent <Rigidbody2D>().gravityScale = 1.0f; MagicWound.AddComponent <BoxCollider2D>(); MagicWoundTrans.eulerAngles = new Vector3(0.0f, 0.0f, 53.165f); MagicWoundScript.ChangeShortingLayer("Player"); //stand in front of box AnimatorCount++; } //wait next animation else if (AnimatorCount == 17 && MagicWoundScript.bfinishFadeOut) { StartCoroutine(WaitToNextAnimate(2.0f)); } //set Dialogue else if (AnimatorCount == 18) { //close magicWound collider MagicWound.GetComponent <BoxCollider2D>().isTrigger = true; MagicWound.GetComponent <Rigidbody2D>().gravityScale = 0.0f; Dialogue.name = "莉妲"; Dialogue.sentences = new string[2]; Dialogue.sentences[0] = "薇妲?你去哪了?"; Dialogue.sentences[1] = "別跟我鬧喔!你快點出來!薇妲!"; CGMoveScript.SetRecTransformX(145.7859f); FindObjectOfType <DialogueManager>().StartDialogue(Dialogue, PlayerCV); AnimatorCount++; } else if (AnimatorCount == 19 && DialogueManager.bFinishDialogue) { Dialogue.name = "薇妲"; Dialogue.sentences = new string[1]; Dialogue.sentences[0] = "莉妲!"; CGMoveScript.SetRecTransformX(62.98596f); FindObjectOfType <DialogueManager>().StartDialogue(Dialogue, VitaCV); AnimatorCount++; } else if (AnimatorCount == 20 && DialogueManager.bFinishDialogue) { Dialogue.name = "莉妲"; Dialogue.sentences = new string[1]; Dialogue.sentences[0] = "薇妲?你在哪裡?"; CGMoveScript.SetRecTransformX(145.7859f); FindObjectOfType <DialogueManager>().StartDialogue(Dialogue, PlayerCV); AnimatorCount++; } else if (AnimatorCount == 21 && DialogueManager.bFinishDialogue) { Dialogue.name = "薇妲"; Dialogue.sentences = new string[1]; CGMoveScript.SetRecTransformX(62.98596f); Dialogue.sentences[0] = "這裡!我在這裡"; FindObjectOfType <DialogueManager>().StartDialogue(Dialogue, VitaCV); AnimatorCount++; } else if (AnimatorCount == 22 && DialogueManager.bFinishDialogue) { StartCoroutine(WaitToNextAnimate(1.0f)); VitaSoul.SetActive(true); } //Vita movement else if (AnimatorCount == 23 && !VitaSoulScript.bMoveFinish) { VitaSoulScript.MoveToward(new Vector2(-1.75f, -0.54f)); //if finish move toward if (VitaSoulScript.bMoveFinish) { VitaSoulScript.VitaSpriteFadeIn(); AnimatorCount++; VitaSoulScript.bMoveFinish = false; } } else if (AnimatorCount == 24) { StartCoroutine(WaitToNextAnimate(1.0f)); } //set Dialogue else if (AnimatorCount == 25 && DialogueManager.bFinishDialogue) { Dialogue.name = "莉妲"; Dialogue.sentences = new string[1]; CGMoveScript.SetRecTransformX(145.7859f); Dialogue.sentences[0] = "啊!薇妲?你怎麼變成這樣?"; FindObjectOfType <DialogueManager>().StartDialogue(Dialogue, PlayerCV); AnimatorCount++; } else if (AnimatorCount == 26 && DialogueManager.bFinishDialogue) { Dialogue.name = "薇妲"; Dialogue.sentences = new string[1]; CGMoveScript.SetRecTransformX(62.98596f); Dialogue.sentences[0] = "一回過神就變成這樣啦!哈哈哈!好好玩喔"; FindObjectOfType <DialogueManager>().StartDialogue(Dialogue, VitaCV); VitaSoulScript.MoveSpeed = 15.0f; //set vita soul new move speed AnimatorCount++; } //Vita movement else if (AnimatorCount == 27 && DialogueManager.bFinishDialogue && !VitaSoulScript.bMoveFinish) { VitaSoulScript.MoveToward(new Vector2(-5.13f, 0.9f)); //if finish move toward if (VitaSoulScript.bMoveFinish) { VitaSoulScript.bMoveFinish = false; AnimatorCount++; } } else if (AnimatorCount == 28 && !VitaSoulScript.bMoveFinish) { VitaSoulScript.MoveToward(new Vector2(4.15f, 0.96f)); //if finish move toward if (VitaSoulScript.bMoveFinish) { VitaSoulScript.bMoveFinish = false; AnimatorCount++; } } else if (AnimatorCount == 29 && !VitaSoulScript.bMoveFinish) { VitaSoulScript.MoveToward(new Vector2(-6.91f, 2.89f)); //if finish move toward if (VitaSoulScript.bMoveFinish) { VitaSoulScript.bMoveFinish = false; AnimatorCount++; } } else if (AnimatorCount == 30 && !VitaSoulScript.bMoveFinish) { VitaSoulScript.MoveToward(new Vector2(-1.75f, -0.54f)); //if finish move toward if (VitaSoulScript.bMoveFinish) { VitaSoulScript.bMoveFinish = false; AnimatorCount++; } } //set Dialogue else if (AnimatorCount == 31) { Dialogue.name = "莉妲"; Dialogue.sentences = new string[1]; Dialogue.sentences[0] = "別鬧了!快下來,我們去找爺爺,他一定知道發生什麼事"; FindObjectOfType <DialogueManager>().StartDialogue(Dialogue, PlayerCV); VitaSoulScript.MoveSpeed = 10.0f; //set vita soul new move speed //set trigger name Wall_left PlayerTriggerScript.TriggerName = "Wall_left"; //player wait for trigger's name AnimatorCount++; } else if (AnimatorCount >= 32 && DialogueManager.bFinishDialogue) { PlayerMovementScript.canMove = true; VitaSoulScript.FollowObj(); if (PlayerTriggerScript.bTrigger) { levelLoaderScript.LoadNextLevel("StudyRoom"); } } }
// Update is called once per frame void Update() { if (!VitaParticleGazeScript.bVitaSoulCanGaze) { VitaParticleScript.FollowObj(); } ////Candle if (TriggerCandleScript1._bSkillOneTrigger && isCloudDestory == false) { StartCoroutine(ChangeCloudColorIEnumerator(CloudToDestroy)); isCloudDestory = true; } if (TriggerCandleScript3._bSkillOneTrigger && isCloudDestory3 == false) { StartCoroutine(ChangeCloudColorIEnumerator(CloudToDestroy3)); isCloudDestory3 = true; } //// ////Stair rotate if (TriggerCandleScript2._bSkillOneTrigger && RotateStair._bIsRotate == false) { RotateStair.StairRotate(); } /// //Dectect Buddha level start bool bCandle1 = StartCandle[0].GetComponent <BuddhaCandle>().DetectCandleFinish(); bool bCandle2 = StartCandle[1].GetComponent <BuddhaCandle>().DetectCandleFinish(); if (bCandle1 && bCandle2 && iBuddhaLevel == 0) { iBuddhaLevel = 1; } //Choose 3number between 1-5 else if (iBuddhaLevel == 1) { for (int i = 0; i < array.Length;) { bool flag = true; int ii = Random.Range(1, 5); for (int j = 0; j < i; j++) { if (ii == array[j]) { flag = false; } } if (flag) { array[i] = ii; i++; } } iBuddhaLevel += 1; } //fade in in order GameCandle 1 else if (iBuddhaLevel == 2) { GameCandle[array[0]].GetComponent <SpriteRenderer>().color = new Color(1.0f, 0.987f, 0f, 1.0f); //Light up candle StartCoroutine(BuddhaLevelDelayIEnumerator(2.0f)); } //fade in in order GameCandle 2 else if (iBuddhaLevel == 3) { GameCandle[array[0]].GetComponent <SpriteRenderer>().color = new Color(0.9294118f, 0.9294118f, 0.9294118f, 1.0f); //Light up candle GameCandle[array[1]].GetComponent <SpriteRenderer>().color = new Color(1.0f, 0.987f, 0f, 1.0f); //Light up candle StartCoroutine(BuddhaLevelDelayIEnumerator(2.0f)); } //fade in in order GameCandle 3 else if (iBuddhaLevel == 4) { GameCandle[array[1]].GetComponent <SpriteRenderer>().color = new Color(0.9294118f, 0.9294118f, 0.9294118f, 1.0f); //Light up candle GameCandle[array[2]].GetComponent <SpriteRenderer>().color = new Color(1.0f, 0.987f, 0f, 1.0f); //Light up candle StartCoroutine(BuddhaLevelDelayIEnumerator(2.0f)); } //fade out else if (iBuddhaLevel == 5) { for (int i = 0; i < 3; i++) { GameCandle[array[i]].GetComponent <SpriteRenderer>().color = new Color(0.9294118f, 0.9294118f, 0.9294118f, 1.0f); //Light up candle Go.color = new Color(Go.color.r, Go.color.g, Go.color.b, 1.0f); } iBuddhaLevel = 6; } //check if Buddha level end else if (iBuddhaLevel == 6) { int iCandleCounter = 0; //Detect all candle for (int i = 0; i < GameCandle.Length; i++) { //detect candle and count if (GameCandle[i].GetComponent <BuddhaCandle>().DetectCandleFinish()) { ilightUpArray[iCandleCounter] = i; iCandleCounter++; } } //one candle light up if (iCandleCounter == 1) { if (!GameCandle[array[0]].GetComponent <BuddhaCandle>().DetectCandleFinish()) // if is not first one { resetCandle(); iCandleCounter = 0; // reset counter } } //two candle light up if (iCandleCounter == 2) { if (!GameCandle[array[1]].GetComponent <BuddhaCandle>().DetectCandleFinish()) // if is not first one { resetCandle(); iCandleCounter = 0; // reset counter } } //three candle light up if (iCandleCounter == 3) { if (!GameCandle[array[2]].GetComponent <BuddhaCandle>().DetectCandleFinish()) // if is not first one { resetCandle(); iCandleCounter = 0; // reset counter } //finish else { iBuddhaLevel++; } } } //finish else if (iBuddhaLevel == 7) { Go.color = new Color(Go.color.r, Go.color.g, Go.color.b, 0.0f); Finish.color = new Color(Finish.color.r, Finish.color.g, Finish.color.b, 1.0f); iBuddhaLevel += 1; Stair.SetActive(true); } // //spread fog candle if (FogGateCandleScript != null) { if (FogGateCandleScript._bSkillOneTrigger) { Destroy(FogGate); } } //BearGate if (BearGateCandleScript._bSkillOneTrigger && !BearGateAnimate) { BearGateAnimate = true; StartCoroutine(BearGateDown()); } //spread water if (WaterGateCandleScript != null) { if (WaterGateCandleScript._bSkillOneTrigger) { Destroy(WaterGate); StartCoroutine(TrapGrowing()); } } //water fall detect if (WaterParticles != null) { GameObject particle; for (int i = 0; i < 174; i++) { particle = WaterParticles.transform.GetChild(i).gameObject; if (particle == null) { break; } if (particle.transform.position.y < -6) { Destroy(particle); } } } }
// Update is called once per frame void Update() { VitaSoulScript.FollowObj(); }
// Update is called once per frame void Update() { VitaSoulScript.FollowObj(); if (AnimatorCount == 0 && GandpaScript.bTouchPlayer && Input.GetKeyDown(KeyCode.A)) { dialogue.name = "莉妲"; dialogue.sentences = new string[1]; dialogue.sentences[0] = "爺爺,不好了!"; CGMoveScript.SetRecTransformX(145.7859f); FindObjectOfType <DialogueManager>().StartDialogue(dialogue, PlayerCV); AnimatorCount++; } else if (AnimatorCount == 1 && DialogueManager.bFinishDialogue) { dialogue.name = "爺爺"; dialogue.sentences = new string[1]; dialogue.sentences[0] = "是莉妲啊?怎麼了嗎?"; CGMoveScript.SetRecTransformX(145.7859f); FindObjectOfType <DialogueManager>().StartDialogue(dialogue, GrandpaCV); AnimatorCount++; } else if (AnimatorCount == 2 && DialogueManager.bFinishDialogue) { dialogue.name = "莉妲"; dialogue.sentences = new string[1]; dialogue.sentences[0] = "是這樣的…"; FindObjectOfType <DialogueManager>().StartDialogue(dialogue, PlayerCV); AnimatorCount++; } else if (AnimatorCount == 3 && DialogueManager.bFinishDialogue) { dialogue.name = "薇妲"; dialogue.sentences = new string[1]; dialogue.sentences[0] = "爺爺~快看看我,我現在竟然可以飛欸!"; CGMoveScript.SetRecTransformX(62.98596f); FindObjectOfType <DialogueManager>().StartDialogue(dialogue, VitaCV); AnimatorCount++; } else if (AnimatorCount == 4 && DialogueManager.bFinishDialogue) { dialogue.name = "爺爺"; dialogue.sentences = new string[1]; dialogue.sentences[0] = "這是薇妲?怎麼變成這樣?"; CGMoveScript.SetRecTransformX(145.7859f); FindObjectOfType <DialogueManager>().StartDialogue(dialogue, GrandpaCV); AnimatorCount++; } else if (AnimatorCount == 5 && DialogueManager.bFinishDialogue) { dialogue.name = "莉妲"; dialogue.sentences = new string[1]; dialogue.sentences[0] = "薇妲碰到書房裡的這個東西,就變成這樣了,爺爺怎麼辦?"; FindObjectOfType <DialogueManager>().StartDialogue(dialogue, PlayerCV); AnimatorCount++; } else if (AnimatorCount == 6 && DialogueManager.bFinishDialogue) { dialogue.name = "爺爺"; dialogue.sentences = new string[1]; dialogue.sentences[0] = "如果我沒猜錯,法鈴開啟了傳送門將薇妲的身體傳到別的地方了,只要找到身體的所在,薇妲就可以回到身體裡"; FindObjectOfType <DialogueManager>().StartDialogue(dialogue, GrandpaCV); AnimatorCount++; } else if (AnimatorCount == 7 && DialogueManager.bFinishDialogue) { dialogue.name = "莉妲"; dialogue.sentences = new string[1]; dialogue.sentences[0] = "真的嗎?那我們該怎麼做?"; FindObjectOfType <DialogueManager>().StartDialogue(dialogue, PlayerCV); AnimatorCount++; } else if (AnimatorCount == 8 && DialogueManager.bFinishDialogue) { dialogue.name = "爺爺"; dialogue.sentences = new string[1]; dialogue.sentences[0] = "你們前往斯克爾都吧!這個法鈴是我從斯克爾族長手中拿到的,他或許會知道更詳細的原因"; FindObjectOfType <DialogueManager>().StartDialogue(dialogue, GrandpaCV); AnimatorCount++; } else if (AnimatorCount == 9 && DialogueManager.bFinishDialogue) { dialogue.name = "莉妲"; dialogue.sentences = new string[1]; dialogue.sentences[0] = "斯克爾都……是那個傳說中受神龍眷顧的城市嗎?"; FindObjectOfType <DialogueManager>().StartDialogue(dialogue, PlayerCV); AnimatorCount++; } else if (AnimatorCount == 10 && DialogueManager.bFinishDialogue) { dialogue.name = "爺爺"; dialogue.sentences = new string[1]; dialogue.sentences[0] = "沒錯,我會給斯克爾族長寫一封信,事情緊急,你們快點出發吧!"; FindObjectOfType <DialogueManager>().StartDialogue(dialogue, GrandpaCV); AnimatorCount++; } }