void PlayA2B() { if (pd) { aTime = Mathf.Clamp(aTime, 0, (float)pd.duration); bTime = Mathf.Clamp(bTime, aTime, (float)pd.duration); pd.time = aTime; pd.DeferredEvaluate(); } }
public void OnEnd() { #if UNITY_EDITOR if (!EditorApplication.isPlaying) { return; //Don't play in edit } #endif //Turn on intro cam IntroCam.ResettiTheSpaghetti(); IntroCam.gameObject.SetActive(true); //Turn cam off cam.enabled = false; cam.gameObject.GetComponent <AudioListener>().enabled = false; if (_director) { _director.time = 0; _director.Stop(); _director.DeferredEvaluate(); } //Send out event if (OnLevelEnd != null) { loopNum++; OnLevelEnd(this, null); } }