void Start() { phase = startingPhase; if (subtitleTextFile == null) { throw new Exception("Subtitle Text File hasn't been specified."); } subtitleCues = StxtReader.ReadFromString(subtitleTextFile.text); tutorialRunning = true; // Skip tutorial by command args string[] args = Environment.GetCommandLineArgs(); foreach (string arg in args) { if (arg == "-launcher") { ExitTutorial(); Debug.Log("Going straight to the launcher."); } } hideAllHints(); }
/// <summary> /// BLASAEOILAHEAEU Unity wont let me use any public function for animation events ~~~!! /// /// </summary> public void SetSheepOn() { #if GazeTut //Disabling Sheep for now SetMeshRenderersInChildren (tutorialSheep, true); #endif auSource.Stop (); tutorialPhase = TutorialPhase.DoneSwing; }
void OkOnClick() { tutorialPhase = TutorialPhase.Ressortwahl; ZeigeTutorialText("Phase1", Ok, false); if (GameObject.Find("Ressortwahl").transform.Find("Finanzen").GetComponent <Image>().enabled == true && GameObject.Find("Curtain").GetComponent <Image>().enabled == false) { ZeigeTutorialText("Phase2", Ok2, true); } }
void Start() { tutorialPhase = TutorialPhase.Completed; Nein.onClick.AddListener(NeinOnClick); Ja.onClick.AddListener(JaOnClick); Ok.onClick.AddListener(OkOnClick); Ok2.onClick.AddListener(Ok2OnClick); Ok3.onClick.AddListener(Ok3OnClick); Ok4.onClick.AddListener(Ok4OnClick); Ok5.onClick.AddListener(Ok5OnClick); }
private void ShowTutorial(TutorialPhase phase) { tutorialPhase = phase; if (tutorialPhase == TutorialPhase.OPEN_TOMB) { float x = Random.Range(GARDEN_LEFT * 0.5f, GARDEN_RIGHT * 0.5f); float y = Random.Range(GARDEN_BOTTOM * 0.5f, GARDEN_TOP * 0.5f); GameObject tomb = Instantiate(PFB_TOMB, backgrounds[0].transform); tomb.transform.position = new Vector3(x, y, y); tomb.GetComponent <SCR_Tomb>().state = TombState.STAY; x = x * 100 + HAND_TOMB_OFFSET_X; y = y * 100 + HAND_TOMB_OFFSET_Y; hand.GetComponent <RectTransform>().anchoredPosition = new Vector2(x, y); hand.SetActive(true); numberUnits[0]++; } if (tutorialPhase == TutorialPhase.OPEN_ZOMBIE_SHOP) { RectTransform buttonRT = btnZombieShop.GetComponent <RectTransform>(); RectTransform handRT = hand.GetComponent <RectTransform>(); handRT.anchoredPosition = GetHandPositionFromRT(buttonRT); } if (tutorialPhase == TutorialPhase.BUY_ZOMBIE) { RectTransform buttonRT = btnBuyZombie1.GetComponent <RectTransform>(); RectTransform handRT = hand.GetComponent <RectTransform>(); handRT.anchoredPosition = GetHandPositionFromRT(buttonRT); } if (tutorialPhase == TutorialPhase.CLOSE_ZOMBIE_SHOP) { RectTransform buttonRT = btnCloseZombieShop.GetComponent <RectTransform>(); RectTransform handRT = hand.GetComponent <RectTransform>(); handRT.anchoredPosition = GetHandPositionFromRT(buttonRT); } if (tutorialPhase == TutorialPhase.EVOLVE_ZOMBIE) { hand.GetComponent <Animator>().SetTrigger("drag"); iTween.ValueTo(gameObject, iTween.Hash("from", 0, "to", 1, "time", 1, "onupdate", "UpdateHandPosition", "looptype", "loop")); } }
public void TutorialFinished(TutorialPhase phase) { _isTutorialGroupRunning = false; _gameManager.canPressBackButton = true; var phaseS = phase.ToString(); if (!_tutoSaveDef.tutorialPhasesCompleted.Contains(phaseS)) { _tutoSaveDef.tutorialPhasesCompleted.Add(phaseS); SaveProgress(); } }
//startet das Tutorial, zeigt die benötigten UI-Elemente an public void StarteTutorial() { tutorialPhase = TutorialPhase.Completed; GameObject.Find("TutorialHintergrund").GetComponent <Image>().enabled = true; Ja.GetComponent <Image>().enabled = true; Ja.enabled = true; Ja.transform.Find("Text").GetComponent <Text>().enabled = true; Nein.GetComponent <Image>().enabled = true; Nein.enabled = true; Nein.transform.Find("Text").GetComponent <Text>().enabled = true; GameObject.Find("TutorialStart").transform.Find("Ueberschrift").GetComponent <Text>().enabled = true; GameObject.Find("TutorialStart").transform.Find("Inhalt").GetComponent <Text>().enabled = true; }
public void SetTutorialGroup(TutorialManager t, GameManager gm) { pointingFingers = new List <Image>(); _tutoManager = t; _realTriggers = new TutorialGroupTriggers(t, gm); ParseFunctionInput(ref _realTriggers, triggers); _realActions = new TutorialGroupActions(t, this); ParseFunctionInput(ref _realActions, actions); _realOutputs = new TutorialGroupOutputs(t, this); ParseOutputs(ref _realOutputs, outputs); _phase = GameUtils.ToEnum(tutorialPhase, TutorialPhase.FirstTimeOnApp); }
void Update() { Vector3 dest = gameObject.transform.parent.gameObject.transform.position; transform.position = Camera.main.WorldToViewportPoint(dest); if (phase == TutorialPhase.TutPhaseMove) { if (Vector3.Distance(initialPosition, transform.position) > 2.1445) { guiTexture.texture = aimTutorial; phase++; } } else if (phase == TutorialPhase.TutPhaseAim) { if (Input.GetMouseButtonDown(0)) { guiTexture.texture = null; phase = TutorialPhase.TutPhaseComplete; } } }
//Puzzle Load public static void LoadLesson(int index, PuzzleBox box, MasterGrid grid) { active = true; introIndex = 0; successIndex = 0; failureIndex = 0; controlLessonIndex = -5; phase = TutorialPhase.Intro; switch (index) { case (0): Lesson1(box, grid); break; case (1): Lesson2(box, grid); break; case (2): Lesson3(box, grid); break; case (3): Lesson4(box, grid); break; case (4): LessonBonus(box, grid); break; case (5): Lesson5(box, grid); break; case (6): Lesson6(box, grid); break; case (7): Lesson7(box, grid); break; case (8): Lesson8(box, grid); break; case (9): Lesson9(box, grid); break; case (10): Lesson10(box, grid); break; default: return; } if (loaded == true) { Mark(box, grid); } else { loaded = true; } }
private IEnumerator StartTutorialPhases() { #region Movement while (phase == TutorialPhase.Movement) { if (KeyHandler.IsMoving()) { phase = TutorialPhase.Jump; } yield return(null); } moveInstruction.Undisplay(this, imgColor, textColor); #endregion yield return(new WaitForSeconds(1f)); moveInstruction.instructionParent.SetActive(false); #region Jumping while (phase == TutorialPhase.Jump) { if (Input.GetKeyDown(KeyHandler.JumpKey)) { phase = TutorialPhase.Strafing; } yield return(null); } jumpInstruction.Undisplay(this, imgColor, textColor); #endregion yield return(new WaitForSeconds(1f)); jumpInstruction.instructionParent.SetActive(false); #region Strafing while (phase == TutorialPhase.Strafing) { if (KeyHandler.IsStrafing()) { phase = TutorialPhase.Interaction; } yield return(null); } strafeInstruction.Undisplay(this, imgColor, textColor); #endregion yield return(new WaitForSeconds(1f)); strafeInstruction.instructionParent.SetActive(false); swordToActivate.SetActive(true); #region Interaction while (phase == TutorialPhase.Interaction) { if (referencer.weaponSystem.currentWeapon == weaponToActivate && !InventorySystem.singleton.isOnInventory) { phase = TutorialPhase.Combat; } yield return(null); } interactionInstruction.Undisplay(this, imgColor, textColor); #endregion yield return(new WaitForSeconds(1f)); interactionInstruction.instructionParent.SetActive(false); #region Combat while (phase == TutorialPhase.Combat) { if (golemToActivate.isDead) { phase = TutorialPhase.Finished; } yield return(null); } combatInstruction.Undisplay(this, imgColor, textColor); #endregion yield return(new WaitForSeconds(1f)); combatInstruction.instructionParent.SetActive(false); }
void UpdateTutorial4() { switch (currentPhase) { case TutorialPhase.Ranged: if (currentInstruction < rangedInstructions.Length) { rangedInstructions[currentInstruction].SetActive(true); } if (Input.GetButtonDown("Confirm")) { if (currentInstruction < rangedInstructions.Length) { rangedInstructions[currentInstruction].SetActive(false); } currentInstruction++; if (currentInstruction == rangedInstructions.Length) { for (int i = 0; i < rangedInstructions.Length; i++) { rangedInstructions[i].SetActive(false); } } else if (currentInstruction > rangedInstructions.Length) { currentInstruction = 0; currentPhase = TutorialPhase.Targeting; } } break; case TutorialPhase.Targeting: if (currentInstruction < targetingInstructions.Length) { targetingInstructions[currentInstruction].SetActive(true); } if (Input.GetButtonDown("Confirm")) { if (currentInstruction < targetingInstructions.Length) { targetingInstructions[currentInstruction].SetActive(false); } currentInstruction++; if (currentInstruction == targetingInstructions.Length) { for (int i = 0; i < rangedInstructions.Length; i++) { targetingInstructions[i].SetActive(false); } } else if (currentInstruction > targetingInstructions.Length && enemyHealth == null) { enemyHealth = Spawn().GetComponentInChildren <EnemyHealth>(); } } if (enemyHealth != null && enemyHealth.IsDead) { gratzInstructions.SetActive(true); if (Input.GetButtonDown("Confirm")) { gratzInstructions.SetActive(false); currentInstruction = 0; SceneManager.LoadScene(4); } } break; } }
void UpdateTutorial3() { switch (currentPhase) { case TutorialPhase.Dash: if (currentInstruction == 0) { dashInstructions.SetActive(true); } if (Input.GetButtonDown("Confirm")) { if (currentInstruction == 0) { currentInstruction++; dashInstructions.SetActive(false); } else { for (int i = 0; i < generalUI.Length; i++) { generalUI[i].SetActive(true); } currentInstruction = 0; currentPhase = TutorialPhase.UI; } } break; case TutorialPhase.UI: Time.timeScale = 0; uiInstructions[currentInstruction].SetActive(true); if (Input.GetButtonDown("Confirm")) { uiInstructions[currentInstruction].SetActive(false); currentInstruction++; if (currentInstruction == uiInstructions.Length) { Time.timeScale = 1; currentInstruction = 0; currentPhase = TutorialPhase.Melee; } else { uiInstructions[currentInstruction].SetActive(true); } } break; case TutorialPhase.Melee: if (currentInstruction == 0) { meleeInstructions.SetActive(true); } if (Input.GetButtonDown("Confirm")) { if (currentInstruction == 0) { currentInstruction++; meleeInstructions.SetActive(false); } else { SceneManager.LoadScene(3); } } break; } }
void NeinOnClick() { tutorialPhase = TutorialPhase.Completed; TutorialStartOff(); }
void Ok4OnClick() { tutorialPhase = TutorialPhase.History; ZeigeTutorialText("Phase4", Ok4, false); }
// Update is called once per frame void FixedUpdate() { if (tutorialPhase == TutorialPhase.SetUpHypno && setUpPokeScript.triggered) { StartCoroutine (setupPocketWatch ()); tutorialPhase = TutorialPhase.Wait; } else if (tutorialPhase == TutorialPhase.Wait && pWatchPokeScript.triggered) { tutorialPhase = TutorialPhase.PocketWatchSwing; } else if (tutorialPhase == TutorialPhase.PocketWatchSwing) { // Debug.LogError("AT PocketWatchSwing !!!"); //Disable PocketWatch SetMeshRenderersInChildren (pocketWatch, false); //auSource.pitch = 1f; myAnim.SetTrigger ("OpenPocketWatch"); textObj.SetActive (false); tutorialPhase = TutorialPhase.SheepAppear; } else if (tutorialPhase == TutorialPhase.DoneSwing) { DonePocketWatchSwing (); //REMOVE THIS LATER //Enviroment Spawner should be setActive true in Finish Gaze function SetMainGameObjects (true); tutorialPhase = TutorialPhase.Finish; } else if (tutorialPhase == TutorialPhase.SheepGaze) { WaitForGaze (); } #if UNITY_EDITOR if (Input.GetKeyDown (KeyCode.Q)) { Vec3Int chunkCoords = vxe.getChunkCoords (watchTrans.position); // biome.swapMaterialsThread (ref voxelMats, chunkCoords.x, chunkCoords.z); } if (Input.GetKeyDown (KeyCode.E)) { biome.swapMaterials (ref voxelMats); } #endif }
// Use this for initialization void Start() { vxe = VoxelExtractionPointCloud.Instance; myAnim = GetComponent<Animator> (); auSource = GetComponent<AudioSource> (); screenFadeScript = playerTrans.GetComponent<ScreenFade> (); playerGazeScript = playerTrans.GetComponent<TutorialGaze> (); pocketWatch = pWatchPokeScript.gameObject; pWatchPokeScript.enabled = false; SetMeshRenderersInChildren (pocketWatch, false); auSource.pitch = 0.75f; TheSheepDog.transform.position = watchTrans.position; tutorialPhase = TutorialPhase.SetUpHypno; SetMeshRenderersInChildren (tutorialSheep, false); //Disable for now, will use GazeTutorial Later //SetMeshRenderersInChildren (gazeTutorialGameObjects, false); SetMainGameObjects (false); }
/// <summary> /// Done the pocket watch swing. /// </summary> void DonePocketWatchSwing() { Destroy (pocketWatch); #if GazeTut //After Pocket Watch Swing is done, allow the TutorialSheep and TutorialGaze //script to start doing stuff sheepScript.waitForAnimationEnd = false; playerGazeScript.waitForAnimationEnd = false; //Set the Sheep's Gaze Target sheepScript.ChangeTarget (gazeTargets [gazeCount]); //Now Start the Sheep Gaze tutorialPhase = TutorialPhase.SheepGaze; #endif //StartCoroutine (screenFadeScript.doColorFade (Color.black)); MainLight.SetActive (true); MainLight.transform.rotation = Quaternion.Euler (386f, 71f, 126f); //biome.resetBiomes (); Vec3Int chunkCoords = vxe.getChunkCoords (watchTrans.position); // Debug.LogError ("Chunk Coords " + chunkCoords.x + " " + chunkCoords.y + " " + chunkCoords.z); biome.swapMaterialsThread (ref voxelMats, chunkCoords.x, chunkCoords.z); }
//OnClick-Events für die Buttons im Tutorial //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ void JaOnClick() { tutorialPhase = TutorialPhase.Attributswerte; TutorialStartOff(); ZeigeTutorialText("Phase1", Ok, true); }
// Use this for initialization void Start() { vxe = VoxelExtractionPointCloud.Instance; myAnim = GetComponent<Animator> (); auSource = GetComponent<AudioSource> (); screenFadeScript = playerTrans.GetComponent<ScreenFade> (); playerGazeScript = playerTrans.GetComponent<TutorialGaze> (); pocketWatch = pWatchPokeScript.gameObject; pWatchPokeScript.enabled = false; SetMeshRenderersInChildren (pocketWatch, false); auSource.pitch = 0.75f; biome.setAllMaterials (biome.fadedMaterials [0]); tutorialPhase = TutorialPhase.SetUpHypno; #if GazeTut SetMeshRenderersInChildren (tutorialSheep, false); #endif //Disable for now, will use GazeTutorial Later //SetMeshRenderersInChildren (gazeTutorialGameObjects, false); SetMainGameObjects (false); audioCueManager.playAudioClip (audioCueManager.lookForPocketWatch); }
/// <summary> /// Done the pocket watch swing. /// </summary> void DonePocketWatchSwing() { #if GazeTut //After Pocket Watch Swing is done, allow the TutorialSheep and TutorialGaze //script to start doing stuff sheepScript.waitForAnimationEnd = false; playerGazeScript.waitForAnimationEnd = false; //Set the Sheep's Gaze Target sheepScript.ChangeTarget (gazeTargets [gazeCount]); //Now Start the Sheep Gaze tutorialPhase = TutorialPhase.SheepGaze; #endif //StartCoroutine (DropFirstSheepBush ()); SetMainGameObjects (true); //StartCoroutine (ItemSpawner.Instance.DropFirstSheepBush (pocketWatch, firstBush)); //Spawns or displays the Sheep dog popping out of the watch TheSheepDog.transform.position = watchTrans.position; //Spawn1stSheep.transform.position = //Rotates the MainLight to day light MainLight.transform.rotation = Quaternion.Euler (386f, 71f, 126f); //biome.resetBiomes (); Vec3Int chunkCoords = vxe.getChunkCoords (watchTrans.position); // Debug.LogError ("Chunk Coords " + chunkCoords.x + " " + chunkCoords.y + " " + chunkCoords.z); biome.swapMaterialsThread (ref voxelMats, chunkCoords.x, chunkCoords.z, 0); playGoFindSheep (); }
void Ok3OnClick() { tutorialPhase = TutorialPhase.Events; ZeigeTutorialText("Phase3", Ok3, false); }
public void SetTutorialMessage(TutorialPhase newMessage) { currentPhase = newMessage; //escape characters (for example \n) are serialized as actual characters (\\n) and that's why we need an excluded character. TMP.text = newMessage.Text.Replace('$', '\n'); }
void Ok2OnClick() { tutorialPhase = TutorialPhase.Massnahmenwahl; ZeigeTutorialText("Phase2", Ok2, false); }
//Puzzle Load public static void LoadLesson(int index, PuzzleBox box, MasterGrid grid) { active = true; introIndex = 0; successIndex = 0; failureIndex = 0; controlLessonIndex = -5; phase = TutorialPhase.Intro; switch (index) { case(0): Lesson1(box, grid); break; case(1): Lesson2(box, grid); break; case (2): Lesson3(box, grid); break; case (3): Lesson4(box, grid); break; case (4): LessonBonus(box, grid); break; case (5): Lesson5(box, grid); break; case (6): Lesson6(box, grid); break; case (7): Lesson7(box, grid); break; case (8): Lesson8(box, grid); break; case (9): Lesson9(box, grid); break; case (10): Lesson10(box, grid); break; default: return; } if (loaded == true) { Mark(box, grid); } else loaded = true; }
/// <summary> /// /// </summary> /// <param name="phase"></param> public void SetTutorialPhase(TutorialPhase phase) { tutorialPhase = phase; }
/// <summary> /// Finishs the gaze. /// </summary> void FinishGaze() { TheSheepDog.SetActive (true); ItemSpawner.SetActive (true); EnvironmentSpawner.SetActive (true); sheepScript.DeActivate (); tutorialPhase = TutorialPhase.Finish; }
void Ok5OnClick() { tutorialPhase = TutorialPhase.Completed; ZeigeTutorialText("Phase5", Ok5, false); }