コード例 #1
0
        public void Initialization()
        {
            _light  = Object.FindObjectOfType <FlashlightModel>();
            _gameUI = Object.FindObjectOfType <GameUI>();
            _gameUI.FlashlightChargeText = _light.BatteryChargeCurrent;

            SetActiveFlashlight(false);
        }
コード例 #2
0
ファイル: ObjectManager.cs プロジェクト: Camypai/OOP
        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);
        }
コード例 #3
0
 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);
 }
コード例 #4
0
    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();
    }
コード例 #5
0
 public void Start()
 {
     _flashlightModel = Object.FindObjectOfType <FlashlightModel>();
 }