C# Класс TweakScale.TweakScale

Наследование: PartModule, IPartCostModifier
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
ScaleFactors float[]
ScaleNodes int[]

Private Properties

Свойство Тип Описание
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

Открытые методы

Метод Описание
GetModuleCost ( float defaultCost ) : float
OnLoad ( ConfigNode node ) : void
OnSave ( ConfigNode node ) : void
OnStart ( StartState state ) : void

Защищенные методы

Метод Описание
Setup ( ) : void

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

Приватные методы

Метод Описание
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).

Описание методов

GetModuleCost() публичный Метод

public GetModuleCost ( float defaultCost ) : float
defaultCost float
Результат float

OnLoad() публичный Метод

public OnLoad ( ConfigNode node ) : void
node System.ConfigNode
Результат void

OnSave() публичный Метод

public OnSave ( ConfigNode node ) : void
node System.ConfigNode
Результат void

OnStart() публичный Метод

public OnStart ( StartState state ) : void
state StartState
Результат void

Setup() защищенный Метод

Sets up values from ScaleType, creates updaters, and sets up initial values.
protected Setup ( ) : void
Результат void

Описание свойств

ScaleFactors защищенное свойство

The scale exponentValue array. If isFreeScale is false, the part may only be one of these scales.
protected float[] ScaleFactors
Результат float[]

ScaleNodes защищенное свойство

The node scale array. If node scales are defined the nodes will be resized to these values.
protected int[] ScaleNodes
Результат int[]