MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / BeginPlay

Method BeginPlay

Source/Engine/Level/Actor.cpp:1018–1055  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1016}
1017
1018void Actor::BeginPlay(SceneBeginData* data)
1019{
1020 CHECK_DEBUG(!IsDuringPlay());
1021
1022 // Set flag
1023 Flags |= ObjectFlags::IsDuringPlay;
1024
1025 OnBeginPlay();
1026
1027 // Update scripts
1028 ACTOR_LOOP_START_MODIFIED_HIERARCHY();
1029 for (int32 i = 0; i < Scripts.Count(); i++)
1030 {
1031 auto e = Scripts.Get()[i];
1032 if (!e->IsDuringPlay())
1033 {
1034 e->BeginPlay(data);
1035 ACTOR_LOOP_CHECK_MODIFIED_HIERARCHY();
1036 }
1037 }
1038
1039 // Update children
1040 for (int32 i = 0; i < Children.Count(); i++)
1041 {
1042 auto e = Children.Get()[i];
1043 if (!e->IsDuringPlay())
1044 {
1045 e->BeginPlay(data);
1046 ACTOR_LOOP_CHECK_MODIFIED_HIERARCHY();
1047 }
1048 }
1049
1050 // Fire events for scripting
1051 if (IsActiveInHierarchy() && GetScene() && !_isEnabled)
1052 {
1053 OnEnable();
1054 }
1055}
1056
1057void Actor::EndPlay()
1058{

Callers 4

FromBytesMethod · 0.45
spawnActorMethod · 0.45
CallBeginPlayMethod · 0.45
OnBeginPlayMethod · 0.45

Calls 6

OnBeginPlayFunction · 0.85
IsActiveInHierarchyFunction · 0.85
GetSceneFunction · 0.85
OnEnableFunction · 0.85
CountMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected