Esempio n. 1
0
        //updates the possible color of the player
        public void AddColor(Color _newColor, float _amount)
        {
            //different format for getting color in proper form (0-1)
            _newColor    = CustomColor.ConvertColor(_newColor.r * _amount, _newColor.g * _amount, _newColor.b * _amount);
            _meterColor += _newColor;

            //bound colors
            _meterColor.r = Mathf.Clamp(_meterColor.r, 0f, 1f);
            _meterColor.g = Mathf.Clamp(_meterColor.g, 0f, 1f);
            _meterColor.b = Mathf.Clamp(_meterColor.b, 0f, 1f);
            _meterColor.a = Mathf.Clamp(_meterColor.a, 0f, 1f);

            _r.UpdateMeter(_meterColor.r);
            _g.UpdateMeter(_meterColor.g);
            _b.UpdateMeter(_meterColor.b);
        }