예제 #1
0
    public virtual void Draw()
    {
        if (Multimesh != null)
        {
            int visibleParticles = 0;
            foreach (Particle particle in particles)
            {
                if (particle.alive)
                {
                    Transform t = particle.transform;

                    if (!local)
                    {
                        t = GlobalTransform.AffineInverse() * t;
                    }

                    Multimesh.SetInstanceTransform(visibleParticles, t);
                    Multimesh.SetInstanceColor(visibleParticles, particle.color);
                    visibleParticles++;
                }
            }

            Multimesh.VisibleInstanceCount = visibleParticles;
        }
    }