コード例 #1
0
    /// <summary>
    /// crea gli oggetti selezionabili.
    /// </summary>
    /// <param name="_item"></param>
    protected override void CreateMenuItem(ISelectable _item)
    {
        GameObject         newGO   = Instantiate(ButtonPrefab, MenuItemsContainer);
        SelectableMenuItem newItem = newGO.GetComponent <SelectableMenuItem>();

        newItem.SetData(_item);
    }
コード例 #2
0
ファイル: MenuBase.cs プロジェクト: Tiger1301/DoomStock
    /// <summary>
    /// Crea un nuovo MenuItem per i button
    /// </summary>
    /// <param name="_item"></param>
    protected virtual void CreateMenuItem(ISelectable _item)
    {
        GameObject         newGO     = Instantiate(ButtonPrefab, MenuItemsContainer);
        SelectableMenuItem newButton = newGO.GetComponent <SelectableMenuItem>();

        newButton.SetData(_item);
        //newButton.onClick.AddListener(() => this.AddSelection(newButton.SelectionData));
    }