Пример #1
0
 public void OnStart()
 {
     _flashLight = Main.Instance.Inventory.FlashLight;
     UiInterface.LightUiText.SetActive(false);
     UiInterface.FlashLightUiBar.SetActive(false);
     Switch(false);
 }
Пример #2
0
 public FlashLightController()
 {
     _flashLight        = MonoBehaviour.FindObjectOfType <FlashLightModel>();
     _flashLightUi      = MonoBehaviour.FindObjectOfType <FlashLightUiText>();
     _flashLightUIImage = MonoBehaviour.FindObjectOfType <FlashLightUIImage>();
     Off();
 }
Пример #3
0
        public void OnStart()
        {
            _weapons = Main.Instance.Player.GetComponentsInChildren <Weapon>();

            foreach (var weapon in Weapons)
            {
                weapon.IsVisible = false;
            }

            FlashLight = Object.FindObjectOfType <FlashLightModel>();
        }
Пример #4
0
 public sealed override void Off()
 {
     if (!IsActive)
     {
         return;
     }
     base.Off();
     _flashLight.Switch(false);
     _flashLight = null;
     UiInterface.LightUiText.SetActive(false);
 }
Пример #5
0
 public override void On()
 {
     if (IsActive)
     {
         return;
     }
     base.On();
     _flashLight = Main.Instance.ObjectManager.FlashLight;
     _flashLight.Switch(true);
     UiInterface.LightUiText.SetActive(true);
 }
Пример #6
0
        public void Start()
        {
            _weapons = Main.Instance.Player.GetComponentsInChildren <Weapon>();

            foreach (var weapon in Weapons)
            {
                weapon.IsVisible = false;
            }

            FlashLight = MonoBehaviour.FindObjectOfType <FlashLightModel>();
            FlashLight.Switch(false);
        }
Пример #7
0
        public void Initialization()
        {
            _weapons = ServiceLocatorMonoBehaviour.GetService <CharacterController>().
                       GetComponentsInChildren <Weapon>();

            foreach (var weapon in Weapons)
            {
                weapon.IsVisible = false;
            }

            FlashLight = Object.FindObjectOfType <FlashLightModel>();
            FlashLight.Switch(FlashLightActiveType.Off);
        }
Пример #8
0
 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;
     }
     base.On(_flashLightModel);
     _flashLightModel.Switch(FlashLightActiveType.On);
     UiInterface.LightUiText.SetActive(true);
     UiInterface.FlashLightUiBar.SetActive(true);
     UiInterface.FlashLightUiBar.SetColor(Color.green);
 }
Пример #9
0
 public void Initialization()
 {
     _flashLightModel = Object.FindObjectOfType <FlashLightModel>();
 }
Пример #10
0
 public void Init()
 {
     _flashLightModel = Object.FindObjectOfType <FlashLightModel>();
     _flashLightUi    = Object.FindObjectOfType <FlashLightUi>();
 }