材料没有颜色属性' _TintColor'

时间:2017-02-14 23:04:33

标签: unity3d shader

我想使用脚本修改材料的TintColor,但在执行此操作时,错误如下:

  

材料没有颜色属性' _TintColor'

我用Google搜索,但所有的努力都徒劳无功。

我阅读了this post,并说它可以使用脚本进行修改。

我使用的着色器是Sprites/Default

public Color[] colors = { new Color(42/255.0f, 246/255.0f, 229/255.0f,1),new Color(20/255.0f, 127/255.0f, 255/255.0f,1),new Color(73/255.0f, 3/255.0f, 198/255.0f,1);
Debug.Log(renderer.material.GetColor("_TintColor"));
//renderer.material.SetColor("_TintColor", colors[2]); /*This eventually I want to use */

我尝试使用alpha值,但它没有工作

我不知道自己做错了什么。如果有人可以指出我的错误或让我如何更改材料的TintColor,那将会非常有帮助。

1 个答案:

答案 0 :(得分:2)

着色器dplyr::count没有library(tidyverse) df %>% separate_rows(Words) %>% count(Words, Letters = substr(Letters, 1, 1), # use regex if more than one letter Frequency = cut(Frequency, breaks = seq(0, 1, .25))) ## Source: local data frame [11 x 4] ## Groups: Frequency, Words [?] ## ## Frequency Words Letters n ## <fctr> <chr> <chr> <int> ## 1 (0,0.25] flower a 1 ## 2 (0,0.25] flower b 1 ## 3 (0,0.25] planet a 1 ## 4 (0,0.25] tree a 1 ## 5 (0.25,0.5] planet c 1 ## 6 (0.25,0.5] tree c 1 ## 7 (0.5,0.75] flower b 1 ## 8 (0.5,0.75] planet b 1 ## 9 (0.5,0.75] tree a 1 ## 10 (0.75,1] planet b 1 ## 11 (0.75,1] tree a 1 ,而是Sprites/Default属性。所以你要做的就是改变

"_TintColor" property

"_Color"