textures and pause game

This commit is contained in:
ntr committed 2023-10-03 16:37:17 +11:00
1 parent 8a0162cf9d
commit 8472073b56
11 files changed
+43 -23

No files matched your search

+6 -6
View File
@@ -9,7 +9,7 @@ public class ShipControls : MonoBehaviour {
public Camera aim;
public Timing timing;
ShipAudio audio;
ShipAudio shipAudio;
SpaceRaceInput input;
Rigidbody rigidBody;
@@ -64,7 +64,7 @@ public class ShipControls : MonoBehaviour {
void Start() {
Cursor.lockState = CursorLockMode.Locked;
rigidBody = GetComponent<Rigidbody>();
audio = GetComponentInChildren<ShipAudio>();
shipAudio = GetComponentInChildren<ShipAudio>();
// just stop the body from being affected by rotation for now
// until the 3p camera is in to explain why
@@ -174,7 +174,7 @@ public class ShipControls : MonoBehaviour {
}
public void Respawn() {
audio.PlayNoise();
shipAudio.PlayNoise();
// IMPORTANT
// stop the timer before we move the ship or anything
// otherwise it might generate a checkpoint time
@@ -203,7 +203,7 @@ public class ShipControls : MonoBehaviour {
public void Damage(float amt, string src) {
Debug.Log($"Damage {amt} from {src}");
audio.PlayNoise();
shipAudio.PlayNoise();
// convert dmg to % to hide internals
float dmg = (amt / powerUnit.ShieldMax) * 100f;
@@ -223,7 +223,7 @@ public class ShipControls : MonoBehaviour {
void Deploy(Output output) {
bool deployed = powerUnit.Deploy(output);
if (deployed) audio.PlayNoise();
if (deployed) shipAudio.PlayNoise();
}
// I prefer doing it this way than registering the callbacks etc
@@ -278,7 +278,7 @@ public class ShipControls : MonoBehaviour {
void OnPowerUnit4(InputAction.CallbackContext ctx) => Deploy(Output.Shield);
void OnBoostCharge() {
// audio.PlayNoise();
// shipAudio.PlayNoise();
// do some ui fx whatever
}