- 博客(18)
- 收藏
- 关注
转载 使用CSV存储游戏数据
using UnityEngine;using System.Collections;using System.IO;public class CSVFile { public string [][]Array; public string GetDataByRowAndCol(int nRow, int nCol) //
2016-09-01 21:01:13
1189
1
原创 简单的方块堆叠实现
if (Input.GetMouseButtonDown(0)) { Ray ray = GetComponent().ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit)
2016-08-24 21:46:52
2033
原创 Unity Shader入门精要读书笔记第二篇
Unity Shader 基础创建shader, unity 5.x中有4种模板可以选择1 Standard Surface Shader 会产生一个包含标准光照模型(使用了Unity 5中新添加的基于物理的渲染方法)的表面着色器模板2 Unlit Shader 会产生一个不包含光照(但包含雾效)的基本顶点/片元着色器3 Image Eff
2016-07-09 11:23:00
906
原创 Unity Shader入门精要读书笔记第一篇
渲染流水线计算机需要从一系列的顶点数据,为力等信息处罚,将这些信息最终转换成一张人眼可以看到的图像。这一渲染过程分成三个阶段:1. 应用阶段 :有开发者主导的阶段。例如,开发者使用了哪些数据,模型,光源等。通常在CPU负责实现。2. 几何阶段:处理所有和我们要绘制的几何相关的事情。例如,决定绘制的图元是什么,怎么绘制,在哪绘制等。通常在GPU上进行。3:光栅化阶
2016-07-08 10:55:22
1650
转载 C#目录操作 Path类与Directory类
网上的资料,做个笔记 自己用Path 类对包含文件或目录路径信息的 String 实例执行操作。 这些操作是以跨平台的方式执行的。路径是提供文件或目录位置的字符串。路径可以包含绝对或相对位置信息。若要确定当前目录,请调用 Directory.GetCurrentDirectory。Path 类的所有成员都是静态的,因此无需具有路径的实例即可被调用。 常用方法
2016-07-01 21:48:09
884
转载 C#中Directory 类的用法
Directory类位于System.IO 命名空间。Directory类提供了在目录和子目录中进行创建移动和列举操作的静态方法。此外,你还可以访问和操作各种各样的目录属性,例如创建或最后一次修改时间以及Windows访问控制列表等 需要引用using System.IO命名空间;下面使用unity测试一下方法在c盘TEST目录下新建一个NewDirectoty目录
2016-07-01 16:28:20
2280
转载 Assetbundle资料整理(二)
将创建好的资源 打包,置于指定的文件夹中。使用BuildPipeline.BuildAssetBundles方法http://blog.youkuaiyun.com/bianchengxiaosheng/article/details/44707423
2016-07-01 16:13:04
252
原创 AssetBundle资料整理
AssetBundle是将资源用Unity提供的一种用于储存资源的压缩格式打包后的集合,可以存储任意一种Unity可以识别的资源。AssetBundle的具体流程1. 创建AssetBundle 2. 上传到服务器3. 下载AssetBundle 4. 加载AssetBundle 5. 卸载AssetBundle 一. 创建AssetBund
2016-06-30 19:42:22
324
原创 ugui 点击物品后创建实例并拖拽
using UnityEngine;using System.Collections;using UnityEngine.EventSystems;using UnityEngine.UI;public class UIDragAble : MonoBehaviour ,IBeginDragHandler, IDragHandler , IEndDragHandler{
2016-06-27 16:19:59
1473
转载 lua 分割字符串
function Split(szFullString, szSeparator) //1.当前字符串 2.分割符号local nFindStartIndex = 1local nSplitIndex = 1local nSplitArray = {} while true do local nFindLastIndex = string.find(szFullStrin
2016-06-25 21:09:03
659
原创 游戏中广播消息公告(测试)
只是测试用,有很多bug,以后用到这个功能在完善吧 public GameObject RollingParent; public int index = 0; public string []aa; void Start () { RollingParent = GameObject.Find ("Canv
2016-06-24 18:00:34
4192
转载 字符串操作 string常用的函数
string MyStr = " Hello World! "; //length长度属性 打印结果 14 Debug.Log(MyStr.Length); //Substring()截取 打印结果 Hello W Debug.Log(MyStr.Substring(0, 8));
2016-06-24 15:04:15
332
原创 倒计时更新组件 每秒更新一次时间文字
using UnityEngine;using UnityEngine.UI;using System.Collections;/// summary>/// Time text update. 倒计时更新组件 每秒更新一次时间文字/// summary>public class TimeTextUpdate : MonoBehaviour { Text te
2016-06-24 14:14:21
911
原创 封装一个进度条倒计时更新
using UnityEngine;using UnityEngine.UI;using System.Collections;public class UIProgressUpdate : MonoBehaviour { RectTransform rectTransform; long maxTime; long curTime = 0;
2016-06-24 14:09:45
365
转载 ugui组件添加事件处理的方法
void Start() { Toggle toggle = gameObject.GetComponentToggle>(); if (toggle == null) { toggle = gameObject.AddComponentToggle>(); }
2016-06-24 11:41:10
404
转载 坐标转换
//2D转3D public static string curHitTag; public static Vector3 pointTo3d(Vector2 position,Camera mcamera,string layerName){ LayerMask mask = 1 LayerMask.NameToL
2016-06-24 11:12:27
308
转载 控制文字体颜色变换
public void SetFontColorOne() { var text = transform.FindChild("Text").gameObject.GetComponentText>(); if (text) text.text = "hello world"; } publi
2016-06-24 10:29:51
614
转载 动态绑定按钮事件
using UnityEngine;using System.Collections;using UnityEngine.UI;using System.Collections.Generic;using UnityEngine.Events;using UnityEngine.EventSystems;public class AddClickEvent : Mono
2016-06-24 10:14:20
402
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人