关于unity中3DText的使用

public override void OnPointerMove(Vector3 postion)
{

if (wallhight == null)
{
wallhight = new GameObject("wallhight");
wallhight.AddComponent();
Camera = GameObject.Find("Main Camera");
}
high = (int)DeviceInfo.target.transform.localScale.y;
wallhight.GetComponent().text = high.ToString();
wallhight.transform.position = new Vector3(postion.x, postion.y + 0.5f, postion.z);
wallhight.GetComponent().color = Color.black;
wallhight.GetComponent().characterSize = 0.3f;
wallhight.transform.LookAt(Camera.transform);

}

这是我自己关于画墙的一个高度的显示,具体的可以去参考官方手册。重要的其实只有这一句:GetComponent().Text="";

你可能感兴趣的:(一百天系列之unity3d)