public override void OnPointerMove(Vector3 postion)
{
if (wallhight == null)
{
wallhight = new GameObject("wallhight");
wallhight.AddComponent<TextMesh>();
Camera = GameObject.Find("Main Camera");
}
high = (int)DeviceInfo.target.transform.localScale.y;
wallhight.GetComponent<TextMesh>().text = high.ToString();
wallhight.transform.position = new Vector3(postion.x, postion.y + 0.5f, postion.z);
wallhight.GetComponent<TextMesh>().color = Color.black;
wallhight.GetComponent<TextMesh>().characterSize = 0.3f;
wallhight.transform.LookAt(Camera.transform);
{
if (wallhight == null)
{
wallhight = new GameObject("wallhight");
wallhight.AddComponent<TextMesh>();
Camera = GameObject.Find("Main Camera");
}
high = (int)DeviceInfo.target.transform.localScale.y;
wallhight.GetComponent<TextMesh>().text = high.ToString();
wallhight.transform.position = new Vector3(postion.x, postion.y + 0.5f, postion.z);
wallhight.GetComponent<TextMesh>().color = Color.black;
wallhight.GetComponent<TextMesh>().characterSize = 0.3f;
wallhight.transform.LookAt(Camera.transform);
}
这是我自己关于画墙的一个高度的显示,具体的可以去参考官方手册。重要的其实只有这一句:GetComponent<TextMesh>().Text="";