增加 第一人称镜头、视角锁定镜头 (#9)

* 增加 第一人称镜头、视角锁定镜头

* Follow 摄像机增加平滑 Y 轴模式; 支持 LookAt 偏移
This commit is contained in:
chinosk
2024-06-04 09:12:30 -05:00
committed by GitHub
parent c5fd80daa2
commit 6a7717a45e
10 changed files with 768 additions and 88 deletions

View File

@@ -125,6 +125,9 @@ namespace Il2cppUtils {
return static_cast<Il2CppClassHead*>(*static_cast<void* const*>(std::assume_aligned<alignof(void*)>(instance)));
}
MethodInfo* il2cpp_class_get_method_from_name(void* klass, const char* name, int argsCount) {
return UnityResolve::Invoke<MethodInfo*>("il2cpp_class_get_method_from_name", klass, name, argsCount);
}
void* find_nested_class(void* klass, std::predicate<void*> auto&& predicate)
{
@@ -147,4 +150,15 @@ namespace Il2cppUtils {
});
}
template <typename RType>
auto ClassGetFieldValue(void* obj, UnityResolve::Field* field) -> RType {
return *reinterpret_cast<RType*>(reinterpret_cast<uintptr_t>(obj) + field->offset);
}
template <typename RType>
auto ClassSetFieldValue(void* obj, UnityResolve::Field* field, RType value) -> void {
return *reinterpret_cast<RType*>(reinterpret_cast<uintptr_t>(obj) + field->offset) = value;
}
}