Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        timer += Time.deltaTime;

        if (timer > timerDuration && !submittingIdea)
        {
            //Debug.Log("Started Coroutine");

            createEvent        = true;
            doneCreatingEvents = false;
            StartCoroutine(GetRequest("https://testserversoubra.herokuapp.com/ListEvents"));

            timer = 0;
        }

        if (createEvent && !doneCreatingEvents && start)
        {
            Debug.Log(eventList.events.Count);
            for (int i = 0; i < eventList.events.Count; i++)
            {
                if (eventsAdded.Contains(eventList.events[i].eventID))
                {
                    Debug.Log("Event Already Created");
                }
                else
                {
                    GameObject temp = Instantiate(eventPrefab, parent.transform);
                    allEvents.Add(temp);
                    EventComponents tempR = temp.GetComponent <EventComponents>();

                    tempR.ID               = eventList.events[i].eventID;
                    tempR.title.text       = eventList.events[i].eventName;
                    tempR.description.text = eventList.events[i].eventDescription;
                    tempR.votedFor         = eventList.events[i].numberVotedForString;
                    tempR.votedAgainst     = eventList.events[i].numberVotedAgainstString;
                    tempR.totalVoted       = eventList.events[i].totalNumberVotedString;

                    temp.transform.SetParent(parent);

                    eventsAdded.Add(eventList.events[i].eventID);
                    SortChildren();
                }
            }

            createEvent        = false;
            doneCreatingEvents = true;
        }
    }
Exemple #2
0
 public EventDescriber(float[] input)
 {
     linkToCalc    = new EventComponents(input);
     absMaxIndexes = linkToCalc.getIndexOfTwoAbsMax();
     absMax        = linkToCalc.getValueOfMaxes();
 }
	public EventDescriber(float[] input){
		linkToCalc = new EventComponents (input);
		absMaxIndexes = linkToCalc.getIndexOfTwoAbsMax ();
		absMax = linkToCalc.getValueOfMaxes ();
	}