public float CalculateAccuracy(SubjectDriver otherDriver) { float sum = 0; var otherScrollElems = otherDriver.scrollElements; for (int i = 0; i < scrollElements.Length; i++) { var error = scrollElements[i].CalcError(otherScrollElems[i]); Debug.LogWarning("--- error for " + scrollElements[i].gameObject.name + ": " + error); sum += 1f - error; } return(sum / scrollElements.Length); // average }
// Update is called once per frame //void Update () { //} public void GenerateSubject() { _subj = Instantiate(_subjectPF, _subjectSpotRight.transform).GetComponent <SubjectDriver>(); // TODO randomize objects, rotation, more... _subj.Generate(); // TODO somewhere I need to give input access to the left but not the right _subj.SetNotInteractable(); _subjDrawing = Instantiate(_subjectPF, _subjectSpotLeft.transform).GetComponent <SubjectDriver>(); _subjDrawing.Generate(); _subjDrawing.gameObject.SetActive(false); //_subjDrawing.ReplaceMaterials(); }
public bool MakeChoiceAboutPrint(SubjectDriver otherDriver) { // TODO relationship between accuracy and acceptance // for now it'll just be random return(Random.Range(0, 1f) > 0.5f); }