Browse Source

Fixed lobby and client

Josh_Dev_branch
JoshuaReason 5 years ago
parent
commit
38a64af971
7 changed files with 177 additions and 20 deletions
  1. +84
    -0
      Assets/Materials/Tint.mat
  2. +8
    -0
      Assets/Materials/Tint.mat.meta
  3. +8
    -0
      Assets/Models.meta
  4. +50
    -17
      Assets/Scenes/Client Scenes/LoginScreen.unity
  5. +7
    -2
      Assets/Scenes/Server Scenes/Lobby.unity
  6. +8
    -0
      Assets/Scripts/LogicBlocks.meta
  7. +12
    -1
      Assets/Scripts/UI/Lobby/LobbyUIController.cs

+ 84
- 0
Assets/Materials/Tint.mat View File

@ -0,0 +1,84 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Tint
m_Shader: {fileID: 10760, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _ColorMask: 15
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _UseUIAlphaClip: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.77254903, g: 0.07843139, b: 0.2031904, a: 0.20392157}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

+ 8
- 0
Assets/Materials/Tint.mat.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8c9a41e0f500cfe4b81c5662abf8edf7
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/Models.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 296bd90e667df1f4697823a0aa45acf0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 50
- 17
Assets/Scenes/Client Scenes/LoginScreen.unity View File

@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
m_IndirectSpecularColor: {r: 0.44657868, g: 0.49641263, b: 0.57481706, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
@ -324,7 +324,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 872212411}
m_MethodName: OnClickConnect
m_MethodName: OnClick_Connect
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
@ -572,7 +572,18 @@ MonoBehaviour:
Culture=neutral, PublicKeyToken=null
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 872212411}
m_MethodName: OnChange_ServerAddress
m_Mode: 0
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
m_TypeName: TMPro.TMP_InputField+OnChangeEvent, Unity.TextMeshPro, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
@ -850,11 +861,11 @@ MonoBehaviour:
lineCount: 1
pageCount: 1
materialCount: 1
m_havePropertiesChanged: 1
m_havePropertiesChanged: 0
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_spriteAnimator: {fileID: 0}
m_isInputParsingRequired: 1
m_isInputParsingRequired: 0
m_inputSource: 0
m_hasFontAssetChanged: 0
m_subTextObjects:
@ -1074,7 +1085,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -0.0018920898, y: 0.0022277832}
m_AnchoredPosition: {x: -0.001953125, y: 0.0022583008}
m_SizeDelta: {x: 0.19995117, y: 0.009979248}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &425791972
@ -1227,7 +1238,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0.0018920898, y: -73.927}
m_AnchoredPosition: {x: 0.0018310547, y: -73.92697}
m_SizeDelta: {x: -0.19995117, y: -147.85999}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &716278963
@ -1605,7 +1616,18 @@ MonoBehaviour:
Culture=neutral, PublicKeyToken=null
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 872212411}
m_MethodName: OnChange_Name
m_Mode: 0
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
m_TypeName: TMPro.TMP_InputField+OnChangeEvent, Unity.TextMeshPro, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
@ -2463,11 +2485,11 @@ MonoBehaviour:
lineCount: 1
pageCount: 1
materialCount: 1
m_havePropertiesChanged: 1
m_havePropertiesChanged: 0
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_spriteAnimator: {fileID: 0}
m_isInputParsingRequired: 1
m_isInputParsingRequired: 0
m_inputSource: 0
m_hasFontAssetChanged: 0
m_subTextObjects:
@ -3414,11 +3436,11 @@ MonoBehaviour:
lineCount: 1
pageCount: 1
materialCount: 1
m_havePropertiesChanged: 1
m_havePropertiesChanged: 0
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_spriteAnimator: {fileID: 0}
m_isInputParsingRequired: 1
m_isInputParsingRequired: 0
m_inputSource: 0
m_hasFontAssetChanged: 0
m_subTextObjects:
@ -3785,7 +3807,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 872212411}
m_MethodName: OnClickConnect
m_MethodName: OnClick_Done
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
@ -3870,7 +3892,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -0.0018920898, y: 0.0022277832}
m_AnchoredPosition: {x: -0.001953125, y: 0.0022583008}
m_SizeDelta: {x: 0.19995117, y: 0.009979248}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1584683395
@ -4267,11 +4289,11 @@ MonoBehaviour:
lineCount: 1
pageCount: 1
materialCount: 1
m_havePropertiesChanged: 1
m_havePropertiesChanged: 0
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_spriteAnimator: {fileID: 0}
m_isInputParsingRequired: 1
m_isInputParsingRequired: 0
m_inputSource: 0
m_hasFontAssetChanged: 0
m_subTextObjects:
@ -4455,7 +4477,18 @@ MonoBehaviour:
Culture=neutral, PublicKeyToken=null
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 872212411}
m_MethodName: OnChange_ServerPort
m_Mode: 0
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
m_TypeName: TMPro.TMP_InputField+OnChangeEvent, Unity.TextMeshPro, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}

+ 7
- 2
Assets/Scenes/Server Scenes/Lobby.unity View File

@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
m_IndirectSpecularColor: {r: 0.44657868, g: 0.49641263, b: 0.57481706, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
@ -148,7 +148,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -129.6, y: 74.4}
m_AnchoredPosition: {x: -129.59998, y: 74.3999}
m_SizeDelta: {x: 219.19995, y: 108.79999}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &90571882
@ -591,6 +591,11 @@ MonoBehaviour:
IPText: {fileID: 910932172}
Content: {fileID: 1584683394}
ClientTag: {fileID: 263791918}
PlayerColors:
- {r: 0.06732824, g: 0.1707894, b: 0.8396226, a: 1}
- {r: 1, g: 0, b: 0.71488476, a: 1}
- {r: 1, g: 0.93624943, b: 0.023584902, a: 1}
- {r: 0, g: 0.9622642, b: 0.020812215, a: 1}
--- !u!114 &872212412
MonoBehaviour:
m_ObjectHideFlags: 0

+ 8
- 0
Assets/Scripts/LogicBlocks.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8936b441d7647f74884c94f97bfb8931
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 12
- 1
Assets/Scripts/UI/Lobby/LobbyUIController.cs View File

@ -26,6 +26,8 @@ public class LobbyUIController : MonoBehaviour
[SerializeField]
private GameObject ClientTag;
[SerializeField]
private Color[] PlayerColors;
// Start is called before the first frame update
void Start()
@ -53,14 +55,23 @@ public class LobbyUIController : MonoBehaviour
if (child.gameObject != ClientTag)
Destroy(child.gameObject);
foreach (ClientData client in Clients.ConnectedClients)
for (int i = 0; i < Clients.ConnectedClients.Count; i++)
{
ClientData client = Clients.ConnectedClients[i];
client.Color = PlayerColors[i % PlayerColors.Length];
GameObject clientObject = Instantiate(ClientTag, Content);
TextMeshProUGUI clientText = clientObject.GetComponent<TextMeshProUGUI>();
clientText.text = client.Name;
clientText.color = client.Color;
clientObject.SetActive(true);
}
}
public void OnClick_StartGame()

Loading…
Cancel
Save