Ejemplo n.º 1
0
        protected virtual void LateUpdate()
        {
            if (_fadingTrails == null)
            {
                _fadingTrails = new List <CircularBuffer <PCTrailPoint> >();
            }

            foreach (Mesh mesh in _toCleanUp)
            {
                Destroy(mesh);
            }

            _toCleanUp.Clear();

            CheckEmitChange();

            if (_activeTrail != null)
            {
                UpdatePoints(Time.deltaTime, _activeTrail);

                Mesh trailMesh = GenerateMesh(_activeTrail);
                if (trailMesh != null)
                {
                    DrawMesh(trailMesh);
                    _toCleanUp.Add(trailMesh);
                }
            }


            for (int i = _fadingTrails.Count - 1; i >= 0; i--)
            {
                CircularBuffer <PCTrailPoint> trail = _fadingTrails[i];
                if (trail == null || trail.Any(a => a.TimeActive() < TrailData.Lifetime) == false)
                {
                    _fadingTrails.RemoveAt(i);
                    continue;
                }
                UpdatePoints(Time.deltaTime, trail);
                Mesh trailMesh = GenerateMesh(trail);
                if (trailMesh != null)
                {
                    DrawMesh(trailMesh);
                    _toCleanUp.Add(trailMesh);
                }
            }
        }
Ejemplo n.º 2
0
 public bool HasSourceId(ISourceId sourceId)
 {
     return(!sourceId.IsNone() && _previousSourceIds.Any(s => s.Value == sourceId.Value));
 }
 public bool HasSourceId(ISourceId sourceId) => !sourceId.IsNone() && _previousSourceIds.Any(s => s.Value == sourceId.Value);