//音效渐变 if (startEndScript) { Camera.main.transform.localPosition = Vector3.Lerp(Camera.main.transform.localPosition, new Vector3(-13.4f, 6.6f, 10),0.01f); if(audioSource.volume > 0 && hasDefault) { audioSource.volume -= Time.deltaTime * 0.5f; if (audioSource.volume <= 0) { hasDefault = false; hasReady = true; audioSource.clip = audioClip; audioSource.Play(); } } if (audioSource.volume <= 0.9f && hasReady) { audioSource.volume += Time.deltaTime * 0.5f; if(audioSource.volume >= 0.85f) { hasReady = false; Destroy(this); } } }