we want have a bool value to control [GUIColor(...)], when ore how to show up!

Issue #168 resolved
奇 金 created an issue

we want have a bool value to control [GUIColor(...)], when ore how to show up !

Maybe like the following.

[GUIColor(1,1,1,1,“$someboolValue”)]

Comments (3)

  1. Tor Esa Vestergaard
    • changed status to open

    This isn't currently possible to do using pre-existing Odin attributes. You can try creating a custom drawer that does this - see this forum post for details on how to do that.

    Otherwise, we're afraid you'll have to wait until Odin 1.1's property system upgrade, where we will introduce the ability to conditionally apply any attribute.

  2. Tor Esa Vestergaard

    You can now do this with the a new parameter for GUIColor which takes a string for a method that returns the actual color to use - in this method, you can have whatever logic you want.

  3. Log in to comment