Beispiel #1
0
                // ...

                void OnFocus()
                {
                    // (Re-)verify current list of particles.

                    ParticleEditorUtility.getSelectedParticleSystems(
                        ref particleSystems, ref selectedGameObjectsWithParticleSystems);
                }
                // ...

                void Update()
                {
                    // (Re-)verify current list of particles.

                    particleSystemsFromLastFrame =
                        new List <ParticleSystem>(particleSystems);

                    ParticleEditorUtility.getSelectedParticleSystems(
                        ref particleSystems, ref selectedGameObjectsWithParticleSystems);

                    particlePlayback.update(particleSystems);
                }
Beispiel #3
0
                // ...

                void OnFocus()
                {
                    // (Re-)verify current list of particles.

                    ParticleEditorUtility.getSelectedParticleSystems(
                        ref particleSystems, ref selectedGameObjectsWithParticleSystems);

                    // Nothing selected. Undo any changes.

                    if (particleSystems.Count == 0 && realtimeScaling)
                    {
                        loadFromParticleScaleValues();
                    }
                }
Beispiel #4
0
                // ...

                void Update()
                {
                    // (Re-)verify current list of particles.

                    particleSystemsFromLastFrame =
                        new List <ParticleSystem>(particleSystems);

                    ParticleEditorUtility.getSelectedParticleSystems(
                        ref particleSystems, ref selectedGameObjectsWithParticleSystems);

                    // Nothing selected. Undo any changes.

                    if (particleSystems.Count == 0 && realtimeScaling)
                    {
                        loadFromParticleScaleValues();
                    }

                    particlePlayback.update(particleSystems);
                }
Beispiel #5
0
                // ...

                void OnSelectionChange()
                {
                    // Clear if set to clear on selection change.

                    if (particlePlayback.clearParticlesOnSelectionChange)
                    {
                        ParticleEditorUtility.clearParticles(particleSystems);
                        ParticleEditorUtility.clearParticles(particleSystemsFromLastFrame);

                        particlePlayback.repaintEditorCameraWindows();
                    }

                    // Pause all selected particles.

                    else if (!Application.isPlaying)
                    {
                        particlePlayback.pause(particleSystems);
                    }

                    // Clear for updated selection.

                    particleSystemScaleValues.Clear();
                    realtimeScaling = false;

                    // (Re-)verify current list of particles.

                    ParticleEditorUtility.getSelectedParticleSystems(ref particleSystems, ref selectedGameObjectsWithParticleSystems);

                    for (int i = 0; i < particleSystems.Count; i++)
                    {
                        particleSystemScaleValues.Add(new ParticleScaleValues(particleSystems[i]));
                    }

                    // Nothing selected. Undo any changes.

                    if (particleSystems.Count == 0 && realtimeScaling)
                    {
                        loadFromParticleScaleValues();
                    }
                }
                // ...

                void OnSelectionChange()
                {
                    // Clear if set to clear on selection change.

                    if (particlePlayback.clearParticlesOnSelectionChange)
                    {
                        ParticleEditorUtility.clearParticles(particleSystems);
                        ParticleEditorUtility.clearParticles(particleSystemsFromLastFrame);

                        particlePlayback.repaintEditorCameraWindows();
                    }

                    // Pause all selected particles.

                    else if (!Application.isPlaying)
                    {
                        particlePlayback.pause(particleSystems);
                    }

                    // (Re-)verify current list of particles.

                    ParticleEditorUtility.getSelectedParticleSystems(ref particleSystems, ref selectedGameObjectsWithParticleSystems);
                }