private void Start() { particleSys = GetComponent <ParticleSystem>(); if (particleArray == null || particleArray.Length < particleSys.maxParticles) { particleArray = new ParticleSystem.Particle[particleSys.maxParticles]; } perfomanceOldSettings = Perfomance; UpdatePerfomanceSettings(); }
private void Start() { particleSys = GetComponent <ParticleSystem>(); #if UNITY_5_5_OR_NEWER if (particleArray == null || particleArray.Length < particleSys.main.maxParticles) { particleArray = new ParticleSystem.Particle[particleSys.main.maxParticles]; } #else if (particleArray == null || particleArray.Length < particleSys.maxParticles) { particleArray = new ParticleSystem.Particle[particleSys.maxParticles]; } #endif perfomanceOldSettings = Perfomance; UpdatePerfomanceSettings(); }
private void Init() { if (isInitilised) { return; } t = transform; particleSys = GetComponent <ParticleSystem>(); if (particleArray == null || particleArray.Length < particleSys.main.maxParticles) { particleArray = new ParticleSystem.Particle[particleSys.main.maxParticles]; } perfomanceOldSettings = Perfomance; UpdatePerfomanceSettings(); vSyncCount = QualitySettings.vSyncCount; isInitilised = true; }
private void Update() { if (!Application.isPlaying) { deltaTime = Time.realtimeSinceStartup - lastStopTime; lastStopTime = Time.realtimeSinceStartup; } else { deltaTime = Time.deltaTime; } currentDelay += deltaTime; if (currentDelay < TimeDelay) { return; } if (!UseGlobalOffset) { currentOffset += OffsetSpeed * deltaTime; } else { if (Application.isPlaying) { currentOffset = OffsetSpeed * Time.time; } else { currentOffset = OffsetSpeed * Time.realtimeSinceStartup; } } if (Perfomance != perfomanceOldSettings) { perfomanceOldSettings = Perfomance; UpdatePerfomanceSettings(); } time += deltaTime; if (QualitySettings.vSyncCount == 2) { UpdateTurbulence(); } else if (QualitySettings.vSyncCount == 1) { if (Perfomance == PerfomanceEnum.Low) { if (skipFrame) { UpdateTurbulence(); } skipFrame = !skipFrame; } if (Perfomance == PerfomanceEnum.High) { UpdateTurbulence(); } } else { if (QualitySettings.vSyncCount == 0) { if (time >= fpsTime) { time = 0; UpdateTurbulence(); deltaTimeLastUpdateOffset = 0; } else { deltaTimeLastUpdateOffset += deltaTime; } } } }