예제 #1
0
파일: Flock.cs 프로젝트: umetaman/nagare
 public void ApplyForce(Vector3 _v)
 {
     foreach (var Boid in Boids)
     {
         Boid.ApplyForce(_v);
     }
 }
예제 #2
0
    IEnumerator InduceCoRoutine(List <BoidDist> _BoidList, Vector3 _Direction)
    {
        _Direction.Normalize();

        foreach (var _Boid in _BoidList)
        {
            Boid  b    = _Boid.Boid;
            float Dist = _Boid.Distance;

            float Scale = Mathf.Lerp(5.0000f, 0.0001f, Dist / DistLimit);
            b.ApplyForce(Scale * _Direction);

            yield return(new WaitForSeconds(0.002f));
        }
    }