Compare commits

...

2 Commits

16 changed files with 2595 additions and 794 deletions

View File

@ -62,7 +62,7 @@ AudioSource:
m_audioClip: {fileID: 8300000, guid: f03afcd094e19824e8549f6fec3655ef, type: 3}
m_PlayOnAwake: 0
m_Volume: 0.092
m_Pitch: 1.13
m_Pitch: 1.05
Loop: 0
Mute: 0
Spatialize: 0

View File

@ -47,7 +47,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
id: 1
audioTag: zone_change_in
pitchRange: 0.4
pitchRange: 0.2
volumeRange: 0.3
--- !u!82 &7696877450501702533
AudioSource:
@ -62,7 +62,7 @@ AudioSource:
m_audioClip: {fileID: 8300000, guid: 4c5447693497adc4ebc7065f253d8b9f, type: 3}
m_PlayOnAwake: 0
m_Volume: 0.25
m_Pitch: 1
m_Pitch: 0.6
Loop: 0
Mute: 0
Spatialize: 0

View File

@ -47,7 +47,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
id: 1
audioTag: zone_change_out
pitchRange: 0.4
pitchRange: 0.2
volumeRange: 0.3
--- !u!82 &7696877450501702533
AudioSource:
@ -62,7 +62,7 @@ AudioSource:
m_audioClip: {fileID: 8300000, guid: fad7b8b8149e035499ded4af2227b5aa, type: 3}
m_PlayOnAwake: 0
m_Volume: 0.25
m_Pitch: 1
m_Pitch: 0.8
Loop: 0
Mute: 0
Spatialize: 0

View File

@ -517,7 +517,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
forcesManager: {fileID: 1659830376}
renderedZoneObject: {fileID: 2129209322}
outsideGravityFunction: 2
outsideGravityFunction: 0
zone: 0
rippleFrequency: 12
rippleDensity: 14

View File

@ -505,6 +505,8 @@ MonoBehaviour:
PlayerManager: {fileID: 4324267968298468629, guid: bf1ba420952f8cd4e8e6e02554c13bac, type: 3}
AudioManager: {fileID: 4421901766771881742, guid: d2fa91ae61bbe6644b3847b83f0f21fb, type: 3}
startCamera: {fileID: 1164443743}
IsTestRun: 0
TestScene: 3
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0

File diff suppressed because it is too large Load Diff

View File

