public override IView ConvertToView(FigmaNode currentNode, ViewNode parent, ViewRenderService rendererService) { var button = TransitionHelper.CreateImageButtonFromFigmaNode(currentNode); //button.Border = false; return(button); }
/// <summary> /// 创建Double值之间的线性动画 /// </summary> public static DoubleAnimation BuildDoubleAnimation(DoubleModel Model) { (Model.Target as UIElement).RenderTransform = TransitionHelper.GetTransformGroup(Model.Target); DoubleAnimation _doubleAnimation = new DoubleAnimation(); _doubleAnimation.From = Model.From; _doubleAnimation.To = Model.To; _doubleAnimation.Duration = new Duration(TimeSpan.FromSeconds(Model.Duration)); _doubleAnimation.AutoReverse = Model.AutoReverse; _doubleAnimation.BeginTime = TimeSpan.FromSeconds(Model.BeginTime); _doubleAnimation.By = Model.By; _doubleAnimation.FillBehavior = Model.FillBehavior; _doubleAnimation.RepeatBehavior = Model.RepeatBehavior; _doubleAnimation.SpeedRatio = Model.SpeedRatio; if (Model.EasingFunction != null) { _doubleAnimation.EasingFunction = Model.EasingFunction; } Storyboard.SetTarget(_doubleAnimation, Model.Target); Storyboard.SetTargetProperty(_doubleAnimation, new PropertyPath(Model.PropertyPath)); return(_doubleAnimation); }
public override IView ConvertToView(FigmaNode currentNode, ViewNode parent, ViewRenderService rendererService) { string text = string.Empty; if (currentNode is IFigmaNodeContainer container) { var figmaText = container.children .OfType <FigmaText>() .FirstOrDefault(); if (figmaText != null) { text = figmaText.characters; } } IView msLogoView = null; if (rendererService is ViewRenderService viewRendererService) { msLogoView = viewRendererService.RenderByName <IView>(LogoImageName, null); } var flatButton = new FixedFlatButton(text, msLogoView.NativeObject as NSView); IButton button = TransitionHelper.CreateButtonFromFigmaNode(flatButton, currentNode); return(button); }
void Start() { CurrentSceneStateProperty.Where(css => css != null).Subscribe(css => { if (IsCampaignRunning) { CurrentCampaign.CurrentScene = css; } if (SceneManager != null && SceneManager.TransitionManager != null) { SceneManager.NextScene.Value = css.SceneName; } else { TransitionHelper.LoadScene(css.SceneName); } }).AddTo(this); IsCampaignRunningProperty.Subscribe(running => { if (running) { CurrentCampaign.SessionStarted = DateTime.Now; CurrentSceneState = CurrentCampaign.CurrentScene; } else { CurrentSceneState = new MainMenuState(); } }).AddTo(this); }
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); } }
public void RevertTransition() { TransitionHelper tH = lastHelpers.Pop(); tH.lastGroup.gameObject.SetActive(true); //Debug.Log("target: " + tH.target.gameObject.name); //Debug.Log("current: " + currentGroup.gameObject.name); switch (tH.type) { case TransType.Blend: StartCoroutine(Blend(tH, true)); break; case TransType.FromLeft: StartCoroutine(Slide(tH, -1, true)); break; case TransType.FromRight: StartCoroutine(Slide(tH, 1, true)); break; case TransType.Immediate: break; default: break; } if (tH.newCamPos) { StartCoroutine(SetCameraTransform(tH, true)); } }
//public void Transition(GameObject targetCanvas, TransType type, float duration) public void Transition(TransitionHelper tH) { tH.lastGroup = currentGroup; tH.lastPos = cameras.position; tH.lastRot = cameras.eulerAngles; switch (tH.type) { case TransType.Blend: StartCoroutine(Blend(tH)); break; case TransType.FromLeft: StartCoroutine(Slide(tH, -1)); break; case TransType.FromRight: StartCoroutine(Slide(tH, 1)); break; case TransType.Immediate: break; default: break; } if (tH.newCamPos) { StartCoroutine(SetCameraTransform(tH)); } lastHelpers.Push(tH); }
// Ends the screen transition for a mission retry private void EndRetryTransition() { // Player GameManager.Player.ResetPlayer(v3PlayerStartPos); // End Goal goEndGoal.SetActive(false); // Stop and Reset Mission Timer missionTimer.StopTimer(); missionTimer.ResetTimer(); // Reset Score if it exists if (missionScore != null) { missionScore.ResetScore(true); } // Disable Mission UI goMissionUI.SetActive(false); // Camera gameCamera.Reset(); gameCamera.transform.position = v3CameraStartPos; // Targets iTargets = agoTargets.Length; for (int i = 0; i < agoTargets.Length; i++) { agoTargets[i].SetActive(true); agoTargets[i].GetComponent <HealthManager>().Revive(); } // Projectiles in Scene GameObject[] projectiles = GameObject.FindGameObjectsWithTag("Projectile"); for (int i = 0; i < projectiles.Length; i++) { projectiles[i].SetActive(false); } // Debris in Scene GameObject[] debris = GameObject.FindGameObjectsWithTag("Debris"); for (int i = 0; i < debris.Length; i++) { debris[i].SetActive(false); } vrMenuManager.gameObject.SetActive(true); vrMenuManager.GoToScreen("VRStart"); AudioManager.Instance.StopAllSounds(); if (onMissionRestart != null) { onMissionRestart(); } TransitionHelper.TransitionIn(goScreenFadeUI); }
IEnumerator SetCameraTransform(TransitionHelper tH, bool revert = false) { float timer = 0f; float percentage = 0f; Vector3 startPos = cameras.position; Vector3 startRot = cameras.eulerAngles; Vector3 targetPos = Vector3.zero; Vector3 targetRot = Vector3.zero; if (revert) { targetPos = tH.lastPos; targetRot = tH.lastRot; } else { targetPos = tH.newPos; targetRot = tH.newRot; } while (percentage < 1f) { percentage = timer / tH.duration; float smoothPercentage = smoothTransition.Evaluate(percentage); cameras.position = Vector3.Lerp(startPos, targetPos, smoothPercentage); cameras.eulerAngles = LerpEulerAngles(startRot, targetRot, smoothPercentage); timer += Time.deltaTime; yield return(wait); } }
void TransitionItem3() { ShowTransitionedDescription("Trigger a transition component with callback."); // transition the third item which is a component that triggers its own transition out on complete. TransitionHelper.TransitionIn(TestGameObject3, TransitionItem4); }
public void HideConfirm() { if (DeleteConfirm.activeSelf) { TransitionHelper.TransitionOut(DeleteConfirm, () => DeleteConfirm.SetActive(false)); } }
private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { var pre = Selected; Selected = (RouteTag)e.AddedItems[0]; ContentFrame.NavigateToRoute(Selected.Type, TransitionHelper.DecideSlideAnimation(pre, Selected)); }
private void NavView_ItemInvoked(NavigationView _, NavigationViewItemInvokedEventArgs args) { var tag = (RouteType)args.InvokedItemContainer.Tag; var pre = Selected; Selected = ApplicationRouter.GetRouteTag(tag); SelectedContainer = args.InvokedItemContainer; ContentFrame.NavigateToRoute(tag, TransitionHelper.DecideSlideAnimation(pre, Selected)); }
// 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); } }
void PerformSignInWithTransition(View v) { var activity = Activity; var pairs = TransitionHelper.CreateSafeTransitionParticipants(activity, true, new Pair(v, activity.GetString(Resource.String.transition_avatar))); var activityOptions = ActivityOptions.MakeSceneTransitionAnimation(activity, pairs); CategorySelectionActivity.Start(activity, player, activityOptions); }
void StartCategoryActivityWithTransition(Activity activity, View toolbar, Category category) { var pairs = TransitionHelper.CreateSafeTransitionParticipants(activity, false, new Pair(toolbar, activity.GetString(Resource.String.transition_toolbar))); var sceneTransitionAnimation = ActivityOptions.MakeSceneTransitionAnimation(activity, pairs); // Start the activity with the participants, animating from one to the other. var transitionBundle = sceneTransitionAnimation.ToBundle(); activity.StartActivity(IntentHelper.GetStartIntent(activity, category), transitionBundle); }
/// <summary> /// Load the specified scene after an (optional) delay. /// </summary> /// <param name="sceneName"></param> /// <param name="delay"></param> public void LoadSceneDelayed(string sceneName, float delay = 0) { if (!Mathf.Approximately(delay, 0)) { StartCoroutine(LoadSceneDelayedCoroutine(sceneName, delay)); } else { TransitionHelper.LoadScene(sceneName); } }
public void SetGradientPaintOnClick() { var gradient = new Gradient <FlatGradientButton>(this, ColorAOnClick, ColorBOnClick, ColorCOnClick, ColorToneOnClick, GradientAngleOnClick); TransitionHelper.GradientPaint(gradient); }
// Update void Update() { if (async != null && !bTransitioning) { if (async.progress == 0.9f) { TransitionHelper.TransitionOut(goScreenFadeUI, EnterScene); bTransitioning = true; } } }
public void SetGradientPaintOnDefault() { var gradient = new Gradient <Form>(this, ColorAOnDefault, ColorBOnDefault, ColorCOnDefault, ColorToneOnDefault, GradientAngleOnDefault); TransitionHelper.GradientPaint(gradient); }
// Begins the Transition In and starts the Dismiss Coroutine private void TransitionSaveNotification() { TransitionHelper.TransitionIn(gameObject); if (dismissCoroutine != null) { StopCoroutine(dismissCoroutine); dismissCoroutine = null; } dismissCoroutine = StartCoroutine(DismissSaveNotification()); }
/// <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); }
/// <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)); }
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); }
// Return to previous screen public override void ReturnToPreviousScreen() { if (sCurrentPanel == "MainMenu") { TransitionHelper.TransitionOut(goMenuInputPanel); } else if (sCurrentPanel == "Options") { SettingsManager.Instance.SaveSettings(); } base.ReturnToPreviousScreen(); }
/// <summary> /// Perform the action /// </summary> /// <returns></returns> protected override void Execute(bool isStart) { var targetFinal = GameActionHelper.ResolveTarget(TargetType, this, Target); if (targetFinal == null) { Debug.LogWarningFormat("No Target is specified for the action {0} on {1}", GetType().Name, Owner.gameObject.name); } if (targetFinal != null) { TransitionHelper.TransitionIn(targetFinal); } }
public static IEnumerable <DataObject> FlattenItems(Request request) { if (!request.issueRequestResponse["key"].ToString().Contains("POB") || !request.issueRequestResponse["fields"]["issuetype"]["name"].ToString().Contains("Story")) { throw new Exception("This is not an OLB story"); } var transitions = new List <Transition>(); lock (transitions) foreach (var requestResponse in request.issueChangeLogRequestResponses) { var values = requestResponse["values"].Where(v => v["items"].Any(i => i.Value <string>("field") == "status")); foreach (var value in values) { foreach (var item in value["items"]) { transitions.Add(new Transition { created = value.Value <DateTime>("created"), toString = item.Value <string>("to"), fromString = item.Value <string>("from") }); } } } Issue issue = new Issue { id = (string)request.issueRequestResponse["key"], type = (string)request.issueRequestResponse["fields"]["issuetype"]["name"], storyPoints = (string)request.issueRequestResponse["fields"]["customfield_10024"], transitions = transitions.ToArray() }; TransitionHelper transitionHelper = new TransitionHelper(issue); yield return(new DataObject { id = issue.id, storyPoints = issue.storyPoints, type = issue.type, qa_total_done_time = transitionHelper.GetTotalQAHours(), in_qa_time = transitionHelper.getInQATime(), dev_total_done_time = transitionHelper.getTotalDevHours(), qa_sitting_time = transitionHelper.getQASittingTime(), in_dev_time = transitionHelper.getInDevTime(), dev_sitting_time = transitionHelper.getDevSittingTime(), time_to_done = transitionHelper.getTotalDevelopmentTime(), doneDate = transitionHelper.getDoneDate() }); }
/// <summary> /// Trigger Component transition with callbacks. /// </summary> void Step3TransitionWithCallback(TransitionStep transitionStep) { ShowTransitionedDescription("Trigger a transition component with callback."); // transition the third item which is a component that has triggers to transition out again when the in // transition has completed and a transition out on complete trigger to run the next step. TransitionHelper.TransitionIn(TestGameObject3); //, CustomTransitionStep); // Rather than using a callback on the component we could also have passed an onComplete method // to TransitionIn as shown below. That would however return after the transition in completed. // Here we want to run the components transition out first and then proceed so we set the oncomplete // callback in the components transition out configuration instead. //TransitionHelper.TransitionIn(TestGameObject3, CustomTransitionStep); }
public MoveTarget(UnityEngine.GameObject target, Vector3? startPosition = null, Vector3? endPosition = null, float delay = 0, float duration = 0.5f, TransitionModeType transitionMode = TransitionModeType.Specified, TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear, AnimationCurve animationCurve = null, Action onStart = null, Action<float> onUpdate = null, Action onComplete = null) : base(target, startPosition, endPosition, delay: delay, duration: duration, transitionMode: transitionMode, tweenType: tweenType, animationCurve: animationCurve, onStart: onStart, onUpdate: onUpdate, onComplete: onComplete) { }
public ScreenFade(UnityEngine.GameObject target, Color? color = null, Texture2D texture = null, float delay = 0, float duration = 0.5f, TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear, AnimationCurve animationCurve = null, Action onStart = null, Action<float> onUpdate = null, Action onComplete = null) : base(target, delay: delay, duration: duration, tweenType: tweenType, animationCurve: animationCurve, onStart: onStart,onUpdate: onUpdate, onComplete: onComplete) { Color = color.HasValue ? color.Value : Color.white; Texture = texture; }
public Fade(UnityEngine.GameObject target, float startTransparency = 0, float endTransparency = 1, float delay = 0, float duration = 0.5f, TransitionModeType transitionMode = TransitionModeType.Specified, TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear, AnimationCurve animationCurve = null, Action onStart = null, Action<float> onUpdate = null, Action onComplete = null) : base(target, startValue: startTransparency, endValue: endTransparency, delay: delay, duration: duration, transitionMode: transitionMode, tweenType: tweenType, animationCurve: animationCurve, onStart: onStart,onUpdate: onUpdate, onComplete: onComplete) { }
public TransitionStepScreen(UnityEngine.GameObject target, float delay = 0, float duration = 0.5f, TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear, AnimationCurve animationCurve = null, Action onStart = null, Action<float> onUpdate = null, TransitionStep onCompleteItem = null, Action onComplete = null, Action<object> onCompleteWithData = null, object onCompleteData = null) : base(target, delay: delay, duration: duration, tweenType: tweenType, animationCurve: animationCurve, onStart: onStart,onUpdate: onUpdate, onComplete: onComplete) { SetupComponentReferences(); }
public Rotate(UnityEngine.GameObject target, Vector3? startRotation = null, Vector3? endRotation = null, float delay = 0, float duration = 0.5f, TransitionModeType transitionMode = TransitionModeType.Specified, TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear, AnimationCurve animationCurve = null, TransitionStep.CoordinateSpaceType coordinateSpace = TransitionStep.CoordinateSpaceType.Global, Action onStart = null, Action<float> onUpdate = null, Action onComplete = null) : base(target, startRotation, endRotation, delay: delay, duration: duration, transitionMode: transitionMode, tweenType: tweenType, animationCurve: animationCurve, coordinateSpace: coordinateSpace, onStart: onStart, onUpdate: onUpdate, onComplete: onComplete) { Assert.AreNotEqual(CoordinateSpaceType.AnchoredPosition, CoordinateSpace, "AnchoredPosition is not supported for Rotate. Please change"); }
public Move(UnityEngine.GameObject target, Vector3? startPosition = null, Vector3? endPosition = null, float delay = 0, float duration = 0.5f, TransitionModeType transitionMode = TransitionModeType.Specified, TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear, AnimationCurve animationCurve = null, CoordinateSpaceType coordinateSpace = CoordinateSpaceType.Global, Action onStart = null, Action<float> onUpdate = null, Action onComplete = null) : base(target, startPosition, endPosition, delay: delay, duration: duration, transitionMode: transitionMode, tweenType: tweenType, animationCurve: animationCurve, coordinateSpace: coordinateSpace, onStart: onStart, onUpdate: onUpdate, onComplete: onComplete) { //TODO: Validation . where to place! //if (MoveMode == MoveModeType.AnchoredPosition) // Assert.IsNotNull(Target.transform as RectTransform, "The target of TransitionMove must contain a RectTransform component (not just a standard Transform component) when using MoveMode of type AnchoredPosition"); }
/// <summary> /// Constructor. Semi-internal - If you use this be prepared for changes. The best way is to use named /// parameters for all optional arguments! /// </summary> /// <param name="target"></param> /// <param name="delay"></param> /// <param name="duration"></param> /// <param name="transitionMode"></param> /// <param name="tweenType"></param> /// <param name="animationCurve"></param> /// <param name="coordinateSpace"></param> /// <param name="onStart"></param> /// <param name="onUpdate"></param> /// <param name="onComplete"></param> public TransitionStep(UnityEngine.GameObject target = null, float delay = 0, float duration = 0.5f, TransitionModeType transitionMode = TransitionModeType.Specified, TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear, AnimationCurve animationCurve = null, CoordinateSpaceType coordinateSpace = CoordinateSpaceType.Global, Action onStart = null, Action<float> onUpdate = null, Action onComplete = null) { Target = target; Delay = delay; Duration = duration; TransitionMode = transitionMode; TweenType = tweenType; AnimationCurve = animationCurve == null ? AnimationCurve.EaseInOut(0, 0, 1, 1) : animationCurve; CoordinateSpace = coordinateSpace; AddOnStartAction(onStart); AddOnUpdateAction(onUpdate); AddOnCompleteAction(onComplete); }
/// <summary> /// Scale extension method for TransitionStep /// </summary> /// <typeparam name="T">interface type</typeparam> /// <param name="TransitionStep"></param> /// <returns></returns> public static Scale ScaleToOriginal(this TransitionStep transitionStep, Vector3 startScale, float delay = 0, float duration = 0.5f, TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear, AnimationCurve animationCurve = null, bool runAtStart = false, Action onStart = null, Action<float> onUpdate = null, Action onComplete = null) { var newTransitionStep = new Scale(transitionStep.Target, startScale, Vector3.zero, delay, duration, TransitionStep.TransitionModeType.ToOriginal, tweenType, animationCurve, onStart, onUpdate, onComplete); if (runAtStart) transitionStep.AddOnStartTransitionStep(newTransitionStep); else transitionStep.AddOnCompleteTransitionStep(newTransitionStep); newTransitionStep.Parent = transitionStep; newTransitionStep.EndValue = newTransitionStep.OriginalValue; return newTransitionStep; }
/// <summary> /// Move extension method for TransitionStep /// </summary> /// <typeparam name="T">interface type</typeparam> /// <param name="TransitionStep"></param> /// <returns></returns> public static Move MoveToOriginal(this TransitionStep transitionStep, Vector3 startPosition, float delay = 0, float duration = 0.5f, TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear, AnimationCurve animationCurve = null, TransitionStep.CoordinateSpaceType coordinateMode = TransitionStep.CoordinateSpaceType.Global, bool runAtStart = false, Action onStart = null, Action<float> onUpdate = null, Action onComplete = null) { var newTransitionStep = new Move(transitionStep.Target, startPosition, Vector3.zero, delay, duration, TransitionStep.TransitionModeType.ToOriginal, tweenType, animationCurve, coordinateMode, onStart, onUpdate, onComplete); if (runAtStart) transitionStep.AddOnStartTransitionStep(newTransitionStep); else transitionStep.AddOnCompleteTransitionStep(newTransitionStep); newTransitionStep.Parent = transitionStep; return newTransitionStep; }
/// <summary> /// Fade extension method for TransitionStep /// </summary> /// <typeparam name="T">interface type</typeparam> /// <param name="TransitionStep"></param> /// <returns></returns> public static ScreenWipe ScreenWipe(this TransitionStep transitionStep, Texture2D maskTexture, bool invertMask = false, Color? color = null, Texture2D texture = null, float delay = 0, float duration = 0.5f, TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear, AnimationCurve animationCurve = null, Action onStart = null, Action<float> onUpdate = null, Action onComplete = null) { var newTransitionStep = new ScreenWipe(transitionStep.Target, maskTexture, invertMask, color, texture, delay, duration, tweenType, animationCurve, onStart, onUpdate, onComplete); transitionStep.AddOnCompleteTransitionStep(newTransitionStep); newTransitionStep.Parent = transitionStep; return newTransitionStep; }
/// <summary> /// Set the transition type /// </summary> /// <param name="tweenType"></param> /// <returns></returns> public TransitionStep SetTweenType(TransitionHelper.TweenType tweenType) { TweenType = tweenType; return this; }
/// <summary> /// Move extension method for TransitionStep /// </summary> /// <typeparam name="T">interface type</typeparam> /// <param name="TransitionStep"></param> /// <returns></returns> public static MoveTarget MoveTargetFromOriginal(this TransitionStep transitionStep, Vector3 endPosition, float delay = 0, float duration = 0.5f, TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear, AnimationCurve animationCurve = null, bool runAtStart = false, Action onStart = null, Action<float> onUpdate = null, Action onComplete = null) { var newTransitionStep = new MoveTarget(transitionStep.Target, Vector3.zero, endPosition, delay, duration, TransitionStep.TransitionModeType.FromCurrent, tweenType, animationCurve, onStart, onUpdate, onComplete); if (runAtStart) transitionStep.AddOnStartTransitionStep(newTransitionStep); else transitionStep.AddOnCompleteTransitionStep(newTransitionStep); newTransitionStep.Parent = transitionStep; newTransitionStep.StartValue = newTransitionStep.OriginalValue; return newTransitionStep; }
/// <summary> /// MoveTarget extension method for TransitionStep /// </summary> /// <typeparam name="T">interface type</typeparam> /// <param name="TransitionStep"></param> /// <returns></returns> public static MoveTarget MoveTarget(this TransitionStep transitionStep, Vector3 startPosition, Vector3 endPosition, float delay = 0, float duration = 0.5f, TransitionStep.TransitionModeType transitionMode = TransitionStep.TransitionModeType.Specified, TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear, AnimationCurve animationCurve = null, bool runAtStart = false, Action onStart = null, Action<float> onUpdate = null, Action onComplete = null) { var newTransitionStep = new MoveTarget(transitionStep.Target, startPosition, endPosition, delay, duration, transitionMode, tweenType, animationCurve, onStart, onUpdate, onComplete); if (runAtStart) transitionStep.AddOnStartTransitionStep(newTransitionStep); else transitionStep.AddOnCompleteTransitionStep(newTransitionStep); newTransitionStep.Parent = transitionStep; return newTransitionStep; }