Multiplayer Shooting Support
This commit is contained in:
@ -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;
|
||||
|
@ -9,6 +9,7 @@ namespace Scriptable
|
||||
{
|
||||
[HideInInspector]
|
||||
public bool IsPaused = false;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
13
Assets/Scripts/SerializedObjects/GlobalReferences.cs
Normal file
13
Assets/Scripts/SerializedObjects/GlobalReferences.cs
Normal 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
|
||||
{
|
||||
|
||||
}
|
||||
}
|
11
Assets/Scripts/SerializedObjects/GlobalReferences.cs.meta
Normal file
11
Assets/Scripts/SerializedObjects/GlobalReferences.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 18c7601bc264c314faad92cf903c1e46
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user