摘要:
分享一点MonoBehaviour的事件和具体功能总结的基础知识,苦于Visual Studio 2013没有对MonoBehaviour的行为做出智能提示,写个函数都要全手打,记性好的将就着手打,脑残一点的就复制粘贴,我就是后者。我曾经把MonoBehaviour的所有事件写成代码片段,后来快捷键... 阅读全文
摘要:
1.Invoke(string methodName,float time)在一定时间调用methodName函数using UnityEngine;using System.Collections; public class example : MonoBehaviour { public ... 阅读全文
摘要:
多点触控时,下标是从0开始的,两个触控点下标就是0,1。代码如下:nt touchCount = 2; // 触摸帧的数量if(touchCount == Input.touchCount()){vector2 touchPosition1 = Input.GetTouch(0).position;... 阅读全文
摘要:
"."的用法: TSprite = { x = 0, y = 0, } function TSprite.setPosition(m, x ,y) m.x = x; m.y = y end local who =... 阅读全文
摘要:
private delegate void FlushClient(); //委托 private void Form1_Load(object sender, EventArgs e) { Thread thread = new T... 阅读全文
摘要:
Depth是全局的,并不是相对于父层,父与子深度一样时,子层更“深” 阅读全文
摘要:
在Unity3D中,Vector3.Dot表示求两个向量的点积;Vector3.Cross表示求两个向量的叉积。 点积计算的结果为数值,而叉积计算的结果为向量。两者要注意区别开来。 在几何数学中:1.点积 点积的计算方式为:a·b=|a|·|b|cos其中|a|和|b|表示向量的模,表示两个向量的夹... 阅读全文
摘要:
table的使用:redat1 = {["mon"] = 1, ["tue"] = 2}print(redat1["mon"])redat2 = {1, 3}print(redat2[1])输出:1 1二维:d = {}d[1123] = {["q"] = 1,["w"] = 2,["e"] = 3... 阅读全文
摘要:
场景加载:Application.LoadLevel(Application.loadedLevel); // 重新调用当前场景Application.LoadLevel(0); // 调用你在设置里摆放的场景,按你的摆放顺序调Application.LoadLevel("SceneName"); ... 阅读全文
摘要:
例如:你想调用已经实例了的Player对象里的PlayJumpTo代码里的Jump()函数private PlayJumpTo playJumpto;private GameObject playerObj; void Start() { playerObj = GameObject.Find... 阅读全文