mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-10 06:34:16 +00:00
Working on vehicle sync
This commit is contained in:
parent
f9e89e25ea
commit
09b1bfae30
3 changed files with 22 additions and 3 deletions
|
@ -11,8 +11,15 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
|||
{
|
||||
|
||||
|
||||
public override void OnBecameActive() {
|
||||
|
||||
public override void OnBecameInactive()
|
||||
{
|
||||
// restore everything
|
||||
|
||||
m_ped.characterController.enabled = true;
|
||||
// restore seat's occupying ped ? - no
|
||||
m_ped.transform.SetParent(null, true);
|
||||
m_model.IsInVehicle = false;
|
||||
|
||||
}
|
||||
|
||||
public bool TryEnterVehicle(Vehicle vehicle, Vehicle.SeatAlignment seatAlignment, bool immediate = false)
|
||||
|
@ -47,8 +54,9 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
|||
m_ped.transform.localPosition = Vector3.zero;
|
||||
m_ped.transform.localRotation = Quaternion.identity;
|
||||
|
||||
if (m_ped.IsControlledByLocalPlayer && seat.IsDriver)
|
||||
if (seat.IsDriver)
|
||||
{
|
||||
// TODO: this should be done when ped enters the car
|
||||
vehicle.StartControlling();
|
||||
}
|
||||
|
||||
|
|
|
@ -67,5 +67,14 @@ namespace SanAndreasUnity.Net
|
|||
m_ped.OnCrouchButtonPressed();
|
||||
}
|
||||
|
||||
public void PedStartedEnteringVehicle()
|
||||
{
|
||||
NetStatus.ThrowIfNotOnServer();
|
||||
|
||||
// send rpc to clients
|
||||
// include params: vehicle, seat
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
- send button input events to server:
|
||||
|
||||
- When ped enters vehicle, he changes parent. Is this allowed in Mirror ? Possible solution would be to only change parent of ped model.
|
||||
|
||||
- stats window
|
||||
|
||||
- display a message to user when network is stopped
|
||||
|
|
Loading…
Reference in a new issue