2021-05-02 13:59:39 +01:00
|
|
|
using QSB.Syncs.TransformSync;
|
2021-05-10 14:50:48 +01:00
|
|
|
using UnityEngine;
|
2020-02-21 21:51:58 +01:00
|
|
|
|
2021-04-11 17:05:02 +01:00
|
|
|
namespace QSB.ShipSync.TransformSync
|
2020-02-21 21:51:58 +01:00
|
|
|
{
|
2021-05-10 14:50:48 +01:00
|
|
|
public class ShipTransformSync : SectoredTransformSync
|
2020-12-02 21:29:53 +00:00
|
|
|
{
|
2021-05-10 14:30:38 +01:00
|
|
|
public static ShipTransformSync LocalInstance { get; private set; }
|
2020-12-02 21:29:53 +00:00
|
|
|
|
2021-04-28 10:02:16 +01:00
|
|
|
public override bool UseInterpolation => true;
|
2021-04-21 19:06:00 +01:00
|
|
|
|
2021-05-10 14:32:47 +01:00
|
|
|
public override bool IsReady
|
|
|
|
=> Locator.GetShipBody() != null;
|
2021-05-10 14:30:38 +01:00
|
|
|
|
|
|
|
public override void OnStartLocalPlayer()
|
|
|
|
=> LocalInstance = this;
|
2020-12-02 21:29:53 +00:00
|
|
|
|
2021-05-10 14:50:48 +01:00
|
|
|
protected override GameObject InitLocalTransform()
|
2021-03-09 19:45:00 +00:00
|
|
|
{
|
|
|
|
SectorSync.SetSectorDetector(Locator.GetShipDetector().GetComponent<SectorDetector>());
|
2021-05-10 14:50:48 +01:00
|
|
|
return Locator.GetShipBody().gameObject;
|
2021-03-09 19:45:00 +00:00
|
|
|
}
|
2020-12-02 21:29:53 +00:00
|
|
|
|
2021-05-10 14:50:48 +01:00
|
|
|
protected override GameObject InitRemoteTransform()
|
2020-12-02 21:29:53 +00:00
|
|
|
{
|
2021-05-10 14:30:38 +01:00
|
|
|
SectorSync.SetSectorDetector(Locator.GetShipDetector().GetComponent<SectorDetector>());
|
2021-05-10 14:50:48 +01:00
|
|
|
return Locator.GetShipBody().gameObject;
|
2020-12-02 21:29:53 +00:00
|
|
|
}
|
|
|
|
}
|
2020-12-03 08:28:05 +00:00
|
|
|
}
|