摘要: using UnityEngine; using System.Collections; public class DrawRectangle : MonoBehaviour { public Color rectColor = Color.green; private Material rectMat = null;//画线的材质 不设定系统会用当前材质画线 结果不可控 // U... 阅读全文
posted @ 2016-07-02 04:58 Shiyu_Huang 阅读(5595) 评论(0) 推荐(0)
摘要: 1、世界坐标→屏幕坐标:camera.WorldToScreenPoint(transform.position);这样可以将世界坐标转换为屏幕坐标。其中camera为场景中的camera对象。 2、屏幕坐标→视口坐标:camera.ScreenToViewportPoint(Input.GetTo 阅读全文
posted @ 2016-07-02 04:54 Shiyu_Huang 阅读(664) 评论(0) 推荐(0)