コード例 #1
0
 public void Apply(TransitionBase transition, TransitionInputParameters parameters, bool forward, float value, bool reset)
 {
     if (reset == true)
     {
         transition.SetResetState(parameters, this.window, null);
     }
     transition.Set(this.window, parameters, null, forward: forward, value: value);
 }
コード例 #2
0
        /// <summary>
        /// Show the specified onShowEnd.
        /// </summary>
        /// <param name="onShowEnd">On show end.</param>
        public void Show(System.Action onShowEnd, TransitionBase transition, TransitionInputParameters transitionParameters)
        {
            if (this.currentState == WindowObjectState.Showing || this.currentState == WindowObjectState.Shown)
            {
                return;
            }
            this.currentState = WindowObjectState.Showing;

            WindowSystem.AddToHistory(this);

            var counter = 0;

            System.Action callback = () => {
                if (this.currentState != WindowObjectState.Showing)
                {
                    return;
                }

                ++counter;
                if (counter < 5)
                {
                    return;
                }

                this.OnShowEnd();
                this.OnLayoutShowEnd();
                this.modules.OnShowEnd();
                this.events.OnShowEnd();
                this.transition.OnShowEnd();
                if (onShowEnd != null)
                {
                    onShowEnd();
                }

                CanvasUpdater.ForceUpdate();

                this.currentState = WindowObjectState.Shown;
            };

            this.OnLayoutShowBegin(callback);
            this.modules.OnShowBegin(callback);

            if (transition != null)
            {
                this.transition.OnShowBegin(transition, transitionParameters, callback);
            }
            else
            {
                this.transition.OnShowBegin(callback);
            }

            this.events.OnShowBegin(callback);
            this.OnShowBegin(callback);

            this.gameObject.SetActive(true);
        }
コード例 #3
0
        /// <summary>
        /// Hide the specified onHideEnd with specific transition.
        /// Wait while all components, animations, events and modules return the callback.
        /// </summary>
        /// <param name="onHideEnd">On hide end.</param>
        /// <param name="transition">Transition.</param>
        /// <param name="transitionParameters">Transition parameters.</param>
        public bool Hide(System.Action onHideEnd, TransitionBase transition, TransitionInputParameters transitionParameters)
        {
            if (this.currentState == WindowObjectState.Hidden || this.currentState == WindowObjectState.Hiding)
            {
                return(false);
            }
            this.currentState = WindowObjectState.Hiding;

            var counter = 0;

            System.Action callback = () => {
                if (this.currentState != WindowObjectState.Hiding)
                {
                    return;
                }

                ++counter;
                if (counter < 5)
                {
                    return;
                }

                WindowSystem.AddToHistory(this);

                this.Recycle();

                this.OnHideEnd();
                this.OnLayoutHideEnd();
                this.modules.OnHideEnd();
                this.events.OnHideEnd();
                this.transition.OnHideEnd();
                if (onHideEnd != null)
                {
                    onHideEnd();
                }

                this.currentState = WindowObjectState.Hidden;
            };

            this.OnLayoutHideBegin(callback);
            this.modules.OnHideBegin(callback);

            if (transition != null)
            {
                this.transition.OnHideBegin(transition, transitionParameters, callback);
            }
            else
            {
                this.transition.OnHideBegin(callback);
            }

            this.events.OnHideBegin(callback);
            this.OnHideBegin(callback, immediately: false);

            return(true);
        }
コード例 #4
0
 public void DoHideBegin(TransitionBase transition, TransitionInputParameters transitionParameters, AppearanceParameters parameters)
 {
     if (transition != null)
     {
         transition.Play(this.window, transitionParameters, null, forward: false, callback: parameters.callback);
     }
     else
     {
         parameters.Call();
     }
 }
コード例 #5
0
        /// <summary>
        /// Shows window of T type.
        /// Returns null if window not registered.
        /// </summary>
        /// <param name="transition">Transition.</param>
        /// <param name="transitionParameters">Transition parameters.</param>
        /// <param name="source">Source.</param>
        /// <param name="parameters">OnParametersPass() values.</param>
        /// <typeparam name="T">The 1st type parameter.</typeparam>
        public static T Show <T>(TransitionBase transition, TransitionInputParameters transitionParameters, T source, params object[] parameters) where T : WindowBase
        {
            var instance = WindowSystem.instance.Create_INTERNAL(source, parameters) as T;

            if (instance != null)
            {
                instance.Show(transition, transitionParameters);
            }

            return(instance);
        }
コード例 #6
0
 public void OnHideBegin(TransitionBase transition, TransitionInputParameters transitionParameters, System.Action callback)
 {
     if (transition != null)
     {
         transition.Play(this.window, transitionParameters, null, forward: false, callback: callback);
     }
     else
     {
         if (callback != null)
         {
             callback();
         }
     }
 }
コード例 #7
0
        /// <summary>
        /// Shows window of T type.
        /// Returns null if window not registered.
        /// </summary>
        /// <param name="onCreatePredicate">On create predicate.</param>
        /// <param name="transition">Transition.</param>
        /// <param name="transitionParameters">Transition parameters.</param>
        /// <param name="parameters">OnParametersPass() values.</param>
        /// <typeparam name="T">The 1st type parameter.</typeparam>
        public static T Show <T>(System.Action <T> onCreatePredicate, TransitionBase transition, TransitionInputParameters transitionParameters, params object[] parameters) where T : WindowBase
        {
            var instance = WindowSystem.Create <T>(parameters);

            if (instance != null)
            {
                if (onCreatePredicate != null)
                {
                    onCreatePredicate(instance);
                }
                instance.Show(transition, transitionParameters);
            }

            return(instance);
        }
