Пример #1
0
        public IEnumerator Start()
        {
            //Checks if we are already connected
            if (trello != null && trello.IsConnected())
            {
                Debug.Log("Connection with Trello server succesful");
                yield break;
            }

            // Creates our trello Obj with our key and token
            trello = new Trello(yourKey, yourToken);

            // gets the boards of the current user
            yield return(trello.PopulateBoardsRoutine());

            trello.SetCurrentBoard(currentBoard);

            // gets the lists on the current board
            yield return(trello.PopulateListsRoutine());

            // check if our reportType match the lists in your trello board
            // otherwise it creates new lists and uploads them
            for (int i = 0; i < reportTypes.Count; i++)
            {
                if (!trello.IsListCached(reportTypes[i].text))
                {
                    var optionList = trello.NewList(reportTypes[i].text);
                    yield return(trello.UploadListRoutine(optionList));
                }
            }

            // caches the new lists created (if any)
            yield return(trello.PopulateListsRoutine());
        }