コード例 #1
0
ファイル: EscortParticles.cs プロジェクト: transkuja/keepers
 // Update is called once per frame
 void Update()
 {
     if (emitting)
     {
         Particle[] parts = new Particle[ps.main.maxParticles];
         ps.GetParticles(parts);
         if (parts.GetUpperBound(0) > 0)
         {
             for (int i = 0; i < parts.GetUpperBound(0); i++)
             {
                 parts[i].position = Vector3.Lerp(parts[i].position, target.position + Vector3.up / 4.0f, Time.deltaTime * 4.0f);
             }
         }
         else
         {
             emitting = false;
         }
         ps.SetParticles(parts, parts.GetLength(0));
     }
 }