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
unity, access standard shared emission by script的更多相关文章
- Effective Java 66 Synchronize access to shared mutable data
synchronized - Only a single thread can execute a method or block at one time. Not only does synchro ...
- OAuth:Access to shared resources via web applications
A web application which wants to gain access to shared resources should redirect the user to a page ...
- unity, setting standard shader by script
http://forum.unity3d.com/threads/change-standard-shader-render-mode-in-runtime.318815/
- Access Java API in Groovy Script
$ cat Hello.java package test; public class Hello { public int myadd(int x, int y) { return 10 * x + ...
- unity, access material
MeshRenderer meshRenderer=gameObject.GetComponent<MeshRenderer>(); if(meshRende ...
- unity里standard pbr(一)
关注forwardbase下的 standard.shader #pragma vertex vertBase #pragma fragment fragBase #include "Uni ...
- Unity用代码实现Remove Missing Script
[MenuItem("Edit/Cleanup Missing Scripts")] static void CleanupMissingScripts () { ; i < ...
- unity, access scene ambient
lighting面板里设置的ambient color,在shader里访问是通过UNITY_LIGHTMODEL_AMBIENT这个变量. 它定义在UnityShaderVariables.cgin ...
- unity, access sprite of UGUI Image
首先需要using UnityEngine.UI; 然后调用下面语句就不报错了: Image.GetComponent<Image>().sprite 参考:http://answers. ...
随机推荐
- GIT使用(自用)
1.远程分支就是本地分支push到服务器上的时候产生的.比如master就是一个最典型的远程分支(默认). 1 $: git push origin master 除了master之外,我们还可以随便 ...
- sqlserver 脚本 多条记录遍历
临时表方式实现多条记录遍历 declare @oper_cart_item_id bigint; declare @oper_cart_id bigint; declare @the_last_cha ...
- 【js】js数组置空的三种方式
方式1: var arr = new Array(1,2,3); alert(arr); arr.splice(0, arr.length); alert(arr); 方式2: var arr = n ...
- 四.rocketMQ原理
⦁ mqnamesrv服务 broker启动的时候(单个.多个),都会去查找namesrv注册. Producer发生消息的时候会根据topic获取路由到broker的信息. Consumer根 ...
- 为TextView设置两种状态,程序中可以动态切换
经常会需要用文字的两种状态来表示当前系统的某两种状态.比如: 这里的第一个TextView和后两个TextView就表示了两种状态.我们可以在程序的动态的切换状态(而不是直接修改颜色) ...
- linux之fork()函数详解
一.fork入门知识 一个进程,包括代码.数据和分配给进程的资源.fork()函数通过系统调用创建一个与原来进程几乎完全相同的进程, 也就是两个进程可以做完全相同的事,但如果初始参数或者传入的变量不同 ...
- 算法之排序Low B三人组
有序区:有的地方的数据已经完全变得有顺序,我们把这部分区域的数据成为有序区无序区:有的地方的数据依旧无序,我们把这部分数据成为无序区时间复杂度:用来估计算法运行时间的一个式子(单位)空间复杂度:用来评 ...
- Qunit的使用
1.新建一个html页面,如下 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "ht ...
- unity stuck when building
卡在 packaging assets 这里的话 把文件夹只读属性去掉 应用于子文件夹
- const 与 指针
#include <iostream> using namespace std; int main() { // 第一种.使指针不能改动对象的值.注:此时指针能够指向另外的对象 int i ...