Multiplayer Shooting Support

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

View File

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

View File

@ -9,6 +9,7 @@ namespace Scriptable
{
[HideInInspector]
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: