There are colors that were specified for the components by common names.
pieceColors = new Color[6] {Color.red, Color.blue, Color.yellow, Color.green, Color.cyan, Color.magenta}; Now when I want to get them with the command
GetComponent<Controller>().getColor (); мне выдаётся информация вида RGBA(0.000, 1.000, 0.000, 1.000) How to get them in the form of a String?
Tried so
Color colt = tempPieces[i].GetComponent<Controller>().getColor(); cvet.text = colt.ToString(); but it still returns issues via RGBA. Is there any way to convert names normally into English?
Color.redis a class object, and in fact the number0xFFFF0000therefore without any additional code I can’t imagine how to do it. And the code can be simply madeswitch (color) case Color.red: return "red"...- pavelgetColormethod? and where doespieceColors, which is not listed anywhere here, except for the beginning of the question? And doesn'tColorhave aNameproperty? ... becauseColor color = Color.Red; string colorName = color.Name; Debug.Log(colorName);Color color = Color.Red; string colorName = color.Name; Debug.Log(colorName);will giveRed- Aleksey ShimanskyyUnityEngine.Color, butSystem.Drawing;will there be a mistake? - Alexey Shimansky