Skip to content

Instantly share code, notes, and snippets.

@Arakade
Created July 13, 2014 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Arakade/749a2d43e62dcf8beee2 to your computer and use it in GitHub Desktop.
Save Arakade/749a2d43e62dcf8beee2 to your computer and use it in GitHub Desktop.
Remove type.IsSerializable test which blocks Comparer's Vector3 members showing in AssertionComponent Editor.
.../UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs | 3 ---
1 file changed, 3 deletions(-)
diff --git a/ProjectName/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs b/ProjectName/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs
index c5d19a0..90411fd 100644
--- a/ProjectName/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs
+++ b/ProjectName/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs
@@ -201,9 +201,6 @@ namespace UnityTest
{
foreach (var prop in script.Action.GetType ().GetFields (BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
{
- var type = prop.FieldType;
- if (!type.IsSerializable)
- continue;
var so = new SerializedObject(script.Action);
var sp = so.FindProperty(prop.Name);
if (sp != null)
@Arakade
Copy link
Author

Arakade commented Jul 13, 2014

Removing doesn't seem to have caused any problems so far but, if it did, a method that properly checked Unity serializability could be written by checking both IsSerializable and all of the special cases listed http://docs.unity3d.com/ScriptReference/SerializeField.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment