Skip to content

Commit

Permalink
[unity]ExtensionAttribute的初始化也统一放到InitialPuerts
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Jan 14, 2025
1 parent 33cdf6f commit 7bb4273
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ static Il2CppClass *g_typeofTypedValue;
static MethodInfoHelper<Il2CppArray*(Il2CppString*)> g_ExtensionMethodGetHelper;

static Il2CppClass* s_ParamArrayAttribute;
static Il2CppClass* s_ExtensionAttribute;

static bool RegisterType(Il2CppClass* klass);
static bool ClassNotFoundCallback(const void* typeId)
Expand Down Expand Up @@ -395,7 +396,6 @@ static bool IsCCtor(const MethodInfo* method)

static bool IsExtensionMethod(const MethodInfo* method)
{
static Il2CppClass* s_ExtensionAttribute = Class::FromName(il2cpp_defaults.corlib, "System.Runtime.CompilerServices", "ExtensionAttribute");
return Method::HasAttribute(method, s_ExtensionAttribute);
}

Expand Down Expand Up @@ -2728,6 +2728,7 @@ void InitialPuerts(pesapi_func_ptr* func_array)
pesapi_init(func_array);

puerts::s_ParamArrayAttribute = Class::FromName(il2cpp_defaults.corlib, "System", "ParamArrayAttribute");
puerts::s_ExtensionAttribute = Class::FromName(il2cpp_defaults.corlib, "System.Runtime.CompilerServices", "ExtensionAttribute");
}

void AddPendingKillScriptObjects(struct pesapi_ffi* apis, puerts::JsEnvPrivate* jsEnvPrivate, pesapi_value_ref valueRef)
Expand Down

0 comments on commit 7bb4273

Please sign in to comment.