mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-16 22:27:45 +08:00
Reduce string alloc
This commit is contained in:
parent
3cfdd6fa43
commit
31dd54d25c
@ -98,15 +98,17 @@ namespace UnityExplorer.Core.Runtime.Il2Cpp
|
|||||||
|
|
||||||
internal delegate IntPtr d_FindObjectsOfTypeAll(IntPtr type);
|
internal delegate IntPtr d_FindObjectsOfTypeAll(IntPtr type);
|
||||||
|
|
||||||
public override UnityEngine.Object[] FindObjectsOfTypeAll(Type type)
|
internal static readonly string[] findObjectsOfTypeAllSignatures = new[]
|
||||||
{
|
|
||||||
var iCall = ICallManager.GetICallUnreliable<d_FindObjectsOfTypeAll>(new[]
|
|
||||||
{
|
{
|
||||||
"UnityEngine.Resources::FindObjectsOfTypeAll",
|
"UnityEngine.Resources::FindObjectsOfTypeAll",
|
||||||
"UnityEngine.ResourcesAPIInternal::FindObjectsOfTypeAll" // Unity 2020+ updated to this
|
"UnityEngine.ResourcesAPIInternal::FindObjectsOfTypeAll" // Unity 2020+ updated to this
|
||||||
});
|
};
|
||||||
|
|
||||||
return new Il2CppReferenceArray<UnityEngine.Object>(iCall.Invoke(Il2CppType.From(type).Pointer));
|
public override UnityEngine.Object[] FindObjectsOfTypeAll(Type type)
|
||||||
|
{
|
||||||
|
return new Il2CppReferenceArray<UnityEngine.Object>(
|
||||||
|
ICallManager.GetICallUnreliable<d_FindObjectsOfTypeAll>(findObjectsOfTypeAllSignatures)
|
||||||
|
.Invoke(Il2CppType.From(type).Pointer));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scene.GetRootGameObjects();
|
// Scene.GetRootGameObjects();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user