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的更多相关文章

  1. 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 ...

  2. 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 ...

  3. unity, setting standard shader by script

    http://forum.unity3d.com/threads/change-standard-shader-render-mode-in-runtime.318815/

  4. Access Java API in Groovy Script

    $ cat Hello.java package test; public class Hello { public int myadd(int x, int y) { return 10 * x + ...

  5. unity, access material

    MeshRenderer meshRenderer=gameObject.GetComponent<MeshRenderer>();                if(meshRende ...

  6. unity里standard pbr(一)

    关注forwardbase下的 standard.shader #pragma vertex vertBase #pragma fragment fragBase #include "Uni ...

  7. Unity用代码实现Remove Missing Script

    [MenuItem("Edit/Cleanup Missing Scripts")] static void CleanupMissingScripts () { ; i < ...

  8. unity, access scene ambient

    lighting面板里设置的ambient color,在shader里访问是通过UNITY_LIGHTMODEL_AMBIENT这个变量. 它定义在UnityShaderVariables.cgin ...

  9. unity, access sprite of UGUI Image

    首先需要using UnityEngine.UI; 然后调用下面语句就不报错了: Image.GetComponent<Image>().sprite 参考:http://answers. ...

随机推荐

  1. [转]ssm整合1(环境搭建)

    1 MyEclipse+Tomcat+MAVEN+SVN项目完整环境搭建http://blog.csdn.net/zhshulin/article/details/307798732 apache-m ...

  2. 配置友盟最新SDK遇到的问题

    编译报错  Undefined symbols for architecture i386:原因:i386是代表模拟器,显示i386错误说明静态库不支持模拟器,只支持真机.友盟最新SDK可能不支持模拟 ...

  3. spring boot application.properties乱码问题

    1. 在application.properties 中增加 spring.http.encoding.force=true spring.http.encoding.charset=UTF- spr ...

  4. HDU 2859 Phalanx (DP)

    Phalanx Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Su ...

  5. 移动端调试神器(eruda)

    在日常的移动端开发时,一般都是试用chrome浏览器的移动端模式进行开发和调试,只有在chrome调试完成,没有问题了才会上到真机测试,移动端开发的一大问题就在于此, 各种品牌各种型号手机,手机中各种 ...

  6. USER Management | Role Categories | Roles | Indirect Responsibilities

    User Mangement Application helps system administrators to assign or un-assign a responsibility for m ...

  7. 实现自动解析properties文件并装配到Bean

    主要实现了,配置的属性就装配, 没有配置的属性不装配 思路: 1 . 通过反射获取类内部所有方法名称 2 . 获取perperties 的key集合 3 .  处理字符串,比较两个匹配,如果匹配成功就 ...

  8. XMPP 常见错误:<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>

    一般登陆/注册 出错,会在认证失败这里打印出error信息 - (void)xmppStream:(XMPPStream *)sender didNotAuthenticate:(DDXMLEleme ...

  9. JAVA常见算法题(二十八)

    package com.forezp.util; import java.util.Arrays; /** * 两个int数组,都是从小到大的的排列,请合并为一个新的数组,也是从小到到大的排列, * ...

  10. 如何获取gcr等镜像

    在cloud.docker.com上注册一个用户,然后登录 然后在github.com上注册一个用户 通过github Desktop建立一个repository,同时加入一个Dockerfile,然 ...