Exemple #1
0
    private IEnumerator _CreateOpportunity()
    {
        Vector2 loc = Vector2.zero;

        yield return(StartCoroutine(GeocodeAPI._GetCoordinates(LocationInput.text, delegate(Vector2 coords)
        {
            loc = coords;
        })));

        EventInfo evtInfo = new EventInfo()
        {
            Name         = NameInput.text,
            Time         = DateTime.Parse(DateText.text),
            Location     = LocationInput.text,
            Latitude     = loc.x,
            Longitude    = loc.y,
            Tags         = TagsInput.text,
            Description  = DescriptionInput.text,
            OrganizerIDs = new List <int>()
            {
                AppManager.CurrentUser.ID
            },
            Links        = _links,
            Requirements = _requirements,
            VolunteerIDs = new List <int>()
        };

        AppData.Events.Add(evtInfo);

        AppManager.BuildMap();

        ToastController.Show("Created " + evtInfo.Name + ".");

        AppManager.SwitchToEventScreen(evtInfo);
    }