列表操作

作者:追风剑情 发布于: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) 浏览(4896)

列表

作者:追风剑情 发布于: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) 浏览(4048)

字符串

作者:追风剑情 发布于: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) 浏览(3887)

保存并执行程序

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

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

阅读全文>>

标签: Python

评论(0) 浏览(4219)

模块

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

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

阅读全文>>

标签: Python

评论(0) 浏览(4103)

内建函数

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

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

阅读全文>>

标签: Python

评论(0) 浏览(4410)

获取用户输入

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

input函数、raw_input函数

阅读全文>>

标签: Python

评论(0) 浏览(3919)

变量、语句

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

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

阅读全文>>

标签: Python

评论(0) 浏览(3866)

自定义阴影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) 浏览(6445)

定时器(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) 浏览(4646)

奇偶校验

作者:追风剑情 发布于: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) 浏览(4978)

透明度物体的阴影

作者:追风剑情 发布于: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) 浏览(5621)

Python数字和表达式

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

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

阅读全文>>

标签: Python

评论(0) 浏览(4567)

统一管理光照衰减和阴影

作者:追风剑情 发布于: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) 浏览(7004)

让物体接收阴影

作者:追风剑情 发布于: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) 浏览(5292)

二进制雷格码(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) 浏览(5442)

将数值上调/下调为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) 浏览(4840)

预编译Shader

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

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

阅读全文>>

标签: Shader

评论(0) 浏览(7105)

让物体投射阴影

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

一、新建场景 Directional Light开启阴影 Cube和Plane开启阴影 这里有个有趣的现象,右侧的Plane1如果背面朝向Cube是看不到阴影的 选择Cast Shadows: Two Sided ...

阅读全文>>

标签: Shader

评论(0) 浏览(5263)

扩展偏好设置面板——PreferenceItem

作者:追风剑情 发布于:2017-11-9 11:11 分类:Unity3d

示例 using UnityEngine; using UnityEditor; using System.Collections; /// <summary> /// 扩展偏好设置面板 /// </summary> public class CPreferenceItem { private static bool pre...

阅读全文>>

标签: Unity3d

评论(0) 浏览(5873)

Parallel——执行并行任务

作者:追风剑情 发布于:2017-11-8 21:57 分类:C#

示例 using System; using System.IO; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; //参考 https://www.cnbl...

阅读全文>>

标签: C#

评论(0) 浏览(4354)

监听资源编辑——AssetModificationProcessor

作者:追风剑情 发布于:2017-11-8 17:39 分类:Unity3d

示例 using UnityEngine; using UnityEditor; using System.Collections; /// <summary> /// 参考 http://www.xuanyusong.com/archives/3535 /// 监听资源修改、删除、移动 /// </summary> public clas...

阅读全文>>

标签: Unity3d

评论(0) 浏览(9277)

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号