public override void On(params BaseObjectScene[] flashLight) { if (IsActive) { return; } if (flashLight.Length > 0) { _flashLightModel = flashLight[0] as FlashLightModel; } if (_flashLightModel == null) { return; } if (_flashLightModel.BatteryChargeCurrent <= 0) { return; } UIInterface.FlashLightUIText.Text = _flashLightModel.BatteryChargeCurrent; base.On(_flashLightModel); _flashLightModel.Switch(FlashLightActiveType.On); UIInterface.FlashLightUIBar.SetColor(Color.green); UIInterface.FlashLightUIText.SetActive(true); UIInterface.FlashLightUIBar.SetActive(true); }
public void Initialization() { _flashLightModel = Object.FindObjectOfType <FlashLightModel>(); _flashLightTextUI = Object.FindObjectOfType <FlashLightTextUI>(); _flashLightFillerUI = Object.FindObjectOfType <FlashLightFillerUI>(); _flashLightTextUI.Text = _flashLightModel.BatteryChargeCurrent; }
public void Initialization() { _weapons = ServiceLocatorMonoBehaviour.GetService <CharacterController>(). GetComponentsInChildren <Weapon>(); foreach (var weapon in _weapons) { weapon.SetActive(false); } FlashLight = Object.FindObjectOfType <FlashLightModel>(); FlashLight.Switch(FlashLightActiveType.Off); }