void Awake()
        {
            try
            {
#if CETO_DEBUG_SCHEDULER
                LogInfo("Debug scheduler is on");
#endif

                //There can only be one ocean in a scene
                if (Instance != null)
                {
                    throw new InvalidOperationException("There can only be one ocean instance.");
                }
                else
                {
                    Instance = this;
                }

                WindDirVector = CalculateWindDirVector();

                if (doublePrecisionProjection)
                {
                    Projection = new Projection3d(this);
                }
                else
                {
                    Projection = new Projection3f(this);
                }

                OceanTime = new OceanTime();

                m_waveOverlayMat = new Material(waveOverlaySdr);

                OverlayManager = new OverlayManager(m_waveOverlayMat);

                m_scheduler = new Scheduler();
            }
            catch (Exception e)
            {
                LogError(e.ToString());
                DisableOcean();
            }
        }
Exemple #2
0
        //OYM:  报错
        void Awake()
        {
            try
            {
                //There can only be one ocean in a scene
                if (Instance != null)
                {
                    throw new InvalidOperationException("There can only be one ocean instance.");
                }
                //OYM:  检测是否有多个实例的
                else
                {
                    Instance = this;
                }

                //This is so I dont forget to set these back to false when finished debugging.
                if (DISABLE_ALL_MULTITHREADING)
                {
                    LogInfo("Disabled multithreading is on");
                }
                if (DISABLE_FOURIER_MULTITHREADING)
                {
                    LogInfo("Disabled Fourier multithreading is on");
                }
                if (DISABLE_PROJECTED_GRID_BORDER)
                {
                    LogInfo("Disabled projection border is on");
                }
                if (DISABLE_PROJECTION_FLIPPING)
                {
                    LogInfo("Disabled flipping is on");
                }
                if (DISABLE_PROJECT_SCENE_VIEW)
                {
                    LogInfo("Disabled project scene is on");
                }
                //OYM:  报错

#if CETO_DEBUG_SCHEDULER
                LogInfo("Debug scheduler is on");
#endif

#if UNITY_WEBGL
                DISABLE_ALL_MULTITHREADING = true;
                LogInfo("Disabled multithreading for WebGL");
#endif

#if CETO_USE_STEAM_VR
                LogInfo("Ceto using StreamVR enabled");
                //OYM:  蛤?
#endif

                OceanVR.Initialize();

                WindDirVector = CalculateWindDirVector();//OYM:  计算风力

                if (doublePrecisionProjection)
                {
                    Projection = new Projection3d(this);//OYM:  双精度函数
                }
                else
                {
                    Projection = new Projection3f(this);
                }

                OceanTime = new OceanTime();                           //OYM:  获取时间,这个地方是考虑到可以改的地方吗

                m_waveOverlayMat = new Material(waveOverlaySdr);       //OYM:  创建material

                OverlayManager = new OverlayManager(m_waveOverlayMat); //OYM:  管理器

                m_scheduler = new Scheduler(100, 100, this);           //OYM:  线程设置
            }
            catch (Exception e)
            {
                LogError(e.ToString());
                DisableOcean();
            }
        }
Exemple #3
0
		void Awake()
		{

            try
            {

#if CETO_DEBUG_SCHEDULER
				LogInfo("Debug scheduler is on");
#endif

                //There can only be one ocean in a scene
                if (Instance != null)
				{
					throw new InvalidOperationException("There can only be one ocean instance.");
				}
				else
				{
					Instance = this;
				}

                WindDirVector = CalculateWindDirVector();

				if(doublePrecisionProjection)
					Projection = new Projection3d(this);
				else
					Projection = new Projection3f(this);
				
				OceanTime = new OceanTime();
				
				m_waveOverlayMat = new Material(waveOverlaySdr);

				OverlayManager = new OverlayManager( m_waveOverlayMat);
			
				m_scheduler = new Scheduler();

			}
			catch(Exception e)
			{
				LogError(e.ToString());
				DisableOcean();
			}

		}