public static void AddPanel(MenuCommand menuCommand) { GameObject panel = DefaultControls.CreatePanel(MenuOptions.GetStandardResources()); MenuOptions.PlaceUIElementRoot(panel, menuCommand); RectTransform component = panel.GetComponent <RectTransform>(); component.anchoredPosition = Vector2.zero; component.sizeDelta = Vector2.zero; }
static public void AddPanel(MenuCommand menuCommand) { GameObject go = DefaultControls.CreatePanel(GetStandardResources()); PlaceUIElementRoot(go, menuCommand); // Panel is special, we need to ensure there's no padding after repositioning. RectTransform rect = go.GetComponent <RectTransform>(); rect.anchoredPosition = Vector2.zero; rect.sizeDelta = Vector2.zero; }