Open GoogleCodeExporter opened 8 years ago
[deleted comment]
I see that the code contains the comment:
//allows namedcolorvalue to be set as either an enum(C# friendly) or a string(JS friendly), string case usage doesn't matter to further increase usability:
In order to support arbitrary strings for the "namedcolorvalue" argument,
you'll probably want to drop this case insensitivity feature (because it is in
theory possible to write a shader with two color parameters that differ only in
case). Luckily, the feature was never documented, so you can expect the
breakage to be fairly small.
Original comment by g...@garethrees.org
on 3 Nov 2010 at 1:17
Thanks for the catch I'll address this.
Original comment by pixelplacement
on 6 Jan 2011 at 5:23
I have a solution for this, but it's not yet complete. As I'm working on Unity
5 and, well, nearly no material.color works anymore, I made those changes:
- "namedcolorvalue" hash item may be of type "string" or "Int32"
- the old code for this was replaced - no more enum NamedColorValue, it simply
keeps an Int32
- upon ParseArgs any color-name will be converted to an ID via
Shader.PropertyToID
- we now use [...].material.GetColor(ID) and [...].material.SetColor(ID,
newColorValue) for reading/writing colors
- ValueTo was replaced by "DoValue", this NEEDS an ID or colorname to work
without a callback for manipulating material properties other than a color
- DoValue may have a "to" entry or a "from", or both. If it has only one
value, the other one will be grabbed from the material on start. This is by
far incomplete, but it works for my needs.
Original comment by st0ff....@gmail.com
on 20 Apr 2015 at 8:10
Attachments:
Original issue reported on code.google.com by
g...@garethrees.org
on 3 Nov 2010 at 12:03