Example #1
0
 private void Update()
 {
     transform.position = Vector3.LerpUnclamped(startPosition, targetPosition, (Time.time - startTime) / Duration);
     if (transform.localPosition.y <= 0)
     {
         if (!invoked)
         {
             invoked = true;
             SpawnWave?.Invoke();
         }
         Destroy(gameObject, .5f);
     }
 }