Skip to content

Commit

Permalink
fix: unitytransport connectionmode buttons (#1176)
Browse files Browse the repository at this point in the history
* fix

This fixes the issue with the UnityTransport updates breaking the ability to still use UNetTransport.

* refactor

Just minor refactoring of when we actually need the ENABLE_RELAY_SERVICE define.
Also some cleanup.

* refactor

removing the InputField pefab.
unpacked this inside of the ConnectionModeButtons prefab.
updated SampleScene to reflect this change

* style

updating comments
  • Loading branch information
NoelStephensUnity authored Sep 14, 2021
1 parent 46dfe4a commit 5ef9f41
Show file tree
Hide file tree
Showing 3 changed files with 467 additions and 393 deletions.
346 changes: 340 additions & 6 deletions testproject/Assets/Prefabs/ConnectionModeButtons.prefab
Original file line number Diff line number Diff line change
@@ -1,5 +1,335 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1075789769728122334
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1075789769728122333}
- component: {fileID: 1075789769728122331}
- component: {fileID: 1075789769728122332}
m_Layer: 5
m_Name: Placeholder
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1075789769728122333
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1075789769728122334}
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: 1075789770412922202}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -0.5}
m_SizeDelta: {x: -20, y: -13}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1075789769728122331
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1075789769728122334}
m_CullTransparentMesh: 1
--- !u!114 &1075789769728122332
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1075789769728122334}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 0.5}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 2
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Relay Join Code
--- !u!1 &1075789770185154495
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1075789770185154494}
- component: {fileID: 1075789770185154492}
- component: {fileID: 1075789770185154493}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1075789770185154494
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1075789770185154495}
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: 1075789770412922202}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -0.5}
m_SizeDelta: {x: -20, y: -13}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1075789770185154492
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1075789770185154495}
m_CullTransparentMesh: 1
--- !u!114 &1075789770185154493
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1075789770185154495}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, 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_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 0
m_HorizontalOverflow: 1
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text:
--- !u!1 &1075789770412922203
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1075789770412922202}
- component: {fileID: 1075789770412922150}
- component: {fileID: 1075789770412922151}
- component: {fileID: 1075789770412922200}
- component: {fileID: 1075789770412922201}
m_Layer: 5
m_Name: InputField
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1075789770412922202
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1075789770412922203}
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: 1075789769728122333}
- {fileID: 1075789770185154494}
m_Father: {fileID: 6633621479308595792}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -474, y: 263}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0, y: 1}
--- !u!222 &1075789770412922150
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1075789770412922203}
m_CullTransparentMesh: 1
--- !u!114 &1075789770412922151
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1075789770412922203}
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: 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_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &1075789770412922200
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1075789770412922203}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d199490a83bb2b844b9695cbf13b01ef, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 1075789770412922151}
m_TextComponent: {fileID: 1075789770185154493}
m_Placeholder: {fileID: 1075789769728122332}
m_ContentType: 0
m_InputType: 0
m_AsteriskChar: 42
m_KeyboardType: 0
m_LineType: 0
m_HideMobileInput: 0
m_CharacterValidation: 0
m_CharacterLimit: 0
m_OnEndEdit:
m_PersistentCalls:
m_Calls: []
m_OnSubmit:
m_PersistentCalls:
m_Calls: []
m_OnValueChanged:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1075789770412922201}
m_TargetAssemblyTypeName: RelayJoinCodeInput, TestProject
m_MethodName: SetJoinCode
m_Mode: 1
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_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_CustomCaretColor: 0
m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412}
m_Text:
m_CaretBlinkRate: 0.85
m_CaretWidth: 1
m_ReadOnly: 0
m_ShouldActivateOnSelect: 1
--- !u!114 &1075789770412922201
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1075789770412922203}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 903872102732f5c4cbdd3863de5dbc97, type: 3}
m_Name:
m_EditorClassIdentifier:
ConnectionScript: {fileID: 4850072633501053442}
--- !u!1 &1249278213434350085
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -153,8 +483,8 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 4850072633501053442}
m_TargetAssemblyTypeName: ConnectionModeScript, Assembly-CSharp
m_MethodName: OnStartServer
m_TargetAssemblyTypeName: ConnectionModeScript, TestProject
m_MethodName: OnStartServerButton
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
Expand Down Expand Up @@ -286,8 +616,8 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 4850072633501053442}
m_TargetAssemblyTypeName: ConnectionModeScript, Assembly-CSharp
m_MethodName: OnStartClient
m_TargetAssemblyTypeName: ConnectionModeScript, TestProject
m_MethodName: OnStartClientButton
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
Expand Down Expand Up @@ -498,8 +828,8 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 4850072633501053442}
m_TargetAssemblyTypeName: ConnectionModeScript, Assembly-CSharp
m_MethodName: OnStartHost
m_TargetAssemblyTypeName: ConnectionModeScript, TestProject
m_MethodName: OnStartHostButton
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
Expand Down Expand Up @@ -863,6 +1193,7 @@ RectTransform:
m_Children:
- {fileID: 1265025556613751300}
- {fileID: 598016439257704092}
- {fileID: 1075789770412922202}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand All @@ -885,6 +1216,9 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_ConnectionModeButtons: {fileID: 6957137875088695540}
m_AuthenticationButtons: {fileID: 1249278213434350085}
m_JoinCodeInput: {fileID: 1075789770412922203}
m_MaxConnections: 10
m_RelayAllocationBasePath: https://relay-allocations-stg.services.api.unity.com
--- !u!1 &8777614647619606221
GameObject:
m_ObjectHideFlags: 0
Expand Down
Loading

0 comments on commit 5ef9f41

Please sign in to comment.