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. Codeforces Round #343 (Div. 2) A. Far Relative’s Birthday Cake 水题

    A. Far Relative's Birthday Cake 题目连接: http://www.codeforces.com/contest/629/problem/A Description Do ...

  2. atomic与nonatomic的区别

    原子性(atomic):某操作具备整体性,也就是说,系统其他部分无法观察到其中间步骤所生成的临时结果,而只能看到操作前与操作后的结果,那么就称改操作就是“原子的”(atomic),或者说,该操作具备“ ...

  3. 基于tiny4412的Linux内核移植(支持device tree)(三)

    作者信息 作者: 彭东林 邮箱:pengdonglin137@163.com QQ:405728433 平台简介 开发板:tiny4412ADK + S700 + 4GB Flash 要移植的内核版本 ...

  4. redis节点管理-新增从节点

    原文:http://blog.sina.com.cn/s/blog_53b45c4d0102wg12.html 新增从节点 新增一个节点7008节点,使用add-node --slave命令. [pl ...

  5. Bower管理依赖库初体验

    比如一开始我用了jquery-1.10.2.min.js,后来要用bootstrap,但bootstrap依赖的确实2.0.3版本的jquery,那又要下载一个去替换原来的,这样的事情发生多了就会觉得 ...

  6. 如何在Visual Studio中加载web load test的后缀为.ltrar的结果文件

    1. From a Web performance and load test project, open a load test.   2. On the embedded toolbar, cho ...

  7. Redis中为什么使用跳表---------转自http://blog.csdn.net/u010412301/article/details/64923131

    最近在研究数据库的一些底层实现,百度的面试官问到了跳表,当时没有回答上来,在csdn上看到了这篇文章,感觉写的比较好,希望大家可以多多交流. Redis里面使用skiplist是为了实现sorted ...

  8. [Angular] Angular i18n Pluralization Support

    // Component: this.coursesTotal = this.course,length <div i18n>{coursesTotal, plural, =0 {No c ...

  9. JedisCluster操作redis集群demo

    package com.chenk; import java.util.HashMap; import java.util.HashSet; import java.util.List; import ...

  10. Textarea自动适用高度且无滚动条解决方案

    今日的系统需要动态显示一项数据库里面的内容,该内容包含换行等格式字符,要求如实的反应在页面上. 最初解决办法是使用textarea控件,代码如下: <textarea style="b ...