using FishNet.Managing.Timing;
using FishNet.Object;
using UnityEngine;
namespace FishNet.Component.Transforming.Beta
{
[System.Serializable]
public struct InitializationSettings
{
///
/// While this script is typically placed on a nested graphical object, the targetTransform would be the object which moves every tick; the TargetTransform can be the same object this script resides but may not be a rigidbody if true;
///
[Tooltip("While this script is typically placed on a nested graphical object, the targetTransform would be the object which moves every tick; the TargetTransform can be the same object this script resides but may not be a rigidbody if true;")]
[SerializeField]
public Transform TargetTransform;
///
/// The transform which is smoothed.
///
[Tooltip("The transform which is smoothed.")]
[System.NonSerialized]
internal Transform GraphicalTransform;
///
/// True to detacth this object from its parent on client start.
///
[Tooltip("True to detach this object from it's parent on client start.")]
public bool DetachOnStart;
///
/// True to re-attach this object to it's parent on client stop.
///
[Tooltip("True to re-attach this object to it's parent on client stop.")]
public bool AttachOnStop;
///
/// True to begin moving soon as movement data becomes available. Movement will ease in until at interpolation value. False to prevent movement until movement data count meet interpolation.
///
/// This is not yet used.
[Tooltip("True to begin moving soon as movement data becomes available. Movement will ease in until at interpolation value. False to prevent movement until movement data count meet interpolation.")]
public bool MoveImmediately => false;
///
/// NetworkBehaviour which initialized these settings. This value may be null if not initialized from a NetworkBehaviour.
///
[System.NonSerialized]
internal NetworkBehaviour InitializingNetworkBehaviour;
///
/// TimeManager initializing these settings.
///
[System.NonSerialized]
internal TimeManager InitializingTimeManager;
public void SetNetworkedRuntimeValues(NetworkBehaviour initializingNetworkBehaviour, Transform graphicalTransform)
{
InitializingNetworkBehaviour = initializingNetworkBehaviour;
GraphicalTransform = graphicalTransform;
InitializingTimeManager = initializingNetworkBehaviour.TimeManager;
}
///
/// Sets values used at runtime. NetworkBehaviour is nullified when calling this method.
///
public void SetOfflineRuntimeValues(TimeManager timeManager, Transform graphicalTransform)
{
InitializingNetworkBehaviour = null;
GraphicalTransform = graphicalTransform;
InitializingTimeManager = timeManager;
}
}
}