feat: can start in test mode instantly starting match, pause menu beginnings
This commit is contained in:
parent
3441b46d6c
commit
965d369673
@ -517,7 +517,7 @@ MonoBehaviour:
|
|||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
forcesManager: {fileID: 1659830376}
|
forcesManager: {fileID: 1659830376}
|
||||||
renderedZoneObject: {fileID: 2129209322}
|
renderedZoneObject: {fileID: 2129209322}
|
||||||
outsideGravityFunction: 2
|
outsideGravityFunction: 0
|
||||||
zone: 0
|
zone: 0
|
||||||
rippleFrequency: 12
|
rippleFrequency: 12
|
||||||
rippleDensity: 14
|
rippleDensity: 14
|
||||||
|
|||||||
@ -505,6 +505,8 @@ MonoBehaviour:
|
|||||||
PlayerManager: {fileID: 4324267968298468629, guid: bf1ba420952f8cd4e8e6e02554c13bac, type: 3}
|
PlayerManager: {fileID: 4324267968298468629, guid: bf1ba420952f8cd4e8e6e02554c13bac, type: 3}
|
||||||
AudioManager: {fileID: 4421901766771881742, guid: d2fa91ae61bbe6644b3847b83f0f21fb, type: 3}
|
AudioManager: {fileID: 4421901766771881742, guid: d2fa91ae61bbe6644b3847b83f0f21fb, type: 3}
|
||||||
startCamera: {fileID: 1164443743}
|
startCamera: {fileID: 1164443743}
|
||||||
|
IsTestRun: 0
|
||||||
|
TestScene: 3
|
||||||
--- !u!1660057539 &9223372036854775807
|
--- !u!1660057539 &9223372036854775807
|
||||||
SceneRoots:
|
SceneRoots:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -9539,7 +9539,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_AnchorMin.x
|
propertyPath: m_AnchorMin.x
|
||||||
@ -9547,11 +9547,11 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_AnchorMin.y
|
propertyPath: m_AnchorMin.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_SizeDelta.x
|
propertyPath: m_SizeDelta.x
|
||||||
value: 522
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_SizeDelta.y
|
propertyPath: m_SizeDelta.y
|
||||||
@ -9587,11 +9587,11 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 261
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -38.65
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
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
|
propertyPath: m_Delegates.Array.data[0].callback.m_PersistentCalls.m_Calls.Array.data[0].m_Target
|
||||||
value:
|
value:
|
||||||
objectReference: {fileID: 938928009}
|
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}
|
- target: {fileID: 5388222474218088325, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
|
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
|
||||||
value: 1
|
value: 1
|
||||||
@ -9672,13 +9680,27 @@ PrefabInstance:
|
|||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_RemovedGameObjects: []
|
m_RemovedGameObjects: []
|
||||||
m_AddedGameObjects: []
|
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}
|
m_SourcePrefab: {fileID: 100100000, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
--- !u!224 &741838669 stripped
|
--- !u!224 &741838669 stripped
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_CorrespondingSourceObject: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
m_CorrespondingSourceObject: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
m_PrefabInstance: {fileID: 741838668}
|
m_PrefabInstance: {fileID: 741838668}
|
||||||
m_PrefabAsset: {fileID: 0}
|
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
|
--- !u!1 &751882170
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -11821,7 +11843,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_AnchorMin.x
|
propertyPath: m_AnchorMin.x
|
||||||
@ -11829,11 +11851,11 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_AnchorMin.y
|
propertyPath: m_AnchorMin.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_SizeDelta.x
|
propertyPath: m_SizeDelta.x
|
||||||
value: 522
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_SizeDelta.y
|
propertyPath: m_SizeDelta.y
|
||||||
@ -11869,11 +11891,11 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 261
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -173.15
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
- target: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
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
|
propertyPath: m_Delegates.Array.data[0].callback.m_PersistentCalls.m_Calls.Array.data[0].m_Target
|
||||||
value:
|
value:
|
||||||
objectReference: {fileID: 938928009}
|
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}
|
- target: {fileID: 5388222474218088325, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
|
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
|
||||||
value: 0
|
value: 0
|
||||||
@ -11942,13 +11972,27 @@ PrefabInstance:
|
|||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_RemovedGameObjects: []
|
m_RemovedGameObjects: []
|
||||||
m_AddedGameObjects: []
|
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}
|
m_SourcePrefab: {fileID: 100100000, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
--- !u!224 &947241301 stripped
|
--- !u!224 &947241301 stripped
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_CorrespondingSourceObject: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
m_CorrespondingSourceObject: {fileID: 5206668379868315107, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
m_PrefabInstance: {fileID: 947241300}
|
m_PrefabInstance: {fileID: 947241300}
|
||||||
m_PrefabAsset: {fileID: 0}
|
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
|
--- !u!1 &951231689
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -22425,7 +22469,7 @@ GameObject:
|
|||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 0
|
m_IsActive: 1
|
||||||
--- !u!224 &1587051624
|
--- !u!224 &1587051624
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -27530,6 +27574,10 @@ PrefabInstance:
|
|||||||
propertyPath: m_Navigation.m_SelectOnDown
|
propertyPath: m_Navigation.m_SelectOnDown
|
||||||
value:
|
value:
|
||||||
objectReference: {fileID: 1863786520}
|
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}
|
- target: {fileID: 5388222474218088325, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
|
||||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
|
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
|
||||||
value:
|
value:
|
||||||
|
|||||||
@ -13,14 +13,6 @@ public class GameplayMetaInputEvents : MonoBehaviour, IMetaActions
|
|||||||
inputActions.Meta.SetCallbacks(this);
|
inputActions.Meta.SetCallbacks(this);
|
||||||
inputActions.Meta.Enable();
|
inputActions.Meta.Enable();
|
||||||
}
|
}
|
||||||
void EnableMetaInput()
|
|
||||||
{
|
|
||||||
inputActions.Meta.Enable();
|
|
||||||
}
|
|
||||||
void DisableMetaInput()
|
|
||||||
{
|
|
||||||
inputActions.Meta.Disable();
|
|
||||||
}
|
|
||||||
public void OnStart(InputAction.CallbackContext context)
|
public void OnStart(InputAction.CallbackContext context)
|
||||||
{
|
{
|
||||||
MatchManager.G.StartPressed();
|
MatchManager.G.StartPressed();
|
||||||
@ -28,6 +20,11 @@ public class GameplayMetaInputEvents : MonoBehaviour, IMetaActions
|
|||||||
|
|
||||||
public void OnPause(InputAction.CallbackContext context)
|
public void OnPause(InputAction.CallbackContext context)
|
||||||
{
|
{
|
||||||
throw new System.NotImplementedException();
|
MatchManager.G.PausePressed();
|
||||||
|
}
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
inputActions.Meta.Disable();
|
||||||
|
inputActions.Meta.RemoveCallbacks(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,7 +78,9 @@ namespace Managers
|
|||||||
|
|
||||||
if (playersControlSchemes.ContainsValue(uc))
|
if (playersControlSchemes.ContainsValue(uc))
|
||||||
{
|
{
|
||||||
|
#if RELEASE
|
||||||
Log.Warn("These controls can't be assigned to a second player.");
|
Log.Warn("These controls can't be assigned to a second player.");
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +90,7 @@ namespace Managers
|
|||||||
Log.Info($"Player Number: {playerId} got assigned control scheme: {uc.SchemeName}.");
|
Log.Info($"Player Number: {playerId} got assigned control scheme: {uc.SchemeName}.");
|
||||||
playersControlSchemes.Add(playerId, uc);
|
playersControlSchemes.Add(playerId, uc);
|
||||||
unassignedPlayers.Remove(playerId);
|
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)
|
private void AssignShipControls(UniqueControl uc, Ship s, ShipProperties p)
|
||||||
|
|||||||
@ -55,12 +55,15 @@ namespace Managers
|
|||||||
[SerializeField]
|
[SerializeField]
|
||||||
private GameObject startCamera;
|
private GameObject startCamera;
|
||||||
|
|
||||||
|
public bool IsTestRun = false;
|
||||||
|
public Scenes TestScene = Scenes.Arena;
|
||||||
|
|
||||||
public event EventHandler<SceneLoadEventArgs> CustomSceneLoaded;
|
public event EventHandler<SceneLoadEventArgs> CustomSceneLoaded;
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
G = this;
|
G = this;
|
||||||
ShowStartScreen();
|
if (!IsTestRun) ShowStartScreen();
|
||||||
ConfigureLog4Net();
|
ConfigureLog4Net();
|
||||||
Log.Info("Awake");
|
Log.Info("Awake");
|
||||||
}
|
}
|
||||||
@ -69,8 +72,16 @@ namespace Managers
|
|||||||
{
|
{
|
||||||
InstantiateBaseManagers();
|
InstantiateBaseManagers();
|
||||||
Log.Info("Space Smash Out is starting.");
|
Log.Info("Space Smash Out is starting.");
|
||||||
|
if (!IsTestRun)
|
||||||
|
{
|
||||||
LoadMainMenu();
|
LoadMainMenu();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Coroutine for waiting a frame and letting the managers run their Start methods
|
||||||
|
StartCoroutine(SetupTestMatch(TestScene));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Configuration of log 4 net, before the game starts.
|
/// Configuration of log 4 net, before the game starts.
|
||||||
@ -204,6 +215,32 @@ namespace Managers
|
|||||||
MatchManager.StartMatch();
|
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>
|
/// <summary>
|
||||||
/// Triggers a method once, when a specific scene was loaded.
|
/// Triggers a method once, when a specific scene was loaded.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -8,6 +8,8 @@ using UnityEditor;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using GameLogic;
|
using GameLogic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Unity.VisualScripting;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// States the match can be in.
|
/// States the match can be in.
|
||||||
@ -287,6 +289,17 @@ namespace Managers
|
|||||||
matchState = MatchState.Match;
|
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)
|
public void ConfirmMatchStart(TaskCompletionSource<bool> startPressed)
|
||||||
{
|
{
|
||||||
startPressed.TrySetResult(true);
|
startPressed.TrySetResult(true);
|
||||||
@ -297,10 +310,35 @@ namespace Managers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void StartPressed()
|
public void StartPressed()
|
||||||
{
|
{
|
||||||
if (OnStartPressed != null)
|
OnStartPressed?.Invoke();
|
||||||
{
|
|
||||||
OnStartPressed.Invoke();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void PausePressed()
|
||||||
|
{
|
||||||
|
if (matchState == MatchState.Pause)
|
||||||
|
{
|
||||||
|
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>
|
/// <summary>
|
||||||
|
|||||||
@ -1,13 +1,7 @@
|
|||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Serialization;
|
|
||||||
using log4net;
|
using log4net;
|
||||||
using Unity.VisualScripting;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Rendering;
|
|
||||||
using UnityEngine.SceneManagement;
|
|
||||||
|
|
||||||
namespace Managers
|
namespace Managers
|
||||||
{
|
{
|
||||||
@ -35,7 +29,8 @@ namespace Managers
|
|||||||
|
|
||||||
public bool StartManagingMatchUI()
|
public bool StartManagingMatchUI()
|
||||||
{
|
{
|
||||||
if (!StartManagingHUD() || !StartManagingAnnouncements())
|
if (!StartManagingHUD() || !StartManagingAnnouncements()
|
||||||
|
|| !StartManagingPauseMenu())
|
||||||
{
|
{
|
||||||
Log.Error("Problems when starting in game match UI.");
|
Log.Error("Problems when starting in game match UI.");
|
||||||
return false;
|
return false;
|
||||||
@ -115,5 +110,15 @@ namespace Managers
|
|||||||
{
|
{
|
||||||
announcments.StopAnnouncement();
|
announcments.StopAnnouncement();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ShowPauseMenu()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void HidePauseMenu()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -349,12 +349,12 @@ public class Ship : MonoBehaviour
|
|||||||
|
|
||||||
void UpdateSounds()
|
void UpdateSounds()
|
||||||
{
|
{
|
||||||
|
float velocityFactor = math.smoothstep(0, props.absolutMaxVelocity, body.velocity.magnitude);
|
||||||
if (math.abs(state.thrustInput) > 0 || IsBoosting())
|
if (math.abs(state.thrustInput) > 0 || IsBoosting())
|
||||||
{
|
{
|
||||||
ThrusterSound.PlayAudio(true);
|
ThrusterSound.PlayAudio(true);
|
||||||
|
|
||||||
ThrusterSound.ChangePitch(
|
ThrusterSound.ChangePitch(velocityFactor);
|
||||||
math.smoothstep(0, props.absolutMaxVelocity, body.velocity.magnitude));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -385,11 +385,13 @@ public class Ship : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (newZone != Zone.NimbleZone)
|
if (newZone != Zone.NimbleZone)
|
||||||
{
|
{
|
||||||
|
LeaveZoneSound.ChangePitch(velocityFactor);
|
||||||
LeaveZoneSound.PlayAudio(false);
|
LeaveZoneSound.PlayAudio(false);
|
||||||
AudioManager.G.BroadcastAudioEffect(AudioEffects.LowPass, transform, true);
|
AudioManager.G.BroadcastAudioEffect(AudioEffects.LowPass, transform, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
EnterZoneSound.ChangePitch(velocityFactor);
|
||||||
EnterZoneSound.PlayAudio(false);
|
EnterZoneSound.PlayAudio(false);
|
||||||
AudioManager.G.BroadcastAudioEffect(AudioEffects.LowPass, transform, false);
|
AudioManager.G.BroadcastAudioEffect(AudioEffects.LowPass, transform, false);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ using UnityEngine;
|
|||||||
|
|
||||||
public class PauseMenu : MonoBehaviour
|
public class PauseMenu : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user