This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
color 对于组件值,使用0到1的范围。
您可以使用构造函数构造颜色。
我使用您的问题中的代码测试了Color32,并且可以正常工作。目前尚不清楚如何复制该问题。
Color uses a range from 0 to 1 for the component values.
You can construct the color using the constructor.
I tested Color32 using the code from your question and it worked correctly. It is unclear how to reproduce the issue.
如果您将颜色公开,那么我们可以调整检查器本身中的颜色。因此,可以轻松查看所需的颜色。您可以在更新中使用代码,并通过更改Inspector中的颜色来查看编辑器中的更改。
在这里检查
if you make the Color as public then we can adjust the color in the inspector itself.So it will be easy to view the color you want.You can use the code in Update and see the changes in the editor by changing the color in inspector.
Check here
使用具有固有的RGB/ARGB设置器的颜色类。
Use the Color class, which has an inherent RGB/ARGB setter.