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

 

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






文章標籤
全站熱搜
創作者介紹
創作者 黃彥霖 的頭像
黃彥霖

彥霖 實驗筆記

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