fix ss walls

This commit is contained in:
ntr committed 2023-08-09 21:17:54 +10:00
1 parent d291dc5a06
commit c2e97d9187
7 files changed
+207 -3

No files matched your search

@@ -58,6 +58,42 @@
"processors": "", "processors": "",
"interactions": "", "interactions": "",
"initialStateCheck": false "initialStateCheck": false
},
{
"name": "powerUnit1",
"type": "Button",
"id": "7871c83b-4bda-4ee4-8128-ed5cd975ff95",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "powerUnit2",
"type": "Button",
"id": "e82aecf6-6941-44ee-b67e-fc4e55837abe",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "powerUnit3",
"type": "Button",
"id": "09c2221d-dc0e-46d0-9bdf-8e66b25b0e83",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "powerUnit4",
"type": "Button",
"id": "49bf2fe6-f03b-4dec-9dd9-e571a9ae3e90",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false
} }
], ],
"bindings": [ "bindings": [
@@ -313,6 +349,50 @@
"action": "look", "action": "look",
"isComposite": false, "isComposite": false,
"isPartOfComposite": false "isPartOfComposite": false
},
{
"name": "",
"id": "448824b6-c8b3-47ec-b7f7-0123f90cf5f6",
"path": "<Keyboard>/1",
"interactions": "",
"processors": "",
"groups": "",
"action": "powerUnit1",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "18e2e44e-8735-45ce-aad2-b75c212fc4dc",
"path": "<Keyboard>/2",
"interactions": "",
"processors": "",
"groups": "",
"action": "powerUnit2",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "46351ee7-55d7-428d-9778-6ffd51bc663c",
"path": "<Keyboard>/3",
"interactions": "",
"processors": "",
"groups": "",
"action": "powerUnit3",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "e36dc262-5e19-467b-9153-98f8795b3752",
"path": "<Keyboard>/4",
"interactions": "",
"processors": "",
"groups": "",
"action": "powerUnit4",
"isComposite": false,
"isPartOfComposite": false
} }
] ]
}, },
Binary file not shown.
Binary file not shown.
+1 -2
View File
@@ -27,11 +27,10 @@ public class PowerUnit {
shieldsRegen = (shieldsMax / 5f) * Time.fixedDeltaTime; shieldsRegen = (shieldsMax / 5f) * Time.fixedDeltaTime;
} }
public void Reassign(float accel, float decel, float strafe, float shields) { public void Reassign(float accel, float decel, float strafe) {
acceleration = baseOutput * accel; acceleration = baseOutput * accel;
deceleration = baseOutput * decel; deceleration = baseOutput * decel;
strafing = baseOutput * strafe; strafing = baseOutput * strafe;
shieldsRegen = shields;
} }
// returns whether shields depleted // returns whether shields depleted
+5
View File
@@ -217,4 +217,9 @@ public class ShipControls : MonoBehaviour, SpaceRaceInput.IShipActions {
public void OnAccelerate(InputAction.CallbackContext ctx) { } public void OnAccelerate(InputAction.CallbackContext ctx) { }
public void OnDecelerate(InputAction.CallbackContext ctx) { } public void OnDecelerate(InputAction.CallbackContext ctx) { }
public void OnLook(InputAction.CallbackContext ctx) { } public void OnLook(InputAction.CallbackContext ctx) { }
public void OnPowerUnit1 (InputAction.CallbackContext ctx) => powerUnit.Reassign(2f, 4f, 1f);
public void OnPowerUnit2 (InputAction.CallbackContext ctx) => powerUnit.Reassign(2f, 4f, 3f);
public void OnPowerUnit4 (InputAction.CallbackContext ctx) => powerUnit.Reassign(2f, 5f, 0f);
public void OnPowerUnit3 (InputAction.CallbackContext ctx) => powerUnit.Reassign(1f, 3f, 3f);
} }
+120
View File
@@ -80,6 +80,42 @@ public partial class @SpaceRaceInput: IInputActionCollection2, IDisposable
""processors"": """", ""processors"": """",
""interactions"": """", ""interactions"": """",
""initialStateCheck"": false ""initialStateCheck"": false
},
{
""name"": ""powerUnit1"",
""type"": ""Button"",
""id"": ""7871c83b-4bda-4ee4-8128-ed5cd975ff95"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""powerUnit2"",
""type"": ""Button"",
""id"": ""e82aecf6-6941-44ee-b67e-fc4e55837abe"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""powerUnit3"",
""type"": ""Button"",
""id"": ""09c2221d-dc0e-46d0-9bdf-8e66b25b0e83"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""powerUnit4"",
""type"": ""Button"",
""id"": ""49bf2fe6-f03b-4dec-9dd9-e571a9ae3e90"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
} }
], ],
""bindings"": [ ""bindings"": [
@@ -335,6 +371,50 @@ public partial class @SpaceRaceInput: IInputActionCollection2, IDisposable
""action"": ""look"", ""action"": ""look"",
""isComposite"": false, ""isComposite"": false,
""isPartOfComposite"": false ""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""448824b6-c8b3-47ec-b7f7-0123f90cf5f6"",
""path"": ""<Keyboard>/1"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""powerUnit1"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""18e2e44e-8735-45ce-aad2-b75c212fc4dc"",
""path"": ""<Keyboard>/2"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""powerUnit2"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""46351ee7-55d7-428d-9778-6ffd51bc663c"",
""path"": ""<Keyboard>/3"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""powerUnit3"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""e36dc262-5e19-467b-9153-98f8795b3752"",
""path"": ""<Keyboard>/4"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""powerUnit4"",
""isComposite"": false,
""isPartOfComposite"": false
} }
] ]
}, },
@@ -388,6 +468,10 @@ public partial class @SpaceRaceInput: IInputActionCollection2, IDisposable
m_ship_look = m_ship.FindAction("look", throwIfNotFound: true); m_ship_look = m_ship.FindAction("look", throwIfNotFound: true);
m_ship_respawn = m_ship.FindAction("respawn", throwIfNotFound: true); m_ship_respawn = m_ship.FindAction("respawn", throwIfNotFound: true);
m_ship_quit = m_ship.FindAction("quit", throwIfNotFound: true); m_ship_quit = m_ship.FindAction("quit", throwIfNotFound: true);
m_ship_powerUnit1 = m_ship.FindAction("powerUnit1", throwIfNotFound: true);
m_ship_powerUnit2 = m_ship.FindAction("powerUnit2", throwIfNotFound: true);
m_ship_powerUnit3 = m_ship.FindAction("powerUnit3", throwIfNotFound: true);
m_ship_powerUnit4 = m_ship.FindAction("powerUnit4", throwIfNotFound: true);
// menu // menu
m_menu = asset.FindActionMap("menu", throwIfNotFound: true); m_menu = asset.FindActionMap("menu", throwIfNotFound: true);
m_menu_ToggleMenu = m_menu.FindAction("ToggleMenu", throwIfNotFound: true); m_menu_ToggleMenu = m_menu.FindAction("ToggleMenu", throwIfNotFound: true);
@@ -458,6 +542,10 @@ public partial class @SpaceRaceInput: IInputActionCollection2, IDisposable
private readonly InputAction m_ship_look; private readonly InputAction m_ship_look;
private readonly InputAction m_ship_respawn; private readonly InputAction m_ship_respawn;
private readonly InputAction m_ship_quit; private readonly InputAction m_ship_quit;
private readonly InputAction m_ship_powerUnit1;
private readonly InputAction m_ship_powerUnit2;
private readonly InputAction m_ship_powerUnit3;
private readonly InputAction m_ship_powerUnit4;
public struct ShipActions public struct ShipActions
{ {
private @SpaceRaceInput m_Wrapper; private @SpaceRaceInput m_Wrapper;
@@ -468,6 +556,10 @@ public partial class @SpaceRaceInput: IInputActionCollection2, IDisposable
public InputAction @look => m_Wrapper.m_ship_look; public InputAction @look => m_Wrapper.m_ship_look;
public InputAction @respawn => m_Wrapper.m_ship_respawn; public InputAction @respawn => m_Wrapper.m_ship_respawn;
public InputAction @quit => m_Wrapper.m_ship_quit; public InputAction @quit => m_Wrapper.m_ship_quit;
public InputAction @powerUnit1 => m_Wrapper.m_ship_powerUnit1;
public InputAction @powerUnit2 => m_Wrapper.m_ship_powerUnit2;
public InputAction @powerUnit3 => m_Wrapper.m_ship_powerUnit3;
public InputAction @powerUnit4 => m_Wrapper.m_ship_powerUnit4;
public InputActionMap Get() { return m_Wrapper.m_ship; } public InputActionMap Get() { return m_Wrapper.m_ship; }
public void Enable() { Get().Enable(); } public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); } public void Disable() { Get().Disable(); }
@@ -495,6 +587,18 @@ public partial class @SpaceRaceInput: IInputActionCollection2, IDisposable
@quit.started += instance.OnQuit; @quit.started += instance.OnQuit;
@quit.performed += instance.OnQuit; @quit.performed += instance.OnQuit;
@quit.canceled += instance.OnQuit; @quit.canceled += instance.OnQuit;
@powerUnit1.started += instance.OnPowerUnit1;
@powerUnit1.performed += instance.OnPowerUnit1;
@powerUnit1.canceled += instance.OnPowerUnit1;
@powerUnit2.started += instance.OnPowerUnit2;
@powerUnit2.performed += instance.OnPowerUnit2;
@powerUnit2.canceled += instance.OnPowerUnit2;
@powerUnit3.started += instance.OnPowerUnit3;
@powerUnit3.performed += instance.OnPowerUnit3;
@powerUnit3.canceled += instance.OnPowerUnit3;
@powerUnit4.started += instance.OnPowerUnit4;
@powerUnit4.performed += instance.OnPowerUnit4;
@powerUnit4.canceled += instance.OnPowerUnit4;
} }
private void UnregisterCallbacks(IShipActions instance) private void UnregisterCallbacks(IShipActions instance)
@@ -517,6 +621,18 @@ public partial class @SpaceRaceInput: IInputActionCollection2, IDisposable
@quit.started -= instance.OnQuit; @quit.started -= instance.OnQuit;
@quit.performed -= instance.OnQuit; @quit.performed -= instance.OnQuit;
@quit.canceled -= instance.OnQuit; @quit.canceled -= instance.OnQuit;
@powerUnit1.started -= instance.OnPowerUnit1;
@powerUnit1.performed -= instance.OnPowerUnit1;
@powerUnit1.canceled -= instance.OnPowerUnit1;
@powerUnit2.started -= instance.OnPowerUnit2;
@powerUnit2.performed -= instance.OnPowerUnit2;
@powerUnit2.canceled -= instance.OnPowerUnit2;
@powerUnit3.started -= instance.OnPowerUnit3;
@powerUnit3.performed -= instance.OnPowerUnit3;
@powerUnit3.canceled -= instance.OnPowerUnit3;
@powerUnit4.started -= instance.OnPowerUnit4;
@powerUnit4.performed -= instance.OnPowerUnit4;
@powerUnit4.canceled -= instance.OnPowerUnit4;
} }
public void RemoveCallbacks(IShipActions instance) public void RemoveCallbacks(IShipActions instance)
@@ -588,6 +704,10 @@ public partial class @SpaceRaceInput: IInputActionCollection2, IDisposable
void OnLook(InputAction.CallbackContext context); void OnLook(InputAction.CallbackContext context);
void OnRespawn(InputAction.CallbackContext context); void OnRespawn(InputAction.CallbackContext context);
void OnQuit(InputAction.CallbackContext context); void OnQuit(InputAction.CallbackContext context);
void OnPowerUnit1(InputAction.CallbackContext context);
void OnPowerUnit2(InputAction.CallbackContext context);
void OnPowerUnit3(InputAction.CallbackContext context);
void OnPowerUnit4(InputAction.CallbackContext context);
} }
public interface IMenuActions public interface IMenuActions
{ {
+1 -1
View File
@@ -54,7 +54,7 @@ public class TimingUI : MonoBehaviour {
return; return;
} }
timerTime.text = $"{TimeSpan.FromSeconds(timing.lapTime):m\\:ss\\.fff}"; timerTime.text = $"{TimeSpan.FromSeconds(timing.lapTime):m\\:ss\\.f}";
// clearly this is not ideal but idk atm // clearly this is not ideal but idk atm
UpdateUI(); UpdateUI();