Exemplo n.º 1
0
    static public void AddToggle(MenuCommand menuCommand)
    {
        GameObject go;

        using (new FactorySwapToEditor())
            go = DefaultControls.CreateToggle(MenuOptions.GetStandardResources());
        MenuOptions.PlaceUIElementRoot(go, menuCommand);
    }
Exemplo n.º 2
0
    static public void AddPanel(MenuCommand menuCommand)
    {
        GameObject go;

        using (new FactorySwapToEditor())
            go = DefaultControls.CreatePanel(MenuOptions.GetStandardResources());
        MenuOptions.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;
    }