BNM 2.4.0
 
Loading...
Searching...
No Matches
BNM::UnityEngine::Object Struct Reference

UnityEngine.Object implementation. More...

#include <UnityStructures.hpp>

Public Member Functions

bool IsValid () const __attribute__((always_inline))
 Check if object is valid.
 
bool Alive () const __attribute__((always_inline))
 Alias for IsValid()
 
bool Same (void *object) const
 Check if current object is the same with other one.
 
bool Same (Object *object) const
 Check if current object is the same with other one.
 

Public Attributes

BNM_INT_PTR m_CachedPtr = 0
 

Detailed Description

UnityEngine.Object implementation.

Should be used for all objects that inherit UnityEngine.Object.

Member Function Documentation

◆ IsValid()

bool BNM::UnityEngine::Object::IsValid ( ) const
inlinenodiscard

Check if object is valid.

Attention
To check Unity object for null ALWAYS use this method. It checks object pointer and pointer to Unity object. These checks reduces crashes significantly.
Returns
True if object is not null and valid for usage in Unity.

◆ Same() [1/2]

bool BNM::UnityEngine::Object::Same ( Object * object) const
inline

Check if current object is the same with other one.

Parameters
objectComparison object
Returns
True if objects are the same.

◆ Same() [2/2]

bool BNM::UnityEngine::Object::Same ( void * object) const
inline

Check if current object is the same with other one.

Parameters
objectComparison object
Returns
True if objects are the same.