👾
IL2CPP Resolver
  • Overview
  • 📦GameObject
    • Find with substring
    • Obtaining list
    • Obtaining Component list
  • 🛠️Utils
    • Usage of field offsets
    • Fetching & filtering classes
    • Fetching class method
  • 🔄Callback
    • OnUpdate
Powered by GitBook
On this page

Was this helpful?

  1. GameObject

Find with substring

std::string m_sObjectSubstring = "VRCPlayer[Local]";

// Obtain list
Unity::il2cppArray<Unity::CGameObject*>* m_pObjects = Unity::Object::FindObjectsOfType<Unity::CGameObject>(UNITY_GAMEOBJECT_CLASS);

// Looping through list
for (uintptr_t u = 0U; m_pObjects->m_uMaxLength > u; ++u)
{
    Unity::CGameObject* m_pObject = m_pObjects->m_pValues[u];
    if (!m_pObject) continue; // Just in-case

    // Obtaining object name and then converting it to std::string
    std::string m_sObjectName = m_pObject->GetName()->ToString();
    if (m_sObjectName.find(m_sObjectSubstring) != std::string::npos)
    {
        // Your code after it finds desired object.
        break;
    }
}

PreviousOverviewNextObtaining list

Last updated 3 years ago

Was this helpful?

📦