Skip to content

Commit

Permalink
Separated game logic from UI views (#571)
Browse files Browse the repository at this point in the history
* Refactored lobby UI prefab

* Moved NetworkManager to Managers prefabs

* Separated pause menu from game logic

* Disabled UI button for session restart (broken before this commit)

* Renamed events and fixed typos
  • Loading branch information
Macoron authored Oct 16, 2020
1 parent b0f390c commit 8f72c67
Show file tree
Hide file tree
Showing 19 changed files with 32,412 additions and 32,584 deletions.
619 changes: 25 additions & 594 deletions Assets/Content/Graphics/UI/Main Canvas.prefab

Large diffs are not rendered by default.

63,505 changes: 31,711 additions & 31,794 deletions Assets/Content/Scenes/Main Station.unity

Large diffs are not rendered by default.

60 changes: 26 additions & 34 deletions Assets/Content/Systems/Managers/LobbyLoginUI.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ MonoBehaviour:
m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_CustomCaretColor: 0
m_SelectionColor: {r: 1, g: 1, b: 1, a: 0.7529412}
m_Text: Localhost
m_Text: localhost
m_CaretBlinkRate: 0
m_CaretWidth: 1
m_ReadOnly: 0
Expand Down Expand Up @@ -478,7 +478,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: -84}
m_SizeDelta: {x: -202.80585, y: 67.899994}
m_SizeDelta: {x: -87.98071, y: 67.899994}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6795732657437310259
CanvasRenderer:
Expand Down Expand Up @@ -560,8 +560,8 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 0}
m_MethodName: StartHost
- m_Target: {fileID: 4282305140430295671}
m_MethodName: OnHostButtonPressed
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
Expand All @@ -571,17 +571,6 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 7054195789446113916}
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &4156058360554617451
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -669,7 +658,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: 49.6}
m_SizeDelta: {x: -202.80585, y: 163.66743}
m_SizeDelta: {x: -87.98071, y: 163.66743}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5206790625420000153
CanvasRenderer:
Expand Down Expand Up @@ -751,20 +740,9 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 0}
m_MethodName: StartClient
m_Mode: 2
m_Arguments:
m_ObjectArgument: {fileID: 6808936566223018411}
m_ObjectArgumentAssemblyTypeName: TMPro.TMP_InputField, Unity.TextMeshPro
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 7054195789446113916}
m_MethodName: SetActive
m_Mode: 6
- m_Target: {fileID: 4282305140430295671}
m_MethodName: OnJoinButtonPressed
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
Expand All @@ -784,7 +762,8 @@ GameObject:
- component: {fileID: 265072263576197880}
- component: {fileID: 1905608984360446013}
- component: {fileID: 7369752885757284378}
- component: {fileID: 5334666174762846377}
- component: {fileID: 4282305140430295671}
- component: {fileID: 2677266313033479783}
m_Layer: 5
m_Name: LobbyLoginUI
m_TagString: Untagged
Expand All @@ -799,7 +778,7 @@ RectTransform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7054195789446113916}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
Expand Down Expand Up @@ -851,7 +830,20 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 3
--- !u!95 &5334666174762846377
--- !u!114 &4282305140430295671
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7054195789446113916}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0388b51b83050d48be7c31dbad1778d, type: 3}
m_Name:
m_EditorClassIdentifier:
ipAddressInputField: {fileID: 6808936566223018411}
--- !u!95 &2677266313033479783
Animator:
serializedVersion: 3
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1008,7 +1000,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "Localhost\u200B"
m_text: "localhost\u200B"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 0d8da653bf6ebc640b69676085b38b91, type: 2}
m_sharedMaterial: {fileID: -5479874421949242954, guid: 0d8da653bf6ebc640b69676085b38b91,
Expand Down
206 changes: 206 additions & 0 deletions Assets/Content/Systems/Managers/Managers.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7400054331349668430
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7400054331349668431}
m_Layer: 0
m_Name: Managers
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7400054331349668431
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7400054331349668430}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 6720920965910209963}
- {fileID: 4108282049392472887}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &2091475271716419156
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 7400054331349668431}
m_Modifications:
- target: {fileID: 2595733014080996707, guid: e84c1b8cfcb1483478aeb2d2767ebf1b,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2595733014080996707, guid: e84c1b8cfcb1483478aeb2d2767ebf1b,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2595733014080996707, guid: e84c1b8cfcb1483478aeb2d2767ebf1b,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2595733014080996707, guid: e84c1b8cfcb1483478aeb2d2767ebf1b,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2595733014080996707, guid: e84c1b8cfcb1483478aeb2d2767ebf1b,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2595733014080996707, guid: e84c1b8cfcb1483478aeb2d2767ebf1b,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2595733014080996707, guid: e84c1b8cfcb1483478aeb2d2767ebf1b,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2595733014080996707, guid: e84c1b8cfcb1483478aeb2d2767ebf1b,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2595733014080996707, guid: e84c1b8cfcb1483478aeb2d2767ebf1b,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2595733014080996707, guid: e84c1b8cfcb1483478aeb2d2767ebf1b,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2595733014080996707, guid: e84c1b8cfcb1483478aeb2d2767ebf1b,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6354123221177745285, guid: e84c1b8cfcb1483478aeb2d2767ebf1b,
type: 3}
propertyPath: m_Name
value: RoundManagers
objectReference: {fileID: 0}
- target: {fileID: 6776297341617078969, guid: e84c1b8cfcb1483478aeb2d2767ebf1b,
type: 3}
propertyPath: m_AssetId
value:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e84c1b8cfcb1483478aeb2d2767ebf1b, type: 3}
--- !u!4 &4108282049392472887 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 2595733014080996707, guid: e84c1b8cfcb1483478aeb2d2767ebf1b,
type: 3}
m_PrefabInstance: {fileID: 2091475271716419156}
m_PrefabAsset: {fileID: 0}
--- !u!114 &8375801033789858656 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 7582578550152058164, guid: e84c1b8cfcb1483478aeb2d2767ebf1b,
type: 3}
m_PrefabInstance: {fileID: 2091475271716419156}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d001f4d08574ed043be20bb696222a8a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &4437257697608760900
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 7400054331349668431}
m_Modifications:
- target: {fileID: 6976582009294150633, guid: 8fae6473a9524504fb4453411967b0e2,
type: 3}
propertyPath: roundManager
value:
objectReference: {fileID: 8375801033789858656}
- target: {fileID: 6976582009294150638, guid: 8fae6473a9524504fb4453411967b0e2,
type: 3}
propertyPath: m_Name
value: Network Manager
objectReference: {fileID: 0}
- target: {fileID: 6976582009294150639, guid: 8fae6473a9524504fb4453411967b0e2,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6976582009294150639, guid: 8fae6473a9524504fb4453411967b0e2,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6976582009294150639, guid: 8fae6473a9524504fb4453411967b0e2,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6976582009294150639, guid: 8fae6473a9524504fb4453411967b0e2,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6976582009294150639, guid: 8fae6473a9524504fb4453411967b0e2,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6976582009294150639, guid: 8fae6473a9524504fb4453411967b0e2,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6976582009294150639, guid: 8fae6473a9524504fb4453411967b0e2,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6976582009294150639, guid: 8fae6473a9524504fb4453411967b0e2,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6976582009294150639, guid: 8fae6473a9524504fb4453411967b0e2,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6976582009294150639, guid: 8fae6473a9524504fb4453411967b0e2,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6976582009294150639, guid: 8fae6473a9524504fb4453411967b0e2,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8fae6473a9524504fb4453411967b0e2, type: 3}
--- !u!4 &6720920965910209963 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6976582009294150639, guid: 8fae6473a9524504fb4453411967b0e2,
type: 3}
m_PrefabInstance: {fileID: 4437257697608760900}
m_PrefabAsset: {fileID: 0}
7 changes: 7 additions & 0 deletions Assets/Content/Systems/Managers/Managers.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8f72c67

Please sign in to comment.