Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to apply ColorUsageAttribute.hdr?

Discussion in 'Scripting' started by StaffanEk, Sep 22, 2015.

  1. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
  2. Harinezumi

    Harinezumi

    Joined:
    Jan 7, 2013
    Posts:
    54
    I know this answer is late, but I've found it out by experimenting.
    You add the attribute to a Color variable with square brackets ([ColorUsage()]), then use one of the constructors of ColorUsageAttribute. For example:
    Code (CSharp):
    1. [ColorUsage(false, true)] public Color hdrColorWithoutAlpha = Color.white;
     
    LaFleurGames likes this.