Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constant errors with conditional field #224

Open
AylanJ123 opened this issue Jan 8, 2023 · 0 comments
Open

Constant errors with conditional field #224

AylanJ123 opened this issue Jan 8, 2023 · 0 comments

Comments

@AylanJ123
Copy link

I'm using ConditionalField to hide a SearchableEnum. These are the attributes:

[SerializeField, Tooltip("If true, invokes a callback to get the proper behaviour")]
private bool managedResponse;

[Tooltip("Default behaviour when in contact with laser"), SerializeField, ConditionalField("managedResponse", true), SearchableEnum]
private HitType type;

But every time an object has a managed response (Custom code to decide what to do with the laser) this error pops up. That means that it only happens when the field is being hiden.

ReflectionTypeLoadException: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
System.Reflection.Assembly.GetTypes () (at <695d1cc93cca45069c528c15c9fdd749>:0)
MyBox.Internal.ConditionalFieldAttributeDrawer+<>c.<Initialize>b__7_3 (System.Reflection.Assembly x) (at Assets/t3ampo-mixit/ThirdParty/MyBox-1.7.0/Attributes/ConditionalFieldAttribute.cs:127)
System.Linq.Enumerable+SelectManySingleSelectorIterator`2[TSource,TResult].MoveNext () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable+WhereEnumerableIterator`1[TSource].MoveNext () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
MyBox.Internal.ConditionalFieldAttributeDrawer.<Initialize>g__CacheAllDrawersInDomain|7_0 () (at Assets/t3ampo-mixit/ThirdParty/MyBox-1.7.0/Attributes/ConditionalFieldAttribute.cs:130)
MyBox.Internal.ConditionalFieldAttributeDrawer.Initialize (UnityEditor.SerializedProperty property) (at Assets/t3ampo-mixit/ThirdParty/MyBox-1.7.0/Attributes/ConditionalFieldAttribute.cs:111)
MyBox.Internal.ConditionalFieldAttributeDrawer.GetPropertyHeight (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Assets/t3ampo-mixit/ThirdParty/MyBox-1.7.0/Attributes/ConditionalFieldAttribute.cs:58)
UnityEditor.PropertyDrawer.GetPropertyHeightSafe (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at <2cd7f07c7b884ea9bf02386eb91a464c>:0)
UnityEditor.PropertyHandler.GetHeight (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <2cd7f07c7b884ea9bf02386eb91a464c>:0)
UnityEditor.PropertyHandler.OnGUILayout (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at <2cd7f07c7b884ea9bf02386eb91a464c>:0)
UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at <2cd7f07c7b884ea9bf02386eb91a464c>:0)
UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at <2cd7f07c7b884ea9bf02386eb91a464c>:0)
MyBox.Internal.FoldoutAttributeHandler.Body () (at Assets/t3ampo-mixit/ThirdParty/MyBox-1.7.0/Attributes/FoldoutAttribute.cs:113)
MyBox.Internal.FoldoutAttributeHandler.OnInspectorGUI () (at Assets/t3ampo-mixit/ThirdParty/MyBox-1.7.0/Attributes/FoldoutAttribute.cs:83)
MyBox.Internal.UnityObjectEditor.OnInspectorGUI () (at Assets/t3ampo-mixit/ThirdParty/MyBox-1.7.0/Tools/Internal/UnityObjectEditor.cs:34)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <bf2356d10abb4ac9a31a334d3389ec17>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant