private void Update() { if (fader == null) { fader = GameObject.FindGameObjectWithTag("World UI").transform.Find("Fader").GetComponent <Fader>(); } float currentLoopTime = loopDuration - musicController.main.time % loopDuration; if (loopSlider == null) { loopSlider = GameObject.FindGameObjectWithTag("UI").transform.Find("LoopSlider").GetComponent <Slider>(); } if (loopSlider != null && loopSlider.IsActive()) { loopSlider.value = GetLoopPercentage(); } if (currentLoopTime > prevLoopTime) { if (playerLooper != null && playerLooper.IsLooping()) { fader.Fade(Color.black, Color.clear, 0.2f); } UpdateLoopers(); fadingOut = false; } else if (currentLoopTime <= 0.2f && !fadingOut) { fadingOut = true; if (playerLooper != null && playerLooper.IsLooping()) { fader.Fade(Color.clear, Color.black, 0.2f); } } prevLoopTime = currentLoopTime; }
private IEnumerator StartRoutine() { yield return(StartCoroutine(fader.Fade(false))); fader.gameObject.SetActive(false); Time.timeScale = 1; }
private void SceneLoaded(Scene scene, LoadSceneMode mode) { string previousScene = PlayerPrefsManager.GetPreviousScene(); if (fader.fade.In && !fader.sceneExcludes.fadeIn.Contains(previousScene)) { fader.Fade(FadeDirection.In); } }
IEnumerator Rutina_Comenzar() { fader.RayTarget(true); yield return(fader.Fade(1, fader.duracionFade)); UnityEngine.SceneManagement.SceneManager.LoadScene(UnityEngine.SceneManagement.SceneManager.GetActiveScene().buildIndex + 1); yield break; }
IEnumerator Rutina_Inicial() { fader.gameObject.SetActive(true); fader.RayTarget(false); yield return(fader.Fade(0, fader.duracionFade)); fader.gameObject.SetActive(false); yield break; }
public IEnumerator SelectMap() { isStart = true; retryFader.gameObject.SetActive(true); player.GetComponent <PlayerControl>().enabled = false; yield return(StartCoroutine(ElevatorMotion(finishElevator))); yield return(StartCoroutine(retryFader.Fade(true))); SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); isStart = false; }
void OnTriggerEnter2D(Collider2D col) { if (col.tag == "Enemy") { fader.Fade(); } }
private IEnumerator LoadGame() { fader.gameObject.SetActive(true); yield return(StartCoroutine(fader.Fade(true))); SceneManager.LoadScene(1); }
public void FaderOn(bool state, float duration) { if (Fader != null) { Fader.gameObject.SetActive(true); Fader.Fade(state, duration); } }
public IEnumerator SelectMap(int levelIndex) { currentMapIndex = levelIndex; fader.gameObject.SetActive(true); yield return(StartCoroutine(fader.Fade(true))); if (currentMap != null) { SaveData(); Destroy(currentMap); } currentMap = Instantiate(maps[levelIndex], transform.position, Quaternion.identity); StartGame(); }
private void Start() { player = GameObject.FindGameObjectWithTag("Player").GetComponent <BoxCollider2D>(); fader = GameObject.FindGameObjectWithTag("UI").transform.Find("Fader").GetComponent <Fader>(); sceneController = GameObject.FindGameObjectWithTag("GameController").GetComponent <SceneController>(); coll = GetComponent <BoxCollider2D>(); fader.Fade(Color.black, Color.clear, transitionDuration); }
// Use this for initialization void Start() { Fader.Fade(FadeDirection.In, () => { var alpha = GUI.color.a; IntegrationTest.Assert(GUI.depth == Fader.drawDepth, "GUI Depth should be set"); IntegrationTest.Assert(alpha == (int)FadeDirection.In, "Alpha of the GUI color should be equal to FadeDirection.In at the end of the fade"); StartCoroutine(TestFaderObjectRemoval()); }); }
void DoUnduck() { lock (m_playablePlayers) { foreach (var ctxt in m_playablePlayers.Values) { Fader.Fade(ctxt.Player, ctxt.Player.Volume, ctxt.AudioContent.Volume, TimeSpan.FromSeconds(0.3), null); } } }
public void FadeInAappearence() { foreach (MeshRenderer meshRenderer in _fader.MeshRenderers) { Color color = meshRenderer.material.color; meshRenderer.material.color = new Color(color.r, color.g, color.b, 0f); } StartCoroutine(_fader.Fade(1f)); }
IEnumerator Step() { agent.velocity = Vector3.zero; agent.acceleration = 0; agent.angularSpeed = 0; yield return(StartCoroutine(fader.Fade(true))); yield return(new WaitForSeconds(step)); yield return(StartCoroutine(fader.Fade(false))); Instantiate(deadPrefab, transform.position - Vector3.up, Quaternion.identity); agent.acceleration = accel; agent.speed = stepSpeed; agent.angularSpeed = 10000; yield return(new WaitForSeconds(0.1f)); StartCoroutine(Step()); }
void Start() { if (fadeOnAwake) { Fader.Fade(); } else { Fader.Unfade(); } }
IEnumerator Rutina_Final() { fader.RayTarget(true); fader.gameObject.SetActive(true); yield return(fader.Fade(1, fader.duracionFade)); SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex - 1); yield break; }
void Die() { lr.positionCount = 0; gamepad.SetVibration(0.75f, 0.75f, 0.75f); state = State.Dead; //gameObject.AddComponent<Floaties>(); Destroy(this, 1.0f); SoundEffectManager.Instance.PlaySoundEffect(SoundEffectManager.SoundEffectChoice.Deflate); //TODO: fade to black BlackFader.Fade(1.0f); Destroy(meshRef, 2.0f); scaleTimer = 0; }
private void QuantizeFade(Fader fader, TemporalAudioSource source, FadeType type) { var beatsToWait = quantizationAmount - (int)source.TotalBeats % quantizationAmount; if (_fadeOut) { source.ExecuteOn( () => fader.Fade(type), (int)source.TotalBeats + beatsToWait); } else { source.ExecuteOn( () => source.source.volume = type == FadeType.In ? 1 : 0, (int)source.TotalBeats + beatsToWait); } }
private void Update() { if (coll.Overlaps(player) && !isFading) { fader.Fade(Color.clear, Color.black, transitionDuration); isFading = true; player.GetComponent <PlayerLooper>().enabled = false; } if (isFading) { timeElapsed += Time.deltaTime; if (timeElapsed >= transitionDuration) { new SceneManager().LoadNextScene(); } } }
// .. COROUTINES IEnumerator UpdateShowHide(object[] args) { bool show = (bool)args[0]; float animation_time = (float)args[1]; if (show) { Fader.Fade(1, animation_time, FadeInEasingType); } else { Fader.Fade(0, animation_time, FadeOutEasingType); } yield return(new WaitForSeconds(animation_time)); gameObject.SetActive(show); }
IEnumerator PlayIntro() { yield return(StartCoroutine(Fader.Fade(fadeUIImage, Fader.FadeType.FadeOut, 2f))); yield return(new WaitForSeconds(underDogsSpriteDuration)); yield return(StartCoroutine(Fader.Fade(fadeUIImage, Fader.FadeType.FadeIn, 1f))); underDogsSprite.SetActive(false); gameTitleText.SetActive(true); yield return(StartCoroutine(Fader.Fade(fadeUIImage, Fader.FadeType.FadeOut, 1f))); yield return(new WaitForSeconds(gameTitleTextDuration)); yield return(StartCoroutine(Fader.Fade(fadeUIImage, Fader.FadeType.FadeIn, 2f))); SceneManager.LoadScene(MENU_SCENE); }
void DuckExcept(params PlayerContext[] ctxts) { lock (m_playablePlayers) { if (m_duckResumeTimer != null) { m_duckResumeTimer.Cancel(); m_duckResumeTimer = null; } foreach (var ctxt in m_playablePlayers.Values) { if (!ctxts.Contains(ctxt)) { Fader.Fade(ctxt.Player, ctxt.Player.Volume, ctxt.AudioContent.Volume * 0.2f, TimeSpan.FromSeconds(0.3), null); } } } Platform.Instance.DuckSystemSounds(); }
//[Server] public void TakeDamage() { if (!isServer || isInvulnerable) { return; } health--; if (health < 1) { RpcDie(); } else { RpcFlashRed(); isInvulnerable = true; fader.Fade(MAX_INVUL_TIME); CanvasManager.Instance.SetMessage("The intruder was hit! Life total at " + (int)(health / (float)maxHealth * 100f) + "%"); } }
// main function for updating trialcount and resetting positions void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("targetObject")) { if (isColliding) { return; } isColliding = true; //Fading and back //Debug.Log("fading"); fader.Fade(); // update trial count on drop to change scene after trial 3 (0,1,2) dataLogger.StopTrial(); dataLogger.UpdateDataFrame(); //dumps data to files dataLogger.trial++; // reset stuff targetObject.GetComponent <hapticFeedback_targetObject>().resetPosition(); UR5_Target.transform.DetachChildren(); dataLogger.ResetData(); } }
private void Start() { TogglePause(false); fader.Fade(false); settings.stage = 1; }
void FadeInOut() { fadingDone = false; fadingOut = true; fader.Fade(false, 0.5f); }
private void Start() { StartCoroutine(Fader.Fade(fadeUIImage, Fader.FadeType.FadeOut, 2f)); }
public void LoadScene(string sceneName) { sceneToLoad = sceneName; fader.Fade(true, fadeInTime); }
public static void Crossfade(Fader fadeIn, Fader fadeOut) { fadeIn.Fade(FadeType.In); fadeOut.Fade(FadeType.Out); }