// Update is called once per frame void Update() { currentInput = input.getRobotInput(); transform.position = currentInput.position; float dist = (lastPos - currentInput.position).sqrMagnitude; moving = !Mathf.Approximately(dist, 0); lastPos = currentInput.position; transform.rotation = Quaternion.Euler(new Vector3(0, 0, currentInput.rotation)); switch (currentInput.shape) { case InputManager.RobotShape.LINE: anim.SetBool("snake", false); anim.SetBool("u", false); anim.SetBool("line", true); break; case InputManager.RobotShape.SQUIGGLY_LINE: anim.SetBool("u", false); anim.SetBool("line", false); anim.SetBool("snake", true); break; case InputManager.RobotShape.U_SHAPE: anim.SetBool("line", false); anim.SetBool("snake", false); anim.SetBool("u", true); break; } }
// Update is called once per frame void Update() { InputManager.RobotInput myInput = input.getRobotInput(); Debug.Log("My X : " + myInput.position[0]); Debug.Log("My Y : " + myInput.position[1]); Debug.Log("My Shape : " + myInput.shape); Debug.Log("My Rotation : " + myInput.rotation); }