mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-25 02:10:16 +00:00
增加自由锚点支持,任意对齐方式
This commit is contained in:
@@ -66,6 +66,10 @@ namespace XCharts
|
||||
chart.transform.SetParent(parent);
|
||||
chart.transform.localScale = Vector3.one;
|
||||
chart.transform.localPosition = Vector3.zero;
|
||||
var rect = chart.GetComponent<RectTransform>();
|
||||
rect.anchorMin = new Vector2(0.5f, 0.5f);
|
||||
rect.anchorMax = new Vector2(0.5f, 0.5f);
|
||||
rect.pivot = new Vector2(0.5f, 0.5f);
|
||||
}
|
||||
|
||||
[MenuItem("GameObject/XCharts/LineChart", priority = 44)]
|
||||
|
||||
Reference in New Issue
Block a user