ICanvasControllerTransitioningAnimator

public interface ICanvasControllerTransitioningAnimator;

Description

The ICanvasControllerTransitioningAnimator interface defines the methods required to perform a transition animation between two canvas controllers. To implement a custom transition animation, you create an object that implements this interface - a transition animator. You can then provide, or vend, this animator to Canvas Flow via the target canvas controller's CanvasController.transitioningAnimatorVendor when the relevant transition is triggered.

When a transition between canvas controllers is to be performed, Canvas Flow will ask the target canvas controller's CanvasController.transitioningAnimatorVendor for an animator. This is where you can return, or vend, your custom animator. Your animator will then have the appropriate AnimateTransition method called, where you can perform your transition animation. Please refer to the included transition animators' source code for examples of animating the transition. These can be found in Canvas Flow/Transition Animators*.

The recommended way to create a custom transition animator, as documented in the manual, is to use the menu item in the Unity Editor at Assets/Create/Canvas Flow/Custom Transition Animator. This creates a CanvasControllerTransitioningAnimator, which is derived from ScriptableObject so it can be used in storyboards, be referenced in the Unity Editor, provide easily tweakable properties, and support having multiple instances. However, you may provide any object that implements this interface as an animator.

Once your transition animator has completed its animation, you must call CanvasControllerTransitionContext.CompleteTransition on the provided transition context. This tells Canvas Flow that the custom animation has been performed and to complete the transition. * The target canvas controller is the canvas controller being acted upon - i.e. the canvas controler being presented or being dismissed. Therefore, in a downstream transition - a presentation, this will be the CanvasControllerTransitionContext.destinationCanvasController , whereas in an upstream transition - a dismissal, this will be the CanvasControllerTransitionContext.sourceCanvasController.

See also:

CanvasControllerTransitioningAnimator

CanvasControllerTransitionContext

CanvasController.transitioningAnimatorVendor

Routine

CanvasControllerExtensions

DynamicObjectExtensions

Properties
None
Methods
AnimateTransition Perform your transition animation with the transitionContext's canvas controllers.
AnimateTransitionForInitialCanvasController Perform your transition animation for an initial canvas controller.

AnimateTransition

void AnimateTransition(CanvasControllerTransitionContext transitionContext);

Parameters

Name Description
transitionContext The transition's context, which provides information about the transition such as the canvas controllers involved.

Description

Perform your transition animation with the transitionContext's canvas controllers.

Note that you must call CanvasControllerTransitionContext.CompleteTransition on the provided transition context when your transition animator has completed its animation. This tells Canvas Flow that the custom animation has been performed and to complete the transition.


AnimateTransitionForInitialCanvasController

void AnimateTransitionForInitialCanvasController( CanvasControllerTransitionContext transitionContext);

Parameters

Name Description
transitionContext The transition's context, which provides information about the transition such as the canvas controllers involved.

Description

Perform your transition animation for an initial canvas controller.

Canvas Flow will call this method on a transition animator instead of AnimateTransition when the transition is presenting or dismissing an initial canvas controller. An initial canvas controller is one with no presenter - i.e. it was the first canvas controller presented, perhaps from a storyboard entry transition or using CanvasController.PresentInitialCanvasController. The only difference from the AnimateTransition method is that either the context's sourceCanvasController or destinationCanvasController will be null, depending on whether the transition is upstream - i.e. it is presenting/dismissing to 'nothing'.

Note that you must call CanvasControllerTransitionContext.CompleteTransition on the provided transition context when your transition animator has completed its animation. This tells Canvas Flow that the custom animation has been performed and to complete the transition.