广告牌

作者:追风剑情 发布于:2017-12-9 13:30 分类:Shader

一、创建Shader // Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject' Shader "Custom/BillboardingShader" { Properties { _MainTex ("Texture", 2D) = "white" {} //调整整体颜色 _...

阅读全文>>

标签: Shader

评论(0) 浏览(3282)

SerializedObject

作者:追风剑情 发布于:2017-12-8 16:53 分类:Unity3d

对SerializedObject中的部分方法进行说明 SerializedObject //Inspector中的值变化同步到targetObject中 ApplyModifiedProperties(); //更新Inspector界面显示 //targetObject中的值变化同步到Inspector中 Update(); //更新Inspector界面显示...

阅读全文>>

标签: Unity3d

评论(0) 浏览(4374)

格式化字符串

作者:追风剑情 发布于:2017-12-8 11:43 分类:Python

示例 # -*- coding: cp936 -*- #字符串和元组一样,是不可修改的 #如果使用列表或者其他序列代替元组,那么序列会被解释为一个值, #只有元组和字典可以格式化一个以上的值。 #如果要在格式字符串中包含百分号,可以这样写%% print '字符串格式化' format = "Hello, %s. %s enough for ya?" va...

阅读全文>>

标签: Python

评论(0) 浏览(3875)

元组

作者:追风剑情 发布于:2017-12-5 18:17 分类:Python

示例 # -*- coding: cp936 -*- #元组不能修改。 #元组可以在映射中当作键使用,而列表不行。 #元组作为很多内建函数和方法的返回值存在。 #创建一个元组 t = 1,2,3 print t #或者括起来 t = (1,2,3,4) print t #创建空元组 t = () print t #创建只包含一个值的元组,以逗号结尾 t =...

阅读全文>>

标签: Python

评论(0) 浏览(2896)

列表操作

作者:追风剑情 发布于:2017-12-5 15:57 分类:Python

示例 # -*- coding: cp936 -*- print '字符串转成字符列表' chr_list = list('Hello') print chr_list print '字符列表转字符串' print ''.join(chr_list) print '索引赋值' x = [1, 1, 1] x[1] = 2 print x print '分片赋值' name = list(...

阅读全文>>

标签: Python

评论(0) 浏览(3001)

列表

作者:追风剑情 发布于:2017-12-4 21:11 分类:Python

示例 # -*- coding: cp936 -*- print '列表' edward = ['Edward Gumby', 42] john = ['John Smith', 50] database = [edward, john] print database print '通用序列操作: 索引(indexing)、分片(slicing)、加(adding)、乘(...

阅读全文>>

标签: Python

评论(0) 浏览(2484)

字符串

作者:追风剑情 发布于:2017-12-3 14:55 分类:Python

# -*- coding: cp936 -*- print "Python中字符串支持单引号或者双引号,也支持转义符" print "Hello. world!" print 'Hello. world!' print "Let's go!" print 'Let\'s go!' print "\"Hello. world!\" she said" print "拼接字符串" ...

阅读全文>>

标签: Python

评论(0) 浏览(2484)

保存并执行程序

作者:追风剑情 发布于:2017-12-3 14:00 分类:Python

在IDLE中新建一个文件 编辑并保存(hello.py),然后按Ctrl+F5运行 通过命令行运行hello.py 首先把安装目录下的python.exe配到环境变量中。

阅读全文>>

标签: Python

评论(0) 浏览(2631)

模块

作者:追风剑情 发布于:2017-12-3 13:45 分类:Python

Python语言本身就提供了对复数的支持。 Python中没有单独的虚数类型。它们被看作实部分为0的复数。 cmath模块提供了支持复数计算的函数, 虚数均以j(或者J)结尾。

阅读全文>>

标签: Python

评论(0) 浏览(2495)

内建函数

作者:追风剑情 发布于:2017-12-3 13:33 分类:Python

通常会把pow等标准函数称为内建函数

阅读全文>>

标签: Python

评论(0) 浏览(2493)

获取用户输入

作者:追风剑情 发布于:2017-12-3 13:25 分类:Python

input函数、raw_input函数

