using FishNet.Object.Prediction; using UnityEngine; using static AffectingForcesManager; namespace ShipHandling { /// /// Variables for the ship which can also be under the players control. /// public class ShipState { public float boostCapacity; public Vector3 currentGravity = new Vector3(); public bool IsFrozen = false; public bool IsFiring = false; public Zone Zone; public bool reset = false; } public struct ReplicateData : IReplicateData { public float Thrust; public float Steer; public float Boost; public ReplicateData(float thrust, float steer, float boost) : this() { Thrust = thrust; Steer = steer; Boost = boost; } private uint _tick; public void Dispose() { } public uint GetTick() => _tick; public void SetTick(uint value) => _tick = value; } public struct ReconcileData : IReconcileData { //PredictionRigidbody is used to synchronize rigidbody states //and forces. This could be done manually but the PredictionRigidbody //type makes this process considerably easier. Velocities, kinematic state, //transform properties, pending velocities and more are automatically //handled with PredictionRigidbody. public PredictionRigidbody PredictionRigidbody; public ReconcileData(PredictionRigidbody pr) : this() { PredictionRigidbody = pr; } private uint _tick; public void Dispose() { } public uint GetTick() => _tick; public void SetTick(uint value) => _tick = value; } }