public void Initialization() { _light = Object.FindObjectOfType <FlashlightModel>(); _gameUI = Object.FindObjectOfType <GameUI>(); _gameUI.FlashlightChargeText = _light.BatteryChargeCurrent; SetActiveFlashlight(false); }
public void Start() { Weapons = new List <WeaponModel>(Main.Instance.Player.GetComponentsInChildren <WeaponModel>()); foreach (var weapon in Weapons) { weapon.IsVisible = false; } FlashlightModel = Object.FindObjectOfType <FlashlightModel>(); FlashlightModel.SetActiveFlashlight(false); }
public override void On(params BaseObjectScene[] flashlight) { if (IsActive) { return; } if (flashlight.Length > 0) { _flashlightModel = flashlight[0] as FlashlightModel; } if (_flashlightModel.CurrentBatteryCharge <= 0) { return; } base.On(_flashlightModel); _flashlightModel.Switch(FlashlightActiveType.On); UIInterface.LightUIText.SetActive(true); UIInterface.FlashlightUIBar.SetActive(true); UIInterface.FlashlightUIBar.SetColor(Color.green); }
public override void OnInspectorGUI() { FlashlightModel flashlightModel = (FlashlightModel)target; EditorGUILayout.Space(); EditorGUILayout.BeginVertical(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.HelpBox("Rotation speed", MessageType.None); flashlightModel.RotationSpeed = EditorGUILayout.Slider(flashlightModel.RotationSpeed, 1, 100); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.HelpBox("Max battery charge", MessageType.None); flashlightModel.MaxBatteryCharge = EditorGUILayout.Slider(flashlightModel.MaxBatteryCharge, 1, 100); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.HelpBox("Light intensity", MessageType.None); flashlightModel.Intensity = EditorGUILayout.Slider(flashlightModel.Intensity, 1, 100); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); }
public void Start() { _flashlightModel = Object.FindObjectOfType <FlashlightModel>(); }