Optimize UI code
This commit is contained in:
@@ -122,8 +122,6 @@ namespace FlaxEngine.GUI
|
||||
if (_parent == value)
|
||||
return;
|
||||
|
||||
Defocus();
|
||||
|
||||
Float2 oldParentSize;
|
||||
if (_parent != null)
|
||||
{
|
||||
|
||||
@@ -23,11 +23,11 @@ MMethod* UICanvas_EndPlay = nullptr;
|
||||
MMethod* UICanvas_ParentChanged = nullptr;
|
||||
|
||||
#define UICANVAS_INVOKE(event) \
|
||||
auto instance = GetManagedInstance(); \
|
||||
if (instance) \
|
||||
auto* managed = GetManagedInstance(); \
|
||||
if (managed) \
|
||||
{ \
|
||||
MObject* exception = nullptr; \
|
||||
UICanvas_##event->Invoke(instance, nullptr, &exception); \
|
||||
UICanvas_##event->Invoke(managed, nullptr, &exception); \
|
||||
if (exception) \
|
||||
{ \
|
||||
MException ex(exception); \
|
||||
|
||||
@@ -22,10 +22,11 @@ MMethod* UIControl_BeginPlay = nullptr;
|
||||
MMethod* UIControl_EndPlay = nullptr;
|
||||
|
||||
#define UICONTROL_INVOKE(event) \
|
||||
if (HasManagedInstance()) \
|
||||
auto* managed = GetManagedInstance(); \
|
||||
if (managed) \
|
||||
{ \
|
||||
MObject* exception = nullptr; \
|
||||
UIControl_##event->Invoke(GetManagedInstance(), nullptr, &exception); \
|
||||
UIControl_##event->Invoke(managed, nullptr, &exception); \
|
||||
if (exception) \
|
||||
{ \
|
||||
MException ex(exception); \
|
||||
|
||||
Reference in New Issue
Block a user