Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     if (hasToFill)
     {
         if (Vector3.Distance(transform.position, peiceToFill.transform.position) > .1f)
         {
             transform.position = Vector3.SmoothDamp(transform.position, peiceToFill.transform.position, ref ignor, Speed * Time.deltaTime);
         }
         else
         {
             hasToFill = false;
             playerController.LostPeices.Remove(peiceToFill);
             peiceToFill.ResetPosition();
             gameObject.SetActive(false);
             playerController.UpdateLostPeicesCounter(1);
         }
     }
 }