Exemplo n.º 1
0
        public override void OnUpdate()
        {
            if (!IsActive)
            {
                return;
            }

            if (_flashLight == null)
            {
                return;
            }
            _flashLight.Rotation();
            if (_flashLight.EditBatteryCharge())
            {
                _flashLightUi.Text = _flashLight.BatteryChargeCurrent;
            }
            else
            {
                Off();
            }
        }
Exemplo n.º 2
0
        public void Execute()
        {
            if (!IsActive)
            {
                return;
            }
            if (_flashLightModel.EditBatteryCharge())
            {
                UiInterface.LightUiText.Text     = _flashLightModel.BatteryChargeCurrent;
                UiInterface.FlashLightUiBar.Fill = _flashLightModel.Charge;
                _flashLightModel.Rotation();

                if (_flashLightModel.LowBattery())
                {
                    UiInterface.FlashLightUiBar.SetColor(Color.red);
                }
            }
            else
            {
                Off();
            }
        }