close

該程式碼是套用在 Image(舉例) 物件上,如下圖所示:

Unity (64bit) - Test.unity - New Unity Project 22 - PC, Mac & Linux Standalone DX11  

RectTransform rt = GetComponent<RectTransform> ();

rt.anchoredPosition3D = new Vector3 (0, 0, 0); // 設定 座標 Pos X, Pos Y, Pos Z
rt.sizeDelta = new Vector2 (t.width, t.height); // 設定 寬, 高 Width, Height
rt.localEulerAngles = new Vector3 (0, 0, 45); // 設定 旋轉 Rotation
rt.localScale = new Vector3 (0.5f, 0.5f, 0.5f); // 設定 大小 Scale






arrow
arrow
    全站熱搜

    黃彥霖 發表在 痞客邦 留言(0) 人氣()