Reorganized UnityEngine namespace
Reorganized UnityEngine namespace by splitting headers into individual classes
This commit is contained in:
15
lib/public/ClientHelper.h
Normal file
15
lib/public/ClientHelper.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
bool IsSinglePlayer();
|
||||
bool IsOnline();
|
||||
bool IsHost();
|
||||
bool IsLocalPlayer(app::NolanBehaviour* player);
|
||||
bool IsPlayerCrawling();
|
||||
bool IsPlayerCrawling(app::GameObject* go);
|
||||
bool IsInGame();
|
||||
|
||||
app::GameObject* GetAzazel(app::Survival* survival);
|
||||
|
||||
std::string SceneName();
|
||||
float Time_DeltaTime();
|
||||
5
lib/public/UnityEngine/Camera.h
Normal file
5
lib/public/UnityEngine/Camera.h
Normal file
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
struct Camera {
|
||||
static app::Camera* GetMainCamera();
|
||||
};
|
||||
7
lib/public/UnityEngine/Engine.hpp
Normal file
7
lib/public/UnityEngine/Engine.hpp
Normal file
@@ -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"
|
||||
6
lib/public/UnityEngine/GameObject.h
Normal file
6
lib/public/UnityEngine/GameObject.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace GameObject {
|
||||
app::Component* GetComponentByName(app::GameObject* go, const char* type);
|
||||
app::Component__Array* LogComponents(app::GameObject* go);
|
||||
};
|
||||
5
lib/public/UnityEngine/Input.h
Normal file
5
lib/public/UnityEngine/Input.h
Normal file
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
struct Input {
|
||||
static float GetAxis(const char* axisName);
|
||||
};
|
||||
8
lib/public/UnityEngine/Math.h
Normal file
8
lib/public/UnityEngine/Math.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
namespace Math {
|
||||
namespace Vector3 {
|
||||
const char* ToString(app::Vector3* v);
|
||||
const char* ToString(app::Vector3 v);
|
||||
}
|
||||
}
|
||||
37
lib/public/UnityEngine/Object.h
Normal file
37
lib/public/UnityEngine/Object.h
Normal file
@@ -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<typename T>
|
||||
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<app::Type*>(object), nullptr);
|
||||
|
||||
if (!obj_1 || IsNull(obj_1)) return nullptr;
|
||||
|
||||
return reinterpret_cast<T*>(obj_1);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static inline bool Enabled(T* behaviour) {
|
||||
return app::Behaviour_get_enabled((app::Behaviour*)behaviour, nullptr);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static inline void Enabled(T* behaviour, bool value) {
|
||||
app::Behaviour_set_enabled((app::Behaviour*)behaviour, value, nullptr);
|
||||
}
|
||||
};
|
||||
6
lib/public/UnityEngine/Transform.h
Normal file
6
lib/public/UnityEngine/Transform.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace Transform {
|
||||
app::Transform* Get(app::GameObject* go);
|
||||
app::Vector3 Position(app::Transform* transform);
|
||||
}
|
||||
20
lib/public/wrapper.h
Normal file
20
lib/public/wrapper.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
struct Il2CppObject;
|
||||
struct Il2CppImage;
|
||||
|
||||
class Wrapper {
|
||||
public:
|
||||
Wrapper(const char* imageName);
|
||||
Wrapper& find_class(const char* classNamespace, const char* className);
|
||||
void get_fields(const char* classNamespace, const char* className);
|
||||
void method_info(const char* classNamespace, const char* className);
|
||||
void classList();
|
||||
Il2CppObject* get_class();
|
||||
const char* GetImageName();
|
||||
const Il2CppImage* get_image();
|
||||
private:
|
||||
const Il2CppImage* GetImage(const char* image);
|
||||
const Il2CppImage* image;
|
||||
Il2CppObject* obj;
|
||||
};
|
||||
Reference in New Issue
Block a user