IEnumerator animShoot() { canShoot = false; LoadEffect.SetActive(false); float time = 0; while (time < shootTime) { time += Time.deltaTime; if (BlendShape) { BlendShape.SetBlendShapeWeight(0, 100f - time / shootTime * 100f); } yield return(null); } if (BlendShape) { BlendShape.SetBlendShapeWeight(0, 0f); } StartCoroutine(getReady()); }
IEnumerator getReady() { float time = 0; while (time < loadTime) { time += Time.deltaTime; if (BlendShape) { BlendShape.SetBlendShapeWeight(0, time / loadTime * 100f); } WinchWheel.Rotate(WinchWheelRotationAxis * 400f * Time.deltaTime, Space.Self); yield return(null); } if (BlendShape) { BlendShape.SetBlendShapeWeight(0, 100f); } projectileAnim.SetActive(true); canShoot = true; }
IEnumerator getReady() { canShoot = false; LoadEffect.SetActive(true); float time = 0; while (time < loadTime) { time += Time.deltaTime; if (BlendShape) { BlendShape.SetBlendShapeWeight(0, time / loadTime * 100f); } yield return(null); } if (BlendShape) { BlendShape.SetBlendShapeWeight(0, 100f); } canShoot = true; }