Unity中的内置CgInclude文件

作者:追风剑情 发布于:2016-2-28 17:09 分类:Shader

你可以在Unity安装目录Editor/Data/CGIncludes/下找到内置的CgInclude文件。 在着色器对物体的渲染过程中它们各司其职,有些是处理阴影和光照的,有些是处理辅助函数的,有些是管理平台依赖关系的。 你可以访问http://docs.unity3d.com/Manual/SL-BuiltinIncludes.html来查找相关信息。 示例...

阅读全文>>

标签: Shader

评论(0) 浏览(3878)

求点到线段的最短距离

作者:追风剑情 发布于:2016-2-25 20:42 分类:Algorithms

线段的向量表示 p=at+b (0≤t≤1) 向量b为线段的起点,向量a是延着线段的向量。 问题:求点(x0, y0)到线段p的最短距离? 解题思路:将线段上的点p=at+b(0≤t≤1)与点(x0, y0)的距离表示为t的函数,然后对t进行微分,求得距离最小时的t。 向量p=at+b (0≤t≤1)可分解表示为:...

阅读全文>>

标签: Algorithms

评论(0) 浏览(4564)

判断一个整数的某个比特位是否为1

作者:追风剑情 发布于:2016-2-21 22:59 分类:C#

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace BigPower { class Program { static void Main(string[] args) { ...

阅读全文>>

标签: C#

评论(0) 浏览(2755)

列表碎片——ListFragment

作者:追风剑情 发布于:2016-2-21 18:59 分类:Android

fragment1.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout...

阅读全文>>

标签: Android

评论(0) 浏览(2503)

摇杆

作者:追风剑情 发布于:2016-2-19 18:02 分类:GUI

摇杆脚本 using UnityEngine; using System; [ExecuteInEditMode] public class Joystick : MonoBehaviour { public enum JoystickAnchor { None, UpperLeft, UpperCenter, UpperRight, MiddleLeft, Midd...

阅读全文>>

标签: GUI

评论(0) 浏览(3908)

委托链——Delegate.Combine()

作者:追风剑情 发布于:2016-2-19 10:48 分类:C#

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CombineTest { public delegate void Log(string message); class Program { ...

阅读全文>>

标签: C#

评论(0) 浏览(5380)

行为树

作者:追风剑情 发布于:2016-2-17 15:46 分类:Unity3d

=====================行为树(Behavior Tree)框架代码====================== 父节点: using UnityEngine; using System.Collections.Generic; /// <summary> /// 父节点 /// </summary> publ...

阅读全文>>

标签: Unity3d

评论(0) 浏览(4549)

动态更改Shader属性值

作者:追风剑情 发布于:2016-2-15 17:36 分类:Shader

一、创建脚本 using UnityEngine; using System.Collections; public class ProceduralMaterialTest : MonoBehaviour { public Color mainColor; void Start () { renderer.materials[...

阅读全文>>

标签: Shader

评论(0) 浏览(5514)

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号