Closed matl4c closed 10 months ago
Create the object, then call Il2Cpp.Object::unbox
to get a Il2Cpp::ValueType
(a struct).
PS: Il2Cpp.Class::alloc
only allocates the instance: its constructor will not be invoked - you need to call it aftwerwards like any other method:
const myInstanceOfInterestingClass = interestingClass.alloc();
myInstanceOfInterestingClass.method(".ctor").invoke(...);
// shorthand to alloc + ctor (but without arguments)
const myInstanceOfInterestingClass = interestingClass.new();
I understand how to create an instance of an existing class...
If the namespace
Some.Namespace
has a struct ofinterestingStruct
, how would I reference and create my own instance of that?