Skip to content

Commit

Permalink
Lobby UI enhanced
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnaf26 committed Nov 24, 2020
1 parent 69c8b3c commit 1e0a512
Show file tree
Hide file tree
Showing 12 changed files with 2,767 additions and 87 deletions.
160 changes: 132 additions & 28 deletions Assets/GUI/Fonts/Glora Black SDF 1.asset

Large diffs are not rendered by default.

2,384 changes: 2,352 additions & 32 deletions Assets/GUI/Fonts/Havertize SDF.asset

Large diffs are not rendered by default.

217 changes: 215 additions & 2 deletions Assets/Prefabs/Lobby/PlayerListItem.prefab
Original file line number Diff line number Diff line change
@@ -1,5 +1,139 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1708080419310408990
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6527863922991526402}
- component: {fileID: 7705279635123747750}
- component: {fileID: 2118714663077949710}
m_Layer: 0
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &6527863922991526402
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1708080419310408990}
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: []
m_Father: {fileID: 3926003877583517027}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: -0.000015258789, y: 0}
m_SizeDelta: {x: 200, y: 50}
m_Pivot: {x: 0, y: 0.5}
--- !u!222 &7705279635123747750
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1708080419310408990}
m_CullTransparentMesh: 0
--- !u!114 &2118714663077949710
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1708080419310408990}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: '[YOU]'
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 414eb3b5d4ea21047b3c1e8181234eee, type: 2}
m_sharedMaterial: {fileID: -909429030698245191, guid: 414eb3b5d4ea21047b3c1e8181234eee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4278190080
m_fontColor: {r: 0, g: 0, b: 0, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 23.6
m_fontSizeBase: 23.6
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 1
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &3260254295233202847
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -30,7 +164,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 3926003877583517027}
m_RootOrder: 0
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
Expand Down Expand Up @@ -105,14 +239,16 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 6527863922991526402}
- {fileID: 3351591928285472094}
- {fileID: 3692127772413951082}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 333.06, y: 83.310486}
m_SizeDelta: {x: 498.9, y: 83.310486}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3926003877583517029
CanvasRenderer:
Expand Down Expand Up @@ -224,3 +360,80 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
text: {fileID: 3926003877583517026}
partyLeader: {fileID: 5628852206102455406}
youText: {fileID: 1708080419310408990}
--- !u!1 &5628852206102455406
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3692127772413951082}
- component: {fileID: 1707513013367259845}
- component: {fileID: 2913633491450958450}
m_Layer: 0
m_Name: LDR
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &3692127772413951082
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5628852206102455406}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.35625544, y: 0.35625544, z: 0.35625544}
m_Children: []
m_Father: {fileID: 3926003877583517027}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 63}
m_Pivot: {x: 1, y: 0.5}
--- !u!222 &1707513013367259845
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5628852206102455406}
m_CullTransparentMesh: 0
--- !u!114 &2913633491450958450
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5628852206102455406}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: f627722ce9a7f4444854e6316c837c2d, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
4 changes: 2 additions & 2 deletions Assets/Scenes/01_Start.unity
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ RectTransform:
m_GameObject: {fileID: 63256562}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 310.99997}
m_LocalScale: {x: 1.0685521, y: 1.0685521, z: 1.0685521}
m_LocalScale: {x: 0.920173, y: 0.920173, z: 0.920173}
m_Children: []
m_Father: {fileID: 1369293772}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 0, y: -126}
m_AnchoredPosition: {x: 0, y: -154.12}
m_SizeDelta: {x: 880, y: 379}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &63256565
Expand Down
20 changes: 10 additions & 10 deletions Assets/Scenes/02_Lobby.unity
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.6509804, g: 0.43529412, b: 0.28627452, a: 0.72156864}
m_Color: {r: 0.6509804, g: 0.43529412, b: 0.28627452, a: 0.90588236}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
Expand Down Expand Up @@ -952,7 +952,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.6509804, g: 0.4392157, b: 0.28627452, a: 0.72156864}
m_Color: {r: 0.6509804, g: 0.4392157, b: 0.28627452, a: 0.90588236}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
Expand Down Expand Up @@ -3984,7 +3984,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.6509804, g: 0.4392157, b: 0.28627452, a: 0.72156864}
m_Color: {r: 0.6509804, g: 0.4392157, b: 0.28627452, a: 0.90588236}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
Expand Down Expand Up @@ -4508,7 +4508,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &968301563
RectTransform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -9334,9 +9334,9 @@ RectTransform:
m_Father: {fileID: 919446319}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 388.43723, y: -16.186478}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 321.7262, y: 85.19928}
m_Pivot: {x: 0, y: 1}
--- !u!114 &1912337143
Expand Down Expand Up @@ -9933,9 +9933,9 @@ RectTransform:
m_Father: {fileID: 919446319}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 35.570343, y: -101.38576}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 321.7262, y: 85.19928}
m_Pivot: {x: 0, y: 0}
--- !u!114 &2143963975
Expand Down
16 changes: 6 additions & 10 deletions Assets/Scripts/Board.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public class Board : MonoBehaviourPunCallbacks
public GameObject playerSelected1 = default;
public GameObject playerSelected2 = default;
public TextMeshProUGUI winText = default;


private int P1Actor;
private int P2Actor;

void Awake()
{
Expand Down Expand Up @@ -104,15 +106,7 @@ private void CheckPlayerNum()
// For awarding win to player if the other player disconnects
if (PhotonNetwork.CurrentRoom.PlayerCount <= 1 && !gameCompleted)
{
if (PhotonNetwork.LocalPlayer.ActorNumber == 1)
{
pv.RPC("EndGame", RpcTarget.All, 1);
}
else
{
pv.RPC("EndGame", RpcTarget.All, 2);
}

pv.RPC("EndGame", RpcTarget.All, P1Actor == PhotonNetwork.LocalPlayer.ActorNumber ? 1 : 2);
PhotonNetwork.CurrentRoom.IsVisible = false;
restartBtn.SetActive(false);
}
Expand Down Expand Up @@ -355,6 +349,7 @@ public void CreateBoard()
if (PhotonNetwork.IsMasterClient)
{
Debug.Log("ONLY MASTER");
P1Actor = PhotonNetwork.LocalPlayer.ActorNumber;

for (int y = 0; y < 3; y++)
{
Expand Down Expand Up @@ -398,6 +393,7 @@ public void CreateBoard()
}
else
{
P2Actor = PhotonNetwork.LocalPlayer.ActorNumber;
restartBtn.SetActive(false);
}
FindMoves();
Expand Down
Loading

0 comments on commit 1e0a512

Please sign in to comment.