mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 19:10:32 +00:00
feat(NetworkRigidbody): Default Sync Direction = Client To Server (#3764)
- This is done in Reset so Network Behaviour isn't effected. - This will not change components already in place on objects / prefabs unless user manually chooses Reset in the inspector.
This commit is contained in:
parent
0821e56105
commit
136c1d2b30
@ -38,8 +38,15 @@ public class NetworkLerpRigidbody : NetworkBehaviour
|
|||||||
protected override void OnValidate()
|
protected override void OnValidate()
|
||||||
{
|
{
|
||||||
base.OnValidate();
|
base.OnValidate();
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void Reset()
|
||||||
|
{
|
||||||
if (target == null)
|
if (target == null)
|
||||||
target = GetComponent<Rigidbody>();
|
target = GetComponent<Rigidbody>();
|
||||||
|
|
||||||
|
syncDirection = SyncDirection.ClientToServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
|
@ -42,8 +42,15 @@ public class NetworkRigidbody : NetworkBehaviour
|
|||||||
protected override void OnValidate()
|
protected override void OnValidate()
|
||||||
{
|
{
|
||||||
base.OnValidate();
|
base.OnValidate();
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void Reset()
|
||||||
|
{
|
||||||
if (target == null)
|
if (target == null)
|
||||||
target = GetComponent<Rigidbody>();
|
target = GetComponent<Rigidbody>();
|
||||||
|
|
||||||
|
syncDirection = SyncDirection.ClientToServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Sync vars
|
#region Sync vars
|
||||||
|
@ -40,8 +40,15 @@ public class NetworkRigidbody2D : NetworkBehaviour
|
|||||||
protected override void OnValidate()
|
protected override void OnValidate()
|
||||||
{
|
{
|
||||||
base.OnValidate();
|
base.OnValidate();
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void Reset()
|
||||||
|
{
|
||||||
if (target == null)
|
if (target == null)
|
||||||
target = GetComponent<Rigidbody2D>();
|
target = GetComponent<Rigidbody2D>();
|
||||||
|
|
||||||
|
syncDirection = SyncDirection.ClientToServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Sync vars
|
#region Sync vars
|
||||||
|
Loading…
Reference in New Issue
Block a user