예제 #1
0
 private void LateUpdate()
 {
     if (initialized)
     {
         if (CanMove)
         {
             if (target && target.gameObject.activeInHierarchy)
             {
                 MoveTowardsTarget();
             }
             else
             {
                 target = parentLauncher.ClosestEnemy();
                 if (!target.gameObject.activeInHierarchy)
                 {
                     Destroy(gameObject);
                 }
             }
         }
     }
 }