diff --git a/IL2CppDLL.vcxproj b/IL2CppDLL.vcxproj index 359e13e..fa26749 100644 --- a/IL2CppDLL.vcxproj +++ b/IL2CppDLL.vcxproj @@ -50,9 +50,14 @@ - - - + + + + + + + + @@ -93,9 +98,15 @@ - - - + + + + + + + + + @@ -226,7 +237,7 @@ Use pch-il2cpp.h true - $(ProjectDir)appdata;$(ProjectDir)framework;$(ProjectDir)user;$(ProjectDir)lib + $(ProjectDir)appdata;$(ProjectDir)framework;$(ProjectDir)user;$(ProjectDir)lib\public; Windows diff --git a/IL2CppDLL.vcxproj.filters b/IL2CppDLL.vcxproj.filters index 218659f..b5db620 100644 --- a/IL2CppDLL.vcxproj.filters +++ b/IL2CppDLL.vcxproj.filters @@ -16,9 +16,6 @@ framework - - lib - include\imgui @@ -64,18 +61,12 @@ user\settings - - lib - user\utils user\features\misc - - lib - user\players @@ -85,6 +76,30 @@ user\network + + lib\private + + + lib\private + + + lib\private\UnityEngine + + + lib\private\UnityEngine + + + lib\private\UnityEngine + + + lib\private\UnityEngine + + + lib\private\UnityEngine + + + lib\private\UnityEngine + @@ -120,9 +135,6 @@ framework - - lib - include\imgui @@ -183,9 +195,6 @@ user\settings - - lib - user\utils @@ -195,9 +204,6 @@ include - - lib - user\players @@ -210,6 +216,33 @@ include + + lib\public + + + lib\public + + + lib\public\UnityEngine + + + lib\public\UnityEngine + + + lib\public\UnityEngine + + + lib\public\UnityEngine + + + lib\public\UnityEngine + + + lib\public\UnityEngine + + + lib\public\UnityEngine + @@ -257,5 +290,17 @@ {faef4024-c359-4051-90fc-8735a4acbe8f} + + {22144ae2-ce2d-48f4-ac56-0cefde863748} + + + {b83e2b95-1a9b-4065-8f3b-750d80fa32da} + + + {a4d2670d-9928-419c-ab6d-12fd69137e9f} + + + {289d934d-1844-4207-b865-47a910a88c81} + \ No newline at end of file diff --git a/lib/UnityEngine.cpp b/lib/UnityEngine.cpp deleted file mode 100644 index 4de7cf2..0000000 --- a/lib/UnityEngine.cpp +++ /dev/null @@ -1,81 +0,0 @@ -#include "pch-il2cpp.h" - -#include "UnityEngine.h" -#include - -app::Component* UnityEngine::GameObject::GetComponentByName(app::GameObject* go, const char* type) -{ - app::Component* component = app::GameObject_GetComponentByName(go, ConvertToSystemString(type), nullptr); - - return component ? component : nullptr; -} - -app::Component__Array* UnityEngine::GameObject::LogComponents(app::GameObject* go) -{ - Wrapper obj("UnityEngine.CoreModule.dll"); - - Il2CppObject* object = obj.find_class("UnityEngine", "Component").get_class(); - - if (!object) return nullptr; - - app::Type* type = reinterpret_cast(object); - if (!type) return nullptr; - - app::Component__Array* __components = app::GameObject_GetComponents(go, type, nullptr); - - return __components ? __components : nullptr; -} - -const char* UnityEngine::Math::Vector3::ToString(app::Vector3* v) -{ - app::String* str = app::Vector3_ToString(v, nullptr); - - return str ? il2cppi_to_string(str).c_str() : "Vector::ToString returned nullptr!\n"; -} - -const char* UnityEngine::Math::Vector3::ToString(app::Vector3 v) -{ - return ("x: " + std::to_string(v.x) + " y: " + std::to_string(v.y) + " z: " + std::to_string(v.z)).c_str(); -} - -app::Transform* UnityEngine::Transform::Get(app::GameObject* go) -{ - if (!go || !app::GameObject_get_transform) return nullptr; - - app::Transform* __transform = app::GameObject_get_transform(go, nullptr); - - return __transform ? __transform : nullptr; -} - -app::Vector3 UnityEngine::Transform::Position(app::Transform* transform) -{ - if (!transform || !app::Transform_get_position) return app::Vector3(); - - return app::Transform_get_position(transform, nullptr); -} - -app::Camera* UnityEngine::Camera::GetMainCamera() { - return app::Camera_get_main(nullptr) ? app::Camera_get_main(nullptr) : nullptr; -} - -const char* UnityEngine::Object::GetObjectName(app::Object_1* obj) -{ - static std::string name = il2cppi_to_string(app::Object_1_GetName(obj, nullptr)); - return name.c_str(); -} - -app::GameObject__Array* UnityEngine::Object::FindGameObjectsWithTag(const char* tag) -{ - app::GameObject__Array* go_array_result = app::GameObject_FindGameObjectsWithTag(ConvertToSystemString(tag), nullptr); - - return go_array_result ? go_array_result : nullptr; -} - -void UnityEngine::Object::FindObjectFromInstanceID(int32_t instanceID) -{ -} - -float UnityEngine::Input::GetAxis(const char* axisName) -{ - return app::Input_1_GetAxis(ConvertToSystemString(axisName), nullptr); -} diff --git a/lib/UnityEngine.h b/lib/UnityEngine.h deleted file mode 100644 index 9bebf03..0000000 --- a/lib/UnityEngine.h +++ /dev/null @@ -1,72 +0,0 @@ -#pragma once - -#include "Wrapper.h" -#include "helpers.h" -#include "ClientHelper.h" - -namespace UnityEngine { - namespace GameObject { - app::Component* GetComponentByName(app::GameObject* go, const char* type); - app::Component__Array* LogComponents(app::GameObject* go); - } - - namespace Math { - namespace Vector3 { - const char* ToString(app::Vector3* v); - const char* ToString(app::Vector3 v); - } - } - - namespace Transform { - app::Transform* Get(app::GameObject* go); - app::Vector3 Position(app::Transform* transform); - } - - struct Input { - static float GetAxis(const char* axisName); - }; - - struct Behaviour { - template - static inline bool Enabled(T* behaviour) { - return app::Behaviour_get_enabled((app::Behaviour*)behaviour, nullptr); - } - - template - static inline void Enabled(T* behaviour, bool value) { - app::Behaviour_set_enabled((app::Behaviour*)behaviour, value, nullptr); - } - }; - - struct Camera { - static app::Camera* GetMainCamera(); - }; - - struct Object { - - static const char* GetObjectName(app::Object_1* obj); - - static app::GameObject__Array* FindGameObjectsWithTag(const char* tag); - - // Object_1_FindObjectFromInstanceID - static void FindObjectFromInstanceID(int32_t instanceID); - - template - static inline T* FindObjectOfType(const char* className, const char* classNamespace = "", const char* assemblyName = "Assembly-CSharp.dll") { - - Wrapper obj(assemblyName); - - Il2CppObject* object = obj.find_class(classNamespace, className).get_class(); - - if (!object || !app::Object_1_FindObjectOfType) return nullptr; - - app::Object_1* obj_1 = app::Object_1_FindObjectOfType(reinterpret_cast(object), nullptr); - - if (!obj_1 || IsNull(obj_1)) return nullptr; - - return reinterpret_cast(obj_1); - } - - }; - -} \ No newline at end of file diff --git a/lib/ClientHelper.cpp b/lib/private/ClientHelper.cpp similarity index 68% rename from lib/ClientHelper.cpp rename to lib/private/ClientHelper.cpp index 348a73b..a2c0db9 100644 --- a/lib/ClientHelper.cpp +++ b/lib/private/ClientHelper.cpp @@ -4,7 +4,7 @@ #include "ClientHelper.h" #include "players/players.h" -#include "UnityEngine.h" +#include "UnityEngine/Engine.hpp" bool IsSinglePlayer() { @@ -43,27 +43,23 @@ bool IsPlayerCrawling() bool IsPlayerCrawling(app::GameObject* go) { - if (go == NULL) + if (go == nullptr) return false; + + app::Component* nbComponent = GameObject::GetComponentByName(go, "NolanBehaviour"); + + if (nbComponent) return false; + + app::NolanBehaviour* nb = reinterpret_cast(nbComponent); + + if (nb) + return app::NolanBehaviour_IsCrawling(nb, nullptr); + else return false; - - if (app::GameObject_GetComponentByName != NULL) { - app::Component* nbComponent = app::GameObject_GetComponentByName(go, ConvertToSystemString("NolanBehaviour"), nullptr); - - if (nbComponent) { - app::NolanBehaviour* nb = reinterpret_cast(nbComponent); - - if (nb) { - return app::NolanBehaviour_IsCrawling(nb, nullptr); - } - } - } - - return app::NolanBehaviour_IsCrawling(Player::GetNolan(), nullptr); } bool IsInGame() { - app::OptionsHelpers* optionsHelpers = UnityEngine::Object::FindObjectOfType("OptionsHelpers"); + app::OptionsHelpers* optionsHelpers = Object::FindObjectOfType("OptionsHelpers"); if (optionsHelpers) return optionsHelpers->fields._inGame_k__BackingField; @@ -71,14 +67,6 @@ bool IsInGame() return false; } -bool IsNull(app::Object_1* obj) -{ - if (obj == nullptr) - return true; - - return !app::Object_1_op_Implicit(obj, nullptr); -} - app::GameObject* GetAzazel(app::Survival* survival) { app::GameObject* ai = app::Survival_GetAzazel(survival, nullptr); diff --git a/lib/private/UnityEngine/Camera.cpp b/lib/private/UnityEngine/Camera.cpp new file mode 100644 index 0000000..32071c3 --- /dev/null +++ b/lib/private/UnityEngine/Camera.cpp @@ -0,0 +1,8 @@ +#include "pch-il2cpp.h" + +#include "UnityEngine/Camera.h" + +app::Camera* Camera::GetMainCamera() +{ + return app::Camera_get_main(nullptr) ? app::Camera_get_main(nullptr) : nullptr; +} diff --git a/lib/private/UnityEngine/GameObject.cpp b/lib/private/UnityEngine/GameObject.cpp new file mode 100644 index 0000000..f1fec1a --- /dev/null +++ b/lib/private/UnityEngine/GameObject.cpp @@ -0,0 +1,29 @@ +#include "pch-il2cpp.h" + +#include "UnityEngine/GameObject.h" + +#include "wrapper.h" +#include + +app::Component* GameObject::GetComponentByName(app::GameObject* go, const char* type) +{ + app::Component* component = app::GameObject_GetComponentByName(go, ConvertToSystemString(type), nullptr); + + return component ? component : nullptr; +} + +app::Component__Array* GameObject::LogComponents(app::GameObject* go) +{ + Wrapper obj("UnityEngine.CoreModule.dll"); + + Il2CppObject* object = obj.find_class("UnityEngine", "Component").get_class(); + + if (!object) return nullptr; + + app::Type* type = reinterpret_cast(object); + if (!type) return nullptr; + + app::Component__Array* __components = app::GameObject_GetComponents(go, type, nullptr); + + return __components ? __components : nullptr; +} diff --git a/lib/private/UnityEngine/Input.cpp b/lib/private/UnityEngine/Input.cpp new file mode 100644 index 0000000..96e128e --- /dev/null +++ b/lib/private/UnityEngine/Input.cpp @@ -0,0 +1,9 @@ +#include "pch-il2cpp.h" + +#include "UnityEngine/Input.h" +#include + +float Input::GetAxis(const char* axisName) +{ + return app::Input_1_GetAxis(ConvertToSystemString(axisName), nullptr); +} diff --git a/lib/private/UnityEngine/Math.cpp b/lib/private/UnityEngine/Math.cpp new file mode 100644 index 0000000..0047d1c --- /dev/null +++ b/lib/private/UnityEngine/Math.cpp @@ -0,0 +1,16 @@ +#include "pch-il2cpp.h" + +#include "UnityEngine/Math.h" +#include + +const char* Math::Vector3::ToString(app::Vector3* v) +{ + app::String* str = app::Vector3_ToString(v, nullptr); + + return str ? il2cppi_to_string(str).c_str() : "Vector::ToString returned nullptr!\n"; +} + +const char* Math::Vector3::ToString(app::Vector3 v) +{ + return ("x: " + std::to_string(v.x) + " y: " + std::to_string(v.y) + " z: " + std::to_string(v.z)).c_str(); +} diff --git a/lib/private/UnityEngine/Object.cpp b/lib/private/UnityEngine/Object.cpp new file mode 100644 index 0000000..9cb93ee --- /dev/null +++ b/lib/private/UnityEngine/Object.cpp @@ -0,0 +1,30 @@ +#include "pch-il2cpp.h" + +#include "UnityEngine/Object.h" +#include +#include + +const char* Object::GetObjectName(app::Object_1* obj) +{ + static std::string name = il2cppi_to_string(app::Object_1_GetName(obj, nullptr)); + return name.c_str(); +} + +app::GameObject__Array* Object::FindGameObjectsWithTag(const char* tag) +{ + app::GameObject__Array* go_array_result = app::GameObject_FindGameObjectsWithTag(ConvertToSystemString(tag), nullptr); + + return go_array_result ? go_array_result : nullptr; +} + +void Object::FindObjectFromInstanceID(int32_t instanceID) +{ +} + +bool Object::IsNull(app::Object_1* obj) +{ + if (obj == nullptr) + return true; + + return !app::Object_1_op_Implicit(obj, nullptr); +} diff --git a/lib/private/UnityEngine/Transform.cpp b/lib/private/UnityEngine/Transform.cpp new file mode 100644 index 0000000..ae10a07 --- /dev/null +++ b/lib/private/UnityEngine/Transform.cpp @@ -0,0 +1,19 @@ +#include "pch-il2cpp.h" + +#include "UnityEngine/Transform.h" + +app::Transform* Transform::Get(app::GameObject* go) +{ + if (!go || !app::GameObject_get_transform) return nullptr; + + app::Transform* __transform = app::GameObject_get_transform(go, nullptr); + + return __transform ? __transform : nullptr; +} + +app::Vector3 Transform::Position(app::Transform* transform) +{ + if (!transform || !app::Transform_get_position) return app::Vector3(); + + return app::Transform_get_position(transform, nullptr); +} diff --git a/lib/wrapper.cpp b/lib/private/wrapper.cpp similarity index 100% rename from lib/wrapper.cpp rename to lib/private/wrapper.cpp diff --git a/lib/ClientHelper.h b/lib/public/ClientHelper.h similarity index 90% rename from lib/ClientHelper.h rename to lib/public/ClientHelper.h index c417a92..653c061 100644 --- a/lib/ClientHelper.h +++ b/lib/public/ClientHelper.h @@ -8,7 +8,6 @@ bool IsLocalPlayer(app::NolanBehaviour* player); bool IsPlayerCrawling(); bool IsPlayerCrawling(app::GameObject* go); bool IsInGame(); -bool IsNull(app::Object_1* obj); app::GameObject* GetAzazel(app::Survival* survival); diff --git a/lib/public/UnityEngine/Camera.h b/lib/public/UnityEngine/Camera.h new file mode 100644 index 0000000..ba518f5 --- /dev/null +++ b/lib/public/UnityEngine/Camera.h @@ -0,0 +1,5 @@ +#pragma once + +struct Camera { + static app::Camera* GetMainCamera(); +}; \ No newline at end of file diff --git a/lib/public/UnityEngine/Engine.hpp b/lib/public/UnityEngine/Engine.hpp new file mode 100644 index 0000000..1c34637 --- /dev/null +++ b/lib/public/UnityEngine/Engine.hpp @@ -0,0 +1,7 @@ +#pragma once + +#include "UnityEngine/Camera.h" +#include "UnityEngine/GameObject.h" +#include "UnityEngine/Input.h" +#include "UnityEngine/Object.h" +#include "UnityEngine/Transform.h" diff --git a/lib/public/UnityEngine/GameObject.h b/lib/public/UnityEngine/GameObject.h new file mode 100644 index 0000000..86de56f --- /dev/null +++ b/lib/public/UnityEngine/GameObject.h @@ -0,0 +1,6 @@ +#pragma once + +namespace GameObject { + app::Component* GetComponentByName(app::GameObject* go, const char* type); + app::Component__Array* LogComponents(app::GameObject* go); +}; \ No newline at end of file diff --git a/lib/public/UnityEngine/Input.h b/lib/public/UnityEngine/Input.h new file mode 100644 index 0000000..ba5d956 --- /dev/null +++ b/lib/public/UnityEngine/Input.h @@ -0,0 +1,5 @@ +#pragma once + +struct Input { + static float GetAxis(const char* axisName); +}; \ No newline at end of file diff --git a/lib/public/UnityEngine/Math.h b/lib/public/UnityEngine/Math.h new file mode 100644 index 0000000..db90cea --- /dev/null +++ b/lib/public/UnityEngine/Math.h @@ -0,0 +1,8 @@ +#pragma once + +namespace Math { + namespace Vector3 { + const char* ToString(app::Vector3* v); + const char* ToString(app::Vector3 v); + } +} \ No newline at end of file diff --git a/lib/public/UnityEngine/Object.h b/lib/public/UnityEngine/Object.h new file mode 100644 index 0000000..b42daa5 --- /dev/null +++ b/lib/public/UnityEngine/Object.h @@ -0,0 +1,37 @@ +#pragma once + +#include "wrapper.h" + +struct Object { + static const char* GetObjectName(app::Object_1* obj); + static app::GameObject__Array* FindGameObjectsWithTag(const char* tag); + static void FindObjectFromInstanceID(int32_t instanceID); + + static bool IsNull(app::Object_1* obj); + + template + static inline T* FindObjectOfType(const char* className, const char* classNamespace = "", const char* assemblyName = "Assembly-CSharp.dll") { + + Wrapper obj(assemblyName); + + Il2CppObject* object = obj.find_class(classNamespace, className).get_class(); + + if (!object || !app::Object_1_FindObjectOfType) return nullptr; + + app::Object_1* obj_1 = app::Object_1_FindObjectOfType(reinterpret_cast(object), nullptr); + + if (!obj_1 || IsNull(obj_1)) return nullptr; + + return reinterpret_cast(obj_1); + } + + template + static inline bool Enabled(T* behaviour) { + return app::Behaviour_get_enabled((app::Behaviour*)behaviour, nullptr); + } + + template + static inline void Enabled(T* behaviour, bool value) { + app::Behaviour_set_enabled((app::Behaviour*)behaviour, value, nullptr); + } +}; \ No newline at end of file diff --git a/lib/public/UnityEngine/Transform.h b/lib/public/UnityEngine/Transform.h new file mode 100644 index 0000000..0f4b33f --- /dev/null +++ b/lib/public/UnityEngine/Transform.h @@ -0,0 +1,6 @@ +#pragma once + +namespace Transform { + app::Transform* Get(app::GameObject* go); + app::Vector3 Position(app::Transform* transform); +} \ No newline at end of file diff --git a/lib/wrapper.h b/lib/public/wrapper.h similarity index 100% rename from lib/wrapper.h rename to lib/public/wrapper.h diff --git a/user/features/esp/esp.cpp b/user/features/esp/esp.cpp index c01232d..d6fc615 100644 --- a/user/features/esp/esp.cpp +++ b/user/features/esp/esp.cpp @@ -2,7 +2,7 @@ #include #include "ClientHelper.h" -#include "UnityEngine.h" +#include "UnityEngine/Engine.hpp" #include "players/players.h" #include "helpers.h" #include "esp.hpp" @@ -31,11 +31,11 @@ static void DrawBoxESP(app::GameObject *it, float footOffset, float headOffset, if (!it || cam == nullptr) return; - app::Transform* _transform = UnityEngine::Transform::Get(it); + app::Transform* _transform = Transform::Get(it); if (_transform == nullptr) return; - app::Vector3 pos = UnityEngine::Transform::Position(_transform); + app::Vector3 pos = Transform::Position(_transform); app::Vector3 footpos = app::Camera_WorldToScreenPoint_1(cam, app::Vector3{pos.x, pos.y + footOffset, pos.z}, NULL); app::Vector3 headpos = app::Camera_WorldToScreenPoint_1(cam, app::Vector3{pos.x, pos.y + headOffset, pos.z}, NULL); diff --git a/user/features/misc/misc.cpp b/user/features/misc/misc.cpp index 209d76a..c3d69f9 100644 --- a/user/features/misc/misc.cpp +++ b/user/features/misc/misc.cpp @@ -5,7 +5,7 @@ #include "ClientHelper.h" #include "players/players.h" #include "helpers.h" -#include "UnityEngine.h" +#include "UnityEngine/Engine.hpp" #include #include "Windows.h" #include @@ -16,7 +16,7 @@ void Misc::ForceStart() std::string _scene = SceneName(); if (IsHost() && _scene == std::string("Menu")) { - app::Menu* _menu = UnityEngine::Object::FindObjectOfType("Menu", "Horror"); + app::Menu* _menu = Object::FindObjectOfType("Menu", "Horror"); if (_menu) { if (app::Menu_OnLobbyStartButtonClick) { @@ -99,7 +99,7 @@ void Misc::InstantWin() int32_t progress = 10; if (_scene == std::string("Inn")) { - app::MapController* _MapController = UnityEngine::Object::FindObjectOfType("MapController"); + app::MapController* _MapController = Object::FindObjectOfType("MapController"); if (_MapController) { @@ -111,7 +111,7 @@ void Misc::InstantWin() } } else if (_scene == std::string("Slaughterhouse")) { - app::SlaughterhouseAltarController* _SlaughterhouseAltarController = UnityEngine::Object::FindObjectOfType("SlaughterhouseAltarController"); + app::SlaughterhouseAltarController* _SlaughterhouseAltarController = Object::FindObjectOfType("SlaughterhouseAltarController"); if (_SlaughterhouseAltarController) { @@ -124,7 +124,7 @@ void Misc::InstantWin() } else { //app::SurvivalObjectBurnController* _SurvivalObjectBurnController = UnityEngine::Object::FindObjectOfType("SurvivalObjectBurnController"); - app::SurvivalObjectBurnController* _SurvivalObjectBurnController = UnityEngine::Object::FindObjectOfType("SurvivalObjectBurnController"); + app::SurvivalObjectBurnController* _SurvivalObjectBurnController = Object::FindObjectOfType("SurvivalObjectBurnController"); if (_SurvivalObjectBurnController) { // DO_APP_FUNC(0x00562590, void, SurvivalObjectBurnController_SkipToGoat, (SurvivalObjectBurnController * __this, int32_t number, MethodInfo * method)); @@ -174,10 +174,10 @@ void Misc::SpawnPrefab(const char* prefabName) { if (localPlayer) { app::Quaternion rotation = app::Quaternion_get_identity(NULL); - app::Transform* playerTransform = UnityEngine::Transform::Get(localPlayer); + app::Transform* playerTransform = Transform::Get(localPlayer); if (playerTransform == nullptr) return; - app::Vector3 playerPos = UnityEngine::Transform::Position(playerTransform); + app::Vector3 playerPos = Transform::Position(playerTransform); if (app::BoltNetwork_Instantiate_6) { app::GameObject* go = (app::GameObject*)app::BoltNetwork_Instantiate_6(p, playerPos, rotation, nullptr); @@ -194,7 +194,7 @@ void Misc::RankSpoofer(int value) { return; } else { - app::NolanRankController* rankController = UnityEngine::Object::FindObjectOfType("NolanRankController"); + app::NolanRankController* rankController = Object::FindObjectOfType("NolanRankController"); if (rankController != nullptr) { if (app::NolanRankController_SetRank != nullptr) { @@ -227,7 +227,7 @@ void Misc::Revive(bool self) } // app::SurvivalReviveInteractable - app::SurvivalReviveInteractable* revive = UnityEngine::Object::FindObjectOfType("SurvivalReviveInteractable"); + app::SurvivalReviveInteractable* revive = Object::FindObjectOfType("SurvivalReviveInteractable"); if (revive == NULL) { if (self) { @@ -288,10 +288,10 @@ void Misc::Jumpscare() { return; } - app::Survival* survival = UnityEngine::Object::FindObjectOfType("Survival"); + app::Survival* survival = Object::FindObjectOfType("Survival"); if (survival == NULL) { return; } - app::SurvivalAzazelBehaviour* azazel = UnityEngine::Object::FindObjectOfType("SurvivalAzazelBehaviour"); + app::SurvivalAzazelBehaviour* azazel = Object::FindObjectOfType("SurvivalAzazelBehaviour"); app::GameObject* ai = GetAzazel(survival); @@ -305,7 +305,7 @@ void Misc::Jumpscare() { if (currentPlayer == NULL) continue; - app::Component* component = UnityEngine::GameObject::GetComponentByName(currentPlayer, "NolanBehaviour"); + app::Component* component = GameObject::GetComponentByName(currentPlayer, "NolanBehaviour"); if (component != NULL) { app::NolanBehaviour* nb = reinterpret_cast(component); @@ -333,10 +333,10 @@ void Misc::Kill(bool self) { return; } - app::Survival* survival = UnityEngine::Object::FindObjectOfType("Survival"); + app::Survival* survival = Object::FindObjectOfType("Survival"); if (survival == NULL) { return; } - app::SurvivalAzazelBehaviour* azazel = UnityEngine::Object::FindObjectOfType("SurvivalAzazelBehaviour"); + app::SurvivalAzazelBehaviour* azazel = Object::FindObjectOfType("SurvivalAzazelBehaviour"); app::GameObject* ai = GetAzazel(survival); @@ -361,7 +361,7 @@ void Misc::Kill(bool self) { if (currentPlayer == NULL) continue; - app::Component* component = UnityEngine::GameObject::GetComponentByName(currentPlayer, "NolanBehaviour"); + app::Component* component = GameObject::GetComponentByName(currentPlayer, "NolanBehaviour"); if (component != NULL) { app::NolanBehaviour* nb = reinterpret_cast(component); @@ -396,7 +396,7 @@ void Misc::TpToAzazel() if (nb == nullptr) return; - app::Survival* _survival = UnityEngine::Object::FindObjectOfType("Survival"); + app::Survival* _survival = Object::FindObjectOfType("Survival"); if (_survival == nullptr) return; // get azazel diff --git a/user/hooks/hooks.cpp b/user/hooks/hooks.cpp index 28a36bc..fa4529d 100644 --- a/user/hooks/hooks.cpp +++ b/user/hooks/hooks.cpp @@ -10,7 +10,7 @@ #include "helpers.h" #include "players/players.h" -#include "UnityEngine.h" +#include "UnityEngine/Engine.hpp" #include "ClientHelper.h" #include "features/misc/misc.h" @@ -92,7 +92,7 @@ void __stdcall hNolanBehaviour_Update(app::NolanBehaviour* __this, MethodInfo* m if (transform) { - app::Vector3 pos = UnityEngine::Transform::Position(transform); + app::Vector3 pos = Transform::Position(transform); if (GetAsyncKeyState('W') & 0x8000) { pos = pos + (app::Transform_get_forward(transform, nullptr) * speed * Time_DeltaTime()); @@ -116,10 +116,10 @@ void __stdcall hNolanBehaviour_Update(app::NolanBehaviour* __this, MethodInfo* m app::GameObject* thisGameObject = app::Component_get_gameObject((app::Component*)__this, nullptr); - if (thisGameObject != nullptr || !IsNull((app::Object_1*)thisGameObject)) { - app::Component* _UltimateCharacterLocomotion = UnityEngine::GameObject::GetComponentByName(thisGameObject, "UltimateCharacterLocomotion"); + if (thisGameObject != nullptr || !Object::IsNull((app::Object_1*)thisGameObject)) { + app::Component* _UltimateCharacterLocomotion = GameObject::GetComponentByName(thisGameObject, "UltimateCharacterLocomotion"); - if (_UltimateCharacterLocomotion != nullptr && !IsNull((app::Object_1*)_UltimateCharacterLocomotion)) { + if (_UltimateCharacterLocomotion != nullptr && !Object::IsNull((app::Object_1*)_UltimateCharacterLocomotion)) { if (app::UltimateCharacterLocomotion_SetPosition_1) { app::UltimateCharacterLocomotion_SetPosition_1((app::UltimateCharacterLocomotion*)_UltimateCharacterLocomotion, pos, false, nullptr); } diff --git a/user/main.cpp b/user/main.cpp index a2439ce..8c5da4c 100644 --- a/user/main.cpp +++ b/user/main.cpp @@ -15,7 +15,7 @@ #include "Wrapper.h" #include "ClientHelper.h" #include "hooks/hooks.hpp" -#include "UnityEngine.h" +#include "UnityEngine/Engine.hpp" #include "color.hpp" #include "features/misc/misc.h" #include "utils/utils.hpp" @@ -127,7 +127,7 @@ void Run() std::string scene = SceneName(); if (scene == std::string("Menu")) { - app::Menu* horrorMenu = UnityEngine::Object::FindObjectOfType("Menu", "Horror"); + app::Menu* horrorMenu = Object::FindObjectOfType("Menu", "Horror"); if (!horrorMenu) return; diff --git a/user/players/players.cpp b/user/players/players.cpp index dc605f3..3337ccd 100644 --- a/user/players/players.cpp +++ b/user/players/players.cpp @@ -2,12 +2,12 @@ #include "players.h" #include -#include "UnityEngine.h" +#include "UnityEngine/Engine.hpp" #include "ClientHelper.h" app::GameObject__Array* Players::GetAllPlayers() { - app::GameObject__Array* players = UnityEngine::Object::FindGameObjectsWithTag("Player"); + app::GameObject__Array* players = Object::FindGameObjectsWithTag("Player"); return players ? players : nullptr; } @@ -18,7 +18,7 @@ app::GameObject* Player::GetLocalPlayer() if (cachedLocalPlayer != nullptr) { // Check if cached player is still valid - if (IsNull((app::Object_1*)cachedLocalPlayer)) { + if (Object::IsNull((app::Object_1*)cachedLocalPlayer)) { cachedLocalPlayer = nullptr; } else { @@ -35,11 +35,11 @@ app::GameObject* Player::GetLocalPlayer() for (int i = 0; i < _size; i++) { app::GameObject* currentPlayer = playerList->vector[i]; - if (IsNull((app::Object_1*)currentPlayer)) { + if (Object::IsNull((app::Object_1*)currentPlayer)) { continue; } else { - app::Component* nbComponent = UnityEngine::GameObject::GetComponentByName(currentPlayer, "NolanBehaviour"); + app::Component* nbComponent = GameObject::GetComponentByName(currentPlayer, "NolanBehaviour"); if (nbComponent) { app::NolanBehaviour* nb = reinterpret_cast(nbComponent); @@ -64,7 +64,7 @@ app::NolanBehaviour* Player::GetNolan() if (lastLocalPlayer != localPlayer) { - app::Component* nbComponent = UnityEngine::GameObject::GetComponentByName(localPlayer, "NolanBehaviour"); + app::Component* nbComponent = GameObject::GetComponentByName(localPlayer, "NolanBehaviour"); if (nbComponent) {