// Update is called once per frame void Update() { if (height != null) { if (height > bodyPartManager.GetChildHeight()) { highEnough = true; navManager.SetBaseOffset(1.5f); } else { highEnough = false; navManager.SetBaseOffset(0.5f); } } if (penguin.trackingId != null) { IsChild(highEnough); GetHeightDifference(); // Jump trigger if (jumping) { jumping = false; //parent.transform.localPosition = new Vector3(parent.transform.localPosition.x, (bodyPartManager.GetHeadHeight((ulong) penguin.trackingId) * 0.55f) * 1f, parent.transform.localPosition.z); child.GetComponent <Animator>().SetTrigger("Jump"); parent.GetComponent <Animator>().SetTrigger("Jump"); } } }
public void WriteToFile(float time) { //"Date","Time","Height (A: 0, C: 1)","Time used" File.AppendAllText("Statistic.txt", '"' + DateTime.Now.Day.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Year.ToString() + '"' + ","); File.AppendAllText("Statistic.txt", '"' + "" + DateTime.Now.TimeOfDay + '"' + ","); if (heightManager.height > bodyPartManager.GetChildHeight()) { //Adult is a zero File.AppendAllText("Statistic.txt", '"' + "0" + '"' + ","); } else { // Children is a one File.AppendAllText("Statistic.txt", '"' + "1" + '"' + ","); } File.AppendAllText("Statistic.txt", '"' + timeEngaged.ToString() + '"' + ","); File.AppendAllText("Statistic.txt", '"' + heightManager.jumpCount.ToString() + '"' + Environment.NewLine); timeEngaged = 0f; heightManager.jumpCount = 0; }