阅读全文>>

标签: Python

评论(0) 浏览(2298)

变量、语句

作者:追风剑情 发布于:2017-12-3 10:18 分类:Python

Python中的变量名可以包括字母、数字和下划线。变量不能以数字开头。

阅读全文>>

标签: Python

评论(0) 浏览(2465)

自定义阴影Pass

作者:追风剑情 发布于:2017-12-2 13:09 分类:Shader

自定义阴影Shader // Upgrade NOTE: replaced '_LightMatrix0' with 'unity_WorldToLight' Shader "Custom/LightShader" { Properties { _MainTex ("Albedo (RGB)", 2D) = "white" {} _Color ("Color", C...

阅读全文>>

标签: Shader

评论(0) 浏览(4756)

定时器(Timer)

作者:追风剑情 发布于:2017-12-1 15:46 分类:C#

示例 using System; using System.Threading; //System.Threading.Timer让一个线程池线程定时调用一个方法(执行后台任务) //System.Windows.Forms.Timer可以保证设置计时器的线程就是执行回调方法的线程 //System.Threading.DispatcherTimer这个类是System.Wind...

阅读全文>>

标签: C#

评论(0) 浏览(3068)

奇偶校验

作者:追风剑情 发布于:2017-11-29 11:14 分类:Algorithms

示例: 判断二进制串的奇偶性 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Test6 { class Program { sta...

阅读全文>>

标签: Algorithms

评论(0) 浏览(3085)

透明度物体的阴影

作者:追风剑情 发布于:2017-11-26 21:13 分类:Shader

在Cube上挂上以下Shader // Upgrade NOTE: replaced '_LightMatrix0' with 'unity_WorldToLight' Shader "Custom/LightShader" { Properties { _MainTex ("Albedo (RGB)", 2D) = "white" {} _Color ("Colo...

阅读全文>>

标签: Shader

评论(0) 浏览(4118)

Python数字和表达式

作者:追风剑情 发布于:2017-11-26 16:23 分类:Python

from __future__ import division 让后面的除法运算保留小数部分

阅读全文>>

标签: Python

评论(0) 浏览(2940)

统一管理光照衰减和阴影

作者:追风剑情 发布于:2017-11-25 22:06 分类:Shader

在Cube上挂上以下Shader // Upgrade NOTE: replaced '_LightMatrix0' with 'unity_WorldToLight' Shader "Custom/LightShader" { Properties { _MainTex ("Albedo (RGB)", 2D) = "white" {} _Color (...

阅读全文>>

标签: Shader

评论(0) 浏览(5194)

让物体接收阴影

作者:追风剑情 发布于:2017-11-24 22:58 分类:Shader

将下面的Shader挂在Cube上 Shader "Custom/LightShader" { Properties { _MainTex ("Albedo (RGB)", 2D) = "white" {} _Color ("Color", Color) = (1,1,1,1) _Specular ("Specular", Color) = (1,1,1,1) ...

阅读全文>>

标签: Shader

评论(0) 浏览(3656)

二进制雷格码(Binary Gray Code)

作者:追风剑情 发布于:2017-11-22 15:47 分类:Algorithms

示例 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Test5 { class Program { static voi...

阅读全文>>

标签: Algorithms

评论(0) 浏览(3566)

将数值上调/下调为2的已知次幂的倍数

作者:追风剑情 发布于:2017-11-14 21:55 分类:Algorithms

示例 using System; namespace Test4 { class Program { static void Main(string[] args) { int x1 = 756; int x2 = -756; for (int...

阅读全文>>

标签: Algorithms

评论(0) 浏览(3041)

预编译Shader

作者:追风剑情 发布于:2017-11-13 20:26 分类:Shader

方法一 游戏启动时调用Shader.WarmupAllShaders(),会对当前内存中的所有Shader进行编译并缓存起来。 方法二 Edit->Project Settings->Graphics 在GraphicsSettings中设置需要预编译的Shader,如图: 注意:未编译的Shader会在首次渲染用到时编译并缓存起来(可能会导...

阅读全文>>

标签: Shader

评论(0) 浏览(4798)

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号