Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Static properity injection to native Classes

Discussion in 'Editor & General Support' started by baruchGames, Dec 17, 2020.

  1. baruchGames

    baruchGames

    Joined:
    Mar 7, 2019
    Posts:
    1
    I am trying add variety to Color class for example:
    Color c = Color.clearWhite;//Should return RGBA (1, 1, 1, 0).
    or
    Color y = Color.trueYellow;//Should return RGBA(1,1,0,1).
    etc.

    is there a way to implement this?
    thanks in advance.
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,722
    Not exactly, but you can write extension method for it. It would be almost like that except for parentheses at the end.
     
    baruchGames likes this.