public async System.Threading.Tasks.Task LotsaStuff() { string userEmail = "*****@*****.**"; var myRealmAppId = "<your_app_id>"; var app = App.Create(myRealmAppId); r appConfig = new AppConfiguration(myRealmAppId) LogLevel = LogLevel.Debug, DefaultRequestTimeout = TimeSpan.FromMilliseconds(1500) p = App.Create(appConfig); ait app.EmailPasswordAuth.RegisterUserAsync(userEmail, "sekrit"); ait app.EmailPasswordAuth.ConfirmUserAsync("<token>", "<token-id>"); ait app.EmailPasswordAuth.SendResetPasswordEmailAsync(userEmail); ring myNewPassword = ""; ait app.EmailPasswordAuth.ResetPasswordAsync( myNewPassword, "<token>", "<token-id>"); ait app.EmailPasswordAuth.CallResetPasswordFunctionAsync( userEmail, myNewPassword, "<security-question-1-answer>", "<security-question-2-answer>"); er = await app.LogInAsync(Credentials.EmailPassword("*****@*****.**", "foobar")); }
// Start is called before the first frame update void Start() { audioData = GetComponent <AudioSource>(); targetHit = false; hitZone = ring.Null; initialPosition = transform.localPosition; }
// Update is called once per frame void Update() { if (TargetHitByDart()) { DetectHit(); // Debug.LogFormat("Hit the bullseye!"); } else if (collision.MissDetected()) { // Debug.LogFormat("Miss!"); hitZone = ring.Miss; results.targetZone = hitZone.ToString(); results.totalScore = GetScore(); experiment.EndCurrentTrial(); collision.HitStateReset(false); // Reset target miss to false } // else if(bonusDart.BalloonHit()) // { // Debug.LogFormat("Hit the balloon!"); // hitZone = ring.Balloon; // totalScore = ComputeScore(); // results.targetZone = hitZone.ToString(); // results.totalScore = GetScore(); // experiment.DestroyAllDarts(); // bonusDart.SetBalloonStatus(false); // } }
void DetectHit() { float distanceFromCentre = Vector2.Distance(dart.transform.position, transform.position); // Calculate 2D distance between dart and centre of the bullseye if (distanceFromCentre > 0 && distanceFromCentre < 0.1) { hitZone = ring.Yellow; } else if (distanceFromCentre > 0.1 && distanceFromCentre < 0.2) { hitZone = ring.Red; } else if (distanceFromCentre > 0.2 && distanceFromCentre < 0.3) { hitZone = ring.Blue; } else if (distanceFromCentre > 0.3 && distanceFromCentre < 0.4) { hitZone = ring.Black; } else if (distanceFromCentre > 0.4 && distanceFromCentre < 0.5) { hitZone = ring.White; } Debug.LogFormat("Hit {0}", hitZone + " zone"); totalScore = ComputeScore(); // Save results results.targetZone = hitZone.ToString(); results.totalScore = GetScore(); // End trial experiment.EndCurrentTrial(); hitZone = ring.Null; // Reset target zone hit as 'Null' targetHit = false; // Reset target hit to false }