判断网络状态——NetworkReachability

作者:追风剑情 发布于:2016-1-29 14:10 分类:Unity3d

using UnityEngine; using System.Collections; public class InternetTest : MonoBehaviour { void OnGUI() { GUI.color = Color.green; GUI.Label(new Rect(20, 20, 500, 200),...

阅读全文>>

标签: Unity3d

评论(0) 浏览(9444)

输入管理器——Input Manager

作者:追风剑情 发布于:2016-1-28 15:50 分类:Unity3d

位于菜单 Edit->Project Settings->Input 字段解释参见: http://www.ceeger.com/Components/class-InputManager.html 对应脚本类Input http://www.ceeger.com/Script/Input/Input.html

阅读全文>>

标签: Unity3d

评论(0) 浏览(5686)

屏幕拾取

作者:追风剑情 发布于:2016-1-27 14:42 分类:Unity3d

示例一: 判断鼠标选中的物体 using UnityEngine; using System.Collections; public class ScreenPointToRayTest : MonoBehaviour { void Update() { if (Input.GetMouseButtonDown(0)) { ...

阅读全文>>

标签: Unity3d

评论(0) 浏览(4528)

动画事件——AnimationEvent

作者:追风剑情 发布于:2016-1-27 11:17 分类:Unity3d

一、创建一个Cube并选中,   二、创建个脚本并挂在Cube上 using UnityEngine; using System.Collections; public class AnimationEventTest : MonoBehaviour { void Event0 () { print("Event0")...

阅读全文>>

标签: Unity3d

评论(0) 浏览(6073)

协程——Coroutine

作者:追风剑情 发布于:2016-1-26 14:31 分类:Unity3d

using UnityEngine; using System.Collections; public class YieldTest : MonoBehaviour { public void Awake() { print("Begin Awake"); //StartCoroutine("FunCoroutine1"); ...

阅读全文>>

标签: Unity3d

评论(0) 浏览(6852)

获取设备信息——SystemInfo

作者:追风剑情 发布于:2016-1-25 14:45 分类:Unity3d

using UnityEngine; using System.Text; using System.Collections; public class SystemInfoTest : MonoBehaviour { void Start() { StringBuilder sb = new StringBuilder(); ...

阅读全文>>

标签: Unity3d

评论(0) 浏览(9282)

绘制纹理——GUI.DrawTexture()

作者:追风剑情 发布于:2016-1-21 11:22 分类:GUI

using UnityEngine; using System.Collections; public class DrawTextureTest : MonoBehaviour { public Texture aTexture; void OnGUI() { if (null == aTexture) { ...

阅读全文>>

标签: GUI

评论(0) 浏览(6850)

Profiler连接真机调试

作者:追风剑情 发布于:2016-1-20 10:44 分类:Unity3d

方案一、通过Wifi连接 方案二、通过ADB连接 步骤1: 打包   步骤2: 在cmd中执行adb 关闭windows的防火墙 adb forward tcp:54999 localabstract:Unity-包名   步骤3: 在unity中打开profiler窗口...

阅读全文>>

标签: Unity3d

评论(0) 浏览(10890)

NGUI绘制饼状图

作者:追风剑情 发布于:2016-1-18 19:22 分类:NGUI

using UnityEngine; using System.Collections; /// <summary> /// 饼状图 /// </summary> public class PieChart : MonoBehaviour { public UITexture texture; public int radius = 10;...

阅读全文>>

标签: NGUI

评论(0) 浏览(6787)

自定义光照模型

作者:追风剑情 发布于:2016-1-17 18:31 分类:Shader

一、创建Shader Shader "Custom/BlinnPhong" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _MainTint ("Diffuse Tint", Color) = (1,1,1,1)//色调 _SpecularColor ("Specular Color", Color)...

阅读全文>>

标签: Shader

评论(0) 浏览(5077)

对数组随机排序

作者:追风剑情 发布于:2016-1-13 20:15 分类:Algorithms

public static void RandSortArray(List<int> arr) { int size = arr.Count; int seed = 10000; //对给定数组随机排序, 每组排列的概率都为 1/size的阶乘 System.Random rand = new System.Ra...

阅读全文>>

标签: Algorithms

评论(0) 浏览(4106)

播放视频

作者:追风剑情 发布于:2016-1-13 17:23 分类:Unity3d

Android 把mp4文件放到Assets\StreamingAssets下面 using UnityEngine; using System.Collections; public class MovieTest : MonoBehaviour { void Start () { if (Application.platform ...

阅读全文>>

标签: Unity3d

评论(0) 浏览(4101)

动态创建纹理贴图

作者:追风剑情 发布于:2016-1-9 12:03 分类:Shader

using UnityEngine; using System.Collections; public class GenerateTexture : MonoBehaviour { public int widthHeight = 512; public Texture2D generatedTexture; private Material currentMater...

阅读全文>>

标签: Shader

评论(0) 浏览(5274)

静态注册Receiver

作者:追风剑情 发布于:2016-1-8 15:19 分类:Android

所谓静态注册Receiver,就是指在AndroidManifest.xml中配置。这样做的好处是app无需启动也能接收到广播消息。 示例: 静态注册GCM Broacase Receiver <!-- IGAWorks GCM Broacase Receiver --> <receiver //指定一个继承了android.content....

阅读全文>>

标签: Android

评论(0) 浏览(5110)

Path类

作者:追风剑情 发布于:2016-1-5 18:13 分类:C#

此类用于处理文件路径 using System; using System.IO; namespace PathTest { class Program { static void Main(string[] args) { string s; Console.WriteLi...

阅读全文>>

标签: C#

评论(0) 浏览(4394)

Windows安装OpenSSL组件

作者:追风剑情 发布于:2016-1-4 19:29 分类:其他

安装方法一:直接下载Win32 OpenSSL安装程序 http://slproweb.com/products/Win32OpenSSL.html 安装方法二:编译openssl源码 参考:http://www.cnblogs.com/ZhouL3777/archive/2012/10/21/2732890.html 安装方法也可在openss...

阅读全文>>

标签: 批处理

评论(0) 浏览(8475)

色阶

作者:追风剑情 发布于:2016-1-3 16:08 分类:Shader

色阶Shader Shader "Custom/LevelsShader" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _inBlack ("Input Black", Range(0, 255)) = 0 _inGamma ("Input Gamma", Range(0, 255)) = 1.61...

阅读全文>>

标签: Shader

评论(0) 浏览(5520)

ScriptableObject

作者:追风剑情 发布于:2015-12-31 17:58 分类:Unity3d

继承ScriptableObject的子类对象可以被序列化成文件保存。   ScriptableObjectEditor.cs using UnityEngine; using UnityEditor; using System.Collections; public class ScriptableObjectE...

阅读全文>>

标签: Unity3d

评论(0) 浏览(6752)

绘制辅助线框——Gizmos

作者:追风剑情 发布于:2015-12-29 16:52 分类:Unity3d

一、创建一个空GameObject和脚本GizmosTest.cs using UnityEngine; using System.Collections; [ExecuteInEditMode]//让脚本在编辑模式下运行 public class GizmosTest : MonoBehaviour { Transform mTran; void St...

阅读全文>>

标签: Unity3d

评论(0) 浏览(6230)

判断obb文件是否存在

作者:追风剑情 发布于:2015-12-25 17:16 分类:Android

一、配置权限 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission andro...

阅读全文>>

标签: Android

评论(0) 浏览(15985)

Animation

作者:追风剑情 发布于:2015-12-25 11:51 分类:Unity3d

一、工程结构   二、创建AnimationTest.cs脚本并挂在箭塔上 using UnityEngine; using System.Collections; public class AnimationTest : MonoBehaviour { public Animation ...

阅读全文>>

标签: Unity3d

评论(0) 浏览(5450)

AlertDialog

作者:追风剑情 发布于:2015-12-24 17:10 分类:Android

示例一: 确认/取消 对话框 /** * 退出游戏确认对话框 */ public void exitGameDialog(String title, String message, String positiveButton, String negativeButton, boolean cancel) { AlertDialog.Builder ...

阅读全文>>

标签: Android

评论(0) 浏览(4482)

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号