From 176f95fbbc569fe75133cf1a181c22b5caf3087f Mon Sep 17 00:00:00 2001
From: Ruan Lucas <79365912+RuanLucasGD@users.noreply.github.com>
Date: Sun, 30 Apr 2023 14:25:41 -0400
Subject: [PATCH] move == operator from Actor class to Object class
---
Source/Engine/Level/Actor.cs | 22 ----------------------
Source/Engine/Scripting/Object.cs | 24 ++++++++++++++++++++++++
2 files changed, 24 insertions(+), 22 deletions(-)
diff --git a/Source/Engine/Level/Actor.cs b/Source/Engine/Level/Actor.cs
index 7ff6622b3..bd005d415 100644
--- a/Source/Engine/Level/Actor.cs
+++ b/Source/Engine/Level/Actor.cs
@@ -357,27 +357,5 @@ namespace FlaxEngine
{
return $"{Name} ({GetType().Name})";
}
-
- ///
- /// Check if Actors are equals
- ///
- ///
- ///
- ///
- public static bool operator ==(Actor left, Actor right)
- {
- return Object.Equals(left, right);
- }
-
- ///
- /// Check if Actors aren't equals
- ///
- ///
- ///
- ///
- public static bool operator !=(Actor left, Actor right)
- {
- return !Object.Equals(left, right);
- }
}
}
diff --git a/Source/Engine/Scripting/Object.cs b/Source/Engine/Scripting/Object.cs
index 227fe99e6..e895b8199 100644
--- a/Source/Engine/Scripting/Object.cs
+++ b/Source/Engine/Scripting/Object.cs
@@ -205,6 +205,30 @@ namespace FlaxEngine
return obj != null && obj.__unmanagedPtr != IntPtr.Zero;
}
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool operator == (Object left, Object right)
+ {
+ return Object.Equals(left, right);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool operator !=(Object left, Object right)
+ {
+ return !Object.Equals(left, right);
+ }
+
///
/// Gets the pointer to the native object. Handles null object reference (returns zero).
///