Example #1
0
        /****************************************************************************
        *       Trail functions
        ****************************************************************************/

        public void ReuseTrail(int trailIndex, TrailParticleInfo particleInfo)
        {
            trails[trailIndex].DequeueForReuse();
            trails[trailIndex].particleId = particleInfo.particleId;
            trails[trailIndex].ClearTrail();

            if (createFirstPointOnParticleBirth)
            {
                float w = EvaluateWidth(0);
                trails[trailIndex].SetFirstPoint(particleInfo.position, particleInfo.velocity, w, time, _calculationStartTime);

                // Send trail point event to listeners
                if (_hasTrailPointEventListener)
                {
                    _eventTrailPoint.Update(
                        trails.Count,
                        0,
                        particleInfo.position,
                        w,
                        time,
                        _calculationStartTime
                        );
                    trailPointEvent(_eventTrailPoint);
                }
            }
        }
        /// <summary>
        /// Returns a copy of this PlaygroundEventTrailPoint instance.
        /// </summary>
        public PlaygroundEventTrailPoint Clone()
        {
            PlaygroundEventTrailPoint trailPointEventClone = new PlaygroundEventTrailPoint();

            trailPointEventClone.Update(
                trailId,
                pointId,
                position,
                width,
                lifetime,
                timeCreated
                );
            return(trailPointEventClone);
        }