Ejemplo n.º 1
0
        private void Update()
        {
            if (ReflectHandler.IsInView(_transform.position))
            {
                return;
            }

            DeactivateTrails();
            _transform.position = ReflectHandler.GetReflectedPosOf(_transform.position);
            Invoke("ActivateTrails", 0.001f);
        }
Ejemplo n.º 2
0
        private void LateUpdate()
        {
            int nParticles = _pSystem.GetParticles(_particles);

            for (int i = 0; i < nParticles; i++)
            {
                Vector3 worldPos = _transform.TransformPoint(_particles[i].position);

                if (!ReflectHandler.IsInView(worldPos))
                {
                    _particles[i].position = _transform.InverseTransformPoint(ReflectHandler.GetReflectedPosOf(worldPos));
                }
            }

            _pSystem.SetParticles(_particles, nParticles);
        }