public override void OnValidate() { if (Application.isPlaying == true) { return; } if (UnityEditor.EditorApplication.isUpdating == true) { return; } base.OnValidate(); if (this.flow != null) { for (int i = 0; i < this.flow.Length; ++i) { this.flow[i].Validate(); } } if (this.flowAdditive != null) { for (int i = 0; i < this.flowAdditive.Length; ++i) { this.flowAdditive[i].Validate(); } } WindowSystemFlow.RefreshAll(); }
/// <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 static void SetEmulatedRuntimePlatform(RuntimePlatform?platform = null) { WindowSystemFlow instance = Object.FindObjectOfType <WindowSystemFlow>(); if (instance == null) { Debug.LogWarning("`WindowSystemFlow` was not found on the scene."); return; } if (platform != null) { instance.currentRuntimePlatform = platform.Value; instance.emulateRuntimePlatform = true; instance.emulateRuntimePlatformEditorOnly = false; } else { instance.emulateRuntimePlatformEditorOnly = true; } }
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)); }
/// <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); }
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)); }