public float moveSpeed() { if (Input.GetKey(KeyCode.Space)) { var runSpeed = RSLerp.EaseInBack(5, 10f, 1f); rotateSpeed = 8; return(runSpeed); } else { rotateSpeed = 5f; var walkSpeed = 5f; return(walkSpeed); } }
public IEnumerator HideDrawRadius() { float elapsed = 0; float duration = .9f; startRadius.GetComponent <Collider>().enabled = false; while (elapsed < duration) { float size = RSLerp.EaseInBack(radiusSize, 0.00001f, elapsed, duration); elapsed = Mathf.Min(duration, elapsed + Time.deltaTime); startRadius.transform.localScale = new Vector3(size * 1, 0.0001f, size * 1);// size * Vector3.one; yield return(new WaitForEndOfFrame()); } startRadius.SetActive(false); }