fix: consume boost capacity when only boosting, double play field exit trigger

This commit is contained in:
Jakob Feldmann 2024-04-13 15:54:23 +02:00
parent 89970a7d1d
commit e444ebf950
3 changed files with 8 additions and 8 deletions

View File

@ -51,8 +51,8 @@ SphereCollider:
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Radius: 0.5
m_Center: {x: 0, y: 0.05, z: 0}
m_Radius: 0.4
m_Center: {x: 0, y: 0.3, z: -0.13130158}
--- !u!1 &950156585708023501
GameObject:
m_ObjectHideFlags: 0
@ -281,7 +281,7 @@ BoxCollider:
m_Bits: 256
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_Bits: 8
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 1

View File

@ -51,8 +51,8 @@ SphereCollider:
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Radius: 0.5
m_Center: {x: 0, y: 0.05, z: 0}
m_Radius: 0.4
m_Center: {x: 0, y: 0.3, z: 0}
--- !u!1 &1372816401649438144
GameObject:
m_ObjectHideFlags: 0
@ -171,7 +171,7 @@ BoxCollider:
m_Bits: 256
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_Bits: 8
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 1

View File

@ -258,7 +258,7 @@ public class Ship : MonoBehaviour
void BoostStateUpdate(float deltaTime)
{
boostUI.UpdateFill(Math.Min(state.boostCapacity / props.maxBoostCapacity, 1));
if (IsBoosting() && state.thrustInput != 0)
if (IsBoosting())
{
state.boostCapacity -= deltaTime;
}
@ -271,7 +271,7 @@ public class Ship : MonoBehaviour
canBoost = false;
}
if ((state.boostInput <= 0 || state.thrustInput == 0 || !canBoost)
if ((state.boostInput <= 0 || !canBoost)
&& zone == Zone.NimbleZone
&& state.boostCapacity <= props.maxBoostCapacity)
{