コード例 #8
0
        public void DoShowBegin(TransitionBase transition, TransitionInputParameters transitionParameters, AppearanceParameters parameters)
        {
            if (transition != null)
            {
                transition.SetResetState(transitionParameters, this.window, null);
                transition.Play(this.window, transitionParameters, null, forward: true, callback: parameters.callback);
            }
            else
            {
                // Reset to defaults
                var layoutWindow = (this.window as LayoutWindowType);
                if (layoutWindow != null)
                {
                    layoutWindow.layout.GetLayoutInstance().root.Reset();
                }

                parameters.Call();
            }
        }
コード例 #9
0
        public void OnShowBegin(TransitionBase transition, TransitionInputParameters transitionParameters, System.Action callback)
        {
            if (transition != null)
            {
                transition.SetResetState(transitionParameters, this.window, null);
                transition.Play(this.window, transitionParameters, null, forward: true, callback: callback);
            }
            else
            {
                // Reset to defaults
                var layoutWindow = (this.window as LayoutWindowType);
                if (layoutWindow != null)
                {
                    layoutWindow.layout.GetLayoutInstance().root.Reset();
                }

                if (callback != null)
                {
                    callback();
                }
            }
        }
コード例 #10
0
        /// <summary>
        /// Shows window of T type.
        /// Returns null if window not registered.
        /// </summary>
        /// <param name="onCreatePredicate">On create predicate.</param>
        /// <param name="transition">Transition.</param>
        /// <param name="transitionParameters">Transition parameters.</param>
        /// <param name="source">Source.</param>
        /// <param name="parameters">OnParametersPass() values.</param>
        /// <typeparam name="T">The 1st type parameter.</typeparam>
        public static T Show <T>(System.Action <T> onCreatePredicate, TransitionBase transition, TransitionInputParameters transitionParameters, T source, params object[] parameters) where T : WindowBase
        {
            var instance = (source != null) ? WindowSystem.instance.Create_INTERNAL(source, parameters) as T : WindowSystem.Create <T>(parameters);

            if (instance != null)
            {
                if (onCreatePredicate != null)
                {
                    onCreatePredicate(instance);
                }

                if (transition != null && transitionParameters != null)
                {
                    instance.Show(transition, transitionParameters);
                }
                else
                {
                    instance.Show();
                }
            }

            return(instance);
        }
コード例 #11
0
 /// <summary>
 /// Show window with specific transition.
 /// </summary>
 /// <param name="transition">Transition.</param>
 /// <param name="transitionParameters">Transition parameters.</param>
 public void Show(TransitionBase transition, TransitionInputParameters transitionParameters)
 {
     this.Show(null, transition, transitionParameters);
 }
コード例 #12
0
 public void Hide(TransitionBase transition, TransitionInputParameters transitionParameters)
 {
     this.window.Hide(transition, transitionParameters);
 }
コード例 #13
0
 /// <summary>
 /// Shows window of T type.
 /// Returns null if window not registered.
 /// </summary>
 /// <param name="transition">Transition.</param>
 /// <param name="transitionParameters">Transition parameters.</param>
 /// <param name="source">Source.</param>
 /// <param name="parameters">OnParametersPass() values.</param>
 /// <typeparam name="T">The 1st type parameter.</typeparam>
 public static T Show <T>(TransitionBase transition, TransitionInputParameters transitionParameters, T source, params object[] parameters) where T : WindowBase
 {
     return(WindowSystem.Show <T>(null, transition, transitionParameters, source, parameters));
 }
コード例 #14
0
 /// <summary>
 /// Shows window of T type.
 /// Returns null if window not registered.
 /// </summary>
 /// <param name="onCreatePredicate">On create predicate.</param>
 /// <param name="transition">Transition.</param>
 /// <param name="transitionParameters">Transition parameters.</param>
 /// <param name="parameters">OnParametersPass() values.</param>
 /// <typeparam name="T">The 1st type parameter.</typeparam>
 public static T Show <T>(System.Action <T> onCreatePredicate, TransitionBase transition, TransitionInputParameters transitionParameters, params object[] parameters) where T : WindowBase
 {
     return(WindowSystem.Show <T>(onCreatePredicate, transition, transitionParameters, null, parameters));
 }
コード例 #15
0
 /// <summary>
 /// Hide window with specific transition.
 /// </summary>
 /// <param name="transition">Transition.</param>
 /// <param name="transitionParameters">Transition parameters.</param>
 public bool Hide(TransitionBase transition, TransitionInputParameters transitionParameters)
 {
     return(this.Hide(null, transition, transitionParameters));
 }
コード例 #16
0
 public void Show(TransitionBase transition, TransitionInputParameters transitionParams)
 {
     this.Show_INTERNAL(onShowEnd: null, transitionItem: null);
 }
コード例 #17
0
 public static T Show <T>(System.Action <T> afterGetInstance, TransitionBase transition, TransitionInputParameters transitionParams, System.Action <T> onParametersPassCall, params object[] parameters) where T : WindowBase
 {
     return(WindowSystem.ShowWithParameters <T>(afterGetInstance, null, null, onParametersPassCall, parameters));
 }
コード例 #18
0
 public bool Hide(TransitionBase transition, TransitionInputParameters transitionParams)
 {
     return(this.Hide_INTERNAL(onHideEnd: null, transitionItem: null));
 }