unity, access standard shared emission by script

unity 5.1.1f1 personal

用下面方法在脚本中设置standard shader的emssion:

gameObject.GetComponent<MeshRenderer> ().material.SetColor("_EmissionColor",color);

一个很奇怪的现象是:如果material的inspector中此standard shader的emission值为(0,0,0),则上面语句不起作用。

所以为了使上面语句能生效,需要把inspector中emission的值设置为非(0,0,0)。

参考:http://hutonggames.com/playmakerforum/index.php?topic=9833.0

posted on   wantnon  阅读(403)  评论(0编辑  收藏  举报

努力加载评论中...

导航

点击右上角即可分享
微信分享提示