Skip to content

Pleas some one Pull it. #53

Description

@SuriMax2

The .hpp is missing important stuff that maybe help on some context.

`class ObjectOverride {
public:

static II::Object* BoxBool(bool value) {
	auto* pClass = I::Invoke<void*>("mono_get_boolean_class");
	auto* boxed = I::Invoke<II::Object*>("mono_value_box", UnityResolve::get_pDomain(), pClass, &value);
	return reinterpret_cast<II::Object*>(boxed);
}`

static II::Object* BoxByte(BYTE value) {
	auto* pClass = I::Invoke<void*>("mono_get_byte_class");
	auto* boxed = I::Invoke<II::Object*>("mono_value_box", UnityResolve::get_pDomain(), pClass, &value);
	return reinterpret_cast<II::Object*>(boxed);
}

static II::Object* BoxInt(int value) {
	auto* pClass = I::Invoke<void*>("mono_get_int32_class");
	auto* boxed = I::Invoke<II::Object*>("mono_value_box", UnityResolve::get_pDomain(), pClass, &value);
	return reinterpret_cast<II::Object*>(boxed);
}

static II::Object* BoxFloat(float value) {
	auto* pClass = I::Invoke<void*>("mono_get_single_class");
	auto* boxed = I::Invoke<II::Object*>("mono_value_box", UnityResolve::get_pDomain(), pClass, &value);
	return reinterpret_cast<II::Object*>(boxed);
}

static II::Object* BoxDouble(double value) {
	auto* pClass = I::Invoke<void*>("mono_get_double_class");
	auto* boxed = I::Invoke<II::Object*>("mono_value_box", UnityResolve::get_pDomain(), pClass, &value);
	return reinterpret_cast<II::Object*>(boxed);
}

static II::Object* BoxUIntptr_t(uintptr_t value) {
	auto* pClass = I::Invoke<void*>("mono_get_uintptr_class");
	auto* boxed = I::Invoke<II::Object*>("mono_value_box", UnityResolve::get_pDomain(), pClass, &value);
	return reinterpret_cast<II::Object*>(boxed);
}

template <typename T>
static T UnBox(II::Object* obj) {
	void* p = I::Invoke<void*>("mono_object_unbox", obj);
	return *reinterpret_cast<T*>(p);
}

};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions