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. CentOS中如何安装7ZIP

    7-zip以高压缩率著称,并且是一款免费开源的压缩软件.在常规的Linux发行版中,无法通过简单的yum命令来安装该软件.那么在CentOS中,如何安装7ZIP呢?有以下3种方法: 第一种,源码编译安 ...

  2. 移动应用安全开发指南(Android)--数据传输

    概述 移动应用很多时候并非孤立存在,在多数场景下存在前.后台以及第三方服务之间进行数据交互,因此,在网络中传输敏感数据在所难免,如果不使用正确安全的传输方式,有可能存在敏感信息泄漏的风险. 安全准则 ...

  3. .net 程式進階除錯教學 - 使用WinDbg

     https://caryhsu.blogspot.com/2011/11/net-windbg.html         從以前一直研究基金方面的資訊,但由於沒有多於的時間常常觀看,再加上碩士時在我 ...

  4. webService 三要素

    WebService(jax-ws)三要素 SOAP: 基于HTTP协议,采用XML格式,用来传递信息的格式. WSDL: 用来描述如何访问具体的服务.(相当于说明书) UDDI: 用户自己可以按UD ...

  5. java/eclipse/myeclipse建立.properties文件的方法

      相比较来说,Java程序的编写相对简单很多,多数文件都可以通过编写文本文件生成!     对于不用IDE的java程序来讲,只需要右键新建>文本文件,建立好以后写好代码,另存为xx.prop ...

  6. xss学习教程

    XSS漏洞详细分析与讲解.rar xss黑白盒渗透测试.pdf xss基础钓鱼-shgcx.com.zip XSS利用教程-shgcx.com.zip xss盲打渗透网站.doc XSS挖掘.ppt  ...

  7. Lateral View使用指南

    https://blog.csdn.net/sunnyyoona/article/details/62894761 select sum(pitem) from (select map_values( ...

  8. Python Pygal绘制世界人口地图

    数据集可在 https://datahub.io/JohnSnowLabs/population-figures-by-country 下载 #coding=utf-8 import json fro ...

  9. linux中backticks反引号的作用

    This is a backtick. A backtick is not a quotation sign. It has a very special meaning. Everything yo ...

  10. ActiveRecord::StatementInvalid (Mysql2::Error: Incorrect string value:

    今天碰到一个相当棘手的问题,那就是ActiveRecord::StatementInvalid (Mysql2::Error: Incorrect string value . 本来在本地测试是没有任 ...