pub struct Il2Cpp { /* private fields */ }Expand description
The game’s Il2Cpp runtime.
Implementations§
Source§impl Il2Cpp
impl Il2Cpp
Sourcepub fn loaded() -> Result<&'static Il2Cpp>
pub fn loaded() -> Result<&'static Il2Cpp>
The runtime of the game binary already loaded in this process.
Sourcepub fn load(path: impl AsRef<Path>) -> Result<&'static Il2Cpp>
pub fn load(path: impl AsRef<Path>) -> Result<&'static Il2Cpp>
Loads a game binary into this process, e.g. to run a game’s code without Unity.
Sourcepub fn get() -> Option<&'static Il2Cpp>
pub fn get() -> Option<&'static Il2Cpp>
The instance set up by Il2Cpp::loaded or Il2Cpp::load.
pub fn api(&self) -> &Api
Sourcepub fn init_standalone(&self, data_dir: impl AsRef<Path>) -> Result<()>
pub fn init_standalone(&self, data_dir: impl AsRef<Path>) -> Result<()>
Starts the runtime without Unity, given the game’s <Game>_Data/il2cpp_data folder.
Only the game’s pure .NET code can run this way; anything calling into Unity will fail.
Sourcepub fn attach_thread(&self)
pub fn attach_thread(&self)
Lets the calling thread run managed code. Needed on threads the game didn’t start.
Sourcepub fn class(
&'static self,
assembly: &str,
namespace: &str,
name: &str,
) -> Result<Class>
pub fn class( &'static self, assembly: &str, namespace: &str, name: &str, ) -> Result<Class>
Finds a class, e.g. class("Assembly-CSharp", "Game.Player", "Health").
Sourcepub fn string(&self, value: &str) -> Result<Il2CppString>
pub fn string(&self, value: &str) -> Result<Il2CppString>
A new managed string.
Sourcepub fn byte_array(&'static self, bytes: &[u8]) -> Result<Object>
pub fn byte_array(&'static self, bytes: &[u8]) -> Result<Object>
A new managed byte[] holding a copy of bytes, e.g. to pass to
Texture2D.LoadRawTextureData.
Sourcepub unsafe fn read_string(&self, string: Object) -> Option<String>
pub unsafe fn read_string(&self, string: Object) -> Option<String>
Sourcepub fn assemblies(&'static self) -> Vec<Image>
pub fn assemblies(&'static self) -> Vec<Image>
Every assembly loaded in the current domain.
Sourcepub unsafe fn exception_message(&self, exception: Ptr) -> String
pub unsafe fn exception_message(&self, exception: Ptr) -> String
Extracts a human-readable message from a managed exception object by
calling its ToString() method. Falls back to the class name if
ToString() fails.
§Safety
exception must be a non-null, live managed exception object.