少年修仙传客户端基础资源
hch
2024-04-01 d01413b00ef631ac20347716b23818b0b811f65f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "il2cpp-config.h"
#include "il2cpp-class-internals.h"
#include "il2cpp-api.h"
#include "EventInfo.h"
#include "vm/Class.h"
#include "vm/Reflection.h"
 
namespace il2cpp
{
namespace icalls
{
namespace mscorlib
{
namespace System
{
namespace Reflection
{
    Il2CppReflectionEvent* EventInfo::internal_from_handle_type(intptr_t handlePtr, intptr_t typePtr)
    {
        Il2CppClass *klass;
 
        IL2CPP_ASSERT(handlePtr);
        ::EventInfo *handle = (::EventInfo*)handlePtr;
        Il2CppType *type = (Il2CppType*)typePtr;
 
        if (!type)
        {
            klass = handle->parent;
        }
        else
        {
            klass = il2cpp_class_from_il2cpp_type(type);
 
            bool found = klass == handle->parent || il2cpp::vm::Class::HasParent(klass, handle->parent);
            if (!found)
                /* Managed code will throw an exception */
                return NULL;
        }
 
        Il2CppReflectionEvent *result = il2cpp::vm::Reflection::GetEventObject(klass, handle);
        return result;
    }
} // namespace Reflection
} // namespace System
} // namespace mscorlib
} // namespace icalls
} // namespace il2cpp