protected override IEnumerator SceneEvents() { Unit her = GetReferenceToHer(); if (her) { her.SetUnitState(new SitState(her, true)); } yield return(new WaitForSeconds(2)); ScreenFader fader = GameObject.FindObjectOfType <ScreenFader>(); CameraControl.Instance.UpdateCameraTargetPosition(); fader.BeginFade(-1); yield return(new WaitForSeconds(2)); if (her) { her.SetUnitState(new IdleState(her, true)); } yield return(new WaitForSeconds(.75f)); if (her) { her.mover.AddMoveTarget(null, sceneLocations[0].transform.position); her.SetUnitState(new MoveState(her, true)); } CameraControl.Instance.UpdateCameraTargetPosition(); CameraControl.Instance.UpdateCameraTargetPosition(99f, 1); //StageManager.Instance.ToggleWaveActivity(true); //StageManager.Instance.VictoryConditionsAreMet(); StartCoroutine(WaitForHatcheryDeactivation()); }
protected override IEnumerator SceneEvents() { ScreenFader fader = GameObject.FindObjectOfType <ScreenFader>(); fader.BeginFade(-1); yield return(new WaitForSeconds(5)); // StageManager.Instance.ToggleWaveActivity(true); }
public void Update(GameTime gameTime, MainCharacter mainCharacter, ContentManager content) { if (FadeOut && !ScreenFader.IsFading()) { FadeOut = false; FadeOutFinished = true; } if (FadeOutFinished && StateChange) { while (PushCount > 0) { GameStack.Push(PushStack.Pop()); PushCount--; StackSize++; } while (PushCount < 0) { GameStack.Pop(); PushCount++; StackSize--; } GameStack.Peek().Reset(this, mainCharacter, content); StateChange = false; if (FadeIn) { ScreenFader.BeginFade(Color.Transparent, 500); } } if (StackSize == 0) { Console.WriteLine("Gamestack is empty. Exiting..."); Game1.QuitGame(); } GameStack.Peek().Update(this, gameTime); // Update the screenfader ScreenFader.Update(gameTime); }
protected override IEnumerator SceneEvents() { yield return(new WaitForSeconds(0.1f)); KillWorkerUnits(); player.cursorManagerScript.DisableCursor(); //ReviveHer(); yield return(new WaitForSeconds(1.7f)); ScreenFader fader = GameObject.FindObjectOfType <ScreenFader>(); fader.BeginFade(-1); TutorialManager.Instance.StartTutorial(); player.cursorManagerScript.EnableCursor(); }
// Funktion, die oben definiertes Panel schliesst und dabei wieder einfadet und eine Runde weiter geht public void close() { nextRound = GameObject.FindGameObjectWithTag("GameController").GetComponent <RoundSystem>(); nextRoundFadeIn = GameObject.FindGameObjectWithTag("GameController").GetComponent <ScreenFader>(); // Die Endphase vom Roundsystem wird auf false gesetzt. Die Kaufphase beginnt also wiede nextRound.EndPhase = false; // Die Rundenzahl wird um 1 erhoeht nextRound.currentRound++; // Das Panel wird inaktiv gesetzt thePanel.SetActive(false); // Das FadeIn wird initialisiert nextRoundFadeIn.BeginFade(-1); }
public void FadeOut(float speed) { screenFader.fadeSpeed = speed; screenFader.BeginFade(1); }