📜  如何调整面板统一的大小 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:09.289000             🧑  作者: Mango

代码示例1
// To Change the "Scale" property use localScale, like this
// Change the numbers in the "()" to your choosen scale
public GameObject YourPanel;
YourPanel.GetComponent().localScale = new Vector3(newWidthUI, newHeightUI, 1);

// If you want to change it in pixels
public GameObject yourUI;
yourUI.GetComponent().sizeDelta = new Vector2(newWidthUI,newHeightUI);