iLMS知識社群歷程檔登入
位置: 黃國哲 > Unity
1140104 物件名稱
by 黃國哲 2025-01-04 16:46:53, 回應(0), 人氣(12)
using UnityEngine;

public class Following : MonoBehaviour
{
    // Start is called once before the first execution of Update after the MonoBehaviour is created

    public Camera m_Camera = null;
    public GameObject m_goFollowing = null;
    public Vector3 m_vOffset;


void OnGUI()

Vector3 vPosScreen = m_Camera.WorldToScreenPoint(m_goFollowing.transform.position + m_vOffset);
GUI.Label
.Label
(new Rect(vPosScreen.x, Screen.height 
- vPosScreen.y, 200, 80), 
this.name);  


GUI.skin.label.fontSize = 30;
GUILayout.Label("HELLO WORLD", GUILayout.Width(300), GUILayout.Height(50)))


https://blog.csdn.net/zuoyamin/article/details/17261361
回應