Exemple #1
0
        private void Craft()
        {
            _path = GetComponent <PathComp>();
            Path_Point pointA = _path.GetPathPoint(0.0f);
            Path_Point pointB = pointA;


            for (float dist = 0.0f; dist < _path._path.TotalDistance; dist += _segment_length)
            {
                pointB = _path.GetPathPoint(Mathf.Clamp(dist + _segment_length, 0, _path._path.TotalDistance));

                _helpTransform1.rotation = Quaternion.LookRotation(pointA.forward, pointA.up);
                _helpTransform1.position = transform.TransformPoint(pointA.point);

                _helpTransform2.rotation = Quaternion.LookRotation(pointB.forward, pointB.up);
                _helpTransform2.position = transform.TransformPoint(pointB.point);

                Add_Segment();

                pointA = pointB;
            }
        }
 // Use this for initialization
 void Start()
 {
     _pathComp = GetComponent <PathComp>();
 }
 void Start()
 {
     _path_comp       = GetComponent <PathComp>();
     _particle_system = GetComponent <ParticleSystem>();
     _particle_array  = new ParticleSystem.Particle[_particle_system.main.maxParticles];
 }