Exemplo n.º 1
0
        public void Start()
        {
            List <CachedPrefabPickMenu> menus = new List <CachedPrefabPickMenu>();

            _prefabs = LoadComponents();
            var groups = _prefabs.GroupBy(x => x.GetCache().GetComponent <TurretComponent>().Category);

            foreach (var group in groups)
            {
                var menuObj = Instantiate(ComponentMenuPrefab, ComponentMenuParent);
                CachedPrefabPickMenu menu = menuObj.GetComponent <CachedPrefabPickMenu>();
                menu._Name = group.Key.Name;
                menu.AddPickables(group);

                menus.Add(menu);
            }

            TabMenu.SetSubmenus(menus.ToArray());
        }