Exemplo n.º 1
0
 ComputeShader GetDiffusionShader()
 {
     if (m_DiffusionCS == null)
     {
         m_DiffusionCS = ComputeUtility.GetShader("Diffusion");
     }
     return(m_DiffusionCS);
 }
 ComputeShader GetComputeShader()
 {
     if (m_HeightCS == null)
     {
         m_HeightCS = ComputeUtility.GetShader("Height");
     }
     return(m_HeightCS);
 }
 ComputeShader GetComputeShader()
 {
     if (m_ConcavityCS == null)
     {
         m_ConcavityCS = ComputeUtility.GetShader("Slope");
     }
     return(m_ConcavityCS);
 }
Exemplo n.º 4
0
 private ComputeShader GetThermalCS()
 {
     if (m_ThermalCS == null)
     {
         m_ThermalCS = ComputeUtility.GetShader("Thermal");
     }
     return(m_ThermalCS);
 }
Exemplo n.º 5
0
 private ComputeShader GetHydraulicCS()
 {
     if (m_HydraulicCS == null)
     {
         m_HydraulicCS = ComputeUtility.GetShader("Hydraulic");
     }
     return(m_HydraulicCS);
 }
 ComputeShader GetComputeShader()
 {
     if (m_AspectCS == null)
     {
         m_AspectCS = ComputeUtility.GetShader("Aspect");
     }
     return(m_AspectCS);
 }
Exemplo n.º 7
0
        //读取.wav音乐文件的携程
        private IEnumerator LoadMusic(string n)
        {
            ShowLoadInfo(musicInfo, "Music loading...");

            var name = Path.ChangeExtension(n, ".wav");
            var dir  = path;
            //string dir = Path.Combine(Path.GetDirectoryName(path), "Music");
            string musicPath = Path.Combine(dir, name);

            /*
             * WWW www = new WWW(musicPath);
             * yield return www;
             * AudioClip clip = www.GetAudioClip();
             */

            var       _unityWebRequest = UnityWebRequestMultimedia.GetAudioClip(musicPath, AudioType.WAV);
            AudioClip clip             = null;

            yield return(_unityWebRequest.SendWebRequest());

            if (_unityWebRequest.isHttpError || _unityWebRequest.isNetworkError)
            {
                Debug.Log(_unityWebRequest.error.ToString());
            }
            else
            {
                clip = DownloadHandlerAudioClip.GetContent(_unityWebRequest);
            }


            if (clip == null)
            {
                ShowLoadInfo(musicInfo, "Music loaded incorrectly!");
            }
            else
            {
                ShowLoadInfo(musicInfo, "Music loaded.");


                time.text = "Time\t\t" + ComputeUtility.FormatTwoTime((int)clip.length);

                audioSource.clip = clip;
                audioSource.Play();

                clip.name = n;

                NotesContainer.Instance.music = clip;

                musicLoaded = true;
            }

            yield return(null);
        }
 ComputeShader GetComputeShader(string name)
 {
     ComputeShader s = null;
     try
     {
         s = m_ComputeShaders[name];
     }
     catch
     {
         s = ComputeUtility.GetShader(name);
         if (s != null)
         {
             m_ComputeShaders[name] = s;
         }
     }
     return s;
 }