A run-time API resolver for IL2CPP Unity.
#include "Main.hpp"
void SomeFunction()
{
IL2CPP::Initialize(); // This needs to be called once!
Unity::CGameObject* pLocal = Unity::GameObject::Find("LocalPlayer");
Unity::CComponent* pLocalData = pLocal->GetComponent("PlayerData");
pLocalData->SetMemberValue<bool>("CanFly", true);
}
void OurUpdateFunction()
{
// Your special code...
}
void OnLoad()
{
IL2CPP::Initialize();
IL2CPP::Callback::Initialize();
IL2CPP::Callback::OnUpdate::Add(OurUpdateFunction);
}