播放视频

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

动态创建纹理贴图

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

静态注册Receiver

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

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

阅读全文>>

标签: Android

评论(0) 浏览(3733)

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) 浏览(2825)

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) 浏览(6413)

色阶

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

ScriptableObject

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

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

阅读全文>>

标签: Unity3d

评论(0) 浏览(4927)

绘制辅助线框——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) 浏览(4089)

判断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) 浏览(14371)

Animation

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

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

阅读全文>>

标签: Unity3d

评论(0) 浏览(3658)

AlertDialog

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

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

阅读全文>>

标签: Android

评论(0) 浏览(2816)

判断当前网络连接类型

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

public void onClick(View view) { TextView textView = (TextView) findViewById(R.id.infoText); ConnectivityManager con=(ConnectivityManager)getSystemService(Activity.CONNECTIVITY_SERVICE); Ne...

阅读全文>>

标签: Android

评论(0) 浏览(2959)

手动设置Off-Mesh Link

作者:追风剑情 发布于:2015-12-10 20:21 分类:Unity3d

一、新建两个地面(Panel),如图: Hierarchy Scene 二、在Nav_Capsule对象上挂NavMeshAgent组件以及NavMeshAgentTest.cs脚本。 NavMeshAgentTest是用来响应鼠标点击地面操作。 三、在link_star...

阅读全文>>

标签: Unity3d

评论(0) 浏览(6370)

拓扑排序(一)

作者:追风剑情 发布于:2015-12-6 19:34 分类:Algorithms

拓扑排序与AOV、AOE网主要用来处理工程管理的。 在图论中,一个有向无环图的所有顶点可以排成一个线性序列,当这个线性序列满足以下条件时,称该序列为一个满足图的拓扑次序(topological order)的序列。 (1)图中的每个顶点在序列中只出现一次; (2)对于图中任意一条有向边(u, v),在该序列中顶点u一定位于顶点v之前。 ...

阅读全文>>

标签: Algorithms

评论(0) 浏览(3384)

调用dll

作者:追风剑情 发布于:2015-12-5 13:53 分类:Unity3d

调用C# DLL接口 一、用Visual Studio生成一个dll 因为unity只支持.NET Framework 2.0,所以生成dll时一定要设置成使用.NET Framework 2.0 如果.NET版本过高,unity会报以下错: Internal compiler error. See the console l...

阅读全文>>

标签: Unity3d

评论(0) 浏览(4769)

MD5加密

作者:追风剑情 发布于:2015-12-3 15:10 分类:C#

需导入 using System.Security.Cryptography; public static class MD5Crypto { //MD5加密(生成32位字符码) public static string Encrypt(string input) { //注意: 编码不同,生成的MD5值也不同 byte[] buffer = Encoding....

阅读全文>>

标签: C#

评论(0) 浏览(2844)

NGUI的UISprite增加灰度处理

作者:追风剑情 发布于:2015-12-3 14:23 分类:NGUI

一、修改Unlit - Transparent Colored.shader Shader "Unlit/Transparent Colored" { Properties { _MainTex ("Base (RGB), Alpha (A)", 2D) = "white" {} } SubShader { LOD 100 Tags ...

阅读全文>>

标签: NGUI

评论(0) 浏览(6140)

camera.depth

作者:追风剑情 发布于:2015-12-3 12:21 分类:Unity3d

摄相机的depth属性用来控制多个相机渲染顺序。depth越大的相机,它所渲染的物体越靠前。 例如: 设置camera在主相机之后渲染 camera.depth = Camera.main.depth + 1;

阅读全文>>

标签: Unity3d

评论(0) 浏览(2718)

DateTime

作者:追风剑情 发布于:2015-12-2 11:43 分类:C#

示例一 using System; using System.Globalization; namespace DateTimeTest { class Program { static void Main(string[] args) { string timeStr; ...

阅读全文>>

标签: C#

评论(0) 浏览(2668)

获取相机在屏幕上的渲染区域

作者:追风剑情 发布于:2015-11-27 19:20 分类:Unity3d

示例: 让物体在屏幕上居中显示 创建一个Cube,并在其上挂上脚本UIAnchorCenter.cs using UnityEngine; /// <summary> /// 物体居中显示脚本 /// </summary> public class UIAnchorCenter : MonoBehaviour { void Star...

阅读全文>>

标签: Unity3d

评论(0) 浏览(3966)

GUILayoutOption

作者:追风剑情 发布于:2015-11-26 17:52 分类:GUI

内部类用于传递布局选项给GUILayout函数。你不要直接使用这些,而是在GUILayout类布局函数中构造它们。 参见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.Expand...

阅读全文>>

标签: GUI

评论(0) 浏览(5114)

GUIContent

作者:追风剑情 发布于:2015-11-26 17:45 分类:GUI

using UnityEngine; using System.Collections; public class GUITest : MonoBehaviour { public Texture texture; public string text = "button text"; public string toolTip = "button too...

阅读全文>>

标签: GUI

评论(0) 浏览(4597)

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号