ShowIf/HideIf/EnableIf/DisableIf errors

Issue #145 resolved
Tarocco
created an issue

I have some code that I am using for a struct type:

public enum SceneLoadDirectiveType
{
    Name,
    Parameter
}

public enum ActionCondition
{
    Always,
    Variable
}

[Serializable]
public struct SceneLoadDirective
{
    [HorizontalGroup("Value")]
    public string Value;

    [HorizontalGroup("Value")]
    public SceneLoadDirectiveType Type;

    [HorizontalGroup("Condition")]
    public ActionCondition Condition;

    private bool IsConditionVariableNameEnabled
    {
        get { return Condition != ActionCondition.Always; }
    }

    [EnableIf("IsConditionVariableNameEnabled")]
    [HorizontalGroup("Condition")]
    public string VariableName;
}

On the first inspector draw/paint, there is no error, but subsequently (and usually very quickly) I am greeted with lots of the attached errors. Had these errors with version 1.0.2.1, so I updated to 1.0.3.0 to see if it would help, to no avail.

Instead of controlling the visibility/editibility of the VariableName property field, it leaves it as is and then adds an error box telling me "There should really be an error message here."

Comments (3)

  1. Tor Esa Vestergaard

    Thanks for reporting this issue - it was due to us emitting invalid method IL for invoking properties and methods on structs in some of our fast reflection code. It has been resolved, and the fix will make it into the next patch. If getting this fix is very important for you, you can mail me your Odin invoice number at tor@sirenix.net, and I'll shoot you a build with the latest fixes.

  2. Log in to comment