void OnBodyPartSaved(BodyPartUI partUI)
    {
        BodyPartMeasure modelPart = BodyParts.Find(x => x.Part.Equals(SelectedPartUI.BodyPart.Part));

        if (modelPart != null)
        {
            Debug.Log("saving bodypart value");
            //save on model
            modelPart.Cm = measurementController.GetUnityValue() * 100f;

            //update UI
            partUI.UpdateMeasure(System.Math.Round(modelPart.Cm, 2).ToString());
            partUI.IsSet = true;

            txtSavedValue.text = measurementController.GetTextValue();
            ResetPoints();
            hitCounts = 0;
            SaveMenu.SetActive(false);
            MidAirPositioner.SetActive(false);
        }
    }
Esempio n. 2
0
 public void SetData(BodyPartMeasure bodyPart)
 {
     BodyPart      = bodyPart;
     BodyText.text = bodyPart.Part.ToString();
     Measure.text  = bodyPart.Cm.ToString();
 }