// Update is called once per frame void Update() { if (MinigameInputHelper.IsButton1Held(hand.player) && !hand.isBurned()) { rbody.MoveRotation(Mathf.Lerp(rbody.rotation, rotLimit, rotSpeed * Time.deltaTime)); } else { rbody.MoveRotation(Mathf.Lerp(rbody.rotation, startRot + startRotLimit, rotSpeed * Time.deltaTime)); } }
// Update is called once per frame void Update() { if (hand.isBurned()) { rbody.MovePosition(rbody.transform.position + new Vector3(0, hand.getBurnRatio()) * Time.deltaTime * moveSpeed); rbody.MoveRotation(Mathf.Lerp(rbody.rotation, 2 * maxRot * Random.Range(-1.0f, 1.0f), 0.4f)); } else { float HorizontalAxis = MinigameInputHelper.GetHorizontalAxis(hand.player); float VerticalAxis = MinigameInputHelper.GetVerticalAxis(hand.player); rbody.MovePosition(rbody.transform.position + new Vector3(HorizontalAxis, VerticalAxis) * Time.deltaTime * moveSpeed); rbody.MoveRotation(Mathf.Lerp(rbody.rotation, maxRot * -HorizontalAxis, 0.1f)); } }