/// <summary>
        /// Dos the flow.
        /// </summary>
        /// <returns>The flow.</returns>
        /// <param name="screen">Screen.</param>
        /// <param name="item">Item.</param>
        /// <param name="hide">If set to <c>true</c> hide.</param>
        /// <param name="onParametersPassCall">On parameters pass call.</param>
        /// <param name="onInstance">On instance.</param>
        /// <typeparam name="T">The 1st type parameter.</typeparam>
        public static T DoFlow <T>(IFunctionIteration screen, AttachItem item, bool hide, System.Action <T> onParametersPassCall, System.Action <T> onInstance = null) where T : WindowBase
        {
            var newWindow = WindowSystem.Show <T>(
                transitionItem: item,
                afterGetInstance: (w) => { if (onInstance != null)
                                           {
                                               onInstance(w);
                                           }
                                           w.SetFunctionIterationIndex(screen.GetFunctionIterationIndex()); },
                onParametersPassCall: onParametersPassCall
                );

            WindowSystemFlow.OnDoTransition((item == null) ? 0 : item.index, screen.GetWindow(), (item == null) ? newWindow.windowId : item.targetId, hide);

            if (hide == true)
            {
                screen.Hide(item);
            }

            return(newWindow);
        }
			public FlowFunctionLoaderRoutes(IFunctionIteration window, int index) : base(window, index) {}
        public static T DoFlow <T>(IFunctionIteration screen, int from, int to, bool hide, System.Action <T> onParametersPassCall, System.Action <T> onInstance = null) where T : WindowBase
        {
            var item = UnityEngine.UI.Windows.Plugins.Flow.FlowSystem.GetAttachItem(from, to);

            return(WindowSystemFlow.DoFlow <T>(screen, item, hide, onParametersPassCall, onInstance));
        }
示例#4
0
        /// <summary>
        /// Dos the flow.
        /// </summary>
        /// <returns>The flow.</returns>
        /// <param name="screen">Screen.</param>
        /// <param name="item">Item.</param>
        /// <param name="hide">If set to <c>true</c> hide.</param>
        /// <param name="onParametersPassCall">On parameters pass call.</param>
        /// <param name="onInstance">On instance.</param>
        /// <typeparam name="T">The 1st type parameter.</typeparam>
        public static T DoFlow <T>(IFunctionIteration screen, AttachItem item, bool hide, bool waitHide, bool async, System.Action <T> onParametersPassCall, System.Action <T> onInstance = null) where T : WindowBase
        {
            if (async == true)
            {
                WindowSystem.ShowAsyncLoader();
            }

            T newWindow = default(T);

            if (hide == true && waitHide == true)
            {
                screen.Hide(() => {
                    newWindow = WindowSystem.Show <T>(
                        async: async,
                        transitionItem: item,
                        afterGetInstance: (w) => {
                        if (onInstance != null)
                        {
                            onInstance.Invoke(w);
                        }
                        w.SetFunctionIterationIndex(screen.GetFunctionIterationIndex());
                    }, onParametersPassCall: onParametersPassCall);

                    UnityEngine.Events.UnityAction action = null;
                    action = () => {
                        newWindow.events.onEveryInstance.Unregister(WindowEventType.OnShowEnd, action);
                        if (async == true)
                        {
                            WindowSystem.HideAsyncLoader();
                        }
                    };
                    newWindow.events.onEveryInstance.Register(WindowEventType.OnShowEnd, action);

                    WindowSystemFlow.OnDoTransition((item == null) ? 0 : item.index, screen.GetWindow(), (item == null) ? newWindow.windowId : item.targetId, hide);
                }, item);
            }
            else
            {
                newWindow = WindowSystem.Show <T>(
                    async: async,
                    transitionItem: item,
                    afterGetInstance: (w) => {
                    if (onInstance != null)
                    {
                        onInstance.Invoke(w);
                    }
                    w.SetFunctionIterationIndex(screen.GetFunctionIterationIndex());
                }, onParametersPassCall: onParametersPassCall);

                UnityEngine.Events.UnityAction action = null;
                action = () => {
                    newWindow.events.onEveryInstance.Unregister(WindowEventType.OnShowEnd, action);
                    if (async == true)
                    {
                        WindowSystem.HideAsyncLoader();
                    }
                };
                newWindow.events.onEveryInstance.Register(WindowEventType.OnShowEnd, action);

                WindowSystemFlow.OnDoTransition((item == null) ? 0 : item.index, screen.GetWindow(), (item == null) ? newWindow.windowId : item.targetId, hide);

                if (hide == true)
                {
                    screen.Hide(item);
                }
            }

            return(newWindow);
        }
示例#5
0
 public static T DoFlow <T>(IFunctionIteration screen, AttachItem item, bool hide, System.Action <T> onParametersPassCall, System.Action <T> onInstance = null, bool async = false) where T : WindowBase
 {
     return(WindowSystemFlow.DoFlow <T>(screen, item, hide, false, async, onParametersPassCall, onInstance));
 }
示例#6
0
 public FlowFunctionLoaderRoutes(IFunctionIteration window, int index) : base(window, index)
 {
 }
示例#7
0
 public WindowRoutes(IFunctionIteration sourceWindow, int index)
 {
     this.sourceWindow = sourceWindow.GetWindow();
     this.index        = index;
 }