David Woodruff
4 年前
当前提交
36fa2ccc
共有 190 个文件被更改,包括 4795 次插入 和 9 次删除
-
57Packages/packages-lock.json
-
9ProjectSettings/DynamicsManager.asset
-
8ProjectSettings/EditorBuildSettings.asset
-
7ProjectSettings/ProjectSettings.asset
-
8Assets/Prefabs.meta
-
16ProjectSettings/BurstAotSettings_StandaloneWindows.json
-
7Assets/Prefabs/PlayerCharacter.prefab.meta
-
259Assets/Prefabs/PlayerCharacter.prefab
-
1001Assets/Scenes/MainMenu.unity
-
7Assets/Scenes/MainMenu.unity.meta
-
8Assets/Scenes/SampleScene.meta
-
648Assets/Scenes/SampleScene.unity
-
2Assets/Scenes/SampleScene/NavMesh.asset
-
8Assets/Scenes/SampleScene/NavMesh.asset.meta
-
88Assets/Scripts/Character.cs
-
11Assets/Scripts/Character.cs.meta
-
8Assets/Scripts/Client.meta
-
8Assets/Scripts/Client/UI.meta
-
8Assets/Scripts/Client/Game.meta
-
8Assets/Scripts/Client/Net.meta
-
11Assets/Scripts/Client/Game/ClientCharSelectBRState.cs.meta
-
11Assets/Scripts/Client/Game/ClientGameBRState.cs.meta
-
11Assets/Scripts/Client/Game/ClientMainMenuBRState.cs.meta
-
31Assets/Scripts/Client/Game/ClientCharSelectBRState.cs
-
28Assets/Scripts/Client/Game/ClientGameBRState.cs
-
37Assets/Scripts/Client/Game/ClientMainMenuBRState.cs
-
11Assets/Scripts/Client/Net/ClientGNHLogic.cs.meta
-
78Assets/Scripts/Client/Net/ClientGNHLogic.cs
-
11Assets/Scripts/Client/UI/MainMenuUI.cs.meta
-
60Assets/Scripts/Client/UI/MainMenuUI.cs
-
25Assets/Scripts/Interpolation.cs
-
11Assets/Scripts/Interpolation.cs.meta
-
40Assets/Scripts/PlayerInput.cs
-
11Assets/Scripts/PlayerInput.cs.meta
-
19Assets/Scripts/PositionInterpolation.cs
-
11Assets/Scripts/PositionInterpolation.cs.meta
-
8Assets/Scripts/Server.meta
-
8Assets/Scripts/Server/Game.meta
-
8Assets/Scripts/Server/Net.meta
-
102Assets/Scripts/Server/Net/ServerGNHLogic.cs
-
11Assets/Scripts/Server/Net/ServerGNHLogic.cs.meta
-
11Assets/Scripts/Server/Game/ServerCharSelectBRState.cs.meta
-
11Assets/Scripts/Server/Game/ServerGameBRState.cs.meta
-
31Assets/Scripts/Server/Game/ServerCharSelectBRState.cs
-
33Assets/Scripts/Server/Game/ServerGameBRState.cs
-
8Assets/Scripts/Shared.meta
-
8Assets/Scripts/Shared/Net.meta
-
11Assets/Scripts/Shared/Net/GameNetHub.cs.meta
-
149Assets/Scripts/Shared/Net/GameNetHub.cs
-
8Assets/Scripts/Shared/Game.meta
-
152Assets/Scripts/Shared/Game/BossRoomStateManager.cs
-
11Assets/Scripts/Shared/Game/BossRoomStateManager.cs.meta
-
35Assets/Scripts/Shared/Game/CharSelectBRState.cs
-
11Assets/Scripts/Shared/Game/CharSelectBRState.cs.meta
-
11Assets/Scripts/Shared/Game/GameBRState.cs.meta
-
33Assets/Scripts/Shared/Game/IBossRoomState.cs
-
11Assets/Scripts/Shared/Game/IBossRoomState.cs.meta
-
36Assets/Scripts/Shared/Game/GameBRState.cs
-
49Assets/Scripts/SimulationManager.cs
-
11Assets/Scripts/SimulationManager.cs.meta
-
5Packages/com.unity.multiplayer.transport.photon-realtime/CHANGELOG.md
-
7Packages/com.unity.multiplayer.transport.photon-realtime/CHANGELOG.md.meta
-
9Packages/com.unity.multiplayer.transport.photon-realtime/README.md
-
7Packages/com.unity.multiplayer.transport.photon-realtime/README.md.meta
-
8Packages/com.unity.multiplayer.transport.photon-realtime/Runtime.meta
-
8Packages/com.unity.multiplayer.transport.photon-realtime/Runtime/Photon.meta
-
8Packages/com.unity.multiplayer.transport.photon-realtime/Runtime/Photon/PhotonChat.meta
-
8Packages/com.unity.multiplayer.transport.photon-realtime/Runtime/Photon/PhotonChat/Code.meta
-
18Packages/com.unity.multiplayer.transport.photon-realtime/Runtime/Photon/PhotonChat/Code/ChannelCreationOptions.cs
-
11Packages/com.unity.multiplayer.transport.photon-realtime/Runtime/Photon/PhotonChat/Code/ChannelCreationOptions.cs.meta
-
14Packages/com.unity.multiplayer.transport.photon-realtime/Runtime/Photon/PhotonChat/Code/ChannelWellKnownProperties.cs
-
11Packages/com.unity.multiplayer.transport.photon-realtime/Runtime/Photon/PhotonChat/Code/ChannelWellKnownProperties.cs.meta
-
191Packages/com.unity.multiplayer.transport.photon-realtime/Runtime/Photon/PhotonChat/Code/ChatChannel.cs
-
11Packages/com.unity.multiplayer.transport.photon-realtime/Runtime/Photon/PhotonChat/Code/ChatChannel.cs.meta
-
1001Packages/com.unity.multiplayer.transport.photon-realtime/Runtime/Photon/PhotonChat/Code/ChatClient.cs
-
11Packages/com.unity.multiplayer.transport.photon-realtime/Runtime/Photon/PhotonChat/Code/ChatClient.cs.meta
-
36Packages/com.unity.multiplayer.transport.photon-realtime/Runtime/Photon/PhotonChat/Code/ChatDisconnectCause.cs
-
11Packages/com.unity.multiplayer.transport.photon-realtime/Runtime/Photon/PhotonChat/Code/ChatDisconnectCause.cs.meta
-
33Packages/com.unity.multiplayer.transport.photon-realtime/Runtime/Photon/PhotonChat/Code/ChatEventCode.cs
-
11Packages/com.unity.multiplayer.transport.photon-realtime/Runtime/Photon/PhotonChat/Code/ChatEventCode.cs.meta
-
36Packages/com.unity.multiplayer.transport.photon-realtime/Runtime/Photon/PhotonChat/Code/ChatOperationCode.cs
|
|||
fileFormatVersion: 2 |
|||
guid: 5d9149b0a2db9664c9d7959745d00bf9 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
{ |
|||
"MonoBehaviour": { |
|||
"Version": 3, |
|||
"EnableBurstCompilation": true, |
|||
"EnableOptimisations": true, |
|||
"EnableSafetyChecks": false, |
|||
"EnableDebugInAllBuilds": false, |
|||
"UsePlatformSDKLinker": false, |
|||
"CpuMinTargetX32": 0, |
|||
"CpuMaxTargetX32": 0, |
|||
"CpuMinTargetX64": 0, |
|||
"CpuMaxTargetX64": 0, |
|||
"CpuTargetsX32": 6, |
|||
"CpuTargetsX64": 72 |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: e57f88b20c296674cb0c1517a43f99da |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!1 &922472105905938403 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 922472105905938412} |
|||
- component: {fileID: 922472105905938413} |
|||
- component: {fileID: 922472105905938415} |
|||
- component: {fileID: 922472105905938414} |
|||
- component: {fileID: 901965000} |
|||
- component: {fileID: 2483890359039831193} |
|||
- component: {fileID: -7978990056136126243} |
|||
m_Layer: 0 |
|||
m_Name: PlayerCharacter |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &922472105905938412 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 922472105905938403} |
|||
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: 308914464942347706} |
|||
m_Father: {fileID: 0} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!114 &922472105905938413 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 922472105905938403} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
NetworkedInstanceId: 0 |
|||
PrefabHash: 6075374942793011955 |
|||
PrefabHashGenerator: PlayerCharacter |
|||
AlwaysReplicateAsRoot: 0 |
|||
DontDestroyWithOwner: 0 |
|||
--- !u!136 &922472105905938415 |
|||
CapsuleCollider: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 922472105905938403} |
|||
m_Material: {fileID: 0} |
|||
m_IsTrigger: 0 |
|||
m_Enabled: 1 |
|||
m_Radius: 0.5 |
|||
m_Height: 2 |
|||
m_Direction: 1 |
|||
m_Center: {x: 0, y: 1, z: 0} |
|||
--- !u!54 &922472105905938414 |
|||
Rigidbody: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 922472105905938403} |
|||
serializedVersion: 2 |
|||
m_Mass: 1 |
|||
m_Drag: 0 |
|||
m_AngularDrag: 0.05 |
|||
m_UseGravity: 1 |
|||
m_IsKinematic: 1 |
|||
m_Interpolate: 0 |
|||
m_Constraints: 0 |
|||
m_CollisionDetection: 0 |
|||
--- !u!195 &901965000 |
|||
NavMeshAgent: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 922472105905938403} |
|||
m_Enabled: 1 |
|||
m_AgentTypeID: 0 |
|||
m_Radius: 0.5 |
|||
m_Speed: 3.5 |
|||
m_Acceleration: 8 |
|||
avoidancePriority: 50 |
|||
m_AngularSpeed: 120 |
|||
m_StoppingDistance: 0 |
|||
m_AutoTraverseOffMeshLink: 1 |
|||
m_AutoBraking: 1 |
|||
m_AutoRepath: 1 |
|||
m_Height: 2 |
|||
m_BaseOffset: 0 |
|||
m_WalkableMask: 4294967295 |
|||
m_ObstacleAvoidanceType: 4 |
|||
--- !u!114 &2483890359039831193 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 922472105905938403} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 5ef335173735a554a98a17d4ef9b21c2, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
movementSpeed: 5 |
|||
movementTarget: {x: 2, y: 0, z: 2} |
|||
--- !u!114 &-7978990056136126243 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 922472105905938403} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 0eaaa5f4790dfc64ebc62ee85984bab9, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
--- !u!1 &2312369181857326860 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 3876725910249473322} |
|||
- component: {fileID: 7677370582403823428} |
|||
- component: {fileID: 1658973705582038100} |
|||
m_Layer: 0 |
|||
m_Name: Capsule |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &3876725910249473322 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 2312369181857326860} |
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} |
|||
m_LocalPosition: {x: 0, y: 1, z: 0} |
|||
m_LocalScale: {x: 1, y: 1, z: 1} |
|||
m_Children: [] |
|||
m_Father: {fileID: 308914464942347706} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!33 &7677370582403823428 |
|||
MeshFilter: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 2312369181857326860} |
|||
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} |
|||
--- !u!23 &1658973705582038100 |
|||
MeshRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 2312369181857326860} |
|||
m_Enabled: 1 |
|||
m_CastShadows: 1 |
|||
m_ReceiveShadows: 1 |
|||
m_DynamicOccludee: 1 |
|||
m_MotionVectors: 1 |
|||
m_LightProbeUsage: 1 |
|||
m_ReflectionProbeUsage: 1 |
|||
m_RayTracingMode: 2 |
|||
m_RayTraceProcedural: 0 |
|||
m_RenderingLayerMask: 1 |
|||
m_RendererPriority: 0 |
|||
m_Materials: |
|||
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} |
|||
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!1 &4347399796013429617 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 308914464942347706} |
|||
- component: {fileID: 2501205002747161907} |
|||
m_Layer: 0 |
|||
m_Name: Graphics |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &308914464942347706 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 4347399796013429617} |
|||
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: 3876725910249473322} |
|||
m_Father: {fileID: 922472105905938412} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!114 &2501205002747161907 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 4347399796013429617} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 7dac193e15c19dd47bcfb78c85bd6d8d, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
1001
Assets/Scenes/MainMenu.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 4b62455423c0e284f96f7fd6ac947bf9 |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: d35e52e80fddfa34e8598be81bb477bb |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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: 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: 705507994} |
|||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, 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: 0} |
|||
--- !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: 23800000, guid: c7720ceef5c5df34c98168df9d4f695e, type: 2} |
|||
--- !u!1 &532797402 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 532797406} |
|||
- component: {fileID: 532797405} |
|||
- component: {fileID: 532797404} |
|||
- component: {fileID: 532797403} |
|||
m_Layer: 0 |
|||
m_Name: Plane |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 4294967295 |
|||
m_IsActive: 1 |
|||
--- !u!64 &532797403 |
|||
MeshCollider: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 532797402} |
|||
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 &532797404 |
|||
MeshRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 532797402} |
|||
m_Enabled: 1 |
|||
m_CastShadows: 1 |
|||
m_ReceiveShadows: 1 |
|||
m_DynamicOccludee: 1 |
|||
m_MotionVectors: 1 |
|||
m_LightProbeUsage: 1 |
|||
m_ReflectionProbeUsage: 1 |
|||
m_RayTracingMode: 2 |
|||
m_RayTraceProcedural: 0 |
|||
m_RenderingLayerMask: 1 |
|||
m_RendererPriority: 0 |
|||
m_Materials: |
|||
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} |
|||
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 &532797405 |
|||
MeshFilter: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 532797402} |
|||
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} |
|||
--- !u!4 &532797406 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 532797402} |
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} |
|||
m_LocalPosition: {x: 0, y: -1, z: 10} |
|||
m_LocalScale: {x: 2, y: 2, z: 2} |
|||
m_Children: [] |
|||
m_Father: {fileID: 1233618361} |
|||
m_RootOrder: 0 |
|||
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} |
|||
m_Layer: 0 |
|||
m_Name: Directional Light |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 4294967295 |
|||
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: 1 |
|||
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: 0 |
|||
m_AreaSize: {x: 1, y: 1} |
|||
m_BounceIntensity: 1 |
|||
m_ColorTemperature: 6570 |
|||
m_UseColorTemperature: 0 |
|||
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: 2, z: 10} |
|||
m_LocalScale: {x: 1, y: 1, z: 1} |
|||
m_Children: [] |
|||
m_Father: {fileID: 1233618361} |
|||
m_RootOrder: 1 |
|||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} |
|||
--- !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.5, y: 0, z: 0, w: 0.8660254} |
|||
m_LocalPosition: {x: 0, y: 10, z: -5.62} |
|||
m_LocalScale: {x: 1, y: 1, z: 1} |
|||
m_Children: [] |
|||
m_Father: {fileID: 0} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 60, y: 0, z: 0} |
|||
--- !u!1 &1069853755 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 1069853757} |
|||
- component: {fileID: 1069853756} |
|||
- component: {fileID: 1069853760} |
|||
- component: {fileID: 1069853759} |
|||
- component: {fileID: 1069853758} |
|||
- component: {fileID: 1069853761} |
|||
m_Layer: 0 |
|||
m_Name: NetworkingManager |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!114 &1069853756 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1069853755} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 593a2fe42fa9d37498c96f9a383b6521, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
DontDestroy: 1 |
|||
RunInBackground: 1 |
|||
LogLevel: 1 |
|||
NetworkConfig: |
|||
ProtocolVersion: 0 |
|||
NetworkTransport: {fileID: 1069853760} |
|||
RegisteredScenes: |
|||
- SampleScene |
|||
AllowRuntimeSceneChanges: 0 |
|||
NetworkedPrefabs: |
|||
- Prefab: {fileID: 922472105905938403, guid: e57f88b20c296674cb0c1517a43f99da, type: 3} |
|||
PlayerPrefab: 1 |
|||
PlayerPrefabHash: |
|||
id: 0 |
|||
CreatePlayerPrefab: 1 |
|||
ReceiveTickrate: 0 |
|||
MaxReceiveEventsPerTickRate: 1000 |
|||
EventTickrate: 0 |
|||
MaxObjectUpdatesPerTick: -1 |
|||
ClientConnectionBufferTimeout: 10 |
|||
ConnectionApproval: 0 |
|||
ConnectionData: |
|||
SecondsHistory: 0 |
|||
EnableTimeResync: 0 |
|||
TimeResyncInterval: 30 |
|||
EnableNetworkedVar: 0 |
|||
EnsureNetworkedVarLengthSafety: 0 |
|||
EnableSceneManagement: 0 |
|||
ForceSamePrefabs: 1 |
|||
UsePrefabSync: 0 |
|||
RecycleNetworkIds: 1 |
|||
NetworkIdRecycleDelay: 120 |
|||
RpcHashSize: 0 |
|||
LoadSceneTimeOut: 120 |
|||
EnableMessageBuffering: 0 |
|||
MessageBufferTimeout: 20 |
|||
EnableNetworkLogs: 1 |
|||
EnableEncryption: 0 |
|||
SignKeyExchange: 0 |
|||
ServerBase64PfxCertificate: |
|||
references: |
|||
version: 1 |
|||
00000000: |
|||
type: {class: NullableBoolSerializable, ns: MLAPI.Configuration, asm: Unity.Multiplayer.MLAPI.Runtime} |
|||
data: |
|||
Value: 6075374942793011955 |
|||
--- !u!4 &1069853757 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1069853755} |
|||
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_Children: [] |
|||
m_Father: {fileID: 0} |
|||
m_RootOrder: 2 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!114 &1069853758 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1069853755} |
|||
m_Enabled: 0 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 52c005b32a68a254cbe502a4e5cb8eb6, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
appId: bc5b8b0d-edf3-4c61-9593-ce38da7f0c79 |
|||
gameVersion: 0.0.0 |
|||
region: EU |
|||
nickName: |
|||
roomName: |
|||
maxPlayers: 4 |
|||
batchedTransportEventCode: 129 |
|||
channelIdCodesStartRange: 130 |
|||
attachSupportLogger: 1 |
|||
sendQueueBatchSize: 4096 |
|||
--- !u!114 &1069853759 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1069853755} |
|||
m_Enabled: 0 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: db28424c2ae12f64da25c9ecccded6b1, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
Port: 7777 |
|||
Address: 127.0.0.1 |
|||
PingInterval: 1 |
|||
DisconnectTimeout: 5 |
|||
ReconnectDelay: 0.5 |
|||
MaxConnectAttempts: 10 |
|||
channels: [] |
|||
MessageBufferSize: 5120 |
|||
SimulatePacketLossChance: 0 |
|||
SimulateMinLatency: 0 |
|||
SimulateMaxLatency: 0 |
|||
--- !u!114 &1069853760 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1069853755} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: b84c2d8dfe509a34fb59e2b81f8e1319, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
MessageBufferSize: 5120 |
|||
MaxConnections: 100 |
|||
MaxSentMessageQueueSize: 128 |
|||
ConnectAddress: 127.0.0.1 |
|||
ConnectPort: 7777 |
|||
ServerListenPort: 7777 |
|||
ServerWebsocketListenPort: 8887 |
|||
SupportWebsocket: 0 |
|||
Channels: [] |
|||
UseMLAPIRelay: 0 |
|||
MLAPIRelayAddress: 184.72.104.138 |
|||
MLAPIRelayPort: 8888 |
|||
MessageSendMode: 0 |
|||
--- !u!114 &1069853761 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1069853755} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: e26f82009f8f36d45a99adae79eab7b9, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
--- !u!1 &1233618360 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 1233618361} |
|||
m_Layer: 0 |
|||
m_Name: Environment |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 4294967295 |
|||
m_IsActive: 1 |
|||
--- !u!4 &1233618361 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1233618360} |
|||
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_Children: |
|||
- {fileID: 532797406} |
|||
- {fileID: 705507995} |
|||
m_Father: {fileID: 0} |
|||
m_RootOrder: 1 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!1 &1601651753 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 1601651754} |
|||
- component: {fileID: 1601651755} |
|||
m_Layer: 0 |
|||
m_Name: SimulationManager |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &1601651754 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1601651753} |
|||
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: 0} |
|||
m_RootOrder: 3 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!114 &1601651755 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 1601651753} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 3e6c31da8c35c2743b0311f50e3e1a69, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
tickRate: 20 |
2
Assets/Scenes/SampleScene/NavMesh.asset
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: c7720ceef5c5df34c98168df9d4f695e |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using MLAPI; |
|||
using MLAPI.Messaging; |
|||
using System; |
|||
using System.IO; |
|||
using System.Linq; |
|||
using UnityEngine; |
|||
using UnityEngine.AI; |
|||
|
|||
public class Character : NetworkedBehaviour |
|||
{ |
|||
[SerializeField] |
|||
private float movementSpeed; |
|||
|
|||
private NavMeshAgent _navMeshAgent; |
|||
private NavMeshPath _path; |
|||
|
|||
private PositionInterpolation _interpolation; |
|||
|
|||
public void Awake() |
|||
{ |
|||
_path = new NavMeshPath(); |
|||
_navMeshAgent = GetComponent<NavMeshAgent>(); |
|||
_interpolation = GetComponentInChildren<PositionInterpolation>(); |
|||
} |
|||
|
|||
///<inheritdoc/>
|
|||
public override void NetworkStart() |
|||
{ |
|||
base.NetworkStart(); |
|||
|
|||
SimulationManager.Singleton.OnSimulationUpdate += SimulationUpdate; |
|||
SimulationManager.Singleton.OnSyncNetworkEvents += SyncNetworkEvents; |
|||
|
|||
_navMeshAgent.updateRotation = false; |
|||
_navMeshAgent.updatePosition = true; |
|||
|
|||
if (!IsServer) |
|||
{ |
|||
Destroy(_navMeshAgent); |
|||
} |
|||
} |
|||
|
|||
private void SyncNetworkEvents(float time, float deltaTime) |
|||
{ |
|||
if (IsServer) |
|||
{ |
|||
_interpolation.AddValue(time, transform.position); |
|||
InvokeClientRpcOnEveryoneExcept<float, Vector3>(ReplicatePosition, NetworkingManager.Singleton.ServerClientId, time, transform.position); |
|||
} |
|||
|
|||
} |
|||
|
|||
public void SetMovementTarget(Vector3 position) |
|||
{ |
|||
_navMeshAgent.CalculatePath(position, _path); |
|||
} |
|||
|
|||
private void SimulationUpdate(float time, float deltaTime) |
|||
{ |
|||
if (IsServer) |
|||
{ |
|||
NavigationMovement(deltaTime); |
|||
} |
|||
} |
|||
|
|||
private void NavigationMovement(float deltaTime) |
|||
{ |
|||
var corners = _path.corners; // TODO: maybe use non-alloc version
|
|||
|
|||
if (corners.Any() && Vector3.SqrMagnitude(corners[corners.Length - 1]- transform.position) < 1) |
|||
{ |
|||
_path = new NavMeshPath(); |
|||
corners = _path.corners; |
|||
} |
|||
|
|||
var direction = corners.Length > 1 ? (corners[1]- corners[0]).normalized : Vector3.zero; |
|||
var movement = direction * movementSpeed * deltaTime; |
|||
|
|||
_navMeshAgent.Move(movement); |
|||
} |
|||
|
|||
[ClientRPC] |
|||
private void ReplicatePosition(float time, Vector3 value) |
|||
{ |
|||
// The time which we receive here is server time. TODO We need to match it with our client time.
|
|||
_interpolation.AddValue(time, value); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 5ef335173735a554a98a17d4ef9b21c2 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 422ec0f4d28e6d4468624a9c76adab77 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 3d8dd27d96315be4c9c7413bc17b82c7 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 96e5af1f6fcbe144a99396d22b4f7dbf |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 834e4dadbaf194f45a280e71aace6a16 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 5c5d294b879617e448dbe34b7f09616d |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: fb79a8334ba58754c98a2ee9fc2a5dee |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 5a65bc8be73a02c42a41f5efef95fbae |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
|
|||
using BossRoom; |
|||
|
|||
|
|||
namespace BossRoomClient |
|||
{ |
|||
class ClientCharSelectBRState : CharSelectBRState |
|||
{ |
|||
// !! STUB CLASS !!
|
|||
// this will be fleshed out with all client-side logic for the character select BossRoom state.
|
|||
|
|||
public override void Destroy() |
|||
{ |
|||
base.Destroy(); |
|||
} |
|||
|
|||
public override void Initialize(BossRoomStateManager manager, Dictionary<string, object> stateParams) |
|||
{ |
|||
base.Initialize(manager, stateParams); |
|||
} |
|||
|
|||
public override void Update() |
|||
{ |
|||
base.Update(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
|
|||
using BossRoom; |
|||
|
|||
namespace BossRoomClient |
|||
{ |
|||
class ClientGameBRState : GameBRState |
|||
{ |
|||
// !! STUB CLASS !!
|
|||
// this will be fleshed out with all client-side logic for the Game BossRoom state.
|
|||
|
|||
public override void Destroy() |
|||
{ |
|||
base.Destroy(); |
|||
} |
|||
|
|||
public override void Initialize(BossRoomStateManager manager, Dictionary<string, object> stateParams) |
|||
{ |
|||
base.Initialize(manager, stateParams); |
|||
} |
|||
|
|||
public override void Update() |
|||
{ |
|||
base.Update(); |
|||
} |
|||
} |
|||
} |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
|
|||
using BossRoom; |
|||
|
|||
|
|||
namespace BossRoomClient |
|||
{ |
|||
/// <summary>
|
|||
/// The BossRoom state logic that runs during MainMenu. Unlike most states, there is only a client variant of this (you are always
|
|||
/// a client when sitting at the Main Menu screen).
|
|||
/// </summary>
|
|||
class ClientMainMenuBRState : IBossRoomState |
|||
{ |
|||
private BossRoomStateManager m_manager; |
|||
|
|||
public BossRoomState State { get { return BossRoomState.MAINMENU; } } |
|||
|
|||
public void Destroy() |
|||
{ |
|||
} |
|||
|
|||
public void Initialize(BossRoomStateManager manager, Dictionary<string, object> stateParams) |
|||
{ |
|||
m_manager = manager; |
|||
|
|||
UnityEngine.Application.targetFrameRate = 60; |
|||
} |
|||
|
|||
public void Update() |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: 5bd31edc1b1fd1342b3bf8193a5a03b2 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
using BossRoom; |
|||
|
|||
namespace BossRoomClient |
|||
{ |
|||
/// <summary>
|
|||
/// Client logic for the GameNetHub. Contains implementations for all of GameNetHub's S2C RPCs.
|
|||
/// </summary>
|
|||
public class ClientGNHLogic |
|||
{ |
|||
private GameNetHub m_hub; |
|||
|
|||
public ClientGNHLogic(GameNetHub hub) |
|||
{ |
|||
m_hub = hub; |
|||
} |
|||
|
|||
public void RecvConnectFinished( ConnectStatus status, BossRoomState targetState ) |
|||
{ |
|||
//on success, there is nothing to do (the MLAPI scene management system will take us to the next scene).
|
|||
//on failure, we must raise an event so that the UI layer can display something.
|
|||
Debug.Log("RecvConnectFinished Got status: " + status); |
|||
m_hub.GetComponent<BossRoomStateManager>().ChangeState(targetState, null); |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// Either loads a Guid string from Unity preferences, or creates one and checkpoints it, then returns it.
|
|||
/// </summary>
|
|||
/// <returns>The Guid that uniquely identifies this client install, in string form. </returns>
|
|||
private static string GetOrCreateGuid() |
|||
{ |
|||
if( PlayerPrefs.HasKey("client_guid")) |
|||
{ |
|||
return PlayerPrefs.GetString("client_guid"); |
|||
} |
|||
|
|||
System.Guid g = System.Guid.NewGuid(); |
|||
string guid_string = g.ToString(); |
|||
|
|||
PlayerPrefs.SetString("client_guid", guid_string); |
|||
return guid_string; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Wraps the invocation of NetworkingManager.StartClient, including our GUID as the payload.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// This method must be static because, when it is invoked, the client still doesn't know it's a client yet, and in particular, GameNetHub hasn't
|
|||
/// yet initialized its client and server GNHLogic objects yet (which it does in NetworkStart, based on the role that the current player is performing).
|
|||
/// </remarks>
|
|||
/// <param name="ipaddress">the IP address of the host to connect to. (currently IPV4 only)</param>
|
|||
/// <param name="port">The port of the host to connect to. </param>
|
|||
public static void StartClient(GameNetHub hub, string ipaddress, int port) |
|||
{ |
|||
string client_guid = GetOrCreateGuid(); |
|||
string payload = $"client_guid={client_guid}\n"; //minimal format where key=value pairs are separated by newlines.
|
|||
|
|||
byte[] payload_bytes = System.Text.Encoding.UTF8.GetBytes(payload); |
|||
|
|||
//DMW_NOTE: non-portable. We need to be updated when moving to UTP transport.
|
|||
var transport = hub.NetworkingManagerGO.GetComponent<MLAPI.Transports.UNET.UnetTransport>(); |
|||
transport.ConnectAddress = ipaddress; |
|||
transport.ConnectPort = port; |
|||
|
|||
hub.NetManager.NetworkConfig.ConnectionData = payload_bytes; |
|||
|
|||
//and...we're off! MLAPI will establish a socket connection to the host.
|
|||
// If the socket connection fails, we'll hear back by [???] (FIXME: GOMPS-79, need to handle transport layer failures too).
|
|||
// If the socket connection succeeds, we'll get our RecvConnectFinished invoked. This is where game-layer failures will be reported.
|
|||
hub.NetManager.StartClient(); |
|||
} |
|||
|
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: f6144e8dd0fc8ec4cb23a1a49059aa08 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
namespace BossRoomViz |
|||
{ |
|||
/// <summary>
|
|||
/// Provides backing logic for all of the UI that runs in the MainMenu stage.
|
|||
/// </summary>
|
|||
public class MainMenuUI : MonoBehaviour |
|||
{ |
|||
public GameObject GameHubGO; |
|||
public GameObject InputTextGO; |
|||
|
|||
private BossRoom.GameNetHub m_netHub; |
|||
|
|||
// Start is called before the first frame update
|
|||
void Start() |
|||
{ |
|||
m_netHub = GameHubGO.GetComponent<BossRoom.GameNetHub>(); |
|||
} |
|||
|
|||
// Update is called once per frame
|
|||
void Update() |
|||
{ |
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the IP Address the user set in the UI, or returns 127.0.0.1 if IP is not present.
|
|||
/// </summary>
|
|||
/// <returns>IP address entered by user, in string form. </returns>
|
|||
private string GetIPAddress() |
|||
{ |
|||
string iptext = InputTextGO.GetComponent<UnityEngine.UI.Text>().text; |
|||
if( iptext == "" ) |
|||
{ |
|||
return "127.0.0.1"; |
|||
} |
|||
|
|||
return iptext; |
|||
} |
|||
|
|||
public void OnHostClicked() |
|||
{ |
|||
Debug.Log("Host Clicked"); |
|||
|
|||
GetIPAddress(); |
|||
|
|||
m_netHub.StartHost(GetIPAddress(), 9998); |
|||
} |
|||
|
|||
public void OnConnectClicked() |
|||
{ |
|||
Debug.Log("Connect Clicked"); |
|||
m_netHub.StartClient(GetIPAddress(), 9998); |
|||
} |
|||
} |
|||
} |
|||
|
|
|||
using System; |
|||
using UnityEngine; |
|||
|
|||
public abstract class Interpolation<T> : MonoBehaviour |
|||
{ |
|||
public abstract Func<T, T, float, T> LerpFunction { get;} |
|||
|
|||
private (float, T) _last; |
|||
private (float, T) _previous; |
|||
|
|||
public T GetValueForTime(float time) |
|||
{ |
|||
float timeSincePrevious = time - _previous.Item1; |
|||
float t = (timeSincePrevious / (_last.Item1 - _previous.Item1) - 1f); |
|||
|
|||
return LerpFunction(_previous.Item2, _last.Item2, t); |
|||
} |
|||
|
|||
public void AddValue(float time, T value) |
|||
{ |
|||
_previous = _last; |
|||
_last = (time, value); |
|||
} |
|||
|
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 4be874942db508e4bb7c4481d0ffb727 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using MLAPI; |
|||
using MLAPI.Messaging; |
|||
using System; |
|||
using UnityEngine; |
|||
|
|||
public class PlayerInput : NetworkedBehaviour |
|||
{ |
|||
private Character character; |
|||
|
|||
public void Awake() |
|||
{ |
|||
character = GetComponent<Character>(); |
|||
} |
|||
|
|||
public override void NetworkStart() |
|||
{ |
|||
if (IsClient) |
|||
{ |
|||
SimulationManager.Singleton.OnSimulationUpdate += SimulationUpdate; |
|||
} |
|||
} |
|||
|
|||
private void SimulationUpdate(float time, float deltaTime) |
|||
{ |
|||
if (Input.GetMouseButton(0)) |
|||
{ |
|||
RaycastHit hit; |
|||
if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit)) |
|||
{ |
|||
InvokeServerRpc(SendPlayerInput, hit.point); |
|||
} |
|||
} |
|||
} |
|||
|
|||
[ServerRPC] |
|||
public void SendPlayerInput(Vector3 position) |
|||
{ |
|||
character.SetMovementTarget(position); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 0eaaa5f4790dfc64ebc62ee85984bab9 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using UnityEngine; |
|||
using MLAPI; |
|||
|
|||
[DefaultExecutionOrder(200)] |
|||
public class PositionInterpolation : Interpolation<Vector3> |
|||
{ |
|||
public override Func<Vector3, Vector3, float, Vector3> LerpFunction => Vector3.LerpUnclamped; |
|||
|
|||
private void Update() |
|||
{ |
|||
var value = GetValueForTime(NetworkingManager.Singleton.NetworkTime); |
|||
if (!float.IsNaN(value.x)) |
|||
{ |
|||
transform.position = value; |
|||
} |
|||
|
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 7dac193e15c19dd47bcfb78c85bd6d8d |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: fea36b5492aa19d4f88d4dd297330468 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 75639e6fb8c2e4b4aac37138c9601db1 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: b49db31b9d52a4e499fc7edbb83dcbc7 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
using BossRoom; |
|||
|
|||
namespace BossRoomServer |
|||
{ |
|||
/// <summary>
|
|||
/// Server logic plugin for the GameNetHub. Contains implementations for all GameNetHub's C2S RPCs.
|
|||
/// </summary>
|
|||
public class ServerGNHLogic |
|||
{ |
|||
private GameNetHub m_Hub; |
|||
|
|||
// used in ApprovalCheck. This is intended as a bit of light protection against DOS attacks that rely on sending silly big buffers of garbage.
|
|||
private const int k_MaxConnectPayload = 1024; |
|||
|
|||
public ServerGNHLogic(GameNetHub hub) |
|||
{ |
|||
m_Hub = hub; |
|||
m_Hub.NetManager.ConnectionApprovalCallback += this.ApprovalCheck; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Initializes host mode on this client. Call this and then other clients should connect to us!
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// See notes in GNH_Client.StartClient about why this must be static.
|
|||
/// </remarks>
|
|||
/// <param name="hub">The GameNetHub that is invoking us. </param>
|
|||
/// <param name="ipaddress">The IP address to connect to (currently IPV4 only).</param>
|
|||
/// <param name="port">The port to connect to. </param>
|
|||
public static void StartHost(GameNetHub hub, string ipaddress, int port ) |
|||
{ |
|||
//DMW_NOTE: non-portable. We need to be updated when moving to UTP transport.
|
|||
var transport = hub.NetworkingManagerGO.GetComponent<MLAPI.Transports.UNET.UnetTransport>(); |
|||
transport.ConnectAddress = ipaddress; |
|||
transport.ServerListenPort = port; |
|||
|
|||
hub.NetManager.StartHost(); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// This logic plugs into the "ConnectionApprovalCallback" exposed by MLAPI.NetworkingManager, and is run every time a client connects to us.
|
|||
/// See GNH_Client.StartClient for the complementary logic that runs when the client starts its connection.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// Since our game doesn't have to interact with some third party authentication service to validate the identity of the new connection, our ApprovalCheck
|
|||
/// method is simple, and runs synchronously, invoking "callback" to signal approval at the end of the method. MLAPI currently doesn't support the ability
|
|||
/// to send back more than a "true/false", which means we have to work a little harder to provide a useful error return to the client. To do that, we invoke a
|
|||
/// client RPC in the same channel that MLAPI uses for its connection callback. Since that channel ("MLAPI_INTERNAL") is both reliable and sequenced, we can be
|
|||
/// confident that our login result message will execute before any disconnect message.
|
|||
/// </remarks>
|
|||
/// <param name="connectionData">binary data passed into StartClient. In our case this is the client's GUID, which is a unique identifier for their install of the game that persists across app restarts. </param>
|
|||
/// <param name="clientId">This is the clientId that MLAPI assigned us on login. It does not persist across multiple logins from the same client. </param>
|
|||
/// <param name="callback">The delegate we must invoke to signal that the connection was approved or not. </param>
|
|||
private void ApprovalCheck( byte[] connectionData, ulong clientId, MLAPI.NetworkingManager.ConnectionApprovedDelegate callback ) |
|||
{ |
|||
if( connectionData.Length > k_MaxConnectPayload ) |
|||
{ |
|||
callback(false, 0, false, null, null ); |
|||
return; |
|||
} |
|||
|
|||
string payload = System.Text.Encoding.UTF8.GetString(connectionData); |
|||
|
|||
string[] config_lines = payload.Split('\n'); |
|||
var payload_config = new Dictionary<string, string>(); |
|||
foreach( var line in config_lines ) |
|||
{ |
|||
//key-value pair.
|
|||
if( line.Contains("=") ) |
|||
{ |
|||
string[] kv = line.Split('='); |
|||
payload_config.Add(kv[0], kv[1]); |
|||
} |
|||
else if( line.Trim() != "" ) |
|||
{ |
|||
//single token, with no value present.
|
|||
payload_config.Add(line, null); |
|||
} |
|||
} |
|||
|
|||
//TODO: GOMPS-78. We'll need to save our client guid so that we can handle reconnect.
|
|||
Debug.Log("host ApprovalCheck: client payload was: " + payload); |
|||
Debug.Log("host ApprovalCheck: client guid was: " + payload_config["client_guid"]); |
|||
|
|||
|
|||
//TODO: GOMPS-79 handle different error cases.
|
|||
|
|||
callback(false, 0, true, null, null); |
|||
|
|||
//FIXME_DMW: it is weird to do this after the callback, but the custom message won't be delivered if we call it beforehand.
|
|||
//This creates an "honor system" scenario where it is up to the client to politely leave on failure. Probably
|
|||
//we should add a NetManager.DisconnectClient call directly below this line, when we are rejecting the connection.
|
|||
m_Hub.S2C_ConnectResult(clientId, ConnectStatus.SUCCESS, BossRoomState.CHARSELECT); |
|||
} |
|||
|
|||
} |
|||
} |
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: 54b0859a1da930541adf0b2d1bb8d977 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 425e77ec23730374bbbe2ee01d6e1e7c |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 48a8e5e3f2de1a74889818336559cf4a |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
|
|||
using BossRoom; |
|||
|
|||
|
|||
namespace BossRoomServer |
|||
{ |
|||
class ServerCharSelectBRState : CharSelectBRState |
|||
{ |
|||
// !! STUB CLASS !!
|
|||
// this will be fleshed out with all server-side logic for the character select BossRoom state.
|
|||
|
|||
public override void Destroy() |
|||
{ |
|||
base.Destroy(); |
|||
} |
|||
|
|||
public override void Initialize(BossRoomStateManager manager, Dictionary<string, object> stateParams) |
|||
{ |
|||
base.Initialize(manager, stateParams); |
|||
} |
|||
|
|||
public override void Update() |
|||
{ |
|||
base.Update(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
|
|||
using BossRoom; |
|||
|
|||
namespace BossRoomServer |
|||
{ |
|||
class ServerGameBRState : GameBRState |
|||
{ |
|||
// !! STUB CLASS !!
|
|||
// this will be fleshed out with all server-side logic for the Game BossRoom state.
|
|||
|
|||
public override void Destroy() |
|||
{ |
|||
base.Destroy(); |
|||
} |
|||
|
|||
public override void Initialize(BossRoomStateManager manager, Dictionary<string, object> stateParams ) |
|||
{ |
|||
base.Initialize(manager, stateParams); |
|||
|
|||
//NOTE: it's very important to use MLAPI's scene switching logic, and not switch the scene yourself. If you do,
|
|||
//MLAPI will get confused internally about which scene is active.
|
|||
//MLAPI_WISHLIST: could MLAPI listen to scene change events and then handle the networked switch itself, internally?
|
|||
MLAPI.SceneManagement.NetworkSceneManager.SwitchScene("SampleScene"); |
|||
} |
|||
|
|||
public override void Update() |
|||
{ |
|||
base.Update(); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 43b21ee40bbd5b642a7ba927b1ae59fb |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: aa3c75122fab71d4189f666de0192dc6 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 7ba4a1d598313d94a81a08ceae147b57 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
using MLAPI.Serialization.Pooled; |
|||
|
|||
namespace BossRoom |
|||
{ |
|||
public enum ConnectStatus |
|||
{ |
|||
SUCCESS, //client successfully connected. This may also be a successful reconnect.
|
|||
ESERVERFULL, //can't join, server is already at capacity.
|
|||
EMATCHSTARTED, //can't join, match is already in progress.
|
|||
EUNKNOWN, //can't join, reason unknown.
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// The GameNetHub is the general purpose entry-point for game network messages between the client and server. It is available
|
|||
/// as soon as the initial network connection has completed, and persists across all scenes. Its purpose is to move non-GameObject-specific
|
|||
/// methods between server and client. Generally these have to do with connection, and match end conditions.
|
|||
/// </summary>
|
|||
///
|
|||
/// <remarks
|
|||
/// Why is there a C2S_ConnectFinished event here? How is that different from the "ApprovalCheck" logic that MLAPI optionally runs
|
|||
/// when establishing a new client connection?
|
|||
/// MLAPI's ApprovalCheck logic doesn't offer a way to return rich data. We need to know certain things directly upon logging in, such as
|
|||
/// whether the game-layer even wants us to join (we could fail because the server is full, or some other non network related reason), and also
|
|||
/// what BossRoomState to transition to. We do this with a Custom Named Message, which fires on the server immediately after the approval check delegate
|
|||
/// has run.
|
|||
///
|
|||
/// Why do we need to send a client GUID? What is it? Don't we already have a clientID?
|
|||
/// ClientIDs are assigned on login. If you connect to a server, then your connection drops, and you reconnect, you get a new ClientID. This
|
|||
/// makes it awkward to get back your old character, which the server is going to hold onto for a fixed timeout. To properly reconnect and recover
|
|||
/// your character, you need a persistent identifier for your own client install. We solve that by generating a random GUID and storing it
|
|||
/// in player prefs, so it persists across sessions of the game.
|
|||
/// </remarks>
|
|||
///
|
|||
public class GameNetHub : MonoBehaviour |
|||
{ |
|||
public GameObject NetworkingManagerGO; |
|||
|
|||
private BossRoomClient.ClientGNHLogic m_ClientLogic; |
|||
private BossRoomServer.ServerGNHLogic m_ServerLogic; |
|||
|
|||
public MLAPI.NetworkingManager NetManager { get; private set; } |
|||
|
|||
// Start is called before the first frame update
|
|||
void Start() |
|||
{ |
|||
Object.DontDestroyOnLoad(this.gameObject); |
|||
|
|||
NetManager = NetworkingManagerGO.GetComponent<MLAPI.NetworkingManager>(); |
|||
|
|||
//because we are not a true NetworkedBehavior, we don't get NetworkStart messages. But we still need to run at that point
|
|||
//where we know if we're a host or client. So we fake a "NetworkingManager.OnNetworkStarted" event out of the existing OnServerStarted
|
|||
//and OnClientConnectedCallback events.
|
|||
//FIXME_DMW could this be improved?
|
|||
NetManager.OnServerStarted += () => |
|||
{ |
|||
NetworkStart(); |
|||
}; |
|||
NetManager.OnClientConnectedCallback += (clientId) => |
|||
{ |
|||
if (clientId == NetManager.LocalClientId) |
|||
{ |
|||
NetworkStart(); |
|||
} |
|||
}; |
|||
} |
|||
|
|||
private void RegisterClientMessageHandlers() |
|||
{ |
|||
MLAPI.Messaging.CustomMessagingManager.RegisterNamedMessageHandler("S2C_ConnectResult", (senderClientId, stream) => |
|||
{ |
|||
using (PooledBitReader reader = PooledBitReader.Get(stream)) |
|||
{ |
|||
ConnectStatus status = (ConnectStatus)reader.ReadInt32(); |
|||
BossRoomState state = (BossRoomState)reader.ReadInt32(); |
|||
m_ClientLogic.RecvConnectFinished(status, state); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
private void RegisterServerMessageHandlers() |
|||
{ |
|||
//TODO: plug in any C->S message handlers here.
|
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// This method runs when NetworkingManager has started up (following a succesful connect on the client, or directly after StartHost is invoked
|
|||
/// on the host). It is named to match NetworkedBehaviour.NetworkStart, and serves the same role, even though GameNetHub itself isn't a NetworkedBehaviour.
|
|||
/// </summary>
|
|||
public void NetworkStart() |
|||
{ |
|||
if (NetManager.IsClient) |
|||
{ |
|||
m_ClientLogic = new BossRoomClient.ClientGNHLogic(this); |
|||
RegisterClientMessageHandlers(); |
|||
} |
|||
if ( NetManager.IsServer ) |
|||
{ |
|||
m_ServerLogic = new BossRoomServer.ServerGNHLogic(this); |
|||
RegisterServerMessageHandlers(); |
|||
} |
|||
if( NetManager.IsHost ) |
|||
{ |
|||
//special host code. This is what kicks off the flow that happens on a regular client
|
|||
//when it has finished connecting successfully. A dedicated server would remove this.
|
|||
m_ClientLogic.RecvConnectFinished(ConnectStatus.SUCCESS, BossRoomState.CHARSELECT); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Wraps the invocation of NetworkingManager.StartClient, including our GUID as the payload.
|
|||
/// </summary>
|
|||
/// <param name="ipaddress">the IP address of the host to connect to. (IPV4 only)</param>
|
|||
/// <param name="port">The port of the host to connect to. </param>
|
|||
public void StartClient(string ipaddress, int port) |
|||
{ |
|||
BossRoomClient.ClientGNHLogic.StartClient(this, ipaddress, port); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Wraps the invocation of NetworkingManager.StartHost.
|
|||
/// </summary>
|
|||
/// <param name="ipaddress">The IP address of the network interface we should listen to connections on. (IPV4 only)</param>
|
|||
/// <param name="port">The port we should listen on. </param>
|
|||
public void StartHost(string ipaddress, int port ) |
|||
{ |
|||
BossRoomServer.ServerGNHLogic.StartHost(this, ipaddress, port); |
|||
} |
|||
|
|||
//Server->Client RPCs
|
|||
|
|||
public void S2C_ConnectResult( ulong netId, ConnectStatus status, BossRoomState targetState ) |
|||
{ |
|||
using (PooledBitStream stream = PooledBitStream.Get()) |
|||
{ |
|||
using (PooledBitWriter writer = PooledBitWriter.Get(stream)) |
|||
{ |
|||
writer.WriteInt32((int)status); |
|||
writer.WriteInt32((int)targetState); |
|||
MLAPI.Messaging.CustomMessagingManager.SendNamedMessage("S2C_ConnectResult", netId, stream, "MLAPI_INTERNAL"); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 3cd90654bfd4b4d448c23aefbf8174ca |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
namespace BossRoom |
|||
{ |
|||
/// <summary>
|
|||
/// enum for the top-level game FSM.
|
|||
/// </summary>
|
|||
public enum BossRoomState |
|||
{ |
|||
NONE, // no state is actively running. Currently this only happens prior to BossRoomStateManager.Start having run.
|
|||
MAINMENU, // main menu logic is running.
|
|||
CHARSELECT, // character select logic is running.
|
|||
GAME, // core game logic is running.
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// The BossRoomStateManager manages the top-level logic for each gamestate.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// This class is intended as the top-level FSM for the game. Because of that, it runs both before and after
|
|||
/// the time when the client has an active connection to the host.
|
|||
/// On the Host, server and client logic run concurrently (with server logic preceding client on every update tic).
|
|||
/// On the Client, only client logic runs.
|
|||
/// </remarks>
|
|||
public class BossRoomStateManager : MonoBehaviour |
|||
{ |
|||
public GameNetHub NetHub { get; private set; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the active state that BossRoomStateManager is in.
|
|||
/// </summary>
|
|||
public BossRoomState ActiveState |
|||
{ |
|||
get |
|||
{ |
|||
//There is always a client state, and client and server states must always match. See ChangeState.
|
|||
//Note: if converting to a dedicated server, you would need to change this to an #IF BUILD_SERVER #ELSE block
|
|||
//that checked either client or server states. See note in ChangeState about converting to a dedicated server.
|
|||
return m_clientState != null ? m_clientState.State : BossRoomState.NONE; |
|||
} |
|||
} |
|||
|
|||
private IBossRoomState m_serverState; |
|||
private IBossRoomState m_clientState; |
|||
|
|||
/// <summary>
|
|||
/// Transitions from one active state to another. Will no-op if transitioning to the current active state.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// On the Host, Server and Client BossRoomState objects run concurrently. On clients, only the "client" version of each
|
|||
/// state is instantiated, and for a hypothetical dedicated server, only the server object would be instantiated. If you were
|
|||
/// moving to a dedicated server model and stripping out server code from the client, this is one method you would need to change
|
|||
/// (for example by making a client and server factory components that plug themselves into the BossRoomStateManager, and are
|
|||
/// guarded by #IF !BUILD_SERVER or #IF BUILD_SERVER, respectively)
|
|||
/// </remarks>
|
|||
/// <param name="target">the target state to transition to</param>
|
|||
/// <param name="stateParams">Any special parameters to inform the next state about, or null for none.</param>
|
|||
public void ChangeState(BossRoomState target, Dictionary<string,System.Object> stateParams ) |
|||
{ |
|||
if( target == ActiveState ) { return; } |
|||
|
|||
Debug.Log("transitioning from state " + ActiveState + " to " + target); |
|||
|
|||
switch(target) |
|||
{ |
|||
case BossRoomState.NONE: |
|||
{ |
|||
DestroyStates(); |
|||
m_serverState = null; |
|||
m_clientState = null; |
|||
break; |
|||
} |
|||
|
|||
case BossRoomState.MAINMENU: |
|||
{ |
|||
DestroyStates(); |
|||
m_clientState = new BossRoomClient.ClientMainMenuBRState(); |
|||
m_clientState.Initialize(this, stateParams); |
|||
break; |
|||
} |
|||
|
|||
case BossRoomState.CHARSELECT: |
|||
{ |
|||
DestroyStates(); |
|||
|
|||
if( NetHub.NetManager.IsServer ) |
|||
{ |
|||
m_serverState = new BossRoomServer.ServerCharSelectBRState(); |
|||
m_serverState.Initialize(this, stateParams); |
|||
} |
|||
if( NetHub.NetManager.IsClient ) |
|||
{ |
|||
m_clientState = new BossRoomClient.ClientCharSelectBRState(); |
|||
m_clientState.Initialize(this, stateParams); |
|||
} |
|||
|
|||
break; |
|||
} |
|||
|
|||
case BossRoomState.GAME: |
|||
{ |
|||
DestroyStates(); |
|||
|
|||
if( NetHub.NetManager.IsServer ) |
|||
{ |
|||
m_serverState = new BossRoomServer.ServerGameBRState(); |
|||
m_serverState.Initialize(this, stateParams); |
|||
} |
|||
if( NetHub.NetManager.IsClient ) |
|||
{ |
|||
m_clientState = new BossRoomClient.ClientGameBRState(); |
|||
m_clientState.Initialize(this, stateParams); |
|||
} |
|||
|
|||
break; |
|||
} |
|||
|
|||
default: |
|||
throw new System.Exception("unimplemented gamestate detected: " + target); |
|||
} |
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Helper method for ChangeState that destroys the active states if they exist.
|
|||
/// </summary>
|
|||
private void DestroyStates() |
|||
{ |
|||
if (m_serverState != null) { m_serverState.Destroy(); } |
|||
if (m_clientState != null) { m_clientState.Destroy(); } |
|||
m_serverState = null; |
|||
m_clientState = null; |
|||
} |
|||
|
|||
// Start is called before the first frame update
|
|||
void Start() |
|||
{ |
|||
NetHub = this.GetComponent<GameNetHub>(); |
|||
ChangeState(BossRoomState.MAINMENU, null); |
|||
} |
|||
|
|||
// Update is called once per frame
|
|||
void FixedUpdate() |
|||
{ |
|||
if( m_serverState != null ) { m_serverState.Update(); } |
|||
if( m_clientState != null ) { m_clientState.Update(); } |
|||
} |
|||
} |
|||
} |
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: 39332c63269f3f34db37df122adcc57b |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
|
|||
using BossRoom; |
|||
|
|||
|
|||
namespace BossRoom |
|||
{ |
|||
/// <summary>
|
|||
/// The BossRoomState that runs during Character Select.
|
|||
/// </summary>
|
|||
class CharSelectBRState : IBossRoomState |
|||
{ |
|||
protected BossRoomStateManager m_manager; |
|||
|
|||
public BossRoomState State { get { return BossRoomState.CHARSELECT; } } |
|||
|
|||
public virtual void Destroy() |
|||
{ |
|||
} |
|||
|
|||
public virtual void Initialize(BossRoomStateManager manager, Dictionary<string, object> stateParams) |
|||
{ |
|||
m_manager = manager; |
|||
} |
|||
|
|||
public virtual void Update() |
|||
{ |
|||
//FIXME_DMW (temp): as we don't have a CharacterSelect scene yet, we just advance directly to the Game state.
|
|||
m_manager.ChangeState(BossRoomState.GAME, null); |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: fe598b22e9599b540a40723c8d48686a |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 19b55cfbf40aa244f9bd90143d441ee4 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
namespace BossRoom |
|||
{ |
|||
/// <summary>
|
|||
/// Interface that models a single state of the BossRoom game. See BossRoomStateManager for more information.
|
|||
/// </summary>
|
|||
interface IBossRoomState |
|||
{ |
|||
/// <summary>
|
|||
/// Called when this BossRoomState is transitioned to.
|
|||
/// <param name="stateParams"/>optional dictionary of parameters to be used by the new gamestate. </param>
|
|||
/// </summary>
|
|||
void Initialize( BossRoomStateManager manager, Dictionary<string,System.Object> stateParams=null ); |
|||
|
|||
/// <summary>
|
|||
/// Called once per Update by the BossRoomStateManager.
|
|||
/// </summary>
|
|||
void Update(); |
|||
|
|||
/// <summary>
|
|||
/// Called when this BossRoomState ends.
|
|||
/// </summary>
|
|||
void Destroy(); |
|||
|
|||
/// <summary>
|
|||
/// What BossRoomState this object represents.
|
|||
/// </summary>
|
|||
BossRoomState State { get; } |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: d6956349616d0304abbd589d59a797f5 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
|
|||
using UnityEngine; |
|||
|
|||
using BossRoom; |
|||
|
|||
namespace BossRoom |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// The BossRoomState that runs during primary gameplay.
|
|||
/// </summary>
|
|||
class GameBRState : IBossRoomState |
|||
{ |
|||
protected BossRoomStateManager m_manager; |
|||
|
|||
public BossRoomState State { get { return BossRoomState.GAME; } } |
|||
|
|||
//!! STUB !! will be filled out with any gamestate logic shared between server and client.
|
|||
|
|||
public virtual void Destroy() |
|||
{ |
|||
} |
|||
|
|||
public virtual void Initialize(BossRoomStateManager manager, Dictionary<string, object> stateParams) |
|||
{ |
|||
m_manager = manager; |
|||
} |
|||
|
|||
public virtual void Update() |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|
|||
using MLAPI; |
|||
using UnityEngine; |
|||
|
|||
[DefaultExecutionOrder(100)] |
|||
public class SimulationManager : MonoBehaviour |
|||
{ |
|||
public static SimulationManager Singleton { get; private set; } |
|||
|
|||
public delegate void SimulationUpdateDelegate(float time, float deltaTime); |
|||
|
|||
/// <summary>
|
|||
/// Main game simulation such as processing inputs, running AI, ticking state machines etc. An event is definitely not what we want to use because we have no order, but FixedUpdate isn't as well.
|
|||
/// </summary>
|
|||
|
|||
public event SimulationUpdateDelegate OnSimulationUpdate; |
|||
/// <summary>
|
|||
/// Called after simulation is done replicate game state such as positions to the client.
|
|||
/// </summary>
|
|||
public event SimulationUpdateDelegate OnSyncNetworkEvents; |
|||
|
|||
[SerializeField] |
|||
private int tickRate = 20; |
|||
|
|||
private float _networkTickDelta; |
|||
private float _lastNetworkTickTime; |
|||
|
|||
private void OnEnable() |
|||
{ |
|||
Singleton = this; |
|||
_networkTickDelta = 1f / tickRate; |
|||
} |
|||
|
|||
|
|||
// Update is called once per frame
|
|||
void Update() |
|||
{ |
|||
|
|||
// The goal here is to sync this up with MLAPIs synchronization but the current network tick model in MLAPI is broken.
|
|||
while (NetworkingManager.Singleton.NetworkTime - _lastNetworkTickTime >= _networkTickDelta) |
|||
{ |
|||
_lastNetworkTickTime += _networkTickDelta; |
|||
|
|||
Physics.Simulate(_networkTickDelta); |
|||
OnSimulationUpdate?.Invoke(_lastNetworkTickTime,_networkTickDelta); |
|||
|
|||
OnSyncNetworkEvents?.Invoke(_lastNetworkTickTime, _networkTickDelta); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 3e6c31da8c35c2743b0311f50e3e1a69 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
Changelog |
|||
All notable changes to this package will be documented in this file. The format is based on Keep a Changelog |
|||
|
|||
[0.0.1-preview.1] - 2020-10-05 |
|||
This is the first release of Enet MLAPI Package |
|
|||
fileFormatVersion: 2 |
|||
guid: 9d6ccdb72b9b37548a841fcc1c4dee76 |
|||
TextScriptImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
Photon Realtime transport for MLAPI |
|||
|
|||
|
|||
--- |
|||
We do NOT have a license for the photon source so keep this internal. |
|||
|
|||
Original `license.txt` in the realtime sdk: |
|||
See the License Agreement at |
|||
https://www.photonengine.com/terms |
|
|||
fileFormatVersion: 2 |
|||
guid: ea5e2ac1b219ffb428dc8f61477267d2 |
|||
TextScriptImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: caaee5b70b02eae44b04ad8149d1ba63 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: ef193029478e7d84692c98b909eaaa00 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 02fbda138c6cf9143aacd0267c5db552 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 29466ff33d534e74baaef92e3459e59f |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// ----------------------------------------------------------------------------------------------------------------------
|
|||
// <summary>The Photon Chat Api enables clients to connect to a chat server and communicate with other clients.</summary>
|
|||
// <remarks>ChannelCreationOptions is a parameter used when subscribing to a public channel for the first time.</remarks>
|
|||
// <copyright company="Exit Games GmbH">Photon Chat Api - Copyright (C) 2018 Exit Games GmbH</copyright>
|
|||
// ----------------------------------------------------------------------------------------------------------------------
|
|||
|
|||
namespace Photon.Chat |
|||
{ |
|||
public class ChannelCreationOptions |
|||
{ |
|||
/// <summary>Default values of channel creation options.</summary>
|
|||
public static ChannelCreationOptions Default = new ChannelCreationOptions(); |
|||
/// <summary>Whether or not the channel to be created will allow client to keep a list of users.</summary>
|
|||
public bool PublishSubscribers { get; set; } |
|||
/// <summary>Limit of the number of users subscribed to the channel to be created.</summary>
|
|||
public int MaxSubscribers { get; set; } |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 8f478e74d7c37554ea2edebe1300c2f9 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// ----------------------------------------------------------------------------------------------------------------------
|
|||
// <summary>The Photon Chat Api enables clients to connect to a chat server and communicate with other clients.</summary>
|
|||
// <remarks>ChannelWellKnownProperties contains the list of well-known channel properties.</remarks>
|
|||
// <copyright company="Exit Games GmbH">Photon Chat Api - Copyright (C) 2018 Exit Games GmbH</copyright>
|
|||
// ----------------------------------------------------------------------------------------------------------------------
|
|||
|
|||
namespace Photon.Chat |
|||
{ |
|||
public class ChannelWellKnownProperties |
|||
{ |
|||
public const byte MaxSubscribers = 255; |
|||
public const byte PublishSubscribers = 254; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 9ff211198d3295e4ca2a4fa56babeb3a |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// ----------------------------------------------------------------------------------------------------------------------
|
|||
// <summary>The Photon Chat Api enables clients to connect to a chat server and communicate with other clients.</summary>
|
|||
// <remarks>ChatClient is the main class of this api.</remarks>
|
|||
// <copyright company="Exit Games GmbH">Photon Chat Api - Copyright (C) 2014 Exit Games GmbH</copyright>
|
|||
// ----------------------------------------------------------------------------------------------------------------------
|
|||
|
|||
#if UNITY_4_7 || UNITY_5 || UNITY_5_3_OR_NEWER
|
|||
#define SUPPORTED_UNITY
|
|||
#endif
|
|||
|
|||
namespace Photon.Chat |
|||
{ |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
#if SUPPORTED_UNITY || NETFX_CORE
|
|||
using Hashtable = ExitGames.Client.Photon.Hashtable; |
|||
using SupportClass = ExitGames.Client.Photon.SupportClass; |
|||
#endif
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// A channel of communication in Photon Chat, updated by ChatClient and provided as READ ONLY.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// Contains messages and senders to use (read!) and display by your GUI.
|
|||
/// Access these by:
|
|||
/// ChatClient.PublicChannels
|
|||
/// ChatClient.PrivateChannels
|
|||
/// </remarks>
|
|||
public class ChatChannel |
|||
{ |
|||
/// <summary>Name of the channel (used to subscribe and unsubscribe).</summary>
|
|||
public readonly string Name; |
|||
|
|||
/// <summary>Senders of messages in chronological order. Senders and Messages refer to each other by index. Senders[x] is the sender of Messages[x].</summary>
|
|||
public readonly List<string> Senders = new List<string>(); |
|||
|
|||
/// <summary>Messages in chronological order. Senders and Messages refer to each other by index. Senders[x] is the sender of Messages[x].</summary>
|
|||
public readonly List<object> Messages = new List<object>(); |
|||
|
|||
/// <summary>If greater than 0, this channel will limit the number of messages, that it caches locally.</summary>
|
|||
public int MessageLimit; |
|||
|
|||
/// <summary>Unique channel ID.</summary>
|
|||
public int ChannelID; |
|||
|
|||
/// <summary>Is this a private 1:1 channel?</summary>
|
|||
public bool IsPrivate { get; protected internal set; } |
|||
|
|||
/// <summary>Count of messages this client still buffers/knows for this channel.</summary>
|
|||
public int MessageCount { get { return this.Messages.Count; } } |
|||
|
|||
/// <summary>
|
|||
/// ID of the last message received.
|
|||
/// </summary>
|
|||
public int LastMsgId { get; protected set; } |
|||
|
|||
private Dictionary<object, object> properties; |
|||
|
|||
/// <summary>Whether or not this channel keeps track of the list of its subscribers.</summary>
|
|||
public bool PublishSubscribers { get; protected set; } |
|||
|
|||
/// <summary>Maximum number of channel subscribers. 0 means infinite.</summary>
|
|||
public int MaxSubscribers { get; protected set; } |
|||
|
|||
/// <summary>Subscribed users.</summary>
|
|||
public readonly HashSet<string> Subscribers = new HashSet<string>(); |
|||
|
|||
/// <summary>Used internally to create new channels. This does NOT create a channel on the server! Use ChatClient.Subscribe.</summary>
|
|||
public ChatChannel(string name) |
|||
{ |
|||
this.Name = name; |
|||
} |
|||
|
|||
public bool TryGetProperty(string key, out object value) |
|||
{ |
|||
if (properties == null) |
|||
{ |
|||
value = default(object); |
|||
return false; |
|||
} |
|||
|
|||
return properties.TryGetValue(key, out value); |
|||
} |
|||
|
|||
/// <summary>Used internally to add messages to this channel.</summary>
|
|||
public void Add(string sender, object message, int msgId) |
|||
{ |
|||
this.Senders.Add(sender); |
|||
this.Messages.Add(message); |
|||
this.LastMsgId = msgId; |
|||
this.TruncateMessages(); |
|||
} |
|||
|
|||
/// <summary>Used internally to add messages to this channel.</summary>
|
|||
public void Add(string[] senders, object[] messages, int lastMsgId) |
|||
{ |
|||
this.Senders.AddRange(senders); |
|||
this.Messages.AddRange(messages); |
|||
this.LastMsgId = lastMsgId; |
|||
this.TruncateMessages(); |
|||
} |
|||
|
|||
/// <summary>Reduces the number of locally cached messages in this channel to the MessageLimit (if set).</summary>
|
|||
public void TruncateMessages() |
|||
{ |
|||
if (this.MessageLimit <= 0 || this.Messages.Count <= this.MessageLimit) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
int excessCount = this.Messages.Count - this.MessageLimit; |
|||
this.Senders.RemoveRange(0, excessCount); |
|||
this.Messages.RemoveRange(0, excessCount); |
|||
} |
|||
|
|||
/// <summary>Clear the local cache of messages currently stored. This frees memory but doesn't affect the server.</summary>
|
|||
public void ClearMessages() |
|||
{ |
|||
this.Senders.Clear(); |
|||
this.Messages.Clear(); |
|||
} |
|||
|
|||
/// <summary>Provides a string-representation of all messages in this channel.</summary>
|
|||
/// <returns>All known messages in format "Sender: Message", line by line.</returns>
|
|||
public string ToStringMessages() |
|||
{ |
|||
StringBuilder txt = new StringBuilder(); |
|||
for (int i = 0; i < this.Messages.Count; i++) |
|||
{ |
|||
txt.AppendLine(string.Format("{0}: {1}", this.Senders[i], this.Messages[i])); |
|||
} |
|||
return txt.ToString(); |
|||
} |
|||
|
|||
internal void ReadProperties(Dictionary<object, object> newProperties) |
|||
{ |
|||
if (newProperties != null && newProperties.Count > 0) |
|||
{ |
|||
if (this.properties == null) |
|||
{ |
|||
this.properties = new Dictionary<object, object>(newProperties.Count); |
|||
} |
|||
foreach (var k in newProperties.Keys) |
|||
{ |
|||
if (newProperties[k] == null) |
|||
{ |
|||
if (this.properties.ContainsKey(k)) |
|||
{ |
|||
this.properties.Remove(k); |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
this.properties[k] = newProperties[k]; |
|||
} |
|||
} |
|||
object temp; |
|||
if (this.properties.TryGetValue(ChannelWellKnownProperties.PublishSubscribers, out temp)) |
|||
{ |
|||
this.PublishSubscribers = (bool)temp; |
|||
} |
|||
if (this.properties.TryGetValue(ChannelWellKnownProperties.MaxSubscribers, out temp)) |
|||
{ |
|||
this.MaxSubscribers = (int)temp; |
|||
} |
|||
} |
|||
} |
|||
|
|||
internal void AddSubscribers(string[] users) |
|||
{ |
|||
if (users == null) |
|||
{ |
|||
return; |
|||
} |
|||
for (int i = 0; i < users.Length; i++) |
|||
{ |
|||
this.Subscribers.Add(users[i]); |
|||
} |
|||
} |
|||
|
|||
internal void ClearProperties() |
|||
{ |
|||
if (this.properties != null && this.properties.Count > 0) |
|||
{ |
|||
this.properties.Clear(); |
|||
} |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: d84ef73471cfacf4daee3a333fb0039a |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
Packages/com.unity.multiplayer.transport.photon-realtime/Runtime/Photon/PhotonChat/Code/ChatClient.cs
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 3dc58b7807acc4d488636fa1d4019f2b |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// ----------------------------------------------------------------------------------------------------------------------
|
|||
// <summary>The Photon Chat Api enables clients to connect to a chat server and communicate with other clients.</summary>
|
|||
// <remarks>ChatClient is the main class of this api.</remarks>
|
|||
// <copyright company="Exit Games GmbH">Photon Chat Api - Copyright (C) 2014 Exit Games GmbH</copyright>
|
|||
// ----------------------------------------------------------------------------------------------------------------------
|
|||
|
|||
namespace Photon.Chat |
|||
{ |
|||
/// <summary>Enumeration of causes for Disconnects (used in <see cref="ChatClient.DisconnectedCause"/>).</summary>
|
|||
/// <remarks>Read the individual descriptions to find out what to do about this type of disconnect.</remarks>
|
|||
public enum ChatDisconnectCause |
|||
{ |
|||
/// <summary>No error was tracked.</summary>
|
|||
None, |
|||
/// <summary>OnStatusChanged: The CCUs count of your Photon Server License is exhausted (temporarily).</summary>
|
|||
DisconnectByServerUserLimit, |
|||
/// <summary>OnStatusChanged: The server is not available or the address is wrong. Make sure the port is provided and the server is up.</summary>
|
|||
ExceptionOnConnect, |
|||
/// <summary>OnStatusChanged: The server disconnected this client. Most likely the server's send buffer is full (receiving too much from other clients).</summary>
|
|||
DisconnectByServer, |
|||
/// <summary>OnStatusChanged: This client detected that the server's responses are not received in due time. Maybe you send / receive too much?</summary>
|
|||
TimeoutDisconnect, |
|||
/// <summary>OnStatusChanged: Some internal exception caused the socket code to fail. Contact Exit Games.</summary>
|
|||
Exception, |
|||
/// <summary>OnOperationResponse: Authenticate in the Photon Cloud with invalid AppId. Update your subscription or contact Exit Games.</summary>
|
|||
InvalidAuthentication, |
|||
/// <summary>OnOperationResponse: Authenticate (temporarily) failed when using a Photon Cloud subscription without CCU Burst. Update your subscription.</summary>
|
|||
MaxCcuReached, |
|||
/// <summary>OnOperationResponse: Authenticate when the app's Photon Cloud subscription is locked to some (other) region(s). Update your subscription or change region.</summary>
|
|||
InvalidRegion, |
|||
/// <summary>OnOperationResponse: Operation that's (currently) not available for this client (not authorized usually). Only tracked for op Authenticate.</summary>
|
|||
OperationNotAllowedInCurrentState, |
|||
/// <summary>OnOperationResponse: Authenticate in the Photon Cloud with invalid client values or custom authentication setup in Cloud Dashboard.</summary>
|
|||
CustomAuthenticationFailed, |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: cb82ca173d68bbf45bdc93c4c827d4f2 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// ----------------------------------------------------------------------------------------------------------------------
|
|||
// <summary>The Photon Chat Api enables clients to connect to a chat server and communicate with other clients.</summary>
|
|||
// <remarks>ChatClient is the main class of this api.</remarks>
|
|||
// <copyright company="Exit Games GmbH">Photon Chat Api - Copyright (C) 2014 Exit Games GmbH</copyright>
|
|||
// ----------------------------------------------------------------------------------------------------------------------
|
|||
|
|||
namespace Photon.Chat |
|||
{ |
|||
/// <summary>
|
|||
/// Wraps up internally used constants in Photon Chat events. You don't have to use them directly usually.
|
|||
/// </summary>
|
|||
public class ChatEventCode |
|||
{ |
|||
/// <summary>(0) Event code for messages published in public channels.</summary>
|
|||
public const byte ChatMessages = 0; |
|||
/// <summary>(1) Not Used. </summary>
|
|||
public const byte Users = 1;// List of users or List of changes for List of users
|
|||
/// <summary>(2) Event code for messages published in private channels</summary>
|
|||
public const byte PrivateMessage = 2; |
|||
/// <summary>(3) Not Used. </summary>
|
|||
public const byte FriendsList = 3; |
|||
/// <summary>(4) Event code for status updates. </summary>
|
|||
public const byte StatusUpdate = 4; |
|||
/// <summary>(5) Event code for subscription acks. </summary>
|
|||
public const byte Subscribe = 5; |
|||
/// <summary>(6) Event code for unsubscribe acks. </summary>
|
|||
public const byte Unsubscribe = 6; |
|||
/// <summary>(8) Event code for new user subscription to a channel where <see cref="ChatChannel.PublishSubscribers"/> is enabled. </summary>
|
|||
public const byte UserSubscribed = 8; |
|||
/// <summary>(9) Event code for when user unsubscribes from a channel where <see cref="ChatChannel.PublishSubscribers"/> is enabled. </summary>
|
|||
public const byte UserUnsubscribed = 9; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: b1fd08cfa8721bf4c8ec428885ae1c39 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// ----------------------------------------------------------------------------------------------------------------------
|
|||
// <summary>The Photon Chat Api enables clients to connect to a chat server and communicate with other clients.</summary>
|
|||
// <remarks>ChatClient is the main class of this api.</remarks>
|
|||
// <copyright company="Exit Games GmbH">Photon Chat Api - Copyright (C) 2014 Exit Games GmbH</copyright>
|
|||
// ----------------------------------------------------------------------------------------------------------------------
|
|||
|
|||
namespace Photon.Chat |
|||
{ |
|||
/// <summary>
|
|||
/// Wraps up codes for operations used internally in Photon Chat. You don't have to use them directly usually.
|
|||
/// </summary>
|
|||
public class ChatOperationCode |
|||
{ |
|||
/// <summary>(230) Operation Authenticate.</summary>
|
|||
public const byte Authenticate = 230; |
|||
|
|||
/// <summary>(0) Operation to subscribe to chat channels.</summary>
|
|||
public const byte Subscribe = 0; |
|||
/// <summary>(1) Operation to unsubscribe from chat channels.</summary>
|
|||
public const byte Unsubscribe = 1; |
|||
/// <summary>(2) Operation to publish a message in a chat channel.</summary>
|
|||
public const byte Publish = 2; |
|||
/// <summary>(3) Operation to send a private message to some other user.</summary>
|
|||
public const byte SendPrivate = 3; |
|||
|
|||
/// <summary>(4) Not used yet.</summary>
|
|||
public const byte ChannelHistory = 4; |
|||
|
|||
/// <summary>(5) Set your (client's) status.</summary>
|
|||
public const byte UpdateStatus = 5; |
|||
/// <summary>(6) Add friends the list of friends that should update you of their status.</summary>
|
|||
public const byte AddFriends = 6; |
|||
/// <summary>(7) Remove friends from list of friends that should update you of their status.</summary>
|
|||
public const byte RemoveFriends = 7; |
|||
} |
|||
} |
部分文件因为文件数量过多而无法显示
撰写
预览
正在加载...
取消
保存
Reference in new issue