MultiWorld 1.9.1
Manage multiple isolated UWorld instances simultaneously in Unreal Engine, transferring player and actors between worlds.
|
Helper class to make a seam transition between two worlds, driving a customizable graphics effect. More...
#include <MultiWorldSeamTransition.h>
Public Member Functions | |
virtual TStatId | GetStatId () const override |
Override. More... | |
virtual void | Initialize (FSubsystemCollectionBase &Collection) override |
Override. More... | |
bool | IsInTransition () const |
Checks if a transition is still running. More... | |
virtual bool | IsTickable () const override |
Override. More... | |
void | SetDefaultFXLayerZOrder (int32 ZOrder) |
Set the ZOrder value used by the widget showing the transition VFX. More... | |
bool | StartTransition (UObject *WorldContextObject, FMultiWorldHandle InDestinationWorldHandle, UMaterialInterface *TransitionMaterial, const FOnTransitionEnd &OnTransitionEnd, float DurationInSeconds=1.0f, float WorldSwitchNormalizedTime=0.5f, bool bForceWorldsTickingDuringTransition=true, bool bAutoHandleAudioFade=true) |
Start a seam visual transition that brings the player to a new world. More... | |
virtual void | Tick (float DeltaTime) override |
Override. More... | |
Helper class to make a seam transition between two worlds, driving a customizable graphics effect.
|
overridevirtual |
Override.
|
overridevirtual |
Override.
bool UMultiWorldSeamTransition::IsInTransition | ( | ) | const |
Checks if a transition is still running.
|
overridevirtual |
Override.
void UMultiWorldSeamTransition::SetDefaultFXLayerZOrder | ( | int32 | ZOrder | ) |
Set the ZOrder value used by the widget showing the transition VFX.
ZOrder | The new ZOrder value to use. The higher the number, the more on top the widget will be. |
The new value will be effective on the next call of StartTransition().
bool UMultiWorldSeamTransition::StartTransition | ( | UObject * | WorldContextObject, |
FMultiWorldHandle | InDestinationWorldHandle, | ||
UMaterialInterface * | TransitionMaterial, | ||
const FOnTransitionEnd & | OnTransitionEnd, | ||
float | DurationInSeconds = 1.0f , |
||
float | WorldSwitchNormalizedTime = 0.5f , |
||
bool | bForceWorldsTickingDuringTransition = true , |
||
bool | bAutoHandleAudioFade = true |
||
) |
Start a seam visual transition that brings the player to a new world.
[in] | WorldContextObject | World context object. |
[in] | InDestinationWorldHandle | Destination world handle. |
[in] | TransitionMaterial | The material used by the visual transition. Read the notes below for details. |
[in] | OnTransitionEnd | Callback called when the transition ends. |
[in] | DurationInSeconds | Transition duration in seconds. Must be not negative. |
[in] | WorldSwitchNormalizedTime | Normalized time in [0, 1] used to control when the world switching is performed (i.e. when UMultiWorldStatics::SwitchWorld() is called). For example, with WorldSwitchNormalizedTime = 0.5f the switch is performed at the middle of the transition; with WorldSwitchNormalizedTime = 1.0f the switch is performed at the end of the transition. |
[in] | bForceWorldsTickingDuringTransition | if true, the ticking is forced for both worlds involved for the transition duration. |
[in] | bAutoHandleAudioFade | if true, then the audio fade-in/out between the two worlds is handled automatically. It requires that each of the involved worlds have a dedicated audio device. |
Only one active transition can run at a given time, otherwise the call will fail returning false.
The effect uses a Material to drive the visual transition. This material must complies to some requirements:
User Interface
;MultiWorld_SeamTransition_MF
to access the information needed to mix the two rendered worlds (like the current animation factor, the sampled colors from the source and destination worlds, etc).The plugin provides some ready-to-use materials (e.g. MW_ST_CrossFading_PPM
, MW_ST_WipeLeftToRight_PPM
, etc.), that you can use as-is or analyze to create your custom ones.
HUD and UMG widgets of the switching worlds are not visible during the transition. If you want them to gently disappear/appear on screen, you must manually take care of it (e.g. animating their opacity) before starting the transition and when the transition ends (see the OnTransitionEnd parameter).
|
overridevirtual |
Override.