Exemple #1
0
    void Start()
    {
        choose.onClick.AddListener(ChooseTask);
        cancle.onClick.AddListener(CancleTask);
        dropdown.onValueChanged.AddListener(ChangeText);
        dropdown.captionText.text = "Team List";

        teams = HTTPUtil.listTeam();
        foreach (TeamDTO team in teams)
        {
            dropdown.options.Add(
                new Dropdown.OptionData(team.id.ToString())
                );
        }
    }
Exemple #2
0
 void Update()
 {
     //刷新列表
     if ((timer -= Time.deltaTime) <= 0F)
     {
         timer = 1F;
         dropdown.options.Clear();
         teams = HTTPUtil.listTeam();
         foreach (TeamDTO team in teams)
         {
             dropdown.options.Add(
                 new Dropdown.OptionData(team.id.ToString())
                 );
         }
     }
 }