MultiWorld
1.0.0
|
Static class with MultiWorld functions that can be called from both Blueprint and C++. More...
#include <MultiWorldStatics.h>
Static Public Member Functions | |
static bool | AreWorldsEquals (const FMultiWorldHandle &InWorldHandleA, const FMultiWorldHandle &InWorldHandleB) |
Return true if the two world handle(s) are equals (they refer to the same world), false otherwise. More... | |
static void | EndWorld (const UObject *WorldContextObject, const FMultiWorldHandle &InWorldHandle) |
Call the EndPlay to the input World and to all its actors; The World and all actors are destroyed. More... | |
static void | ExecuteConsoleCommandInWorld (const FMultiWorldHandle &InWorldHandle, const FString &Command) |
Executes a console command on a specific world. More... | |
static FMultiWorldHandle | GetActiveWorldHandle (const UObject *WorldContextObject) |
Return the world handle of the active World. More... | |
static class AActor * | GetActorOfClass (const FMultiWorldHandle &InWorldHandle, TSubclassOf< AActor > ActorClass) |
Find the first Actor in the world of the specified class. More... | |
static void | GetAllActorsOfClass (const FMultiWorldHandle &InWorldHandle, TSubclassOf< AActor > ActorClass, TArray< AActor * > &OutActors) |
Find all Actors in the world of the specified class. More... | |
static void | GetAllActorsOfClassWithTag (const FMultiWorldHandle &InWorldHandle, TSubclassOf< AActor > ActorClass, FName Tag, TArray< AActor * > &OutActors) |
Find all Actors in the world of the specified class with the specified tag. More... | |
static void | GetAllActorsWithInterface (const FMultiWorldHandle &InWorldHandle, TSubclassOf< UInterface > Interface, TArray< AActor * > &OutActors) |
Find all Actors in the world with the specified interface. More... | |
static void | GetAllActorsWithTag (const FMultiWorldHandle &InWorldHandle, FName Tag, TArray< AActor * > &OutActors) |
Find all Actors in the world with the specified tag. More... | |
static void | GetAllObjectsWithInterface (const FMultiWorldHandle &InWorldHandle, TSubclassOf< UInterface > Interface, TArray< UObject * > &OutObjects) |
Find all UObject(s) in the world with the specified interface. More... | |
static FMultiWorldHandle | GetMainWorldHandle (const UObject *WorldContextObject) |
Return the main world handle. More... | |
static FMultiWorldHandle | GetThisWorldHandle (const UObject *WorldContextObject) |
Return the world handle where the caller lives. More... | |
static FMultiWorldHandle | GetWorldHandleByName (const UObject *WorldContextObject, FName WorldName) |
Return the world handle of the world with the given name if found or an invalid handle otherwise. More... | |
static void | InitializeWorld (const UObject *WorldContextObject, const FMultiWorldHandle &InWorldHandle) |
Setup the input World for playing; Actors are intialized, BeginPlay is called etc... More... | |
static bool | IsValidHandle (const UObject *WorldContextObject, const FMultiWorldHandle &InWorldHandle) |
Return true if the input world handle is valid, false otherwise. More... | |
static FMultiWorldHandle | LoadWorld (const UObject *WorldContextObject, TSoftObjectPtr< UWorld > MapAsset, FMultiWorldLoadParameters InParams) |
Synchronously load a World into memory. More... | |
static void | LoadWorldAsync (const UObject *WorldContextObject, TSoftObjectPtr< UWorld > MapAsset, FMultiWorldLoadParameters InParams) |
Asynchronously load a World into memory. More... | |
static bool | ReturnToMainWorld (const UObject *WorldContextObject) |
Travel the local players to the main world. More... | |
static void | SetAutoHandleWidgetsForMainWorld (const UObject *WorldContextObject, bool bAutoHandleWidgets) |
Sets whenever the UMG main world widgets must be handled automatically or not (shown when the world is active, hidden when the world is not). More... | |
static void | SetPhysicsActorTransform (AActor *Actor, const FTransform &NewTransform, ETeleportType Teleport=ETeleportType::ResetPhysics) |
Set the Actor transform, moving also all attached physics bodies as a single entity. More... | |
static void | SetShouldTickWhenInBackground (const UObject *WorldContextObject, const FMultiWorldHandle &InWorldHandle, bool bShouldTick) |
Sets whether or not the input world is ticked by the engine when it is in background (when not in play). More... | |
static AActor * | SpawnActorInWorld (const UObject *WorldContextObject, TSubclassOf< class AActor > ActorClass, const FMultiWorldHandle &InWorldHandle, const FTransform &SpawnTransform, ESpawnActorCollisionHandlingMethod CollisionHandlingOverride, AActor *Owner) |
Create an actor and place it in the input world. More... | |
static bool | SwitchWorld (const UObject *WorldContextObject, const FMultiWorldHandle &InWorldHandle) |
Change the Active World, travelling the local players to the input world. More... | |
static void | TransferActorToWorld (const UObject *WorldContextObject, AActor *InActor, const FMultiWorldHandle &InWorldHandle, const FMultiWorldTransferActorParameters &Options) |
Transfer the input actor from its actual world to the input one. More... | |
Static class with MultiWorld functions that can be called from both Blueprint and C++.
Few extra features (mainly Delegates) are available using the UMultiWorldManager subsystem.
|
static |
Return true if the two world handle(s) are equals (they refer to the same world), false otherwise.
[in] | InWorldHandleA | first world handle to compare |
[in] | InWorldHandleB | second world handle to compare |
|
static |
Call the EndPlay to the input World and to all its actors; The World and all actors are destroyed.
The input world handle is not more valid after.
[in] | WorldContextObject | the world context object |
InWorldHandle | the world handle |
|
static |
Executes a console command on a specific world.
InWorldHandle | The handle of the world where to exec the command |
Command | Command to send to the console |
|
static |
Return the world handle of the active World.
[in] | WorldContextObject | the world context object |
|
static |
Find the first Actor in the world of the specified class.
This is a slow operation, use with caution e.g. do not use every frame.
InWorldHandle | The handle of the world where find the actor. |
ActorClass | Class of Actor to find. Must be specified or result will be empty. |
|
static |
Find all Actors in the world of the specified class.
This is a slow operation, use with caution e.g. do not use every frame.
InWorldHandle | The handle of the world where find the actors. |
ActorClass | Class of Actor to find. Must be specified or result array will be empty. |
OutActors | Output array of Actors of the specified class. |
|
static |
Find all Actors in the world of the specified class with the specified tag.
This is a slow operation, use with caution e.g. do not use every frame.
InWorldHandle | The handle of the world where find the actors. |
Tag | Tag to find. Must be specified or result array will be empty. |
ActorClass | Class of Actor to find. Must be specified or result array will be empty. |
OutActors | Output array of Actors of the specified tag. |
|
static |
Find all Actors in the world with the specified interface.
This is a slow operation, use with caution e.g. do not use every frame.
InWorldHandle | The handle of the world where find the actors. |
Interface | Interface to find. Must be specified or result array will be empty. |
OutActors | Output array of Actors of the specified interface. |
|
static |
Find all Actors in the world with the specified tag.
This is a slow operation, use with caution e.g. do not use every frame.
InWorldHandle | The handle of the world where find the actors. |
Tag | Tag to find. Must be specified or result array will be empty. |
OutActors | Output array of Actors of the specified tag. |
|
static |
Find all UObject(s) in the world with the specified interface.
This is a slow operation, use with caution e.g. do not use every frame.
InWorldHandle | The handle of the world where find the actors. |
Interface | Interface to find. Must be specified or result array will be empty. |
OutObjects | Output array of UObject(s) of the specified interface. |
|
static |
Return the main world handle.
The main world is the world loaded by the Unreal Engine itself.
[in] | WorldContextObject | the world context object |
|
static |
Return the world handle where the caller lives.
Technically it's the UWorld of the World Context Object implicitly passed by UE4 to the function.
[in] | WorldContextObject | the world context object |
|
static |
Return the world handle of the world with the given name if found or an invalid handle otherwise.
If two or more worlds have the same name, the first found is returned.
[in] | WorldContextObject | the world context object |
[in] | WorldName | the name of the world to looking for |
|
static |
Setup the input World for playing; Actors are intialized, BeginPlay is called etc...
After you call this method, you can switch world calling SwitchWorld.
[in] | WorldContextObject | the world context object |
InWorldHandle | the world to setup; it should came from the function LoadWorld. |
|
static |
Return true if the input world handle is valid, false otherwise.
[in] | WorldContextObject | the world context object |
[in] | InWorldHandle | the world handle to check |
|
static |
Synchronously load a World into memory.
Be aware that the loaded world exists only on the local client and is not replicated.
[in] | WorldContextObject | the world context object |
MapAsset | the map asset where the World is located. | |
InParams | optional params to customize the loading. |
|
static |
Asynchronously load a World into memory.
Use the delegate UMultiWorldManager::OnAsyncLoadCompleted to be notified when the load is completed. Be aware that the loaded world exists only on the local client and is not replicated.
DefaultEngine.ini
: [in] | WorldContextObject | the world context object |
MapAsset | the map asset where the World is located. | |
InParams | optional params to customize the loading. |
|
static |
Travel the local players to the main world.
The main world is the world loaded by the Unreal Engine itself. If you call from the main world, the call doesn't have any effect.
[in] | WorldContextObject | the world context object |
|
static |
Sets whenever the UMG main world widgets must be handled automatically or not (shown when the world is active, hidden when the world is not).
[in] | WorldContextObject | the world context object |
[in] | bAutoHandleWidgets | true if widgets are handled automatically for the main world, false otherwise. |
|
static |
Set the Actor transform, moving also all attached physics bodies as a single entity.
Actor | The Actor to move. |
NewTransform | The new transform. |
Teleport | How we teleport the physics state (see AActor::SetActorTransform()). |
|
static |
Sets whether or not the input world is ticked by the engine when it is in background (when not in play).
[in] | WorldContextObject | the world context object |
InWorldHandle | the world handle for which to apply the setting | |
bShouldTick | the "tick-when-in-background" flag |
|
static |
Create an actor and place it in the input world.
[in] | WorldContextObject | the world context object |
[in] | ActorClass | the class to use to create the actor |
[in] | InWorldHandle | the world where to place the actor |
[in] | SpawnTransform | the absolute world transform of the new actor |
[in] | CollisionHandlingOverride | the strategy for handling the case of collision when the actor is spawned |
[in] | Owner | the owner of the new actor |
|
static |
Change the Active World, travelling the local players to the input world.
Secondary Worlds are not replicated.
All actors implementing the interface IMultiWorldActorInterface are notified accordingly to the interface.
The delegate UMultiWorldManager::OnWorldSwitched is notified.
UMG widgets are managed accordingly to the configuration (see FMultiWorldLoadParameters::bAutoHandleWidgets and SetAutoHandleWidgetsForMainWorld()).
[in] | WorldContextObject | the world context object |
InWorldHandle | the world handle where to go |
|
static |
Transfer the input actor from its actual world to the input one.
It's not network-replicated.
[in] | WorldContextObject | the world context object |
InActor | the actor to transfer | |
InWorldHandle | the new world of the input actor | |
Options | Options to customize the transfer (including setting a final transform for the actor). |