摘要: http://www.gamelook.com.cn/2013/02/109109 阅读全文
posted @ 2013-02-18 19:31 渡蓝 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 相关文档:file:///C:/Program%20Files/Unity3.5/Editor/Data/Documentation/Documentation/ScriptReference/index.Script_compilation_28Advanced29.html有中文文档,但是感觉还是先看英文的,如果怕理解不透测再参照中文文档看。个人感觉获益良多http://game.ceeger.com/Script/Overview/Overview.Script_compilation.html最近有个单子,是关于设置泛光效果的。因为泛光效果的脚本是java的。要做到功能很简单,其实就是 阅读全文
posted @ 2012-12-04 10:05 渡蓝 阅读(439) 评论(0) 推荐(0) 编辑
摘要: 创建一个分支选择分支,点gitbashgit checkout -b (branchName) ---------------------- 创建分支 阅读全文
posted @ 2012-09-19 17:29 渡蓝 阅读(201) 评论(0) 推荐(0) 编辑
摘要: VAR 是3.5新出的一个定义变量的类型其实也就是弱化类型的定义;VAR可代替任何类型编译器会根据上下文来判断你到底是想用什么类型的;至于什么情况下用到VAR ,我想就是你无法确定自己将用的是什么类型就可以使用VAR ; 类似OBJECT但是效率比OBJECT高点使用var定义变量时有以下四个特点:1.必须在定义时初始化。也就是必须是var s = “abcd”形式,而不能是如下形式:var s;s = “abcd”;2.一旦初始化完成,就不能再给变量赋与初始化值类型不同的值了。3.var要求是局部变量。4.使用var定义变量和object不同,它在效率上和使用强类型方式定义变量完全一样。 阅读全文
posted @ 2012-09-17 10:17 渡蓝 阅读(751) 评论(0) 推荐(2) 编辑
摘要: Windows系统Unity3D中的快捷键组合键键功能File 文件CtrlNNew Scene 新建场景CtrlOOpen Scene 打开场景CtrlSSave Scene 保存CtrlShiftSSave Scene as 保存场景为CtrlShiftBBuild Settings... 编译设置...CtrlBBuild and run 编译并运行Edit 编辑CtrlZUndo 撤消CtrlYRedo 重做CtrlXCut 剪切CtrlCCopy 拷贝CtrlVPaste 粘贴CtrlDDuplicate 复制ShiftDelDelete 删除FFrame selected 选择的帧 阅读全文
posted @ 2012-08-23 11:28 渡蓝 阅读(934) 评论(0) 推荐(1) 编辑
摘要: 概念了解:1、什么是匿名委托(匿名方法的简单介绍、为什么要用匿名方法)2、匿名方法的【拉姆达表达式】方法定义3、匿名方法的调用(匿名方法的参数传递、使用过程中需要注意什么)什么是匿名方法?匿名方法是C#2.0引入的一个新特性,它允许开发者声明自己的函数代码而无须使用委托函数。C#为委托提供一种机制,可以为委托定义匿名方法,匿名方法没有名称,编译器会定指定一个名称,匿名方法中不能使用跳转语句跳转到该匿名方法的外部,也不能跳转到该方法的内部。也不能在匿名方法外部使用的ref和out参数。通过使用匿名方法,可以不必创建单独的方法,因此减少了实例化委托所需的编码系统开销。例如,如果创建方法所需的系统开 阅读全文
posted @ 2012-08-17 14:23 渡蓝 阅读(7316) 评论(3) 推荐(0) 编辑
摘要: http://game.ceeger.com/Script/Application/Application.CaptureScreenshot.html[java]function OnGUI(){ if(GUI.Button(Rect(Screen.width*0.5-50,Screen.height*0.5-50,100,100),"screen")){ Application.CaptureScreenshot("Screenshot.png"); }}【c#】using UnityEngine; using System.Collections; 阅读全文
posted @ 2012-08-08 18:24 渡蓝 阅读(1690) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine;using System.Collections;public class RonmandMove : MonoBehaviour { // Use this for initialization Vector3 randomPoint = Vector3.zero; bool moving = false; void Awake() { randomPoint = new Vector3(Random.Range(-30,30),transform.position.y,Rand... 阅读全文
posted @ 2012-08-02 14:10 渡蓝 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 原文地址http://www.unifycommunity.com/wiki/index.php?title=General_Performance_TipsScriptingAre you using the right algorithm? Selecting the rightalgorithm for a task yields much better optimization than any othercode tweaking you might do. Note that the best algorithm is notalways the one with the low. 阅读全文
posted @ 2012-07-26 14:29 渡蓝 阅读(847) 评论(0) 推荐(1) 编辑
摘要: Unity内部的脚本,是通过附加自定义脚本对象到游戏物体组成的。在脚本对象内部不同的函数被特定的事件调用。最常用的列在下面:Awake: 在MonoBehavior创建后就立刻调用Start: 将在MonoBehavior创建后在该帧Update之前,在该Monobehavior.enabled == true的情况下执行。当MonoBehavior没有定义[ExecuteInEditMode]时 总结:我们尽量将其他Object的reference设置等事情放在Awake处理。然后将这些reference的Object的赋值设置放在Start()中来完成。当MonoBehavior有定义[. 阅读全文
posted @ 2012-07-25 11:30 渡蓝 阅读(5444) 评论(0) 推荐(1) 编辑
摘要: 之前做工具时需要获取Gameobject下所有子物件,删除除了某个子物件之外其他子物件上的除了tranform的组件关于代码片段View Code 1 //获取所有子物体 2 foreach (Transform t in go.transform) 3 { 4 if (!t.name.Equals("Quality")) 5 { 6 UnityEngine.Object.... 阅读全文
posted @ 2012-07-20 10:43 渡蓝 阅读(732) 评论(1) 推荐(0) 编辑
摘要: 如题需求using UnityEngine;using System.Collections;using UnityEditor;using System.Collections.Generic;public class DestroySubComponent{ [MenuItem("Assets/Example/DestroySubComponent")] public static void DestroySubCom() { UnityEngine.Object[] selection = Selection.GetFiltered(typeof(UnityEngin 阅读全文
posted @ 2012-07-18 16:44 渡蓝 阅读(266) 评论(0) 推荐(0) 编辑
摘要: unity3d 提供了比读取txt,xml更好用的ScriptableObject(脚本对象化)。为了方便于版本管理,一般会添加一个版本号(guid) 1 public class ScriptObjectCOS : ScriptableObject 2 { 3 public string guid = ""; 4 } 5 6 public class LevelPortalRefTable : ScriptObjectCOS 7 { 8 public List<LevelPortalRef> levelPortalRefList = new List<L 阅读全文
posted @ 2012-07-16 10:35 渡蓝 阅读(390) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine;using System.Collections;public class StoneDrop : MonoBehaviour { public floatfireTime; //开火时间 public floatcoolTime; //冷却时间 void Start() {coolTime = 2.0f; } // Update iscalled once per frame void Update() {if(fireTime < coolTime){fireTime += Time.deltaTime;}if(fireTime > cool 阅读全文
posted @ 2012-07-15 14:27 渡蓝 阅读(718) 评论(0) 推荐(0) 编辑
摘要: 三层结构http://www.cnblogs.com/gaoweipeng/archive/2009/01/18/1377855.html设计模式http://www.cnblogs.com/zhenyulu/category/6930.html 阅读全文
posted @ 2012-07-06 17:53 渡蓝 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 1,c# 中return;和return null;有什么不同么?return:当前方法返回值类型为void的时候,运行到return;语句时候,直接返回,在该方法中return语句后的语句不再执行。return null:当有方法有返回值的时候使用 return null表示返回不存在对某个对象的引用,一般是方法出了异常的时候返回null。如果强行对返回的null对象引用会出现“未将对象引用设置到对象实例的错误”。 阅读全文
posted @ 2012-04-23 09:10 渡蓝 阅读(355) 评论(0) 推荐(0) 编辑
摘要: 如当前的需求是对一好友列表排序。好友的信息结构public class Friend{ public int characterID;//好友角色ID public string name;//名字 public int level;//级别 public int raceID;//种族ID public int classID;//职业ID public int state;//relationshipType 0:单向好友;1:双向好友 public int flag;//标志位:0:无效(删除);1:有效;2:暂时好友 public int onlineFlag;//是否在线0:不在线; 阅读全文
posted @ 2012-04-17 14:51 渡蓝 阅读(530) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2012-03-30 09:58 渡蓝 阅读(299) 评论(3) 推荐(0) 编辑