C# Class TweakScale.TweakScale

Inheritance: PartModule, IPartCostModifier
Afficher le fichier Open project: Biotronic/TweakScale Class Usage Examples

Protected Properties

Свойство Type Description
ScaleFactors float[]
ScaleNodes int[]

Private Properties

Свойство Type Description
AutoScale void
ChainScale void
CheckForDuplicateTweakScale bool
CheckForInvalidCfg bool
GetRelativeScaling float?
MoveNode void
NodesBetween AttachNode>?.Tuple
OnTweakScaleChanged void
RescaleNode void
SetupFromConfig void
Update void
UpdateByWidth void
UpdateWindow void

Méthodes publiques

Méthode Description
GetModuleCost ( float defaultCost ) : float
OnLoad ( ConfigNode node ) : void
OnSave ( ConfigNode node ) : void
OnStart ( StartState state ) : void

Méthodes protégées

Méthode Description
Setup ( ) : void

Sets up values from ScaleType, creates updaters, and sets up initial values.

Private Methods

Méthode Description
AutoScale ( TweakScale a, TweakScale b ) : void

Automatically scale part to match other part, if applicable.

ChainScale ( ) : void

Scale children with the part.

CheckForDuplicateTweakScale ( ) : bool

Checks if there is more than one TweakScale instance on this part.

CheckForInvalidCfg ( ) : bool

Checks if the config for this TweakScale instance is valid. If not, logs it and returns false.

GetRelativeScaling ( TweakScale a, TweakScale b ) : float?

Calculate the correct scale to use for scaling a part relative to another.

MoveNode ( AttachNode node, AttachNode baseNode, bool movePart, bool absolute ) : void

Moves node to reflect the new scale. If movePart is true, also moves attached parts.

NodesBetween ( Part a, Part b ) : AttachNode>?.Tuple

Find the Attachnode that fastens a to b and vice versa.

OnTweakScaleChanged ( ) : void

Scale has changed!

RescaleNode ( AttachNode node, AttachNode baseNode ) : void

Change the size of node to reflect the new size of the part it's attached to.

SetupFromConfig ( ScaleType scaleType ) : void

Loads settings from scaleType.

Update ( ) : void
UpdateByWidth ( bool moveParts, bool absolute ) : void

Updates properties that change linearly with scale.

UpdateWindow ( ) : void

Marks the right-click window as dirty (i.e. tells it to update).

Method Details

GetModuleCost() public méthode

public GetModuleCost ( float defaultCost ) : float
defaultCost float
Résultat float

OnLoad() public méthode

public OnLoad ( ConfigNode node ) : void
node System.ConfigNode
Résultat void

OnSave() public méthode

public OnSave ( ConfigNode node ) : void
node System.ConfigNode
Résultat void

OnStart() public méthode

public OnStart ( StartState state ) : void
state StartState
Résultat void

Setup() protected méthode

Sets up values from ScaleType, creates updaters, and sets up initial values.
protected Setup ( ) : void
Résultat void

Property Details

ScaleFactors protected_oe property

The scale exponentValue array. If isFreeScale is false, the part may only be one of these scales.
protected float[] ScaleFactors
Résultat float[]

ScaleNodes protected_oe property

The node scale array. If node scales are defined the nodes will be resized to these values.
protected int[] ScaleNodes
Résultat int[]