Esempio n. 1
0
    private void onLoadMusic()
    {
        _music.clip = LoadControl.getUnityObjectByType <AudioClip>(_curMusic);

        //刷新状态
        pauseMusic(_pauseMusic);
    }
Esempio n. 2
0
        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();
            }
        }
Esempio n. 3
0
    /// <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);
        });
    }
Esempio n. 4
0
    private void onLoadUISound()
    {
        _uiSound.clip = LoadControl.getUnityObjectByType <AudioClip>(_curUISound);

        pauseUISound(_pauseUISound);
    }