Git Product home page Git Product logo

Comments (6)

Deadcows avatar Deadcows commented on May 20, 2024 1

For now I figured out that ConditionalField should always be the first attribute. I experimented with order, like this:
public bool B; [Tag(order = 1), ConditionalField(nameof(B), order = 2)] public string BB;
but strangely with such setup fieldInfo of PropertyDrawer becomes null.
I'll leave this issue to figure out null problem later, for now I'll suggest to simply keep ConditionalField the first attribute.

Hopefully this will work in your case 🙄

from mybox.

Deadcows avatar Deadcows commented on May 20, 2024

Well, such issue were opened once, but I considered this behavior is "intended".
Now I think that such thing would be certainly nice to have 👌🏻 so thanks you for bringing this up.
I'll implement this in a few days I believe, I don't have much time at the moment

from mybox.

TheXRMonk avatar TheXRMonk commented on May 20, 2024

Cool thanks! Will make it easy to make components that can check layers/tags or not. :)

from mybox.

Deadcows avatar Deadcows commented on May 20, 2024

Oh dang, I completely misunderstood what you requested for some reason (probably I should sleep a bit more 😅). I though you wanted to hide Separator or Header along with the property.

Ok then, I was unable to reproduce your issue.
Can you share your code?

    public bool A;
    [ConditionalField("A"), Tag] public string TA;
    [Tag] public string TB;

from mybox.

TheXRMonk avatar TheXRMonk commented on May 20, 2024

Apparently, tag needs to be the last attribute assigned. In this code, the conditionalfield for Tag works, but not for Layer;

public bool checkTag;
[ConditionalField(nameof(checkTag)), Tag]
public string CollideWithTag = "Untagged";

public bool checkLayer;

[Layer, ConditionalField(nameof(checkLayer))]
public int CollideWithLayer;

from mybox.

Deadcows avatar Deadcows commented on May 20, 2024

one of the previous changes I made in ConditionalField should fix this issue

from mybox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.