Exemplo n.º 1
0
    IEnumerator DisplayHosts()
    {
        while (client.PollHostList() == null)
        {
            yield return(new WaitForSeconds(.5f));
        }

        foreach (var h in client.PollHostList())
        {
            HostDisplay display = Instantiate(hostDisplay, container.transform) as HostDisplay;

            display.setInfo(h);
        }
    }
Exemplo n.º 2
0
        public IActionResult Hosts()
        {
            List <HostDisplay> HostDisplays = new List <HostDisplay>();

            if (_context.Hosts.FirstOrDefault() == null)
            {
                return(View("NoHosts"));
            }
            foreach (Host h in _context.Hosts)
            {
                HostDisplay newHost = new HostDisplay()
                {
                    name  = h.name,
                    image = h.image,
                    bio   = h.bio,
                    links = _context.Links.Where(l => l.host_id == h.id).ToList()
                };
                HostDisplays.Add(newHost);
            }
            return(View(HostDisplays));
        }