@ -9539,7 +9539,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_AnchorMin.x
@ -9547,11 +9547,11 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_SizeDelta.x
value: 522
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_SizeDelta.y
@ -9587,11 +9587,11 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_AnchoredPosition.x
value: 261
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_AnchoredPosition.y
value: -38.65
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@ -9613,6 +9613,14 @@ PrefabInstance:
propertyPath: m_Delegates.Array.data[0].callback.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 938928009}
- target: {fileID: 5388222474218088325, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_Navigation.m_SelectOnDown
value:
objectReference: {fileID: 947241302}
- target: {fileID: 5388222474218088325, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_Navigation.m_SelectOnLeft
value:
objectReference: {fileID: 1876351060}
- target: {fileID: 5388222474218088325, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
value: 1
@ -9672,13 +9680,27 @@ PrefabInstance:
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 5429289958580070961, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
insertIndex: -1
addedObject: {fileID: 0}
m_SourcePrefab: {fileID: 100100000, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
--- !u!224 &741838669 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
m_PrefabInstance: {fileID: 741838668}
m_PrefabAsset: {fileID: 0}
--- !u!114 &741838670 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5388222474218088325, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
m_PrefabInstance: {fileID: 741838668}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &751882170
GameObject:
m_ObjectHideFlags: 0
@ -11821,7 +11843,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_AnchorMin.x
@ -11829,11 +11851,11 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_SizeDelta.x
value: 522
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_SizeDelta.y
@ -11869,11 +11891,11 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_AnchoredPosition.x
value: 261
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_AnchoredPosition.y
value: -173.15
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@ -11895,6 +11917,14 @@ PrefabInstance:
propertyPath: m_Delegates.Array.data[0].callback.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 938928009}
- target: {fileID: 5388222474218088325, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_Navigation.m_SelectOnUp
value:
objectReference: {fileID: 741838670}
- target: {fileID: 5388222474218088325, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_Navigation.m_SelectOnLeft
value:
objectReference: {fileID: 1876351060}
- target: {fileID: 5388222474218088325, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
value: 0
@ -11942,13 +11972,27 @@ PrefabInstance:
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 5429289958580070961, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
insertIndex: -1
addedObject: {fileID: 0}
m_SourcePrefab: {fileID: 100100000, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
--- !u!224 &947241301 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
m_PrefabInstance: {fileID: 947241300}
m_PrefabAsset: {fileID: 0}
--- !u!114 &947241302 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5388222474218088325, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
m_PrefabInstance: {fileID: 947241300}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &951231689
GameObject:
m_ObjectHideFlags: 0
@ -22425,7 +22469,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &1587051624
RectTransform:
m_ObjectHideFlags: 0
@ -27530,6 +27574,10 @@ PrefabInstance:
propertyPath: m_Navigation.m_SelectOnDown
value:
objectReference: {fileID: 1863786520}
- target: {fileID: 5388222474218088325, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_Navigation.m_SelectOnRight
value:
objectReference: {fileID: 741838670}
- target: {fileID: 5388222474218088325, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:

View File

@ -13,14 +13,6 @@ public class GameplayMetaInputEvents : MonoBehaviour, IMetaActions
inputActions.Meta.SetCallbacks(this);
inputActions.Meta.Enable();
}
void EnableMetaInput()
{
inputActions.Meta.Enable();
}
void DisableMetaInput()
{
inputActions.Meta.Disable();
}
public void OnStart(InputAction.CallbackContext context)
{
MatchManager.G.StartPressed();
@ -28,6 +20,11 @@ public class GameplayMetaInputEvents : MonoBehaviour, IMetaActions
public void OnPause(InputAction.CallbackContext context)
{
throw new System.NotImplementedException();
MatchManager.G.PausePressed();
}
public void Dispose()
{
inputActions.Meta.Disable();
inputActions.Meta.RemoveCallbacks(this);
}
}

View File

@ -78,7 +78,9 @@ namespace Managers
if (playersControlSchemes.ContainsValue(uc))
{
#if RELEASE
Log.Warn("These controls can't be assigned to a second player.");
#endif
return;
}
@ -88,7 +90,7 @@ namespace Managers
Log.Info($"Player Number: {playerId} got assigned control scheme: {uc.SchemeName}.");
playersControlSchemes.Add(playerId, uc);
unassignedPlayers.Remove(playerId);
PlayerControlAssigned.Invoke(this, new Tuple<int, UniqueControl>(playerId, uc));
PlayerControlAssigned?.Invoke(this, new Tuple<int, UniqueControl>(playerId, uc));
}
private void AssignShipControls(UniqueControl uc, Ship s, ShipProperties p)

View File

@ -55,12 +55,15 @@ namespace Managers
[SerializeField]
private GameObject startCamera;
public bool IsTestRun = false;
public Scenes TestScene = Scenes.Arena;
public event EventHandler<SceneLoadEventArgs> CustomSceneLoaded;
void Awake()
{
G = this;
ShowStartScreen();
if (!IsTestRun) ShowStartScreen();
ConfigureLog4Net();
Log.Info("Awake");
}
@ -69,7 +72,15 @@ namespace Managers
{
InstantiateBaseManagers();
Log.Info("Space Smash Out is starting.");
LoadMainMenu();
if (!IsTestRun)
{
LoadMainMenu();
}
else
{
// Coroutine for waiting a frame and letting the managers run their Start methods
StartCoroutine(SetupTestMatch(TestScene));
}
}
/// <summary>
@ -204,6 +215,32 @@ namespace Managers
MatchManager.StartMatch();
}
public IEnumerator SetupTestMatch(Scenes scene)
{
yield return null;
SceneManager.LoadScene((int)scene, LoadSceneMode.Additive);
yield return null;
SceneManager.LoadScene((int)Scenes.GameplayUserInterface, LoadSceneMode.Additive);
yield return null;
SceneManager.SetActiveScene(SceneManager.GetSceneByBuildIndex((int)scene));
yield return null;
MatchManager.LoadMatchRules(0);
MatchManager.LoadArenaProperties(0);
PlayerManager.LocalMatchJoinPlayers(MatchManager.arenaProperties.minPlayerCount);
// TODO: This is in place of a character choosing menu etc.
foreach (Player p in PlayerManager.localPlayers)
{
CharacterManager.AssignShipFixed(p);
Log.Debug($"Ship: {p.character.name} assigned to player: {p.playerNumber}.");
}
MatchManager.StartCharacterSelect();
MatchManager.SpawnCharacters(PlayerManager.localPlayers);
UIManager.StartManagingMatchUI();
UIManager.AssignHUDElementsToPlayers(PlayerManager.localPlayers);
ControlsManager.AssignControlsToPlayers(PlayerManager.localPlayers);
MatchManager.StartTestMatch();
}
/// <summary>
/// Triggers a method once, when a specific scene was loaded.
/// </summary>

View File

@ -8,6 +8,8 @@ using UnityEditor;
using UnityEngine;
using GameLogic;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using Unity.VisualScripting;
/// <summary>
/// States the match can be in.
@ -287,6 +289,17 @@ namespace Managers
matchState = MatchState.Match;
}
public void StartTestMatch()
{
foreach (Player p in matchPlayers)
{
p.spawnedCharacter.transform.localPosition =
arenaProperties.spawnPositions[p.playerNumber - 1];
}
SetupMatchPlayerStatistics();
matchState = MatchState.Match;
}
public void ConfirmMatchStart(TaskCompletionSource<bool> startPressed)
{
startPressed.TrySetResult(true);
@ -297,10 +310,35 @@ namespace Managers
/// </summary>
public void StartPressed()
{
if (OnStartPressed != null)
OnStartPressed?.Invoke();
}
public void PausePressed()
{
if (matchState == MatchState.Pause)
{
OnStartPressed.Invoke();
ContinueMatch();
UIManager.G.ShowPauseMenu();
return;
}
if (matchState != MatchState.Match)
{
Log.Info("Can only pause when match is in progress.");
return;
}
matchState = MatchState.Pause;
UIManager.G.HidePauseMenu();
}
async private void ContinueMatch()
{
UIManager.G.announcments.QueueAnnounceText("Get Ready.", 0.3f);
UIManager.G.announcments.QueueAnnounceText("Get Ready..", 0.3f);
UIManager.G.announcments.QueueAnnounceText("Get Ready...", 0.3f);
UIManager.G.announcments.QueueAnnounceText("GO!", 0.5f);
await Tween.Delay(0.9f);
matchState = MatchState.Match;
}
/// <summary>

View File

@ -1,13 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
using System.Xml.Serialization;
using log4net;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
namespace Managers
{
@ -35,7 +29,8 @@ namespace Managers
public bool StartManagingMatchUI()
{
if (!StartManagingHUD() || !StartManagingAnnouncements())
if (!StartManagingHUD() || !StartManagingAnnouncements()
|| !StartManagingPauseMenu())
{
Log.Error("Problems when starting in game match UI.");
return false;
@ -115,5 +110,15 @@ namespace Managers
{
announcments.StopAnnouncement();
}
public void ShowPauseMenu()
{
}
public void HidePauseMenu()
{
}
}
}

View File

@ -349,12 +349,12 @@ public class Ship : MonoBehaviour
void UpdateSounds()
{
float velocityFactor = math.smoothstep(0, props.absolutMaxVelocity, body.velocity.magnitude);
if (math.abs(state.thrustInput) > 0 || IsBoosting())
{
ThrusterSound.PlayAudio(true);
ThrusterSound.ChangePitch(
math.smoothstep(0, props.absolutMaxVelocity, body.velocity.magnitude));
ThrusterSound.ChangePitch(velocityFactor);
}
else
{
@ -385,11 +385,13 @@ public class Ship : MonoBehaviour
{
if (newZone != Zone.NimbleZone)
{
LeaveZoneSound.ChangePitch(velocityFactor);
LeaveZoneSound.PlayAudio(false);
AudioManager.G.BroadcastAudioEffect(AudioEffects.LowPass, transform, true);
}
else
{
EnterZoneSound.ChangePitch(velocityFactor);
EnterZoneSound.PlayAudio(false);
AudioManager.G.BroadcastAudioEffect(AudioEffects.LowPass, transform, false);
}

View File

@ -4,8 +4,9 @@ using UnityEngine;
public class PauseMenu : MonoBehaviour
{
// Start is called before the first frame update
void Start()
// Start is called before the first frame update
void Start()
{
}