Reorganized UnityEngine namespace

Reorganized UnityEngine namespace by splitting headers into individual classes
This commit is contained in:
Jadis0x
2024-06-07 19:07:09 +03:00
parent 0d3675c8cd
commit 0b90598356
26 changed files with 311 additions and 236 deletions

View File

@@ -0,0 +1,29 @@
#include "pch-il2cpp.h"
#include "UnityEngine/GameObject.h"
#include "wrapper.h"
#include <helpers.h>
app::Component* GameObject::GetComponentByName(app::GameObject* go, const char* type)
{
app::Component* component = app::GameObject_GetComponentByName(go, ConvertToSystemString(type), nullptr);
return component ? component : nullptr;
}
app::Component__Array* GameObject::LogComponents(app::GameObject* go)
{
Wrapper obj("UnityEngine.CoreModule.dll");
Il2CppObject* object = obj.find_class("UnityEngine", "Component").get_class();
if (!object) return nullptr;
app::Type* type = reinterpret_cast<app::Type*>(object);
if (!type) return nullptr;
app::Component__Array* __components = app::GameObject_GetComponents(go, type, nullptr);
return __components ? __components : nullptr;
}