From a40308bcbc537a73a1ff107447807c66038c353d Mon Sep 17 00:00:00 2001 From: BOTAlex Date: Fri, 9 Feb 2024 04:09:08 +0100 Subject: [PATCH] sync because i forgor :skull: --- Assets/Prefabs/Managers.prefab | 16 +- .../Networked/NetworkPrefabsList.asset | 7 +- .../Prefabs/Networked/NetworkedPlayer.prefab | 618 ++++++++++++++++++ .../Networked/NetworkedPlayer.prefab.meta | 7 + Assets/Prefabs/{Networked => }/Player1.prefab | 0 .../{Networked => }/Player1.prefab.meta | 0 Assets/Prefabs/{Networked => }/Player2.prefab | 0 .../{Networked => }/Player2.prefab.meta | 0 Assets/Scenes/GameScene.unity | 235 ++----- .../Multi-SetupLoad.unity | 66 -- ...PlayerSpawner.cs => NetworkedGameSetup.cs} | 8 +- ...ner.cs.meta => NetworkedGameSetup.cs.meta} | 0 Assets/Scripts/Multiplayer/ZDisablerV2.cs | 40 ++ .../Scripts/Multiplayer/ZDisablerV2.cs.meta | 11 + Assets/Scripts/Multiplayer/ZNGODisabler.cs | 50 ++ .../Scripts/Multiplayer/ZNGODisabler.cs.meta | 11 + 16 files changed, 788 insertions(+), 281 deletions(-) create mode 100644 Assets/Prefabs/Networked/NetworkedPlayer.prefab create mode 100644 Assets/Prefabs/Networked/NetworkedPlayer.prefab.meta rename Assets/Prefabs/{Networked => }/Player1.prefab (100%) rename Assets/Prefabs/{Networked => }/Player1.prefab.meta (100%) rename Assets/Prefabs/{Networked => }/Player2.prefab (100%) rename Assets/Prefabs/{Networked => }/Player2.prefab.meta (100%) rename Assets/Scripts/Multiplayer/{NetworkedPlayerSpawner.cs => NetworkedGameSetup.cs} (86%) rename Assets/Scripts/Multiplayer/{NetworkedPlayerSpawner.cs.meta => NetworkedGameSetup.cs.meta} (100%) create mode 100644 Assets/Scripts/Multiplayer/ZDisablerV2.cs create mode 100644 Assets/Scripts/Multiplayer/ZDisablerV2.cs.meta create mode 100644 Assets/Scripts/Multiplayer/ZNGODisabler.cs create mode 100644 Assets/Scripts/Multiplayer/ZNGODisabler.cs.meta diff --git a/Assets/Prefabs/Managers.prefab b/Assets/Prefabs/Managers.prefab index ad60284..21f8068 100644 --- a/Assets/Prefabs/Managers.prefab +++ b/Assets/Prefabs/Managers.prefab @@ -14,7 +14,6 @@ GameObject: - component: {fileID: 2042633577611342856} - component: {fileID: 1387340064394057177} - component: {fileID: 3147574454562838623} - - component: {fileID: 2416568176804350145} m_Layer: 0 m_Name: Managers m_TagString: Untagged @@ -105,7 +104,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} m_Name: m_EditorClassIdentifier: - GlobalObjectIdHash: 639341465 + GlobalObjectIdHash: 2209800833 AlwaysReplicateAsRoot: 0 SynchronizeTransform: 1 ActiveSceneSynchronization: 0 @@ -113,16 +112,3 @@ MonoBehaviour: SpawnWithObservers: 1 DontDestroyWithOwner: 0 AutoObjectParentSync: 1 ---- !u!114 &2416568176804350145 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 809911508645467208} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7eac85aca6b45da4bbc5cb3d6940523b, type: 3} - m_Name: - m_EditorClassIdentifier: - PlayerPrefab: {fileID: 0} diff --git a/Assets/Prefabs/Networked/NetworkPrefabsList.asset b/Assets/Prefabs/Networked/NetworkPrefabsList.asset index dadf984..e74bc03 100644 --- a/Assets/Prefabs/Networked/NetworkPrefabsList.asset +++ b/Assets/Prefabs/Networked/NetworkPrefabsList.asset @@ -15,12 +15,7 @@ MonoBehaviour: IsDefault: 0 List: - Override: 0 - Prefab: {fileID: 3120938410244321186, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - SourcePrefabToOverride: {fileID: 0} - SourceHashToOverride: 0 - OverridingTargetPrefab: {fileID: 0} - - Override: 0 - Prefab: {fileID: 3120938410244321186, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + Prefab: {fileID: 3120938410244321186, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} SourcePrefabToOverride: {fileID: 0} SourceHashToOverride: 0 OverridingTargetPrefab: {fileID: 0} diff --git a/Assets/Prefabs/Networked/NetworkedPlayer.prefab b/Assets/Prefabs/Networked/NetworkedPlayer.prefab new file mode 100644 index 0000000..57d1349 --- /dev/null +++ b/Assets/Prefabs/Networked/NetworkedPlayer.prefab @@ -0,0 +1,618 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1936012740462134995 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1930891210259786141} + - component: {fileID: 2669453284189978930} + - component: {fileID: 8069942137008974672} + - component: {fileID: 1842047609192968100} + - component: {fileID: 5062989152879916107} + m_Layer: 7 + m_Name: Renderer + m_TagString: Player + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1930891210259786141 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1936012740462134995} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 320690117028550720} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &2669453284189978930 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1936012740462134995} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 1 + m_Sprite: {fileID: 21300000, guid: 5a20c171ff49c2e40a9de6632d3df997, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!95 &8069942137008974672 +Animator: + serializedVersion: 5 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1936012740462134995} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 81c73a7a84f57774a97dd2b42d966d9d, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_StabilizeFeet: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorStateOnDisable: 0 + m_WriteDefaultValuesOnDisable: 0 +--- !u!58 &1842047609192968100 +CircleCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1936012740462134995} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 192 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + serializedVersion: 2 + m_Radius: 0.5 +--- !u!114 &5062989152879916107 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1936012740462134995} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 136b23dbdb54d7f4493b3da7b84f0173, type: 3} + m_Name: + m_EditorClassIdentifier: + body: {fileID: 1508323898269695585} + damageLayers: + serializedVersion: 2 + m_Bits: 1 + speedToDamage: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 10 + value: 0 + inSlope: 16.652266 + outSlope: 16.652266 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0.02691511 + - serializedVersion: 3 + time: 29.937866 + value: 150 + inSlope: 0.82769793 + outSlope: 0.82769793 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.13692878 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + speedYouNeedToNotTakeDamageFromRammingOrSomtmh: 10 +--- !u!1 &2470138561869876166 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5278398606840885145} + - component: {fileID: 647933724824315688} + - component: {fileID: 9130580774853064894} + m_Layer: 0 + m_Name: Canvas + m_TagString: Player + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5278398606840885145 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2470138561869876166} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4334414235280299636} + m_Father: {fileID: 320690117028550720} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 1920, y: 1080} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &647933724824315688 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2470138561869876166} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 0 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &9130580774853064894 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2470138561869876166} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 1 +--- !u!1 &3096169748286405671 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1170758327458850867} + m_Layer: 7 + m_Name: Hand + m_TagString: Player + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1170758327458850867 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3096169748286405671} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.05, y: -0.42, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 320690117028550720} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &3120938410244321186 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 320690117028550720} + - component: {fileID: 651446758998956252} + - component: {fileID: 3086165646112058191} + - component: {fileID: 1508323898269695585} + - component: {fileID: 1949941092232239315} + - component: {fileID: 1449424410418603396} + - component: {fileID: 1160419468000791564} + - component: {fileID: 1294282455099768770} + - component: {fileID: 5998872828059799024} + m_Layer: 7 + m_Name: NetworkedPlayer + m_TagString: Player + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &320690117028550720 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3120938410244321186} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.7082175, y: -0.44170734, z: -0.09089095} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5278398606840885145} + - {fileID: 1930891210259786141} + - {fileID: 1170758327458850867} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &651446758998956252 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3120938410244321186} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3dbdb849a2f5df14d9e109a7776c5ac0, type: 3} + m_Name: + m_EditorClassIdentifier: + animationHandler: {fileID: 0} + moveSpeed: 70 + whipAttack: {fileID: 0} + whipSmashSpeed: 2 + whipSmashDamageMult: 2 + whipMoveSpeed: 25 + maxWhipMoveSpeed: 30 +--- !u!114 &3086165646112058191 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3120938410244321186} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1fdfc885f1a69704b893825cf9e616ba, type: 3} + m_Name: + m_EditorClassIdentifier: + bloodRegen: 1 + regen: 1000 + onlyCallZeroHealthOnce: 1 + maxHealth: 100 + damageTickDelay: 0.25 + OnHealthZero: + m_PersistentCalls: + m_Calls: [] + OnHealthChange: + m_PersistentCalls: + m_Calls: [] + minThreshold: 1 + squezeDamageScalor: 1 +--- !u!50 &1508323898269695585 +Rigidbody2D: + serializedVersion: 4 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3120938410244321186} + m_BodyType: 0 + m_Simulated: 1 + m_UseFullKinematicContacts: 0 + m_UseAutoMass: 0 + m_Mass: 1 + m_LinearDrag: 10 + m_AngularDrag: 0.05 + m_GravityScale: 0 + m_Material: {fileID: 6200000, guid: 7c680ffb793a1f2478e6682c957e4868, type: 2} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_Interpolate: 0 + m_SleepingMode: 1 + m_CollisionDetection: 1 + m_Constraints: 4 +--- !u!114 &1949941092232239315 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3120938410244321186} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: de340bb967770a7499e140a52a287f84, type: 3} + m_Name: + m_EditorClassIdentifier: + playerNumber: 0 + movement: {x: 0, y: 0} + look: {x: 0, y: 0} + whipAttack: 0 + useArrowKeys: 0 +--- !u!114 &1449424410418603396 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3120938410244321186} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6b097a132c072b72fbc7808ebf263e52, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1160419468000791564 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3120938410244321186} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c66441ada081b6c4c841000e83cc2b7a, type: 3} + m_Name: + m_EditorClassIdentifier: + flipTrans: {fileID: 320690117028550720} + body: {fileID: 1508323898269695585} +--- !u!114 &1294282455099768770 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3120938410244321186} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + GlobalObjectIdHash: 4009941625 + AlwaysReplicateAsRoot: 0 + SynchronizeTransform: 1 + ActiveSceneSynchronization: 0 + SceneMigrationSynchronization: 1 + SpawnWithObservers: 1 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 +--- !u!114 &5998872828059799024 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3120938410244321186} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2d19183357399174e9b76aff8bde44d3, type: 3} + m_Name: + m_EditorClassIdentifier: + objectsToDisable: + - {fileID: 1949941092232239315} + - {fileID: 5062989152879916107} +--- !u!1001 &6225877037457186740 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 5278398606840885145} + m_Modifications: + - target: {fileID: 1788304117561062157, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_TagString + value: Player + objectReference: {fileID: 0} + - target: {fileID: 3891416435710064780, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: attachedHealth + value: + objectReference: {fileID: 3086165646112058191} + - target: {fileID: 3891416435710064780, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: disableOnDeath + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5537527563549888860, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_Name + value: HealthBar + objectReference: {fileID: 0} + - target: {fileID: 5537527563549888860, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_TagString + value: Player + objectReference: {fileID: 0} + - target: {fileID: 7075700545869768638, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_Sprite + value: + objectReference: {fileID: 21300000, guid: 714062a6703c86948abaa8b5566e01c1, type: 3} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_SizeDelta.x + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_SizeDelta.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_AnchoredPosition.y + value: 1.54 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7968169009781750056, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + propertyPath: m_TagString + value: Player + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} +--- !u!224 &4334414235280299636 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 7656168731602766272, guid: 0ea0f1215ba49f5448e8e8d60a899fe8, type: 3} + m_PrefabInstance: {fileID: 6225877037457186740} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/Prefabs/Networked/NetworkedPlayer.prefab.meta b/Assets/Prefabs/Networked/NetworkedPlayer.prefab.meta new file mode 100644 index 0000000..c1f2afe --- /dev/null +++ b/Assets/Prefabs/Networked/NetworkedPlayer.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 29c8b8bbcf7287b4eb597729b2e0c9f9 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Networked/Player1.prefab b/Assets/Prefabs/Player1.prefab similarity index 100% rename from Assets/Prefabs/Networked/Player1.prefab rename to Assets/Prefabs/Player1.prefab diff --git a/Assets/Prefabs/Networked/Player1.prefab.meta b/Assets/Prefabs/Player1.prefab.meta similarity index 100% rename from Assets/Prefabs/Networked/Player1.prefab.meta rename to Assets/Prefabs/Player1.prefab.meta diff --git a/Assets/Prefabs/Networked/Player2.prefab b/Assets/Prefabs/Player2.prefab similarity index 100% rename from Assets/Prefabs/Networked/Player2.prefab rename to Assets/Prefabs/Player2.prefab diff --git a/Assets/Prefabs/Networked/Player2.prefab.meta b/Assets/Prefabs/Player2.prefab.meta similarity index 100% rename from Assets/Prefabs/Networked/Player2.prefab.meta rename to Assets/Prefabs/Player2.prefab.meta diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity index 78850bc..3922c70 100644 --- a/Assets/Scenes/GameScene.unity +++ b/Assets/Scenes/GameScene.unity @@ -728,7 +728,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!1001 &869964773 +--- !u!1001 &820004546 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 @@ -736,89 +736,59 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} propertyPath: m_LocalPosition.x - value: -1.42 + value: 0 objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} propertyPath: m_LocalPosition.y - value: -19.97 + value: 0 objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} + - target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 3086165646112058191, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} - propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.data[0].m_Target - value: - objectReference: {fileID: 652688744} - - target: {fileID: 3120938410244321186, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} - propertyPath: m_Name - value: Player2 + - target: {fileID: 1294282455099768770, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} + propertyPath: GlobalObjectIdHash + value: 686008210 + objectReference: {fileID: 0} + - target: {fileID: 3120938410244321186, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} + propertyPath: m_Name + value: NetworkedPlayer objectReference: {fileID: 0} - - target: {fileID: 5108819328747686001, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} - propertyPath: rope - value: - objectReference: {fileID: 1920006248} - - target: {fileID: 7071433868121438663, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} - propertyPath: otherPlayerAttack - value: - objectReference: {fileID: 1232208433} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} ---- !u!114 &869964774 stripped -MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 7071433868121438663, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} - m_PrefabInstance: {fileID: 869964773} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1579580564} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b69b92d72c7244443854899c4b700d9c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &869964775 stripped -MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 5467488512035376674, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} - m_PrefabInstance: {fileID: 869964773} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1579580564} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4aabce12c1341ff488ee4dc806fd80e8, type: 3} - m_Name: - m_EditorClassIdentifier: + m_SourcePrefab: {fileID: 100100000, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3} --- !u!1 &941230147 GameObject: m_ObjectHideFlags: 0 @@ -1071,11 +1041,6 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!4 &1194834060 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 320690117028550720, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} - m_PrefabInstance: {fileID: 869964773} - m_PrefabAsset: {fileID: 0} --- !u!1 &1228272672 GameObject: m_ObjectHideFlags: 0 @@ -1160,118 +1125,6 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!1001 &1232208432 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - propertyPath: m_LocalPosition.x - value: -20.81614 - objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - propertyPath: m_LocalPosition.y - value: -19.089561 - objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1749848915408613053, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - propertyPath: otherPlayerAttack - value: - objectReference: {fileID: 869964774} - - target: {fileID: 3086165646112058191, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.data[0].m_Target - value: - objectReference: {fileID: 652688744} - - target: {fileID: 3120938410244321186, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - propertyPath: m_Name - value: Player1 - objectReference: {fileID: 0} - - target: {fileID: 3389629528887116870, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - propertyPath: rope - value: - objectReference: {fileID: 1920006248} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} ---- !u!114 &1232208433 stripped -MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 1749848915408613053, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - m_PrefabInstance: {fileID: 1232208432} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1254139629} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b69b92d72c7244443854899c4b700d9c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &1232208436 stripped -MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 5467488512035376674, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - m_PrefabInstance: {fileID: 1232208432} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1254139629} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4aabce12c1341ff488ee4dc806fd80e8, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!4 &1232208440 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - m_PrefabInstance: {fileID: 1232208432} - m_PrefabAsset: {fileID: 0} ---- !u!1 &1254139629 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 3120938410244321186, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - m_PrefabInstance: {fileID: 1232208432} - m_PrefabAsset: {fileID: 0} ---- !u!114 &1254139639 stripped -MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 1449424410418603396, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - m_PrefabInstance: {fileID: 1232208432} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1254139629} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6b097a132c072b72fbc7808ebf263e52, type: 3} - m_Name: - m_EditorClassIdentifier: --- !u!1 &1282889729 GameObject: m_ObjectHideFlags: 0 @@ -3625,22 +3478,24 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1579580564 stripped +--- !u!1 &1566837117 stripped GameObject: - m_CorrespondingSourceObject: {fileID: 3120938410244321186, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} - m_PrefabInstance: {fileID: 869964773} + m_CorrespondingSourceObject: {fileID: 809911508645467208, guid: ec5007446d8bbca48bf02b3a7e752da1, type: 3} + m_PrefabInstance: {fileID: 1683288374126251321} m_PrefabAsset: {fileID: 0} ---- !u!114 &1579580574 stripped +--- !u!114 &1566837126 MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 7729933180365677331, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} - m_PrefabInstance: {fileID: 869964773} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1579580564} + m_GameObject: {fileID: 1566837117} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6b097a132c072b72fbc7808ebf263e52, type: 3} + m_Script: {fileID: 11500000, guid: 42a55d924c00a4749b9c44597675fd36, type: 3} m_Name: m_EditorClassIdentifier: + PlayerPrefab: {fileID: 0} --- !u!1 &1600052931 GameObject: m_ObjectHideFlags: 0 @@ -3832,7 +3687,10 @@ PrefabInstance: m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 809911508645467208, guid: ec5007446d8bbca48bf02b3a7e752da1, type: 3} + insertIndex: -1 + addedObject: {fileID: 1566837126} m_SourcePrefab: {fileID: 100100000, guid: ec5007446d8bbca48bf02b3a7e752da1, type: 3} --- !u!1001 &4158834148864819266 PrefabInstance: @@ -3857,11 +3715,11 @@ PrefabInstance: - target: {fileID: 2458716502903188221, guid: 48e0e53445d42474895d37a321c39d1c, type: 3} propertyPath: player1 value: - objectReference: {fileID: 1254139629} + objectReference: {fileID: 0} - target: {fileID: 2458716502903188221, guid: 48e0e53445d42474895d37a321c39d1c, type: 3} propertyPath: player2 value: - objectReference: {fileID: 1579580564} + objectReference: {fileID: 0} - target: {fileID: 2458716502903188221, guid: 48e0e53445d42474895d37a321c39d1c, type: 3} propertyPath: bloodManager value: @@ -4010,11 +3868,11 @@ PrefabInstance: - target: {fileID: 7717684785049474632, guid: 0248db69242a3dd47898c6742b6c9f60, type: 3} propertyPath: end value: - objectReference: {fileID: 869964775} + objectReference: {fileID: 0} - target: {fileID: 7717684785049474632, guid: 0248db69242a3dd47898c6742b6c9f60, type: 3} propertyPath: start value: - objectReference: {fileID: 1232208436} + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] @@ -4031,19 +3889,19 @@ PrefabInstance: - target: {fileID: 3401975006071930001, guid: c53e6971c95afb1429cd82616a7b6737, type: 3} propertyPath: m_Targets.Array.data[0].target value: - objectReference: {fileID: 1232208440} + objectReference: {fileID: 0} - target: {fileID: 3401975006071930001, guid: c53e6971c95afb1429cd82616a7b6737, type: 3} propertyPath: m_Targets.Array.data[1].target value: - objectReference: {fileID: 1194834060} + objectReference: {fileID: 0} - target: {fileID: 3603265075407754381, guid: c53e6971c95afb1429cd82616a7b6737, type: 3} propertyPath: players.Array.data[0] value: - objectReference: {fileID: 1254139629} + objectReference: {fileID: 0} - target: {fileID: 3603265075407754381, guid: c53e6971c95afb1429cd82616a7b6737, type: 3} propertyPath: players.Array.data[1] value: - objectReference: {fileID: 1579580564} + objectReference: {fileID: 0} - target: {fileID: 5959206239141280122, guid: c53e6971c95afb1429cd82616a7b6737, type: 3} propertyPath: m_LocalPosition.x value: 0 @@ -4833,11 +4691,11 @@ PrefabInstance: - target: {fileID: 4056614590725156132, guid: a99c6b890ab711f4faebdfd6335c5f16, type: 3} propertyPath: mop1 value: - objectReference: {fileID: 1254139639} + objectReference: {fileID: 0} - target: {fileID: 4056614590725156132, guid: a99c6b890ab711f4faebdfd6335c5f16, type: 3} propertyPath: mop2 value: - objectReference: {fileID: 1579580574} + objectReference: {fileID: 0} - target: {fileID: 6363525508243884259, guid: a99c6b890ab711f4faebdfd6335c5f16, type: 3} propertyPath: m_LocalPosition.x value: 0 @@ -4892,8 +4750,6 @@ SceneRoots: - {fileID: 1600052934} - {fileID: 480860136} - {fileID: 150061137} - - {fileID: 1232208432} - - {fileID: 869964773} - {fileID: 4910321061857220295} - {fileID: 8530121857647845872} - {fileID: 5796191506433166633} @@ -4901,3 +4757,4 @@ SceneRoots: - {fileID: 1481267923} - {fileID: 65889293} - {fileID: 652688745} + - {fileID: 820004546} diff --git a/Assets/Scenes/MultiplayerTestingScenes/Multi-SetupLoad.unity b/Assets/Scenes/MultiplayerTestingScenes/Multi-SetupLoad.unity index 0d82d6d..46957f4 100644 --- a/Assets/Scenes/MultiplayerTestingScenes/Multi-SetupLoad.unity +++ b/Assets/Scenes/MultiplayerTestingScenes/Multi-SetupLoad.unity @@ -364,71 +364,6 @@ MonoBehaviour: SteamBtn: {fileID: 72056934} ButtonsHolder: {fileID: 602651291} LoadingText: {fileID: 784252204} ---- !u!1 &361110443 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 361110445} - - component: {fileID: 361110444} - - component: {fileID: 361110446} - m_Layer: 0 - m_Name: PlayerSpawner - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &361110444 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 361110443} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 72f69be188e3b8b44bacd5ddc0feabef, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!4 &361110445 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 361110443} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 426.1242, y: 127.288666, z: -216.60748} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &361110446 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 361110443} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} - m_Name: - m_EditorClassIdentifier: - GlobalObjectIdHash: 322881486 - AlwaysReplicateAsRoot: 0 - SynchronizeTransform: 1 - ActiveSceneSynchronization: 0 - SceneMigrationSynchronization: 1 - SpawnWithObservers: 1 - DontDestroyWithOwner: 0 - AutoObjectParentSync: 1 --- !u!1 &440441323 GameObject: m_ObjectHideFlags: 0 @@ -1433,7 +1368,6 @@ SceneRoots: m_Roots: - {fileID: 1806809595} - {fileID: 450402328} - - {fileID: 361110445} - {fileID: 1029836803} - {fileID: 1886719421} - {fileID: 162513277} diff --git a/Assets/Scripts/Multiplayer/NetworkedPlayerSpawner.cs b/Assets/Scripts/Multiplayer/NetworkedGameSetup.cs similarity index 86% rename from Assets/Scripts/Multiplayer/NetworkedPlayerSpawner.cs rename to Assets/Scripts/Multiplayer/NetworkedGameSetup.cs index bfb0100..7fc6cca 100644 --- a/Assets/Scripts/Multiplayer/NetworkedPlayerSpawner.cs +++ b/Assets/Scripts/Multiplayer/NetworkedGameSetup.cs @@ -5,17 +5,13 @@ using Unity.Netcode; using UnityEngine; using UnityEngine.SceneManagement; -public class NetworkedPlayerSpawner : NetworkBehaviour +public class NetworkedGameSetup : NetworkBehaviour { [SerializeField] private GameObject PlayerPrefab; private void Start() { DontDestroyOnLoad(this); - } - - public override void OnNetworkSpawn() - { NetworkManager.Singleton.SceneManager.OnLoadEventCompleted += SceneLoaded; } @@ -29,5 +25,7 @@ public class NetworkedPlayerSpawner : NetworkBehaviour player.GetComponent().SpawnAsPlayerObject(clientsCompleted[i], true); } } + + NetworkManager.Singleton.SceneManager.OnLoadEventCompleted -= SceneLoaded; } } diff --git a/Assets/Scripts/Multiplayer/NetworkedPlayerSpawner.cs.meta b/Assets/Scripts/Multiplayer/NetworkedGameSetup.cs.meta similarity index 100% rename from Assets/Scripts/Multiplayer/NetworkedPlayerSpawner.cs.meta rename to Assets/Scripts/Multiplayer/NetworkedGameSetup.cs.meta diff --git a/Assets/Scripts/Multiplayer/ZDisablerV2.cs b/Assets/Scripts/Multiplayer/ZDisablerV2.cs new file mode 100644 index 0000000..c0c9f8c --- /dev/null +++ b/Assets/Scripts/Multiplayer/ZDisablerV2.cs @@ -0,0 +1,40 @@ +using System.Collections; +using System.Collections.Generic; +using Unity.Netcode; +using UnityEngine; + +public class ZDisablerV2 : NetworkBehaviour +{ + [Tooltip("Add all the objects to disable on join, if not owner")] + public UnityEngine.Object[] objectsToDisable; + + private void OnEnable() + { + // Run if networked + if (NetworkManager.Singleton == null || IsOwner) return; + + for (int i = 0; i < objectsToDisable.Length; i++) + { + var objectType = objectsToDisable[i]; // Apparently, "typeof" is not needed /shrug + + switch (objectType) + { + case MonoBehaviour monoBehaviour: + monoBehaviour.enabled = false; + break; + + case GameObject gameObject: + gameObject.SetActive(false); + break; + + case Rigidbody rigidbody: + rigidbody.isKinematic = true; + break; + + default: + Debug.LogError($"Can't disable: {objectType.name} (not supported)", objectType); + break; + } + } + } +} diff --git a/Assets/Scripts/Multiplayer/ZDisablerV2.cs.meta b/Assets/Scripts/Multiplayer/ZDisablerV2.cs.meta new file mode 100644 index 0000000..e243324 --- /dev/null +++ b/Assets/Scripts/Multiplayer/ZDisablerV2.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2d19183357399174e9b76aff8bde44d3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Multiplayer/ZNGODisabler.cs b/Assets/Scripts/Multiplayer/ZNGODisabler.cs new file mode 100644 index 0000000..ff89d59 --- /dev/null +++ b/Assets/Scripts/Multiplayer/ZNGODisabler.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using Unity.Netcode; +using Unity.Netcode.Components; +using UnityEngine; + + +/// +/// [Netcode for gameobjects] This is used for disabling components/objects depending on is host/server/client. +/// +public class ZNGODisabler : NetworkBehaviour +{ + [SerializeField] private bool RunOnAwake = true; + [Space(10)] + + [Tooltip("Add all the objects to disable on join")] + public UnityEngine.Object[] objectsToDisable; + + private void Start() { if (RunOnAwake) ZDisable(); } + + public void ZDisable() + { + if (RunOnAwake && IsOwner) return; + + for (int i = 0; i < objectsToDisable.Length; i++) + { + var objectType = objectsToDisable[i]; // Apparently, "typeof" is not needed /shrug + + switch (objectType) + { + case MonoBehaviour monoBehaviour: + monoBehaviour.enabled = false; + break; + + case GameObject gameObject: + gameObject.SetActive(false); + break; + + case Rigidbody rigidbody: + rigidbody.isKinematic = true; + break; + + default: + Debug.LogError($"Can't disable: {objectType.name} (not supported)", objectType); + break; + } + } + } +} diff --git a/Assets/Scripts/Multiplayer/ZNGODisabler.cs.meta b/Assets/Scripts/Multiplayer/ZNGODisabler.cs.meta new file mode 100644 index 0000000..7ebac93 --- /dev/null +++ b/Assets/Scripts/Multiplayer/ZNGODisabler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d782d015a2b59634784c7016112d769b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: