How to modify RectTransform properties in script [Unity 4.6 beta]

后端 未结 7 917
面向向阳花
面向向阳花 2020-12-24 15:03

\"enter

Hello, I\'m using the new UI system from Unity 4.6 beta...

Tried diffe

相关标签:
7条回答
  • 2020-12-24 15:46

    try to use something like that [in C#]:

     ...
    
        RectTransform rTrans = (RectTransform) transform.GetComponent<RectTransform>();
    
        // set new width and height
    
        rTrans.anchoredPosition = new Vector2(15, 200);
    
        ...
    
    0 讨论(0)
提交回复
热议问题