Exemplo n.º 1
0
    /// <summary>
    /// Adds a menu item and the option to include a sub menu
    /// </summary>
    public void AddMenuItem(string description, ContextMenuItem.StandardDelegate onClickMethod, ContextMenu subMenu)
    {
        ContextMenuItem temp = Instantiate <GameObject>(menuItemPrefab.gameObject).GetComponent <ContextMenuItem>();

        temp.transform.SetParent(menuLayout.transform);
        temp.transform.localScale    = Vector3.one;//reset the scale, the position is handled auotmatically
        temp.transform.localPosition = Vector3.zero;

        temp.Initialise(this, description, onClickMethod, subMenu);

        menuItems.Add(temp);
    }
Exemplo n.º 2
0
 public void AddMenuItem(string description, ContextMenuItem.StandardDelegate onClickMethod)
 {
     AddMenuItem(description, onClickMethod, null);
 }