public abstract class StoryboardHook : MonoBehaviour;
A storyboard hook component is attached to game objects to make them hookable in the storyboard editor.
A StoryboardTransition will contain a reference to the storyboard hook component whom triggered it. You could use this reference to access the hook itself, as well as any other components on the hook's game object. This class is not used directly. It is derived from to create custom storyboard hooks, as documented in the manual.
|AutoAddComponentType||Override to specify the component type to which this hook should be automatically added.|
|Identifier||The hook's unique identifier.|
|CalculateRect01||A normalized rect used to position the hook element within the canvas preview area of the node view in the storyboard editor.|
|Connect||Override to attach the provided callback to your storyboard hook.|
public virtual System.Type AutoAddComponentType;
Override to specify the component type to which this hook should be automatically added.
When a canvas controller scene is saved in the Editor, Canvas Flow will ensure that storyboard hooks are present on any game objects with the hook's 'auto-add' component type. Here you can return the target type of your hook, such as your custom button type, to have your hook automatically added to any game objects with the target component type.
public string Identifier;
The hook's unique identifier.
public virtual Rect CalculateRect01();
A normalized rect used to position the hook element within the canvas preview area of the node view in the storyboard editor.
This method is invoked by Canvas Flow in the Editor when laying out a node's hooks in the storyboard editor. The default implementation of this method calculates the relative position of the hook's
RectTransform component to its highest parent canvas. You may override it to specify a custom implementation.
public abstract void Connect(System.Action<StoryboardHook> invokeTransition);
Override to attach the provided callback to your storyboard hook.
When a canvas controller is loaded from a storyboard at runtime, its connected hooks will be provided with a callback via the
Connect() method. Your hook's responsibility is to simply invoke this callback when it deems itself to have been triggered. Invoking the provided callback is all that is required to trigger a storyboard transition.