增加自由锚点支持,任意对齐方式

This commit is contained in:
monitor1394
2020-04-28 12:28:05 +08:00
parent e512d27784
commit f4f1bb4b54
28 changed files with 11372 additions and 4675 deletions

View File

@@ -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)]