예제 #1
0
        private void EmitCheck()
        {
            if (_prevPos == default(Vector3))
            {
                _prevPos = transform.position;
                return;
            }

            Vector3 delta = transform.position - _prevPos;

            if (delta.sqrMagnitude < _sqrDistanceThreshold)
            {
                return;
            }

            float   len = delta.magnitude;
            Vector3 dir = delta.normalized;

            for (float t = 0; t <= _distanceThreshold; t += 0.05f)
            {
                _particle.Emit(new ParticleParam
                {
                    Position = _prevPos + (dir * t),
                    Delay    = 0,
                    Color    = ColorVec,
                }, _particleCount);
            }

            _prevPos = transform.position;
        }
 /// <summary>
 /// Normal emit particles.
 /// </summary>
 private void NormalEmit()
 {
     _particle.Emit(new ParticleParam
     {
         Position = transform.position,
         Delay    = 0,
         Color    = ColorVec,
     }, 500);
 }