Ejemplo n.º 1
0
    public void Show(string title, List <ButtonData> options)    // string needs to be changed
    {
        canvas.SetActive(true);
        Clear();

        float degree = -360 / options.Count;

        for (int i = 0; i < options.Count; i++)
        {
            CommandMenuButton button = Dequeue();

            //set selectionNum

            button.selectionNum = i;
            //set eulerAngle
            tempRT = button.GetComponent <RectTransform>();
            tempRT.localEulerAngles         = new Vector3(0, 0, degOffset + i * degree);
            button.childRT.localEulerAngles = new Vector3(0, 0, -degOffset - i * degree);

            button.Setup(options[i]);
            buttons.Add(button);
        }
        SetSelection(0);
        TogglePos(true);
    }
Ejemplo n.º 2
0
    CommandMenuButton Dequeue()
    {
        Poolable          p     = GameObjectPoolController.Dequeue(EntryPoolKey);
        CommandMenuButton entry = p.GetComponent <CommandMenuButton>();

        entry.transform.SetParent(buttonCenter, false);
        entry.transform.localScale = Vector3.one;
        entry.GetComponent <RectTransform>().localPosition = Vector3.zero;
        entry.gameObject.SetActive(true);
        entry.Reset();
        return(entry);
    }
Ejemplo n.º 3
0
    void Enqueue(CommandMenuButton entry)
    {
        Poolable p = entry.GetComponent <Poolable>();

        GameObjectPoolController.Enqueue(p);
    }