unity 点击模型出现标签

 void OnGUI() {
       if (ifDown) {
            Vector3 worldToScreen = Camera.main.WorldToScreenPoint(transform.position);
            GUIStyle style1 = new GUIStyle();
            style1.fontSize = 30;
            style1.normal.textColor = Color.red;
            Rect rec = new Rect(worldToScreen.x, Screen.height - worldToScreen.y, 400, 50);
            GUI.Label(rec, "123123", style1);
       }
    }

 

posted on 2020-06-18 17:04  zqiang0803  阅读(551)  评论(0编辑  收藏  举报

导航