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);
     }
 }
示例#3
0
 public void HideConfirm()
 {
     if (DeleteConfirm.activeSelf)
     {
         TransitionHelper.TransitionOut(DeleteConfirm, () => DeleteConfirm.SetActive(false));
     }
 }
示例#4
0
 // 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);
            }
        }
示例#6
0
 // 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);
        }
示例#8
0
    // Return to previous screen
    public override void ReturnToPreviousScreen()
    {
        if (sCurrentPanel == "MainMenu")
        {
            TransitionHelper.TransitionOut(goMenuInputPanel);
        }
        else if (sCurrentPanel == "Options")
        {
            SettingsManager.Instance.SaveSettings();
        }

        base.ReturnToPreviousScreen();
    }
示例#9
0
        /// <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));
        }
示例#10
0
 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);
 }
示例#11
0
        // 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);
            }
        }
示例#12
0
        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);
 }
示例#15
0
 public void TransitionOut()
 {
     TransitionHelper.TransitionOut(TransitionGameobject);
 }
 // Fade Screen Out
 private void FadeOut()
 {
     TransitionHelper.TransitionOut(goObjFadeUI, IncrementRenderers);
 }
示例#17
0
    // Dismisses the save notification after 1 second
    private IEnumerator DismissSaveNotification()
    {
        yield return(new WaitForSecondsRealtime(1));

        TransitionHelper.TransitionOut(gameObject, CloseSaveNotification);
    }