-
Notifications
You must be signed in to change notification settings - Fork 16
BoltWithNut
Namespace: TommoJProductions.ModApi.Attachable
public class BoltWithNut : BoltInheritance Object → Bolt → BoltWithNut
if , scrolling on this bolt will do nothing.
public bool ignoreInput;The add nut.
public Bolt nut { get; }The base bolt settings for this bolt
public virtual BoltSettings settings { get; }Bolt with Nut specific settings. derived from BoltSettings.
public BoltWithNutSettings boltWithNutSettings { get; }The total tightness of the bolt and nut.
public virtual int tightness { get; set; }The max tightness of the bolt and nut.
public virtual int maxTightness { get; }The bolt waiting value. when true, the bolt has been tightened/loosened and is waiting for x amount of time base on the tool used before continuing to update the model transform, play the bolt audio, invoke events bolt tighten/loosen events.
public virtual bool wait { get; set; }The last scroll input.
public virtual int scrollInput { get; set; }Returns true if this bolt is tight.
public virtual bool isTight { get; }Returns true if this bolt is loose.
public virtual bool isLoose { get; }The start position of the bolt.
public virtual Vector3 startPosition { get; set; }Vector3
The start rotation of the bolt.
public virtual Vector3 startEulerAngles { get; set; }Vector3
The position vector step (direction * step). How much and in what direction does the bolt move per tightness step.
public virtual Vector3 positionVectorStep { get; }Vector3
The rotation vector (direction * step). How much and in what direction does the bolt rotate per tightness step.
public virtual Vector3 rotationVectorStep { get; }Vector3
The Bolts ID
public string boltID { get; }The bolt model
public GameObject model { get; }GameObject
The callback
public BoltCallback callback { get; }the bolt func routine.
public Coroutine routine { get; }Coroutine
Initialies this bolt.
public BoltWithNut(BoltWithNutSettings settings, Vector3 position, Vector3 eulerAngles)settings BoltWithNutSettings
the settings for the bolt.
position Vector3
the position of the bolt
eulerAngles Vector3
the rotation of the bolt.
Initialies this bolt with a tightness value.
public BoltWithNut(int tightness, BoltWithNutSettings settings, Vector3 position, Vector3 eulerAngles)tightness Int32
The the tightness of the bolt.
settings BoltWithNutSettings
the settings for the bolt.
position Vector3
the position of the bolt
eulerAngles Vector3
the rotation of the bolt.
Initialies this bolt with a nut offset overload. only use if you intend on this bolt having an 'add nut'
public BoltWithNut(BoltWithNutSettings settings, Vector3 position, Vector3 eulerAngles, Nullable<float> nutOffsetOverride)settings BoltWithNutSettings
the settings for the bolt.
position Vector3
the position of the bolt
eulerAngles Vector3
the rotation of the bolt.
nutOffsetOverride Nullable<Single>
the nut offset overload
Initialies this bolt with a tightness value and a nut offset overload. only use if you intend on this bolt having an 'add nut'
public BoltWithNut(int tightness, BoltWithNutSettings settings, Vector3 position, Vector3 eulerAngles, Nullable<float> nutOffsetOverride)tightness Int32
The the tightness of the bolt.
settings BoltWithNutSettings
the settings for the bolt.
position Vector3
the position of the bolt
eulerAngles Vector3
the rotation of the bolt.
nutOffsetOverride Nullable<Single>
the nut offset overload
Initializes this bolt. assigns field values with an option of setting a overload for nut offset. Called in Constructors. Use only if this bolt is using add nut, otherwise this does nothing extra.
void init(BoltWithNutSettings settings, Vector3 position, Vector3 eulerAngles, int tightness, Nullable<float> nutOffsetOverride)settings BoltWithNutSettings
The settings for the bolt.
position Vector3
the position of the bolt
eulerAngles Vector3
the rotation of the bolt.
tightness Int32
The the tightness of the bolt.
nutOffsetOverride Nullable<Single>
the nut offset overload
inits bolt and add nut.
public virtual void createBolt(int tightness, Transform parent)tightness Int32
bolt tightness
parent Transform
the parent for the bolt.
De/Activates the bolt.
public virtual void activateBolt(bool active)active Boolean
Activate the bolt or not.
Updates the model position and rotation based on start and tightness values.
public virtual void updateModelPosition()Represents the post onscrew event. occurs when this bolt is screwed in or out. called after all other bolt events are called. Bolt.onLoose, Bolt.onTight.
public event Action onScrew;Represents the on loose event. occurs when this bolt becomes loose (screwed to loose state)
public event Action onLoose;Represents the on tight event. occurs when this bolt becomes tight (screwed to tight state)
public event Action onTight;Represents the out loose event. occurs when this bolt was loose but was screw in (screwed from loose state)
public event Action outLoose;Represents the out tight event. occurs when this bolt was tight but was screw out. (screwed from tight state)
public event Action outTight;