private void onLoadMusic() { _music.clip = LoadControl.getUnityObjectByType <AudioClip>(_curMusic); //刷新状态 pauseMusic(_pauseMusic); }
private void onLoadOver() { SkeletonDataAsset asset = LoadControl.getUnityObjectByType <SkeletonDataAsset>(_loadTool.getResourceID()); if (asset != null) { setLoading(false); _skeletonGraphic.skeletonDataAsset = asset; _skeletonGraphic.startingAnimation = ""; _skeletonGraphic.Initialize(true); } if (_overFunc != null) { _overFunc(); } }
/// <summary> /// 播放音效 /// </summary> public void playSound(int id) { if (id <= 0) { return; } if (!_soundSwitch) { return; } LoadControl.loadOne(id, () => { AudioClip audioClip = LoadControl.getUnityObjectByType <AudioClip>(id); AudioSource audioSource = _soundGameObjectPool.getOne(); audioSource.gameObject.SetActive(true); audioSource.clip = audioClip; audioSource.Play(); _soundList.add(audioSource); }); }
private void onLoadUISound() { _uiSound.clip = LoadControl.getUnityObjectByType <AudioClip>(_curUISound); pauseUISound(_pauseUISound); }