Example #1
0
    void ActualizeHarborState(float distance)
    {
        if (_harbor != null)
        {
            float maxDistance = collider.radius + _harbor.innerRadius;

            if (_isAtRange && maxDistance < distance)
            {
                _isAtRange = false;
                _harbor.SetIndicatorState(false);
                HarborWindowManager.instance.Disappear();
            }
            else if (!_isAtRange && maxDistance > distance)
            {
                _isAtRange = true;
                HarborWindowManager.instance.Appear(_harbor.type);
                SetInfo(_harbor);
                _harbor.SetIndicatorState(true);
                HarborWindowManager.instance.SetIsOpen(_harbor.isOpen);
            }
        }
    }