void handleAnnotText() { annotationT1.SetText(""); annotationT2.SetText(""); annotationT3.SetText(""); if (instructions.steps[currentStep].annotations.Count >= 1) { annotationT1.SetText(instructions.steps[currentStep].annotations[0].annotation); //Resets the annotOneObj in case it is not the corresponding one inside the steps array annotOneObj = instructions.steps[currentStep].annotations[0]; annotationT1.transform.position = MarkerX1Comp.transform.position + arrowLength; annotationT1.transform.LookAt(annotationT1.transform.position + Camera.main.transform.rotation * Vector3.forward, Camera.main.transform.rotation * Vector3.up); } else { annotationT3.SetText(""); MarkerX1Comp.transform.position = new Vector3(5000, 5000, 5000); } if (instructions.steps[currentStep].annotations.Count >= 2) { annotationT2.SetText(instructions.steps[currentStep].annotations[1].annotation); //Resets the annotTwoObj in case it is not the corresponding one inside the steps array annotTwoObj = instructions.steps[currentStep].annotations[1]; annotationT2.transform.position = MarkerA2Comp.transform.position + arrowLength; annotationT2.transform.LookAt(annotationT2.transform.position + Camera.main.transform.rotation * Vector3.forward, Camera.main.transform.rotation * Vector3.up); } else { annotationT3.SetText(""); MarkerA2Comp.transform.position = new Vector3(5000, 5000, 5000); } if (instructions.steps[currentStep].annotations.Count >= 3) { annotationT3.SetText(instructions.steps[currentStep].annotations[2].annotation); //Resets the annotThreeObj in case it is not the corresponding one inside the steps array annotThreeObj = instructions.steps[currentStep].annotations[2]; annotationT3.transform.position = MarkerQ3Comp.transform.position + arrowLength; annotationT3.transform.LookAt(annotationT3.transform.position + Camera.main.transform.rotation * Vector3.forward, Camera.main.transform.rotation * Vector3.up); } else { annotationT3.SetText(""); MarkerQ3Comp.transform.position = new Vector3(5000, 5000, 5000); } }
void updateStepAnnot() { if (instructions.steps[currentStep].annotations.Count > 0) { if (instructions.steps[currentStep].annotations.Count == 1 && instructions.steps[currentStep].annotations[0] != null) { annotOneObj = instructions.steps[currentStep].annotations[0]; } if (instructions.steps[currentStep].annotations.Count == 2 && instructions.steps[currentStep].annotations[1] != null) { annotTwoObj = instructions.steps[currentStep].annotations[1]; } if (instructions.steps[currentStep].annotations.Count == 3 && instructions.steps[currentStep].annotations[2] != null) { annotThreeObj = instructions.steps[currentStep].annotations[2]; } } else { annotOneObj = null; annotTwoObj = null; annotThreeObj = null; } }