Multiplayer Shooting Support

This commit is contained in:
sebastianhampel1 2023-06-15 11:34:45 -04:00
parent 1fc4c37e5a
commit 67eff07ace
13 changed files with 209 additions and 9 deletions

View File

@ -14,6 +14,9 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_prefabs: _prefabs:
- {fileID: 5498159848629933595, guid: 10110e55c50520d42a4601f2a7d6542f, type: 3} - {fileID: 5498159848629933595, guid: 10110e55c50520d42a4601f2a7d6542f, type: 3}
- {fileID: 1069525110278255243, guid: 5e611af8f39b09a4f9b479a29f3460ff, type: 3}
- {fileID: -2750772001946868067, guid: 396e7ba93ef9d4147a6a6c09b1abe39d, type: 3}
- {fileID: -3687221924445419690, guid: 52ba61e86784ff5458c6685514d6d6c8, type: 3}
- {fileID: -3690528308152583234, guid: 148456ca1eee0994eb0165cb943e8322, type: 3} - {fileID: -3690528308152583234, guid: 148456ca1eee0994eb0165cb943e8322, type: 3}
- {fileID: 4512293259955182956, guid: 300370bdf7819da41937e0beac65b32c, type: 3} - {fileID: 4512293259955182956, guid: 300370bdf7819da41937e0beac65b32c, type: 3}
- {fileID: 233110740096973419, guid: e05b94df3e7783a48ac1ed2d12a71774, type: 3} - {fileID: 233110740096973419, guid: e05b94df3e7783a48ac1ed2d12a71774, type: 3}

View File

@ -206,7 +206,7 @@ Material:
- _StencilWriteMask: 6 - _StencilWriteMask: 6
- _StencilWriteMaskDepth: 8 - _StencilWriteMaskDepth: 8
- _StencilWriteMaskGBuffer: 14 - _StencilWriteMaskGBuffer: 14
- _StencilWriteMaskMV: 40 - _StencilWriteMaskMV: 42
- _SubsurfaceMask: 1 - _SubsurfaceMask: 1
- _SupportDecals: 1 - _SupportDecals: 1
- _SurfaceType: 0 - _SurfaceType: 0

View File

