Implemented Steamlobby manager with player support

This commit is contained in:
Madhav Kapa 2023-06-01 09:06:43 -07:00
parent f3949c7190
commit e741eb1c5e
9 changed files with 892 additions and 26 deletions

View File

@ -8,7 +8,14 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="8e9b3697-c9b4-441a-aeed-4ea7b4488600" name="Changes" comment="" />
<list default="true" id="8e9b3697-c9b4-441a-aeed-4ea7b4488600" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.idea.station_obscurum_temp/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.station_obscurum_temp/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.sln.meta" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/FishNet/Runtime/Transporting/Transports/Tugboat/LiteNetLib/LiteNetLib.csproj.meta" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Materials/AlienMats/Flesh_graph_0/Flesh_graph_dissolve_vert.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Materials/AlienMats/Flesh_graph_0/Flesh_graph_dissolve_vert.mat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/VFXGraph/GabrielAguiarProductions/VFXGraph_Muzzle_2020.3_HDRP_v1.0.1.unitypackage.meta" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/VFXGraph/GabrielAguiarProductions/VFXGraph_Muzzle_2020.3_URP_v1.0.1.unitypackage.meta" beforeDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -17,19 +24,23 @@
<component name="HighlightingSettingsPerFile">
<setting file="file://$PROJECT_DIR$/Assets/Scripts/Steam/FriendObject.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/Scripts/Steam/SteamFriendsManager.cs" root0="SKIP_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/Scripts/Steam/SteamLobbyWithPlayer.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/Scripts/Steam/SteamManager.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$USER_HOME$/Downloads/Unity-Facepunch-Steamwork-tutorial-main/Assets/SteamFriendsManager.cs" root0="SKIP_HIGHLIGHTING" />
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectId" id="2QaKQGlpcBQN822RXF9HTdnO83e" />
<component name="ProjectLevelVcsManager">
<ConfirmationsSetting value="2" id="Add" />
</component>
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;ASKED_ADD_EXTERNAL_FILES&quot;: &quot;true&quot;,
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
@ -38,7 +49,7 @@
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.pluginManager&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.build.unityPlugin&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
},
&quot;keyToStringList&quot;: {
@ -102,6 +113,7 @@
<workItem from="1685636572156" duration="4819000" />
<workItem from="1685617055026" duration="83000" />
<workItem from="1685617157524" duration="2799000" />
<workItem from="1685632962650" duration="1910000" />
</task>
<servers />
</component>
@ -111,6 +123,11 @@
<component name="UnityProjectConfiguration" hasMinimizedUI="true" />
<component name="UnityUnitTestConfiguration" currentTestLauncher="Both" />
<component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
</component>
<component name="XSLT-Support.FileAssociations.UIState">
<expand />
<select />
</component>
</project>

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 2ad85b0f43f25f1499c27a4dca23ddd8
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -230,7 +230,7 @@ Material:
- _StencilWriteMaskDepth: 8
- _StencilWriteMaskDistortionVec: 4
- _StencilWriteMaskGBuffer: 14
- _StencilWriteMaskMV: 42
- _StencilWriteMaskMV: 40
- _SubsurfaceMask: 1
- _SupportDecals: 1
- _SurfaceType: 0

View File

@ -0,0 +1,697 @@
%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: 9
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: 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: 705507994}
m_IndirectSpecularColor: {r: 262.3369, g: 325.0498, b: 430.21924, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 12
m_GIWorkflowMode: 1
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_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 500
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 2
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 0
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_LightingSettings: {fileID: 4890085278179872738, guid: bf4cb08b84523014ba7d58b84641dafa, type: 2}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
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
accuratePlacement: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &240545134
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 240545138}
- component: {fileID: 240545137}
- component: {fileID: 240545136}
- component: {fileID: 240545135}
m_Layer: 0
m_Name: Floor
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!64 &240545135
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 240545134}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 4
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &240545136
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 240545134}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 257
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 73c176f402d2c2f4d929aa5da7585d17, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &240545137
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 240545134}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &240545138
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 240545134}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 100, y: 1, z: 100}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &705507993
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 705507995}
- component: {fileID: 705507994}
- component: {fileID: 705507996}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &705507994
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 705507993}
m_Enabled: 1
serializedVersion: 10
m_Type: 1
m_Shape: 0
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 100000
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 1
m_LightShadowCasterMode: 2
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 1
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &705507995
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 705507993}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!114 &705507996
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 705507993}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Intensity: 100000
m_EnableSpotReflector: 1
m_LuxAtDistance: 1
m_InnerSpotPercent: 0
m_SpotIESCutoffPercent: 100
m_LightDimmer: 1
m_VolumetricDimmer: 1
m_LightUnit: 2
m_FadeDistance: 10000
m_VolumetricFadeDistance: 10000
m_AffectDiffuse: 1
m_AffectSpecular: 1
m_NonLightmappedOnly: 0
m_ShapeWidth: 0.5
m_ShapeHeight: 0.5
m_AspectRatio: 1
m_ShapeRadius: 0.025
m_SoftnessScale: 1
m_UseCustomSpotLightShadowCone: 0
m_CustomSpotLightShadowCone: 30
m_MaxSmoothness: 0.99
m_ApplyRangeAttenuation: 1
m_DisplayAreaLightEmissiveMesh: 0
m_AreaLightCookie: {fileID: 0}
m_IESPoint: {fileID: 0}
m_IESSpot: {fileID: 0}
m_IncludeForRayTracing: 1
m_AreaLightShadowCone: 120
m_UseScreenSpaceShadows: 0
m_InteractsWithSky: 1
m_AngularDiameter: 0.5
m_FlareSize: 2
m_FlareTint: {r: 1, g: 1, b: 1, a: 1}
m_FlareFalloff: 4
m_SurfaceTexture: {fileID: 0}
m_SurfaceTint: {r: 1, g: 1, b: 1, a: 1}
m_Distance: 1.5e+11
m_UseRayTracedShadows: 0
m_NumRayTracingSamples: 4
m_FilterTracedShadow: 1
m_FilterSizeTraced: 16
m_SunLightConeAngle: 0.5
m_LightShadowRadius: 0.5
m_SemiTransparentShadow: 0
m_ColorShadow: 1
m_DistanceBasedFiltering: 0
m_EvsmExponent: 15
m_EvsmLightLeakBias: 0
m_EvsmVarianceBias: 0.00001
m_EvsmBlurPasses: 0
m_LightlayersMask: 1
m_LinkShadowLayers: 1
m_ShadowNearPlane: 0.1
m_BlockerSampleCount: 24
m_FilterSampleCount: 16
m_MinFilterSize: 0.1
m_KernelSize: 5
m_LightAngle: 1
m_MaxDepthBias: 0.001
m_ShadowResolution:
m_Override: 512
m_UseOverride: 1
m_Level: 0
m_ShadowDimmer: 1
m_VolumetricShadowDimmer: 1
m_ShadowFadeDistance: 10000
m_UseContactShadow:
m_Override: 0
m_UseOverride: 1
m_Level: 0
m_RayTracedContactShadow: 0
m_ShadowTint: {r: 0, g: 0, b: 0, a: 1}
m_PenumbraTint: 0
m_NormalBias: 0.75
m_SlopeBias: 0.5
m_ShadowUpdateMode: 0
m_AlwaysDrawDynamicShadows: 0
m_UpdateShadowOnLightMovement: 0
m_CachedShadowTranslationThreshold: 0.01
m_CachedShadowAngularThreshold: 0.5
m_BarnDoorAngle: 90
m_BarnDoorLength: 0.05
m_preserveCachedShadow: 0
m_OnDemandShadowRenderOnPlacement: 1
m_ShadowCascadeRatios:
- 0.05
- 0.2
- 0.3
m_ShadowCascadeBorders:
- 0.2
- 0.2
- 0.2
- 0.2
m_ShadowAlgorithm: 0
m_ShadowVariant: 0
m_ShadowPrecision: 0
useOldInspector: 0
useVolumetric: 1
featuresFoldout: 1
m_AreaLightEmissiveMeshShadowCastingMode: 0
m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0
m_AreaLightEmissiveMeshLayer: -1
m_Version: 11
m_ObsoleteShadowResolutionTier: 1
m_ObsoleteUseShadowQualitySettings: 0
m_ObsoleteCustomShadowResolution: 512
m_ObsoleteContactShadows: 0
m_PointlightHDType: 0
m_SpotLightShape: 0
m_AreaLightShape: 0
--- !u!1 &822391265
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 822391267}
- component: {fileID: 822391266}
- component: {fileID: 822391268}
m_Layer: 0
m_Name: SteamManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &822391266
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 822391265}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c790abd20c22fc348ac5c95c419527bb, type: 3}
m_Name:
m_EditorClassIdentifier:
appId: 480
onSteamFailed:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 0}
m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine
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: 1
m_CallState: 2
--- !u!4 &822391267
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 822391265}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 447.38983, y: 246.23274, z: -66.40144}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &822391268
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 822391265}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4a9cdaa19da06c243b851b524d9e182a, type: 3}
m_Name:
m_EditorClassIdentifier:
onLobbyCreated:
m_PersistentCalls:
m_Calls: []
onLobbyJoined:
m_PersistentCalls:
m_Calls: []
onLobbyLeave:
m_PersistentCalls:
m_Calls: []
playerPrefab: {fileID: 1918460693}
--- !u!1 &963194225
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 963194228}
- component: {fileID: 963194227}
- component: {fileID: 963194226}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &963194226
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_Enabled: 1
--- !u!20 &963194227
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &963194228
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1614639985
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 633407180949222505, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7054175668069193621, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7054175669031773906, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_Name
value: BasicLevel0
objectReference: {fileID: 0}
- target: {fileID: 7054175669031773917, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 7054175669031773917, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7054175669031773917, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7054175669031773917, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7054175669031773917, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7054175669031773917, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7054175669031773917, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7054175669031773917, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7054175669031773917, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7054175669031773917, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7054175669031773917, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7274624881880131364, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7274624882445554639, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.y
value: -0.000000034718123
objectReference: {fileID: 0}
- target: {fileID: 7274624882445554639, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.z
value: 0.0000000049993236
objectReference: {fileID: 0}
- target: {fileID: 7274624883331524490, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.y
value: -0.0000000344453
objectReference: {fileID: 0}
- target: {fileID: 7274624883331524490, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.z
value: 0.0000000015444355
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
--- !u!1 &1918460693 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7274624881880131364, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
m_PrefabInstance: {fileID: 1614639985}
m_PrefabAsset: {fileID: 0}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 246f31a0e00fea74a93125fec6d80da8
guid: 6a1378d77c148e84cb5a02f71c4a474d
DefaultImporter:
externalObjects: {}
userData:

View File

@ -0,0 +1,162 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Steamworks;
using Steamworks.Data;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
public class SteamLobbyWithPlayer : MonoBehaviour
{
public static Lobby CurrentLobby;
public static bool UserInLobby;
public UnityEvent onLobbyCreated;
public UnityEvent onLobbyJoined;
public UnityEvent onLobbyLeave;
public Dictionary<SteamId, GameObject> inLobby = new();
public GameObject playerPrefab;
private void Start()
{
DontDestroyOnLoad(this);
SteamMatchmaking.OnLobbyCreated += OnLobbyCreatedCallBack;
SteamMatchmaking.OnLobbyEntered += OnLobbyEntered;
SteamMatchmaking.OnLobbyMemberJoined += OnLobbyMemberJoined;
// SteamMatchmaking.OnChatMessage += OnChatMessage;
SteamMatchmaking.OnLobbyMemberDisconnected += OnLobbyMemberDisconnected;
SteamMatchmaking.OnLobbyMemberLeave += OnLobbyMemberDisconnected;
SteamMatchmaking.OnLobbyGameCreated += OnLobbyGameCreated;
SteamFriends.OnGameLobbyJoinRequested += OnGameLobbyJoinRequest;
SteamMatchmaking.OnLobbyInvite += OnLobbyInvite;
CreateLobbyAsync();
}
private void OnLobbyInvite(Friend friend, Lobby lobby)
{
Debug.Log($"{friend.Name} invited you to his lobby.");
}
private void OnLobbyGameCreated(Lobby lobby, uint ip, ushort port, SteamId id)
{
}
private async void OnLobbyMemberJoined(Lobby lobby, Friend friend)
{
Debug.Log($"{friend.Name} joined the lobby");
GameObject obj = Instantiate(playerPrefab, Vector3.zero, Quaternion.identity);
inLobby.Add(friend.Id, obj);
}
private void OnLobbyMemberDisconnected(Lobby lobby, Friend friend)
{
Debug.Log($"{friend.Name} left the lobby");
Debug.Log($"New lobby owner is {CurrentLobby.Owner}");
if (inLobby.ContainsKey(friend.Id))
{
Destroy(inLobby[friend.Id]);
inLobby.Remove(friend.Id);
}
}
private async void OnGameLobbyJoinRequest(Lobby joinedLobby, SteamId id)
{
var joinedLobbySuccess = await joinedLobby.Join();
if (joinedLobbySuccess != RoomEnter.Success)
Debug.Log("failed to join lobby : " + joinedLobbySuccess);
else
CurrentLobby = joinedLobby;
}
private void OnLobbyCreatedCallBack(Result result, Lobby lobby)
{
if (result != Result.OK)
{
Debug.Log("lobby creation result not ok : " + result);
}
else
{
onLobbyCreated.Invoke();
Debug.Log("lobby creation result ok");
}
}
private async void OnLobbyEntered(Lobby lobby)
{
Debug.Log("Client joined the lobby");
UserInLobby = true;
foreach (var user in inLobby.Values) Destroy(user);
inLobby.Clear();
GameObject player = Instantiate(playerPrefab, Vector3.zero, Quaternion.identity);
inLobby.Add(SteamClient.SteamId, player);
foreach (var friend in CurrentLobby.Members)
if (friend.Id != SteamClient.SteamId)
{
GameObject other_player = Instantiate(playerPrefab, Vector3.zero, Quaternion.identity);
inLobby.Add(friend.Id, other_player);
}
onLobbyJoined.Invoke();
}
public async void CreateLobbyAsync()
{
var result = await CreateLobby();
if (!result)
{
Debug.Log("Failed to create lobby");
}
else
{
Debug.Log("Lobby created");
}
}
public static async Task<bool> CreateLobby()
{
try
{
var createLobbyOutput = await SteamMatchmaking.CreateLobbyAsync();
if (!createLobbyOutput.HasValue)
{
Debug.Log("Lobby created but not correctly instantiated.");
return false;
}
CurrentLobby = createLobbyOutput.Value;
CurrentLobby.SetPublic();
//currentLobby.SetPrivate();
CurrentLobby.SetJoinable(true);
return true;
}
catch (Exception exception)
{
Debug.Log("Failed to create multiplayer lobby : " + exception);
return false;
}
}
public void LeaveLobby()
{
try
{
UserInLobby = false;
CurrentLobby.Leave();
onLobbyLeave.Invoke();
foreach (var user in inLobby.Values) Destroy(user);
inLobby.Clear();
}
catch
{
}
}
private void Update()
{
if(Input.GetKeyDown(KeyCode.Return)) {
print("OWNER?:"+CurrentLobby.Owner);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4a9cdaa19da06c243b851b524d9e182a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 96a44475794fb6445a6f3c4b9ee13966
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 0957b521a08374f4aa508231735153bc
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: