void FixedUpdate() { if (splitter.getState("isMoving")) { //it's moving, find direction if (splitter.moveDirection == 1) { //it's going up if (isRight) { transform.Rotate(new Vector3(0, 0, -20f)); } else { transform.Rotate(new Vector3(0, 0, 20f)); } } else { //it's going down if (isRight) { transform.Rotate(new Vector3(0, 0, 20f)); } else { transform.Rotate(new Vector3(0, 0, -20f)); } } } }
// Update is called once per frame void FixedUpdate() { if (splitter.getState("yellowReady")) { if (!prevCharged) { animator.SetBool("inActive", false); prevCharged = true; } } else if (prevCharged) { animator.SetBool("inActive", true); spriteRenderer.sprite = null; prevCharged = false; } }