标签:inverse form turn for point npos ngui position 中间
将世界坐标转成NGUI坐标,这个中间须要一个屏幕坐标,可參考例如以下代码:
/// <summary> /// 将世界坐标转成UI坐标 /// </summary> /// <param name="wordPos">Word position.</param> public Vector3 wordPos_to_uiPos(Vector3 wordPos) { Vector3 screenPos = Camera.main.WorldToScreenPoint (wordPos); screenPos = new Vector3 (screenPos.x, screenPos.y, 0f); Vector3 uiPos = uiCamera.ScreenToWorldPoint (screenPos); uiPos = uiCamera.transform.InverseTransformPoint (uiPos); return uiPos; }
标签:inverse form turn for point npos ngui position 中间
原文地址:http://www.cnblogs.com/yxysuanfa/p/6860737.html