Merge remote-tracking branch 'origin/main'

This commit is contained in:
Nikita Kruglickiy 2024-03-16 22:19:48 +03:00
commit adf7c5895b
3 changed files with 2 additions and 6 deletions

View File

@ -261,7 +261,7 @@ public class Interactions : NetworkBehaviour
_lightIntensity = Mathf.Lerp(_lightIntensity, (_gunSpread < Time.time) && (controller.currentEnergy >= controller.shootDepletion) ? 1f : 0f, Time.deltaTime * 5f); _lightIntensity = Mathf.Lerp(_lightIntensity, (_gunSpread < Time.time) && (controller.currentEnergy >= controller.shootDepletion) ? 1f : 0f, Time.deltaTime * 5f);
if (gunLayerWeight == 1) gun.SetActive(true); if (gunLayerWeight == 1) gun.SetActive(true);
if (gunRig.weight <= 0.1) gun.SetActive(false); if (gunRig.weight <= 0.1 || controller.currentEnergy <= 0) gun.SetActive(false);
if (gun != null) if (gun != null)
{ {

View File

@ -213,12 +213,9 @@ namespace StarterAssets
private void CalculateEnergy() private void CalculateEnergy()
{ {
if (Input.GetKey(KeyCode.LeftShift) && _inputMove.magnitude != 0) if (Input.GetKey(KeyCode.LeftShift) && _inputMove.magnitude != 0)
{
if (currentEnergy > 0)
{ {
currentEnergy = Mathf.MoveTowards(currentEnergy, 0, _depletionSpeed * Time.deltaTime); currentEnergy = Mathf.MoveTowards(currentEnergy, 0, _depletionSpeed * Time.deltaTime);
} }
}
else if (currentEnergy <= _maxEnergy) else if (currentEnergy <= _maxEnergy)
{ {
currentEnergy = Mathf.MoveTowards(currentEnergy, _maxEnergy, _regenerationSpeed * Time.deltaTime); currentEnergy = Mathf.MoveTowards(currentEnergy, _maxEnergy, _regenerationSpeed * Time.deltaTime);

View File

@ -8,7 +8,6 @@ using TMPro;
public class NetworkManagerUI : MonoBehaviour public class NetworkManagerUI : MonoBehaviour
{ {
public NetworkManager manager; public NetworkManager manager;
public GameObject adressInputGO;
public TMP_InputField adressInput; public TMP_InputField adressInput;
public TMP_InputField nicknameInput; public TMP_InputField nicknameInput;
public TMP_InputField MaxPlayersInput; public TMP_InputField MaxPlayersInput;