mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-23 04:23:04 +00:00
Working on vehicle networking
This commit is contained in:
parent
ad2c8c9010
commit
c38c386563
1 changed files with 17 additions and 2 deletions
|
@ -1,19 +1,34 @@
|
|||
using UnityEngine;
|
||||
using SanAndreasUnity.Net;
|
||||
using Mirror;
|
||||
|
||||
namespace SanAndreasUnity.Behaviours.Vehicles
|
||||
{
|
||||
[RequireComponent(typeof(Vehicle))]
|
||||
public class VehicleController : MonoBehaviour
|
||||
|
||||
public class VehicleController : NetworkBehaviour
|
||||
{
|
||||
private Vehicle m_vehicle;
|
||||
|
||||
[SyncVar] int m_net_id = 0;
|
||||
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
m_vehicle = GetComponent<Vehicle>();
|
||||
}
|
||||
|
||||
public override void OnStartClient()
|
||||
{
|
||||
base.OnStartClient();
|
||||
|
||||
if (!NetStatus.IsServer)
|
||||
{
|
||||
// load vehicle on clients
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
|
||||
|
|
Loading…
Reference in a new issue