public static ParticleSystemProfiler Create(GameObject ps_gobj, ParticleSystem[] ps_arr) { if (instance != null) { DestroyImmediate(instance.gameObject); } GameObject gobj = new GameObject("particlesystem_profilor"); ParticleSystemProfiler psp = gobj.AddComponent <ParticleSystemProfiler>(); psp.root_gobj = ps_gobj; psp.m_ParticleSystems = ps_arr; instance = psp; return(psp); }
void OnEditorUpdate() { if (EditorApplication.isPlaying) { if (particle_info != null) { if (particle_mono_profilor == null) { ParticleSystem[] ps_arr = new ParticleSystem[particle_info.single_particle_list.Count]; for (int i = 0; i < particle_info.single_particle_list.Count; i++) { ps_arr[i] = particle_info.single_particle_list[i].ps; } particle_mono_profilor = ParticleSystemProfiler.Create(particle_info.single_gobj, ps_arr); window.Repaint(); } } if (window == null) { Show_Profiler_Particle_Select(); } } }