Esempio n. 1
0
        // Use this for initialization
        async void Update()
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                Requirement res = await RequirementsBazaar.UndoVote(2101);

                Debug.Log("Posting");
            }
        }
Esempio n. 2
0
 public async void OnVoteClick()
 {
     voteButton.interactable = false;
     if (requirement.UserVoted != UserVoted.NO_VOTE) // if user already voted => undo by voting down
     {
         SetVoteIcon(false);
         // delete vote
         Requirement = await RequirementsBazaar.UndoVote(Requirement.Id);
     }
     else // if user did not yet vote => vote up; this is the standard case; no voting down possible with this UI
     {
         SetVoteIcon(true);
         Requirement = await RequirementsBazaar.VoteForRequirement(Requirement.Id);
     }
     voteButton.interactable = true;
 }