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); }
/// <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); }
/// <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); }
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(); } }
/// <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); }
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(); } } }
/// <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); }
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(); } }
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(); } } }
/// <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); }
/// <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); }
public void Hide(TransitionBase transition, TransitionInputParameters transitionParameters) { this.window.Hide(transition, transitionParameters); }
/// <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)); }
/// <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)); }
/// <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)); }
public void Show(TransitionBase transition, TransitionInputParameters transitionParams) { this.Show_INTERNAL(onShowEnd: null, transitionItem: null); }
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)); }
public bool Hide(TransitionBase transition, TransitionInputParameters transitionParams) { return(this.Hide_INTERNAL(onHideEnd: null, transitionItem: null)); }