Beispiel #1
0
    public void ChangeLife(float value)
    {
        float width = _currentBar.ChangeLife(value * _ratio);

        if (width < 0 && ChangeIndex(1))
        {
            Exchange();
            _currentBar.transform.SetAsLastSibling();
            _nextBar.ResetToWidth();
            SetBarData(_currentIndex, _data);
            ChangeLife(width / _ratio);
        }
        else if (width > 0 && ChangeIndex(-1))
        {
            Exchange();
            _currentBar.transform.SetAsLastSibling();
            _currentBar.ResetToZero();
            SetBarData(_currentIndex, _data);
            ChangeLife(width / _ratio);
        }
    }