Closed yukieiji closed 1 month ago
Try Il2CppSystem.Collections.Generic.Dictionary<Collider2D, Il2CppReferenceArray<IUsable>>
instead.
@yukieiji did the advice from js6pak resolve your issue?
I have solved the problem, but I don't know how to find out if it is an Il2CppReferenceArray<T>
from the Type
.
Interfaces are reference types.
For example, for Type Il2CppSystem.Collections.Generic.Dictionary<Collider2D, IUsable[]>
, what code should I use?
Try
Il2CppSystem.Collections.Generic.Dictionary<Collider2D, Il2CppReferenceArray<IUsable>>
instead.
How can I dynamically check that an Array is included and replace it with an Il2CppReferenceArray<T>
?
I need to dynamically detect and replace the Array contained in the Type for this function to work.
GPT:
In C#, you can determine if a System.Type represents a value type by using the IsValueType property. This property returns a boolean value indicating whether the type is a value type. Value types include all primitive types (such as int, float, char, etc.), as well as struct types.
When I try to get
NativeClassPtr
of a class likeIl2cppSystem.Collection.Generic.Dictionary<Collider2D, IUsable[]>
(in AmongUs), I get the following error.