Author Topic: More datatypes for attributes  (Read 63 times)

Tom Bell

  • Guest
More datatypes for attributes
« on: August 26, 2021, 10:25:55 AM »
It would be nice if there was support for more data types in the attributes, mainly color, and texture. When adding an attribute it would be nice if there was a dropdown to change to the datatype. I want to store stuff like flags and country color in the country's attributes, and at the moment I'm having to type "000,000,000" for color and the path to the texture for the flag.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 7262
    • View Profile
Re: More datatypes for attributes
« Reply #1 on: August 26, 2021, 12:03:32 PM »
Hi,

For colors, you could store them in hexadecimal and use the ColorUtil class to convert them to Color values (https://docs.unity3d.com/ScriptReference/ColorUtility.html).

Also, storing the name of the texture resource is fine as storing the texture in binary form or other format will clash with the building device as Unity converts the texture to native format depending on the device while building.

Regards