Beispiel #1
0
    public void MakeSubmission()
    {
        Debug.Log("Making submission...");

        var title = Title_InputField.text;

        if (title == "" || title == null)
        {
            Title_InputField.GetComponent <Image>().color = new Color(1f, 181f / 255f, 181f / 255f);
            return;
        }

        var contributorsList = ContributorsList.GetAddressList();
        var referencesList   = ReferencesList.GetAddressList();
        var bodyData         = SerializeSurface();

        var rpcSubmission = new MatryxJsonRpc.Submission();

        Debug.Log("Submission: " + tournament.address + " -> " + title);
        rpcSubmission.tournamentAddress = tournament.address;
        rpcSubmission.title             = title;
        rpcSubmission.body = bodyData;
        rpcSubmission.contributorsList(contributorsList);
        rpcSubmission.referencesList(referencesList);

        submittingCanvasObject.SetActive(true);
        MatryxJsonRpc.Request.RunUploadSubmission(rpcSubmission, delegate(object result)
        {
            // Switch out the submitting screen for the results screen.
            submittingCanvasObject.SetActive(false);
            resultsCanvasObject.SetActive(true);
            this.gameObject.SetActive(false);
            // Debug
            Debug.Log("Submission uploaded");
            Debug.Log(result);
            // Check success
            if (result != null)
            {
                resultsCanvasObject.GetComponent <ResultsMenu>().PostSuccess(tournament);
            }
            else
            {
                resultsCanvasObject.GetComponent <ResultsMenu>().PostFailure(tournament);
            }
        });
    }
Beispiel #2
0
 // UPLOAD SUBMISSION
 public static void RunUploadSubmission(Submission submission, ResultDelegate callback)
 {
     // Schedule query
     queue(CoroutineUploadSubmission(new RoutineContext(new object[] { submission }, callback)));
 }