- changed status to resolved
ShowIf string comparison not working in 2.0.0 as it was in Odin 1.0.6
Issue #389
resolved
The ShowIf attribute seems to not work if comparing strings. Using Unity 5.6.6f2
This was working in 1.0.6.x but seems to not work in 2.0.0.0
Recreation:
- Fresh project in Unity 5.6.6f2
- Import Odin 2.0.0.0 from the Asset Store
- Create C# script "OdinTest"
using Sirenix.OdinInspector;
using UnityEngine;
public class OdinTest : MonoBehaviour
{
private string comparisonString = "this is the value";
[ShowIf("comparisonString", "this is the value")]
[SerializeField]
private bool shouldBeVisible;
// this shows in inspector as expected
[ShowIf("comparisonString", "this is some other value")]
[SerializeField]
private bool shouldNotBeVisible;
// this also shows in inspector whereas in Odin 1.06 it would not (and I'd expect it to not
}
- Create an object with OdinTest
- Both fields are visible in inspector
Comments (3)
-
-
reporter Fantastic! Are you able to let me know when the fix will hit the asset store? A date if you are able to give but if not, I'll simply wait :)
-
It was released as part of a small patch yesterday, so it is already on the Asset Store :)
You can find the release notes here: https://www.sirenix.net/odininspector/releasenotes/2-0-1-0
- Log in to comment
Strings were treated as reference types and compared using null checks instead. I've changed the behaviour for strings, so now this should work as expected.