Expose Properties from Script

  • #1, by johnmSunday, 17. November, 09:27 2 weeks ago
    I have various behavious that I've created with properties that I would like to expose in the editor when selecting the behavior for an object.

    So far, I haven't seen any way to do this and I'm assuming that the Behavior component only exposes the 'Link' property and doesn't consider any properties on the Ilios script itself. Is this the case?

    For now, I am just inheriting from base classes and overriding properties. This creates a lot of hard coded variables but does work. Is this the intended work flow?

    Newbie

    7 Posts


  • #2, by johnmSunday, 17. November, 11:02 2 weeks ago
    I believe the answer is to add Values on the objects and read those from within the script which works fine for my use.

    That said, I do think that being able to expose properties would still be a valuable addition so designers could see the known set of variables and set them accordingly instead of having to know which properties the script expects.

    Newbie

    7 Posts

  • #3, by johnmSaturday, 23. November, 08:25 A week ago
    After a bit more digging, I've found the keyword 'outlet' exposes properties from a behaviour as I was wanting.

    NOTE: On occassion, I did have to restart the editor to get the properties to show in the UI.

    Example:

    outlet int ExposedInt = 1;

    Newbie

    7 Posts

  • #4, by dionousSaturday, 23. November, 16:38 A week ago
    yeah, that's cool; similar to unity's SerializeField

    Forum Fan

    248 Posts

Write post