Esempio n. 1
0
        public bool IsReadyToBreak()
        {
            if (!_hasChildren)
            {
                return(_controller.IsAbleToTransform(_radius));
            }

            foreach (var child in _children)
            {
                if (child.IsReadyToBreak())
                {
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 2
0
 protected override void UpdateSelf()
 {
     if (_isFirst)
     {
         _currentVertices.SetToVector((_targetVertices).GetCentroid());
         _isFirst = false;
     }
     else
     {
         if (!_controller.IsAbleToTransform(_value))
         {
             return;
         }
         _currentVertices.Lerp(_targetVertices, Time.deltaTime * LinearController.SPEED);
         IsSet = _currentVertices.TheSame(_targetVertices, LinearController.DELTA);
         if (IsSet)
         {
             _currentVertices = _targetVertices;
         }
     }
     SetVertices(_currentVertices);
 }