IEnumerator TransitionParallel(GameObject fromGameObject, GameObject toGameObject) { float transitionOutTime = 0; if (fromGameObject != null) { if (TransitionHelper.ContainsTransition(fromGameObject)) { var transitions = TransitionHelper.TransitionOut(fromGameObject); transitionOutTime = TransitionHelper.GetTransitionOutTime(transitions); } } if (toGameObject != null) { toGameObject.SetActive(true); if (TransitionHelper.ContainsTransition(toGameObject)) { TransitionHelper.TransitionIn(toGameObject); } } // wait for transition out to complete before we disable. if (!Mathf.Approximately(0, transitionOutTime)) { yield return(new WaitForSeconds(transitionOutTime)); } if (fromGameObject != null) { fromGameObject.SetActive(false); } }
/// <summary> /// Perform the action /// </summary> /// <returns></returns> protected override void Execute(bool isStart) { if (Target != null) { TransitionHelper.TransitionOut(Target); } }
public void HideConfirm() { if (DeleteConfirm.activeSelf) { TransitionHelper.TransitionOut(DeleteConfirm, () => DeleteConfirm.SetActive(false)); } }
// Reloads the scene to retry the mission public void RetryMission() { // Pause Game GameManager.SetPause(true); // Make time flow normally Time.timeScale = 1; // Screen Transition TransitionHelper.TransitionOut(goScreenFadeUI, EndRetryTransition); }
/// <summary> /// The actual method that does the work /// </summary> void PerformAction() { var gameObject = Fsm.GetOwnerDefaultTarget(Target); if (gameObject != null) { TransitionHelper.TransitionOut(gameObject); } }
// Update void Update() { if (async != null && !bTransitioning) { if (async.progress == 0.9f) { TransitionHelper.TransitionOut(goScreenFadeUI, EnterScene); bTransitioning = true; } } }
/// <summary> /// Transition out using transitions on the specified gameobjects /// </summary> /// <param name="transitionGameObjects"></param> public float TransitionOut(UnityEngine.GameObject[] transitionGameObjects) { var transitionBases = new List <TransitionBase>(); foreach (var transitionGameObject in transitionGameObjects) { transitionBases.AddRange(TransitionHelper.TransitionOut(transitionGameObject)); } var delay = TransitionHelper.GetTransitionOutTime(transitionBases); return(delay); }
// Return to previous screen public override void ReturnToPreviousScreen() { if (sCurrentPanel == "MainMenu") { TransitionHelper.TransitionOut(goMenuInputPanel); } else if (sCurrentPanel == "Options") { SettingsManager.Instance.SaveSettings(); } base.ReturnToPreviousScreen(); }
/// <summary> /// Complete the dialog /// </summary> public void Done() { // show / transition in and when done call coroutine float transitionTime = 0; #if BEAUTIFUL_TRANSITIONS //if (TransitionHelper.ContainsTransition(gameObject)) //{ transitionTime = TransitionHelper.GetTransitionOutTime(TransitionHelper.TransitionOut(gameObject)); //} #endif StartCoroutine(CoRoutines.DelayedCallback(transitionTime, DoneFinished)); }
IEnumerator TransitionOutIn(GameObject oldGameObject, GameObject newGameObject) { if (oldGameObject != null) { if (TransitionHelper.ContainsTransition(oldGameObject)) { var transitions = TransitionHelper.TransitionOut(oldGameObject); yield return(new WaitForSeconds(TransitionHelper.GetTransitionOutTime(transitions))); } oldGameObject.SetActive(false); } newGameObject.SetActive(true); }
// Use this for initialization void Start() { var activeChanged = Shown.Skip(1); activeChanged.Where(active => active).Subscribe(active => { TransitionHelper.TransitionIn(gameObject); }).AddTo(this); activeChanged.Where(active => !active).TakeUntilDestroy(this).Subscribe(active => { TransitionHelper.TransitionOut(gameObject); }).AddTo(this); if (Shown.Value) { TransitionHelper.TransitionIn(gameObject); } }
public override void Start() { NextScene.Where(scene => !string.IsNullOrEmpty(scene)).Subscribe(s => GetComponent <FadeScreen>().OutConfig.SceneToLoad = s).AddTo(this); base.Start(); ActiveMenu.Subscribe(active => { if (active == 0) { TransitionHelper.TransitionIn(Wheels); } else { TransitionHelper.TransitionOut(Wheels); } Menus.ForEach(m => m.Shown.Value = false); Menus[active].Shown.Value = true; }).AddTo(this); }
IEnumerator TransitionOutIn(GameObject fromGameObject, GameObject toGameObject) { if (fromGameObject != null) { // is an out transition then run and wait for completion if (TransitionHelper.ContainsTransition(fromGameObject)) { var transitions = TransitionHelper.TransitionOut(fromGameObject); var transitionOutTime = TransitionHelper.GetTransitionOutTime(transitions); yield return(new WaitForSeconds(transitionOutTime)); } fromGameObject.SetActive(false); } if (toGameObject != null) { toGameObject.SetActive(true); if (TransitionHelper.ContainsTransition(toGameObject)) { TransitionHelper.TransitionIn(toGameObject); } } }
public void TransitionOut() { TransitionHelper.TransitionOut(TransitionFromButtons); }
public void TransitionOut() { TransitionHelper.TransitionOut(TransitionGameobject); }
// Fade Screen Out private void FadeOut() { TransitionHelper.TransitionOut(goObjFadeUI, IncrementRenderers); }
// Dismisses the save notification after 1 second private IEnumerator DismissSaveNotification() { yield return(new WaitForSecondsRealtime(1)); TransitionHelper.TransitionOut(gameObject, CloseSaveNotification); }