- object class removed
+ added some helper functions
This commit is contained in:
Jadis0x
2024-04-13 16:00:43 +03:00
parent ec7b62f51e
commit 9bc7092e5a
5 changed files with 174566 additions and 174580 deletions

19
lib/ClientHelper.cpp Normal file
View File

@@ -0,0 +1,19 @@
#include "pch-il2cpp.h"
#include "ClientHelper.h"
#include <iostream>
bool IsSinglePlayer()
{
return app::BoltNetwork_get_IsSinglePlayer(NULL);
}
bool IsOnline()
{
return not app::BoltNetwork_get_IsSinglePlayer(NULL);
}
bool IsHost()
{
return app::BoltNetwork_get_IsServer(NULL);
}

5
lib/ClientHelper.h Normal file
View File

@@ -0,0 +1,5 @@
#pragma once
bool IsSinglePlayer();
bool IsOnline();
bool IsHost();

View File

@@ -1,22 +0,0 @@
#include "pch-il2cpp.h"
#include "object.h"
#include "helpers.h"
app::GameObject* GameObject::FindWithTag(const char* tag)
{
Il2CppString* newStr = il2cpp_string_new(tag);
app::String* convert_to_appString = reinterpret_cast<app::String*>(newStr);
if (app::GameObject_FindWithTag(convert_to_appString, nullptr)) {
return app::GameObject_FindWithTag(convert_to_appString, nullptr);
}
return nullptr;
}
template<typename T>
inline T* GameObject::GetComponent()
{
return nullptr;
}

View File

@@ -1,16 +0,0 @@
#pragma once
class GameObject {
public:
GameObject() = default;
app::GameObject* FindWithTag(const char* tag);
template<typename T>
T* GetComponent();
private:
app::GameObject* _currentGameObject = nullptr;
};