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

Method Init

Source/Editor/Editor.cpp:680–719  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

678}
679
680bool Editor::Init()
681{
682 // Scripts project files generation from command line
683 if (CommandLine::Options.GenProjectFiles.IsTrue())
684 {
685 const String customArgs = TEXT("-verbose -log -logfile=\"Cache/Intermediate/ProjectFileLog.txt\"");
686 const bool failed = ScriptsBuilder::GenerateProject(customArgs);
687 exit(failed ? 1 : 0);
688 return true;
689 }
690 PROFILE_CPU();
691 PROFILE_MEM(Editor);
692
693 // If during last lightmaps baking engine crashed we could try to restore the progress
694 ShadowsOfMordor::Builder::Instance()->CheckIfRestoreState();
695
696 Engine::Update.Bind(&EditorImpl::OnUpdate);
697 Managed = New<ManagedEditor>();
698
699 // Show splash screen
700 if (!CommandLine::Options.Headless.IsTrue())
701 {
702 PROFILE_CPU_NAMED("Splash");
703 if (EditorImpl::Splash == nullptr)
704 EditorImpl::Splash = New<SplashScreen>();
705 EditorImpl::Splash->SetTitle(Project->Name);
706 EditorImpl::Splash->Show();
707 }
708
709 // Initialize managed editor
710 Managed->Init();
711
712 // Start play if requested by cmd line
713 if (CommandLine::Options.Play.HasValue())
714 {
715 Managed->RequestStartPlayOnEditMode();
716 }
717
718 return false;
719}
720
721void Editor::BeforeRun()
722{

Callers

nothing calls this directly

Calls 8

CheckIfRestoreStateMethod · 0.80
InstanceClass · 0.50
IsTrueMethod · 0.45
BindMethod · 0.45
SetTitleMethod · 0.45
ShowMethod · 0.45
HasValueMethod · 0.45

Tested by

no test coverage detected