This commit is contained in:
Stedd 2023-04-15 12:26:50 +02:00
parent 68de921a69
commit d9a3b158bd
7 changed files with 9 additions and 19 deletions

View File

@ -1,4 +1,3 @@
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.AI;

View File

@ -1,6 +1,3 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
@ -40,7 +37,7 @@ public class FlashLight : MonoBehaviour
{
CurrentCharge -= _powerDraw * Time.deltaTime;
CurrentCharge = Mathf.Clamp(CurrentCharge, 0, _maxCharge);
if (CurrentCharge == 0)
if (CurrentCharge >= 0)
{
FlashLightOff();
}
@ -52,6 +49,7 @@ public class FlashLight : MonoBehaviour
private void FlashLightOff()
{
_light.enabled = false;
_isActive = false;
}
private void FlashLightOn()

View File

@ -1,6 +1,3 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AmmoPickup : MonoBehaviour
@ -12,13 +9,13 @@ public class AmmoPickup : MonoBehaviour
private void OnTriggerEnter(Collider other)
{
var ammoBelt = other.GetComponentInChildren<AmmoBelt>();
var amountBefore = ammoBelt.GetBeltCurrentAmmoAmount(_ammoType);
int amountBefore = ammoBelt.GetBeltCurrentAmmoAmount(_ammoType);
if (ammoBelt != null)
{
ammoBelt.ModifyBeltCurrentAmmoAmount(_ammoType, _pickupAmount);
}
var amountAfter = ammoBelt.GetBeltCurrentAmmoAmount(_ammoType);
int amountAfter = ammoBelt.GetBeltCurrentAmmoAmount(_ammoType);
if (amountBefore != amountAfter)
{

View File

@ -1,6 +1,3 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BatteryPickup : MonoBehaviour
@ -12,15 +9,15 @@ public class BatteryPickup : MonoBehaviour
{
print("Battery Pickup" + other);
var flashLight = other.GetComponentInChildren<FlashLight>();
var amountBefore = flashLight.CurrentCharge;
float amountBefore = flashLight.CurrentCharge;
if (flashLight != null)
{
flashLight.ModifyCharge(_pickupAmount);
}
var amountAfter = flashLight.CurrentCharge;
float amountAfter = flashLight.CurrentCharge;
if (amountBefore != amountAfter)
if (Mathf.Approximately(amountBefore, amountAfter))
{
Destroy(gameObject.transform.parent.gameObject);
}

View File

@ -1,5 +1,4 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Weapon : MonoBehaviour

View File

@ -3,7 +3,7 @@
"com.unity.cinemachine": "2.8.6",
"com.unity.collab-proxy": "1.17.2",
"com.unity.feature.development": "1.0.1",
"com.unity.ide.rider": "3.0.16",
"com.unity.ide.rider": "3.0.18",
"com.unity.ide.visualstudio": "2.0.16",
"com.unity.ide.vscode": "1.2.5",
"com.unity.inputsystem": "1.4.2",

View File

@ -45,7 +45,7 @@
}
},
"com.unity.ide.rider": {
"version": "3.0.16",
"version": "3.0.18",
"depth": 0,
"source": "registry",
"dependencies": {