public override IEnumerator TransitionInAsync() { yield return(new WaitForEndOfFrame()); CocoAudio.PlaySound(CocoAudioID.Button_Click_07); int index = 0; while (index < m_CurPlayIndexs.Count) { int[] idxs = m_CurPlayIndexs [index]; foreach (int idx in idxs) { PlayItem(idx, true); } index++; yield return(new CCWait(m_PlayItemTime - m_DelayTime)); } m_Loading.gameObject.SetActive(true); yield return(new CCWait(0.3f)); // CocoAudio.PlaySound (Game.CocoAudioID.Contest_Cards_In); LeanTween.moveLocalY(m_Logo.gameObject, m_LogoTargetY, 0.8f).setEase(LeanTweenType.easeOutBack).setIgnoreTimeScale(true); yield return(new CCWait(0.8f)); }
public override IEnumerator TransitionOutAsync() { m_Loading.gameObject.SetActive(false); CocoAudio.PlaySound(CocoAudioID.Button_Click_07); yield return(new WaitForEndOfFrame()); LeanTween.moveLocalY(m_Logo.gameObject, 800, 0.5f).setEase(LeanTweenType.easeInBack).setIgnoreTimeScale(true); yield return(new CCWait(0.3f)); m_CurPlayIndexs.Reverse(); int index = 0; while (index < m_CurPlayIndexs.Count) { int[] idxs = m_CurPlayIndexs [index]; foreach (int idx in idxs) { PlayItem(idx, false); } index++; yield return(new CCWait(m_PlayItemTime - m_DelayTime)); } yield return(new CCWait(0.65f)); foreach (var t in m_Images) { GameObject.Destroy(t.gameObject); } Debug.LogError(Time.time + ": ----- end" + m_Logo.transform.localPosition); }
protected void ResumeBGMusic() { CocoAudio.StopBgMusic(); if (!CocoAudio.IsOn) { CocoAudio.StopAll(); } else { CocoAudio.MuteAll(false); } }
protected override void PlayEnd() { m_CurRole.gameObject.SetActive(false); m_CurRole.transform.localPosition = Vector3.zero; m_CurRole.transform.localEulerAngles = Vector3.zero; m_CurRole.Animation.SetAutoSwithEnable(false); // m_CurRole.Animation.animator.Stop(); m_CurRole.Animation.animator.runtimeAnimatorController = null; CocoAudio.StopBgMusic(); m_CloseSignal.Dispatch(); base.PlayEnd(); }
protected override void OnButtonClickWithButtonName(CocoUINormalButton button, string pButtonName) { base.OnButtonClickWithButtonName(button, pButtonName); switch (pButtonName) { case "Speack": CocoAudio.StopBgMusic(); StartListeningButtonOnClickHandler(); break; case "Stop": StopListeningButtonOnClickHandler(); CocoAudio.PlayBgMusic(gameGlobalData.GetSceneBg(gameGlobalData.CurSceneID)); break; // case "speed": // _speechRepeater.audioConfig.volume += 1f; // break; // // case "Tone": // _speechRepeater.audioConfig.pitch += 1f; // break; } }
protected override void OnLoadingFinished() { base.OnLoadingFinished(); CocoAudio.StopBgMusic(); CocoAudio.PlayBgMusic(gameGlobalData.GetSceneBg(gameGlobalData.CurSceneID)); }
public void StopSound() { CocoAudio.StopOnTarget(gameObject); }
/// <summary> /// Modify support AnimationOverrideController dynamic loading animClip; /// </summary> /// <param name="pAnimData"></param> /// <returns></returns> IEnumerator CoroutinePlay(CCAnimationData pAnimData) { m_CurrAnimData = pAnimData; AnimationClip animClip = GetAnimationClip(pAnimData.AnimName); string animName = pAnimData.AnimName; if (animClip == null) { if (m_AnimatorControl is AnimatorOverrideController) { if (OverrideAnimatorControllerClip(pAnimData, ref animClip)) { animName = stanceAnimStateName; } else { yield break; } } else { Debug.LogError("Animation lost : " + animName); yield break; } } _CurPlayingClip = animClip; if (m_OnPlayAnimation != null) { m_OnPlayAnimation(pAnimData); } if (m_CrossEnable) { animator.CrossFade(animName, 0.1f, 0, pAnimData.normalizedTime); } else { animator.Play(animName, 0, pAnimData.normalizedTime); } #if UNITY_EDITOR if (m_LogEnable) { Debug.Log(Time.time + " - pAnimData : " + animName); } #endif if (m_SoundEnable) { CocoAudio.StopOnTarget(gameObject); CocoAudio.PlayOnTarget(gameObject, pAnimData.Audio); } float animLength = animClip.length * (1 - pAnimData.normalizedTime) / animator.speed; switch (pAnimData.mWrapMode) { case WrapMode.Loop: while (true) { yield return(new WaitForSeconds(animLength)); if (m_SoundEnable) { CocoAudio.PlayOnTarget(gameObject, pAnimData.Audio); } } break; case WrapMode.ClampForever: yield return(new WaitForSeconds(animLength)); while (true) { yield return(new WaitForEndOfFrame()); } break; default: // Clamp yield return(new WaitForSeconds(animLength)); break; } m_CurrAnimData = null; if (m_PlayAnimationList != null && m_PlayAnimationList.Count > 0) { PlayList(m_PlayAnimationList); } else if (m_AutoSwitchEanble) { SwitchAnimation(); } if (m_OnFinishAnimation != null) { m_OnFinishAnimation(pAnimData); } }