add: GetActiveScene() function

This commit is contained in:
jadis0x
2022-10-02 19:31:44 +03:00
committed by GitHub
parent 8f9c904130
commit f66aa4aebe

View File

@@ -19,3 +19,19 @@ bool Helpers::IsInGame() {
return OptionsHelpersData->GetMemberValue<bool*>("inGame");
}
std::string Helpers::GetActiveScene() {
Unity::CGameObject* MapHelper = Unity::GameObject::Find("SaveHelpers");
if (!MapHelper) {
return "";
}
Unity::CComponent* MapHelperData = MapHelper->GetComponent("SaveHelpers");
if (!MapHelperData) {
return "";
}
return MapHelperData->GetMemberValue<Unity::System_String*>("sceneName")->ToString();
}