Fixed relay loading
This commit is contained in:
109
Assets/Prefabs/Transports/UnityRelay.prefab
Normal file
109
Assets/Prefabs/Transports/UnityRelay.prefab
Normal file
@@ -0,0 +1,109 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &9034779159098495524
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3113593585179992424}
|
||||
- component: {fileID: 1279289402888951419}
|
||||
- component: {fileID: 3671259382383785297}
|
||||
m_Layer: 0
|
||||
m_Name: UnityRelay
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &3113593585179992424
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9034779159098495524}
|
||||
serializedVersion: 2
|
||||
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_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1279289402888951419
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9034779159098495524}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 593a2fe42fa9d37498c96f9a383b6521, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.NetworkManager
|
||||
NetworkManagerExpanded: 0
|
||||
NetworkConfig:
|
||||
ProtocolVersion: 0
|
||||
NetworkTransport: {fileID: 3671259382383785297}
|
||||
PlayerPrefab: {fileID: 0}
|
||||
Prefabs:
|
||||
NetworkPrefabsLists:
|
||||
- {fileID: 11400000, guid: 7b4919f232aabc04b9891b736d8945bb, type: 2}
|
||||
TickRate: 30
|
||||
ClientConnectionBufferTimeout: 10
|
||||
ConnectionApproval: 0
|
||||
ConnectionData:
|
||||
EnableTimeResync: 0
|
||||
TimeResyncInterval: 30
|
||||
EnsureNetworkVariableLengthSafety: 0
|
||||
EnableSceneManagement: 1
|
||||
ForceSamePrefabs: 1
|
||||
RecycleNetworkIds: 1
|
||||
NetworkIdRecycleDelay: 120
|
||||
RpcHashSize: 0
|
||||
LoadSceneTimeOut: 120
|
||||
SpawnTimeout: 10
|
||||
EnableNetworkLogs: 1
|
||||
NetworkTopology: 0
|
||||
UseCMBService: 0
|
||||
AutoSpawnPlayerPrefabClientSide: 1
|
||||
NetworkMessageMetrics: 1
|
||||
NetworkProfilingMetrics: 1
|
||||
OldPrefabList: []
|
||||
RunInBackground: 1
|
||||
LogLevel: 1
|
||||
--- !u!114 &3671259382383785297
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9034779159098495524}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6960e84d07fb87f47956e7a81d71c4e6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.Transports.UTP.UnityTransport
|
||||
m_ProtocolType: 1
|
||||
m_UseWebSockets: 0
|
||||
m_UseEncryption: 0
|
||||
m_MaxPacketQueueSize: 128
|
||||
m_MaxPayloadSize: 6144
|
||||
m_HeartbeatTimeoutMS: 500
|
||||
m_ConnectTimeoutMS: 1000
|
||||
m_MaxConnectAttempts: 60
|
||||
m_DisconnectTimeoutMS: 30000
|
||||
ConnectionData:
|
||||
Address: 127.0.0.1
|
||||
Port: 7777
|
||||
WebSocketPath: /
|
||||
ServerListenAddress: 127.0.0.1
|
||||
ClientBindPort: 0
|
||||
DebugSimulator:
|
||||
PacketDelayMS: 0
|
||||
PacketJitterMS: 0
|
||||
PacketDropRate: 0
|
||||
@@ -1,6 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9929f0a32e5b1e34cb25f39b34081905
|
||||
DefaultImporter:
|
||||
guid: 7656fcf64c81db4429bec9369890e544
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
128
Assets/Resources/Bootstrap.prefab
Normal file
128
Assets/Resources/Bootstrap.prefab
Normal file
@@ -0,0 +1,128 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &54727468585482924
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8202003614288763792}
|
||||
- component: {fileID: 6270600115969400515}
|
||||
m_Layer: 0
|
||||
m_Name: Network
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8202003614288763792
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 54727468585482924}
|
||||
serializedVersion: 2
|
||||
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_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5606574559930480875}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &6270600115969400515
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 54727468585482924}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f490d6c8b73d447fbe47c95efede54d0, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::PashaBibko.PenguinChase.Core.Network.Network
|
||||
LocalHostTransport: {fileID: 6715254673078816961, guid: 054af26d74325fb4e9aaec18704fb248, type: 3}
|
||||
UnityRelayTransport: {fileID: 9034779159098495524, guid: 7656fcf64c81db4429bec9369890e544, type: 3}
|
||||
InternalCurrentTransport: 2
|
||||
GameJoinCode:
|
||||
--- !u!1 &8168339053005722410
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5606574559930480875}
|
||||
m_Layer: 0
|
||||
m_Name: Bootstrap
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &5606574559930480875
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8168339053005722410}
|
||||
serializedVersion: 2
|
||||
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_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 8202003614288763792}
|
||||
- {fileID: 8895838412485116748}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &8300071393855764827
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8895838412485116748}
|
||||
- component: {fileID: 7414676207426431135}
|
||||
m_Layer: 0
|
||||
m_Name: ConnectionManager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8895838412485116748
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8300071393855764827}
|
||||
serializedVersion: 2
|
||||
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_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5606574559930480875}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &7414676207426431135
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8300071393855764827}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ed9f8d66fd664fd68f1901f0120a0daf, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::PashaBibko.PenguinChase.Core.Network.ConnectionManager
|
||||
PrefabForEachClient: {fileID: 401049662134316001, guid: 90d7552110f715f4d8c56436b0621b94, type: 3}
|
||||
7
Assets/Resources/Bootstrap.prefab.meta
Normal file
7
Assets/Resources/Bootstrap.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ddba8f31447deee47bd0f60b4c09ed13
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,220 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 10
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 13
|
||||
m_BakeOnSceneLoad: 0
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 12
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAmbientOcclusion: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 2
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 512
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 256
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRDenoiserTypeDirect: 1
|
||||
m_PVRDenoiserTypeIndirect: 1
|
||||
m_PVRDenoiserTypeAO: 1
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 1
|
||||
m_PVRFilteringGaussRadiusAO: 1
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_LightingSettings: {fileID: 0}
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 3
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
buildHeightMesh: 0
|
||||
maxJobWorkers: 0
|
||||
preserveTilesOutsideBounds: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &380762915
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 380762917}
|
||||
- component: {fileID: 380762916}
|
||||
m_Layer: 0
|
||||
m_Name: ConnectionManager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &380762916
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 380762915}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ed9f8d66fd664fd68f1901f0120a0daf, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::PashaBibko.PenguinChase.Core.Network.ConnectionManager
|
||||
PrefabForEachClient: {fileID: 401049662134316001, guid: 90d7552110f715f4d8c56436b0621b94, type: 3}
|
||||
--- !u!4 &380762917
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 380762915}
|
||||
serializedVersion: 2
|
||||
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_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1684958312
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1684958313}
|
||||
- component: {fileID: 1684958314}
|
||||
m_Layer: 0
|
||||
m_Name: Network
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1684958313
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1684958312}
|
||||
serializedVersion: 2
|
||||
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_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1684958314
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1684958312}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f490d6c8b73d447fbe47c95efede54d0, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::PashaBibko.PenguinChase.Core.Network.Network
|
||||
LocalHostTransport: {fileID: 6715254673078816961, guid: 054af26d74325fb4e9aaec18704fb248, type: 3}
|
||||
UnityRelayTransport: {fileID: 0}
|
||||
InternalCurrentTransport: 2
|
||||
GameJoinCode:
|
||||
--- !u!1660057539 &9223372036854775807
|
||||
SceneRoots:
|
||||
m_ObjectHideFlags: 0
|
||||
m_Roots:
|
||||
- {fileID: 1684958313}
|
||||
- {fileID: 380762917}
|
||||
@@ -1,4 +1,3 @@
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine;
|
||||
|
||||
namespace PashaBibko.PenguinChase.Core
|
||||
@@ -8,15 +7,11 @@ namespace PashaBibko.PenguinChase.Core
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||
private static void LoadBoostrapScene()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
// Stops loading in on the bootstrap scene
|
||||
if (SceneManager.GetActiveScene().name == "Bootstrap")
|
||||
{
|
||||
SceneManager.LoadScene("MainMenu", LoadSceneMode.Single);
|
||||
}
|
||||
#endif // UNITY_EDITOR
|
||||
|
||||
SceneManager.LoadScene("Bootstrap", LoadSceneMode.Additive);
|
||||
GameObject go = Resources.Load<GameObject>("Bootstrap");
|
||||
GameObject instance = Object.Instantiate(go);
|
||||
|
||||
Object.DontDestroyOnLoad(instance);
|
||||
instance.name = "Bootstrap";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,46 @@
|
||||
using Unity.Services.Authentication;
|
||||
using PashaBibko.PenguinChase.Extensions;
|
||||
using Unity.Services.Authentication;
|
||||
using Unity.Services.Core;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
namespace PashaBibko.PenguinChase.Core.Network
|
||||
{
|
||||
public static class Authenticator
|
||||
{
|
||||
public static bool IsAuthenticated { get; private set; }
|
||||
private static bool sIsAuthenticating;
|
||||
|
||||
public static IEnumerator Authenticate()
|
||||
{
|
||||
// Early return if already authenticated
|
||||
Debug.Log($"Authenticate called, [Authenticated: {IsAuthenticated}]");
|
||||
if (IsAuthenticated)
|
||||
{
|
||||
// User is already authenticated
|
||||
yield break;
|
||||
}
|
||||
|
||||
// TODO: Sign in via current platform
|
||||
|
||||
yield return UnityServices.InitializeAsync();
|
||||
yield return AuthenticationService.Instance.SignInAnonymouslyAsync();
|
||||
// Stops multiple authentication attempts at the same time
|
||||
if (sIsAuthenticating)
|
||||
{
|
||||
yield return new WaitUntil(() => IsAuthenticated || !sIsAuthenticating);
|
||||
yield break; // User should be logged in from other attempt
|
||||
}
|
||||
sIsAuthenticating = true;
|
||||
|
||||
Debug.Log("Initializing Unity Services");
|
||||
yield return UnityServices
|
||||
.InitializeAsync()
|
||||
.Await();
|
||||
|
||||
Debug.Log("Signing in anonymously");
|
||||
yield return AuthenticationService.Instance
|
||||
.SignInAnonymouslyAsync()
|
||||
.Await();
|
||||
|
||||
Debug.Log("User has been authenticated");
|
||||
sIsAuthenticating = false;
|
||||
IsAuthenticated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace PashaBibko.PenguinChase.Core.Network
|
||||
[SerializeField] private GameObject PrefabForEachClient;
|
||||
public static GameObject ClientPrefab => sInstance?.PrefabForEachClient;
|
||||
|
||||
private void Start()
|
||||
private void Awake()
|
||||
{
|
||||
// Stops overlapping instances
|
||||
if (sInstance is not null)
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace PashaBibko.PenguinChase.Core.Network
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
private void Awake()
|
||||
{
|
||||
// Stops overlapping instances
|
||||
if (sInstance is not null)
|
||||
@@ -91,9 +91,7 @@ namespace PashaBibko.PenguinChase.Core.Network
|
||||
// Then actually hosts the lobby
|
||||
yield return sConnectionManager.Host(() =>
|
||||
{
|
||||
SceneManager.UnloadSceneAsync("MainMenu");
|
||||
NetworkManager.Singleton.SceneManager.LoadScene("GameScene", LoadSceneMode.Additive);
|
||||
|
||||
NetworkManager.Singleton.SceneManager.LoadScene("GameScene", LoadSceneMode.Single);
|
||||
Debug.Log("Hosted");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace PashaBibko.PenguinChase.Core.Network
|
||||
{
|
||||
public class UnityRelayTransport : INetworkTransport
|
||||
{
|
||||
private const uint MAX_CONNECTIONS = 7;
|
||||
private const int MAX_CONNECTIONS = 7;
|
||||
|
||||
public IEnumerator Join(string code, Action callback)
|
||||
{
|
||||
@@ -34,11 +34,13 @@ namespace PashaBibko.PenguinChase.Core.Network
|
||||
public IEnumerator Host(Action callback)
|
||||
{
|
||||
yield return Authenticator.Authenticate();
|
||||
Debug.Log("Authenticated");
|
||||
|
||||
Allocation allocation;
|
||||
{
|
||||
Result<Allocation> result = new();
|
||||
yield return RelayService.Instance
|
||||
.CreateAllocationAsync(7)
|
||||
.CreateAllocationAsync(MAX_CONNECTIONS)
|
||||
.Await(result);
|
||||
|
||||
allocation = result.Value;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
namespace PashaBibko.PenguinChase.Extensions
|
||||
{
|
||||
@@ -10,6 +11,20 @@ namespace PashaBibko.PenguinChase.Extensions
|
||||
|
||||
public static class TaskExtensions
|
||||
{
|
||||
public static IEnumerator Await(this Task task)
|
||||
{
|
||||
// Waits until the task is completed
|
||||
while (!task.IsCompleted)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (task.IsFaulted)
|
||||
{
|
||||
Debug.LogError($"Task failed: [{task.Exception?.InnerException?.Message}]");
|
||||
}
|
||||
}
|
||||
|
||||
public static IEnumerator Await<T>(this Task<T> task, Result<T> result)
|
||||
where T : class
|
||||
{
|
||||
@@ -19,6 +34,11 @@ namespace PashaBibko.PenguinChase.Extensions
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (task.IsFaulted)
|
||||
{
|
||||
Debug.LogError($"Task failed: [{task.Exception?.InnerException?.Message}]");
|
||||
}
|
||||
|
||||
// Has to return the value like this because of the wonders of C#
|
||||
result.Value = task.Result;
|
||||
}
|
||||
|
||||
53
Assets/Settings/PlayMode/EditorAndExtraPlayer.asset
Normal file
53
Assets/Settings/PlayMode/EditorAndExtraPlayer.asset
Normal file
@@ -0,0 +1,53 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 15024, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_Name: EditorAndExtraPlayer
|
||||
m_EditorClassIdentifier: UnityEditor.MultiplayerModule.dll::Unity.Multiplayer.PlayMode.Editor.ScenarioConfig
|
||||
m_Description:
|
||||
m_EnableEditors: 1
|
||||
m_MainEditorInstance:
|
||||
Name: Main Editor
|
||||
<CorrespondingNodeId>k__BackingField:
|
||||
m_Nodes: []
|
||||
m_Role: 3
|
||||
m_PlayerTag:
|
||||
m_InitialScene: {fileID: 102900000, guid: 74b90beff86079840bff70644df98b7f, type: 3}
|
||||
m_EditorInstances: []
|
||||
m_LocalInstances:
|
||||
- Name: Instance
|
||||
<CorrespondingNodeId>k__BackingField:
|
||||
m_Nodes: []
|
||||
m_BuildProfile: {fileID: 11400000, guid: 1980319f771aa994fa22cfa96bba79f1, type: 2}
|
||||
m_ServerSettings:
|
||||
DeployMode: 0
|
||||
SimulatorSettings:
|
||||
AutoAllocate: 1
|
||||
CliSettings:
|
||||
UseDefaultArguments: 1
|
||||
Port: 7777
|
||||
QueryProtocol: 0
|
||||
QueryPort: 20000
|
||||
advancedConfiguration:
|
||||
m_StreamLogsToMainEditor: 1
|
||||
m_LogsColor: {r: 0.3643, g: 0.581, b: 0.8679, a: 1}
|
||||
m_LocalArguments: -screen-fullscreen 0 -screen-width 1024 -screen-height 720
|
||||
m_SimulatedArguments:
|
||||
m_DeviceID:
|
||||
m_DeviceName:
|
||||
m_RemoteInstances: []
|
||||
m_MainEditorInstanceObsolete:
|
||||
rid: -2
|
||||
references:
|
||||
version: 2
|
||||
RefIds:
|
||||
- rid: -2
|
||||
type: {class: , ns: , asm: }
|
||||
8
Assets/Settings/PlayMode/EditorAndExtraPlayer.asset.meta
Normal file
8
Assets/Settings/PlayMode/EditorAndExtraPlayer.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a5898040022cca643960575bc5fadf70
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -8,9 +8,6 @@ EditorBuildSettings:
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/MainMenu.unity
|
||||
guid: 74b90beff86079840bff70644df98b7f
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/Bootstrap.unity
|
||||
guid: 9929f0a32e5b1e34cb25f39b34081905
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/GameScene.unity
|
||||
guid: 1330a3e27c419f7468d5a2bfee53e3e3
|
||||
|
||||
@@ -13,7 +13,7 @@ PlayerSettings:
|
||||
useOnDemandResources: 0
|
||||
accelerometerFrequency: 60
|
||||
companyName: DefaultCompany
|
||||
productName: PenguinsTwoChase
|
||||
productName: PenguinsTwoChase (Client)
|
||||
defaultCursor: {fileID: 0}
|
||||
cursorHotspot: {x: 0, y: 0}
|
||||
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
|
||||
|
||||
Reference in New Issue
Block a user