@ -44,7 +44,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3847c9aa2dda4d64f84842c3cc880d7e, type: 3} m_Script: {fileID: 11500000, guid: 3847c9aa2dda4d64f84842c3cc880d7e, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_componentIndexCache: 3 _componentIndexCache: 4
_addedNetworkObject: {fileID: 5498159848629933595} _addedNetworkObject: {fileID: 5498159848629933595}
_networkObjectCache: {fileID: 5498159848629933595} _networkObjectCache: {fileID: 5498159848629933595}
cam: {fileID: 0} cam: {fileID: 0}
@ -1738,7 +1738,7 @@ MonoBehaviour:
noiseManager: {fileID: 1000589094} noiseManager: {fileID: 1000589094}
shift: {fileID: 0} shift: {fileID: 0}
isDead: 0 isDead: 0
manager: {fileID: 0} manager: {fileID: 11400000, guid: 11aa6a76246138741ae6aeda5ffa9a94, type: 2}
--- !u!1 &1542395871221419507 --- !u!1 &1542395871221419507
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -5331,6 +5331,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 86fd72b889d47804e844e0bc9c04218d, type: 3} m_Script: {fileID: 11500000, guid: 86fd72b889d47804e844e0bc9c04218d, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_componentIndexCache: 1
_addedNetworkObject: {fileID: 5498159848629933595}
_networkObjectCache: {fileID: 5498159848629933595}
health: 5 health: 5
maxHealth: 5 maxHealth: 5
stamina: 20 stamina: 20
@ -5404,8 +5407,9 @@ MonoBehaviour:
<PredictedSpawn>k__BackingField: {fileID: 0} <PredictedSpawn>k__BackingField: {fileID: 0}
_networkBehaviours: _networkBehaviours:
- {fileID: 2821278824672803001} - {fileID: 2821278824672803001}
- {fileID: 1000589095}
- {fileID: 3207797364320485426} - {fileID: 3207797364320485426}
- {fileID: 0} - {fileID: 558651035056782169}
- {fileID: 165371622} - {fileID: 165371622}
<ParentNetworkObject>k__BackingField: {fileID: 0} <ParentNetworkObject>k__BackingField: {fileID: 0}
<ChildNetworkObjects>k__BackingField: [] <ChildNetworkObjects>k__BackingField: []
@ -5432,7 +5436,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3} m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_componentIndexCache: 1 _componentIndexCache: 2
_addedNetworkObject: {fileID: 5498159848629933595} _addedNetworkObject: {fileID: 5498159848629933595}
_networkObjectCache: {fileID: 5498159848629933595} _networkObjectCache: {fileID: 5498159848629933595}
_componentConfiguration: 1 _componentConfiguration: 1
@ -5474,9 +5478,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e8cac635f24954048aad3a6ff9110beb, type: 3} m_Script: {fileID: 11500000, guid: e8cac635f24954048aad3a6ff9110beb, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_componentIndexCache: 255 _componentIndexCache: 3
_addedNetworkObject: {fileID: 5498159848629933595} _addedNetworkObject: {fileID: 5498159848629933595}
_networkObjectCache: {fileID: 0} _networkObjectCache: {fileID: 5498159848629933595}
IgnoredParameters: [] IgnoredParameters: []
_animator: {fileID: 5567518431331631942} _animator: {fileID: 5567518431331631942}
_smoothFloats: 1 _smoothFloats: 1

View File

@ -14,6 +14,8 @@ GameObject:
- component: {fileID: 4575714109450776058} - component: {fileID: 4575714109450776058}
- component: {fileID: -3126027469558985513} - component: {fileID: -3126027469558985513}
- component: {fileID: -2166122047152726235} - component: {fileID: -2166122047152726235}
- component: {fileID: 1069525110278255243}
- component: {fileID: 8789794426191792349}
m_Layer: 0 m_Layer: 0
m_Name: FlareParticle m_Name: FlareParticle
m_TagString: Untagged m_TagString: Untagged
@ -132,6 +134,77 @@ MonoBehaviour:
type: flare type: flare
damageRange: 3 damageRange: 3
damageMagnitude: 1 damageMagnitude: 1
--- !u!114 &1069525110278255243
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4575714109450776061}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3}
m_Name:
m_EditorClassIdentifier:
<IsNested>k__BackingField: 0
<ComponentIndex>k__BackingField: 0
<PredictedSpawn>k__BackingField: {fileID: 0}
_networkBehaviours: []
<ParentNetworkObject>k__BackingField: {fileID: 0}
<ChildNetworkObjects>k__BackingField: []
_isNetworked: 1
_isGlobal: 0
_initializeOrder: 0
_defaultDespawnType: 0
NetworkObserver: {fileID: 0}
<PrefabId>k__BackingField: 0
<SpawnableCollectionId>k__BackingField: 0
_scenePathHash: 0
<SceneId>k__BackingField: 0
<AssetPathHash>k__BackingField: 17677934213645310587
_sceneNetworkObjects: []
--- !u!114 &8789794426191792349
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4575714109450776061}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3}
m_Name:
m_EditorClassIdentifier:
_componentIndexCache: 255
_addedNetworkObject: {fileID: 1069525110278255243}
_networkObjectCache: {fileID: 0}
_componentConfiguration: 0
_synchronizeParent: 0
_packing:
Position: 1
Rotation: 1
Scale: 0
_interpolation: 2
_extrapolation: 2
_enableTeleport: 0
_teleportThreshold: 1
_clientAuthoritative: 1
_sendToOwner: 1
_synchronizePosition: 1
_positionSnapping:
X: 0
Y: 0
Z: 0
_synchronizeRotation: 1
_rotationSnapping:
X: 0
Y: 0
Z: 0
_synchronizeScale: 1
_scaleSnapping:
X: 0
Y: 0
Z: 0
--- !u!1 &4575714110311104494 --- !u!1 &4575714110311104494
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -514,6 +514,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a0bc8aa373bfbe44e91f0625324088be, type: 3} m_Script: {fileID: 11500000, guid: a0bc8aa373bfbe44e91f0625324088be, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_componentIndexCache: 255
_addedNetworkObject: {fileID: 0}
_networkObjectCache: {fileID: 0}
aimMode: 2 aimMode: 2
targetingLight: {fileID: 935129114346117162} targetingLight: {fileID: 935129114346117162}
targetObjectPrefab: {fileID: 7083481049935262560, guid: 25e7708870a1a78479d6e4df73bec788, type: 3} targetObjectPrefab: {fileID: 7083481049935262560, guid: 25e7708870a1a78479d6e4df73bec788, type: 3}

View File

@ -382,5 +382,21 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a0bc8aa373bfbe44e91f0625324088be, type: 3} m_Script: {fileID: 11500000, guid: a0bc8aa373bfbe44e91f0625324088be, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_componentIndexCache: 255
_addedNetworkObject: {fileID: 0}
_networkObjectCache: {fileID: 0}
aimMode: 2
targetingLight: {fileID: 7403853081934682846} targetingLight: {fileID: 7403853081934682846}
targetObjectPrefab: {fileID: 7083481049935262560, guid: 25e7708870a1a78479d6e4df73bec788, type: 3} targetObjectPrefab: {fileID: 7083481049935262560, guid: 25e7708870a1a78479d6e4df73bec788, type: 3}
projectilePrefab: {fileID: 0}
projectileName:
bulletSpawnPoint: {fileID: 0}
firePower: 20
maxProjectileDuration: 5
maxTargetObjDistance: 15
shootEffect: {fileID: 0}
shootLight: {fileID: 0}
shootLightDuration: 0.1
ignoreLayers:
serializedVersion: 2
m_Bits: 0

View File

@ -1798,6 +1798,10 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 0} m_TransformParent: {fileID: 0}
m_Modifications: m_Modifications:
- target: {fileID: 7054175667404048554, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: state
value:
objectReference: {fileID: 11400000, guid: 11aa6a76246138741ae6aeda5ffa9a94, type: 2}
- target: {fileID: 7054175669031773906, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3} - target: {fileID: 7054175669031773906, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: BasicLevel0 value: BasicLevel0
@ -1846,6 +1850,30 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7274624881599411862, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.w
value: 0.99938023
objectReference: {fileID: 0}
- target: {fileID: 7274624881599411862, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.x
value: -0.03520201
objectReference: {fileID: 0}
- target: {fileID: 7274624881599411862, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.y
value: -0.00000001750598
objectReference: {fileID: 0}
- target: {fileID: 7274624881599411862, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.z
value: 0.000000002846753
objectReference: {fileID: 0}
- target: {fileID: 7274624882445554639, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.w
value: 0.9985746
objectReference: {fileID: 0}
- target: {fileID: 7274624882445554639, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.x
value: -0.053374406
objectReference: {fileID: 0}
- target: {fileID: 7274624882445554639, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3} - target: {fileID: 7274624882445554639, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.y propertyPath: m_LocalRotation.y
value: -3.9161743e-10 value: -3.9161743e-10
@ -1854,6 +1882,38 @@ PrefabInstance:
propertyPath: m_LocalRotation.z propertyPath: m_LocalRotation.z
value: 5.6392228e-11 value: 5.6392228e-11
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7274624882710027854, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.w
value: 0.99744195
objectReference: {fileID: 0}
- target: {fileID: 7274624882710027854, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.x
value: -0.07148121
objectReference: {fileID: 0}
- target: {fileID: 7274624882710027854, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.y
value: -0.000000017597836
objectReference: {fileID: 0}
- target: {fileID: 7274624882710027854, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.z
value: 0.0000000022089703
objectReference: {fileID: 0}
- target: {fileID: 7274624883331524490, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalPosition.y
value: 0.82000005
objectReference: {fileID: 0}
- target: {fileID: 7274624883331524490, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalPosition.z
value: -3
objectReference: {fileID: 0}
- target: {fileID: 7274624883331524490, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.w
value: 0.9989963
objectReference: {fileID: 0}
- target: {fileID: 7274624883331524490, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.x
value: 0.04479234
objectReference: {fileID: 0}
- target: {fileID: 7274624883331524490, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3} - target: {fileID: 7274624883331524490, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: m_LocalRotation.y propertyPath: m_LocalRotation.y
value: 0.0000000344453 value: 0.0000000344453
@ -1862,6 +1922,10 @@ PrefabInstance:
propertyPath: m_LocalRotation.z propertyPath: m_LocalRotation.z
value: -0.0000000015444355 value: -0.0000000015444355
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9048691461878283844, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
propertyPath: manager
value:
objectReference: {fileID: 11400000, guid: 11aa6a76246138741ae6aeda5ffa9a94, type: 2}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 3cbb87b9c7b0a01458108d45dc4eee05, type: 3}
--- !u!1 &191404492 --- !u!1 &191404492

View File

@ -1,9 +1,11 @@
using UnityEngine; using UnityEngine;
using UnityEngine.VFX; using UnityEngine.VFX;
using FishNet.Object;
using FishNet;
namespace Item namespace Item
{ {
public class PistolComponent : MonoBehaviour public class PistolComponent : NetworkBehaviour
{ {
public enum AimMode public enum AimMode
{ {
@ -130,7 +132,10 @@ namespace Item
{ {
shootLightDuration = 0; shootLightDuration = 0;
shootLight.gameObject.SetActive(true); shootLight.gameObject.SetActive(true);
var projectile = Instantiate(projectilePrefab, bulletSpawnPoint); var projectile = Instantiate(projectilePrefab, bulletSpawnPoint);
InstanceFinder.ServerManager.Spawn(projectile);
projectile.transform.localPosition = Vector3.zero; projectile.transform.localPosition = Vector3.zero;
projectile.transform.localEulerAngles = Vector3.zero; projectile.transform.localEulerAngles = Vector3.zero;
projectile.transform.localScale = Vector3.one; projectile.transform.localScale = Vector3.one;

View File

@ -9,6 +9,7 @@ namespace Scriptable
{ {
[HideInInspector] [HideInInspector]
public bool IsPaused = false; public bool IsPaused = false;
} }
} }

View File

@ -0,0 +1,13 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Scriptable
{
[CreateAssetMenu(fileName = "GameState", menuName = "ScriptableObjects/GameStateManager", order = 1)]
public class GlobalReferences : ScriptableObject
{
}
}

View File

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

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: a9c34549a246d47439b106bb23f71dff guid: 96a44475794fb6445a6f3c4b9ee13966
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

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