public IEnumerator ShowDrawRadius() { float elapsed = 0; float duration = .5f; UpdateDrawRadius(true); startRadius.GetComponent <Collider>().enabled = true; startRadius.SetActive(true); while (elapsed < duration) { float size = RSLerp.EaseInCubic(0.00001f, radiusSize, elapsed, duration); elapsed = Mathf.Min(duration, elapsed + Time.deltaTime); startRadius.transform.localScale = new Vector3(1 * size, radiusScale.y, 1 * size); yield return(new WaitForEndOfFrame()); } }
IEnumerator CameraZoomIn() { GameManager.instance.gameState = GameManager.GameState.camZoom; float elapsed = 0; float duration = 1f; Vector3 movingPos; Vector3 currentAngle; while (elapsed < duration) { currentAngle = RSLerp.EaseInCubic(startRot, endRot, elapsed, duration); movingPos = RSLerp.EaseInCubic(startPos, endPos, elapsed, duration); mainCamera.transform.eulerAngles = currentAngle; mainCamera.transform.localPosition = movingPos; elapsed = Mathf.Min(duration, elapsed + Time.deltaTime); yield return(new WaitForEndOfFrame()); } offset = Vector3.Distance(mainCamera.transform.position, CaveManController.instance.myRb.position); Debug.Log(offset); isFollowing = true; GameManager.instance.gameState = GameManager.GameState.running; }