예제 #1
0
 private void Update()
 {
     if (growing)
     {
         controller.Grow(speed * Time.deltaTime);
     }
     else
     {
         controller.Shrink(speed * Time.deltaTime);
         if (transform.localScale.x <= 0f)
         {
             Destroy(gameObject);
         }
     }
 }
예제 #2
0
 private void Update()
 {
     if (totalGrowLength < MaximumLength)
     {
         float growLength = speed * Time.deltaTime;
         totalGrowLength += growLength;
         controller.Grow(growLength);
     }
     if (stop)
     {
         controller.Shrink(speed * Time.deltaTime);
         if (transform.localScale.x <= 0f)
         {
             Destroy(gameObject);
         }
     }
 }