Beispiel #1
0
        public void refresh(Hero[] heros, int selected)
        {
            foreach (DeviceItem item in list_)
            {
                Destroy(item.gameObject);
            }
            list_.Clear();

            foreach (Hero hero in heros)
            {
                DeviceItem item = GameObject.Instantiate(_phototype);
                item.transform.SetParent(this.transform);
                item.transform.position   = _phototype.transform.position;
                item.transform.localScale = _phototype.transform.localScale;
                if (hero.data.id == selected)
                {
                    item.select();
                }
                item.gameObject.SetActive(true);
                item.name = "UI@" + hero.data.name;
                item.refresh();
                list_.Add(item);
                item.setup(hero.transform, hero.data, hero.state);
            }
        }
Beispiel #2
0
 public void refresh(DeviceInfoList list)
 {
     foreach (DeviceItem device in list_)
     {
         DestroyImmediate(device.gameObject);
     }
     list_.Clear();
     foreach (DeviceInfo info in list)
     {
         DeviceItem item = GameObject.Instantiate(_phototype);
         item.setup(info);
         item.transform.SetParent(this.transform);
         item.transform.position   = _phototype.transform.position;
         item.transform.localScale = _phototype.transform.localScale;
         item.gameObject.SetActive(true);
         list_.Add(item);
     }
     //throw new NotImplementedException();
 }