textures and pause game

This commit is contained in:
ntr committed 2023-10-03 16:37:17 +11:00
1 parent 0992d2233d
commit 62323965cd
11 files changed
+43 -23

No files matched your search

View File
File mode changed.
+1 -1
View File
@@ -128,7 +128,7 @@ Material:
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 2.2588236, b: 8, a: 1}
- _EmissionColor: {r: 0, g: 0.42297584, b: 1.4980394, a: 1}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_BuildTextureStacks: []
--- !u!114 &398519245074296181
+1 -1
View File
@@ -128,7 +128,7 @@ Material:
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 4, b: 0.14117648, a: 1}
- _EmissionColor: {r: 0, g: 1.4980394, b: 0.05287198, a: 1}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_BuildTextureStacks: []
--- !u!114 &398519245074296181
+1 -1
View File
@@ -128,7 +128,7 @@ Material:
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 8, g: 0, b: 0, a: 1}
- _EmissionColor: {r: 1.4980394, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_BuildTextureStacks: []
--- !u!114 &398519245074296181
+5 -1
View File
@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 705507994}
m_IndirectSpecularColor: {r: 0.14633277, g: 0.17844424, b: 0.14237845, a: 1}
m_IndirectSpecularColor: {r: 0.13586485, g: 0.16515756, b: 0.1291475, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
@@ -1382,6 +1382,10 @@ PrefabInstance:
propertyPath: timingUi
value:
objectReference: {fileID: 766862836}
- target: {fileID: 5313449993149091347, guid: ebed5434f18ca13e38d2d7bfcc18d6c3, type: 3}
propertyPath: shipAudio
value:
objectReference: {fileID: 235775467}
- target: {fileID: 5313449993149091347, guid: ebed5434f18ca13e38d2d7bfcc18d6c3, type: 3}
propertyPath: timingDoc
value:
+8 -8
View File
@@ -30,11 +30,11 @@ Material:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 57878ff7becbdfeb49e897c235fcd13a, type: 3}
m_Texture: {fileID: 2800000, guid: 17801f6600aff15a9a030fe1477f76a6, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 2800000, guid: 687d8e41dbf54edb68a65b1f399660c6, type: 3}
m_Texture: {fileID: 2800000, guid: 89bb05f0f47cc490798f25ad3e26f563, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
@@ -42,7 +42,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 2800000, guid: 277d00e38be7681a491dd3bf1557824a, type: 3}
m_Texture: {fileID: 2800000, guid: bc3995cb0bd4043df818b9e9540ae135, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
@@ -50,23 +50,23 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 2800000, guid: 5903a9f196dc3dc4983ea3caa46c011e, type: 3}
m_Texture: {fileID: 2800000, guid: 9c8cb3484bdeeaed0bdf2414b7e7bc41, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 57878ff7becbdfeb49e897c235fcd13a, type: 3}
m_Texture: {fileID: 2800000, guid: 17801f6600aff15a9a030fe1477f76a6, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 2800000, guid: 38b1ebcc987699268bff0eb4013b6b82, type: 3}
m_Texture: {fileID: 2800000, guid: 33165c4da57b0a30283e5dc7e509360f, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 2800000, guid: a426ec70e6f7f3a339bae47e767905b0, type: 3}
m_Texture: {fileID: 2800000, guid: cc2a9cfbc7336b2708a860f84e70cd49, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 2800000, guid: 56c50cf21746aadf6a4f5f684a050b1e, type: 3}
m_Texture: {fileID: 2800000, guid: ba18cee4f860687e2bec971b0864e0ef, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
+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
}
+2 -2
View File
@@ -17,7 +17,7 @@ public class Timing: MonoBehaviour {
public bool timerEnabled;
[SerializeField]
ShipAudio audio;
ShipAudio shipAudio;
public string mapName;
public double sectorTime;
@@ -111,7 +111,7 @@ public class Timing: MonoBehaviour {
Debug.Log($"{sectorTimes.Count} / {sectors.Length}");
// play a sound :)
if (audio != null) audio.PlayNoise();
if (shipAudio != null) shipAudio.PlayNoise();
// restart the timer for the next sector
sectorStart = Time.timeAsDouble;
+17 -2
View File
@@ -29,7 +29,7 @@ public class MenuControls : MonoBehaviour {
ControlsUI controlsUI;
[SerializeField]
ShipAudio audio;
ShipAudio shipAudio;
SpaceRaceInput input;
@@ -68,14 +68,26 @@ public class MenuControls : MonoBehaviour {
input.menu.Enable();
input.menu.ToggleMenu.started += OnToggleMenu;
input.menu.CloseMenu.started += OnCloseMenu;
InputSystem.onDeviceChange += OnDeviceChange;
}
void OnDeviceChange(InputDevice device, InputDeviceChange change) {
if (change != InputDeviceChange.Removed) return;
Show();
}
void OnDestroy() {
input.menu.ToggleMenu.started -= OnToggleMenu;
input.menu.CloseMenu.started -= OnCloseMenu;
InputSystem.onDeviceChange -= OnDeviceChange;
}
void Show() {
// pause the game
Time.timeScale = 0f;
visible = true;
UnityEngine.Cursor.lockState = CursorLockMode.None;
menuDoc.enabled = true;
@@ -96,6 +108,9 @@ public class MenuControls : MonoBehaviour {
}
void Hide() {
// pause the game
Time.timeScale = 1f;
visible = false;
UnityEngine.Cursor.lockState = CursorLockMode.Locked;
menuDoc.enabled = false;
@@ -111,7 +126,7 @@ public class MenuControls : MonoBehaviour {
}
void OnToggleMenu(InputAction.CallbackContext _ctx) {
audio.PlayNoise();
shipAudio.PlayNoise();
visible = !visible;
if (visible) {
+1
View File
@@ -27,6 +27,7 @@ public class TimingUI : MonoBehaviour {
Label noticePosition;
bool ShouldHide => timing?.sectors.Count() == 0;
public bool TimerEnabled => timing.timerEnabled;
static string[] completionMsgs = {
"(⌐▨_▨)",
+1 -1
View File
@@ -5,5 +5,5 @@ TimeManager:
m_ObjectHideFlags: 0
Fixed Timestep: 0.01
Maximum Allowed Timestep: 0.33333334
m_TimeScale: 1
m_TimeScale: 0
Maximum Particle Timestep: 0.03