随笔分类 - Unity3d
摘要:1.下载Opencv for unity. 2.把OpenCVForUnity下的StreamingAssets拖到Assets下。 3.点击Tools->opencv for unity->set plugin import settings. 4. using UnityEngine; usin
阅读全文
摘要:using UnityEngine; using System.Collections; public class dynaMesh : MonoBehaviour { public SkinnedMeshRenderer meshRenderer; public MeshCollider coll
阅读全文
摘要:1.Invoke(string methodName,float time) 在一定时间调用methodName函数 using UnityEngine; using System.Collections; public class example : MonoBehaviour { public
阅读全文
摘要:using UnityEngine; using System.Collections; public class DrawRectangle : MonoBehaviour { public Color rectColor = Color.green; private Material rectMat = null;//画线的材质 不设定系统会用当前材质画线 结果不可控 // U...
阅读全文
摘要:1、世界坐标→屏幕坐标:camera.WorldToScreenPoint(transform.position);这样可以将世界坐标转换为屏幕坐标。其中camera为场景中的camera对象。 2、屏幕坐标→视口坐标:camera.ScreenToViewportPoint(Input.GetTo
阅读全文
摘要:if (Input.GetKeyDown(KeyCode.A)){ Debug.Log("您按下了A键"); } if (Input.GetKeyUp(KeyCode.A)) { Debug.Log("您抬起了A键"); }
阅读全文
摘要:1.Application.CaptureScreenshot("Screenshot.png", 0); 2. 截中间4分之(如下图):CaptureScreenshot2( new Rect( Screen.width*0.25f, Screen.height*0.25f, Screen.wid
阅读全文