1. Hey everybody,

    how can i define a CUIPanel name to destroy it later?

    Code:
    void create()
    {
                var elements = new CuiElementContainer();
                guiInfo[player.userID] = CuiHelper.GetGuid();            var mainName = elements.Add(new CuiPanel
                {
                    Image =
                    {
                        Color = "0.2 0.2 0.2 1"
                    },
                    RectTransform =
                    {
                        AnchorMin = "0.001 0.001",
                        AnchorMax = "0.999 0.999"
                    },
                    CursorEnabled = true
                });
                CuiHelper.AddUi(player, elements);
    }void destroy()
    {
    name of gui?
    }
     
  2. Use the Name attribute to specify its name, then later on,
    Code:
    CuiHelper.DestroyUi(player, "thename");
     
  3. Thank i now how to destroy but who can i set the name of the gui on create?

    var mainName = elements.Add(new CuiPanel
    {
    name = ""

    doesn't work
    [DOUBLEPOST=1472325621][/DOUBLEPOST]You can only use the name attribute on new CuiElement but not on CuiPanel.
    [DOUBLEPOST=1472325933][/DOUBLEPOST]Ok i got it work. you must set the name attribut at the bottom

    Code:
                var mainName = elements.Add(new CuiPanel
                {
                    Image =
                    {
                        Color = "0.2 0.2 0.2 1"
                    },
                    RectTransform =
                    {
                        AnchorMin = "0.001 0.001",
                        AnchorMax = "0.999 0.999"
                    },
                    CursorEnabled = true
                }, "Hud", "GUINAME);