// Initial target position public static void SetInitialTargetPosition(PlaygroundParticlesC playgroundParticles, Vector3 position, bool refreshParticleSystem) { for (int p = 0; p<playgroundParticles.particleCache.Length; p++) { playgroundParticles.playgroundCache.previousTargetPosition[p] = position; playgroundParticles.playgroundCache.targetPosition[p] = position; playgroundParticles.particleCache[p].size = 0; playgroundParticles.playgroundCache.position[p] = position; } if (refreshParticleSystem) playgroundParticles.GetComponent<ParticleSystem>().SetParticles(playgroundParticles.particleCache, playgroundParticles.particleCache.Length); }
// Initial target position public static void SetInitialTargetPosition (PlaygroundParticlesC playgroundParticles, Vector3 position, bool refreshParticleSystem) { for (int p = 0; p<playgroundParticles.particleCache.Length; p++) { playgroundParticles.playgroundCache.previousTargetPosition[p] = position; playgroundParticles.playgroundCache.targetPosition[p] = position; #if UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2 playgroundParticles.particleCache[p].size = 0; #else playgroundParticles.particleCache[p].startSize = 0; #endif playgroundParticles.particleCache[p].position = position; playgroundParticles.playgroundCache.position[p] = position; playgroundParticles.playgroundCache.collisionParticlePosition[p] = position; } if (refreshParticleSystem) playgroundParticles.GetComponent<ParticleSystem>().SetParticles(playgroundParticles.particleCache, playgroundParticles.particleCache.Length); }