C# Class KAS.KAS_Shared

ファイルを表示 Open project: KospY/KAS Class Usage Examples

Public Methods

Method Description
AddNodeTransform ( Part p, AttachNode attachNode ) : void
CreatePart ( AvailablePart avPart, Vector3 position, Quaternion rotation, Part flagFromPart ) : Part
CreatePart ( string partname, Vector3 position, Quaternion rotation, Part flagFromPart ) : Part
DebugError ( string format ) : void
DebugLog ( string format ) : void
DebugWarning ( string format ) : void
DecoupleAllChilds ( Part p ) : void
DecoupleFromAll ( Part p ) : void
DirectionToQuaternion ( Transform transf, Vector3 nodeDirection ) : Quaternion
DisableEditorClickthrough ( Rect guiWindowRect ) : void
DisableVesselCollision ( Vessel vess, Collider col ) : void
GetAllChilds ( Part tgtPart, bool addSelf = false ) : List
GetAllParents ( Part tgtPart, bool addSelf = false ) : List
GetAllWinch ( Vessel fromVessel = null ) : List
GetAngleFromDirAndPoints ( Vector3 dir, Vector3 srcPos, Vector3 tgtPos ) : float
GetBaseConfigNode ( PartModule partModule ) : ConfigNode
GetConnectedWinch ( Part p ) : KASModuleWinch
GetEvaCollider ( Vessel evaVessel, string colliderName ) : Collider
GetKerbalEvaUnderCursor ( ) : KerbalEVA
GetLocalPosFrom ( Transform trf, Transform from ) : Vector3
GetLocalRotFrom ( Transform trf, Transform from ) : Quaternion
GetPartByID ( Vessel searchVessel, string partID ) : Part
GetPartByID ( string vesselID, string partID ) : Part
GetPartUnderCursor ( ) : Part
GetTransformUnderCursor ( ) : Transform
GetVesselByName ( string name ) : Vessel
GetWinchModuleGrabbed ( Vessel evaVessel ) : KASModuleWinch
InvalidateContextMenu ( Part part ) : void
LoadPartSnapshot ( Vessel vessel, ConfigNode node, Vector3 position, Quaternion rotation ) : Part
LoadProtoPartSnapshot ( ConfigNode node ) : ProtoPartSnapshot
MouseIsOverWindow ( Rect guiWindowRect ) : bool
MoveAbove ( Transform fromTransform, Vector3 fromLocalPos, Vector3 fromOrientation, RaycastHit hit ) : void
MoveAlign ( Transform source, Transform childNode, RaycastHit hit, Quaternion adjust ) : void
MoveAlign ( Transform source, Transform childNode, Transform target ) : void
MoveAlign ( Transform source, Transform childNode, Vector3 targetPos, Quaternion targetRot ) : void
MoveAlignLight ( Part fromPart, Transform fromTransform, Part toPart, Transform toTransform, List partToMoveWith = null ) : void
MoveAlignLight ( Vessel fromVessel, Transform fromTransform, Vessel toVessel, Transform toTransform ) : void
MovePartWith ( Part rootPart, List moveWithParts, Vector3 position, Quaternion rotation ) : void
MoveRelatedTo ( Transform fromTransform, Transform toTransform, Vector3 position, Vector3 direction ) : void
ParseCfgVector3 ( string vectorString ) : Vector3
RemoveAttachJointBetween ( Part part1, Part part2 ) : void
RemoveFixedJointBetween ( Part part1, Part part2 ) : void
RemoveHingeJointBetween ( Part part1, Part part2 ) : void
RequestPower ( Part prt, float power ) : bool
ResetChildPartVesselCollision ( Part p ) : void
ResetCollisionEnhancer ( Part p, bool create_new = true ) : void
SavePartSnapshot ( Part part ) : ConfigNode
SendMsgToWinch ( String methodeName, object value = null, Vessel vess = null ) : void
SetAllChildsPartPos ( string vesselID, Vector3>.Dictionary partsPos ) : void
SetChildTrfParent ( Part sourcePart, Transform parent ) : void
SetPartLocalPosFrom ( Transform trf, Transform from, Vector3 localPos ) : void
SetPartLocalPosRotFrom ( Transform trf, Transform from, Vector3 localPos, Quaternion localRot ) : void
SetPartLocalRotFrom ( Transform trf, Transform from, Quaternion localRot ) : void
SetPartsPosition ( Part rootPart, List parts, Vector3 position, bool usePristineCoords ) : void
SetPartsRotation ( Part rootPart, List parts, Quaternion rotation ) : void
UpdateChildsOrgPos ( Part p, bool includeItself = false ) : void
UpdateChildsOrgPosDelayed ( Part p, float waitTime ) : IEnumerator
createFXSound ( Part part, FXGroup group, string sndPath, bool loop, float maxDistance = 30f ) : bool

Private Methods

Method Description
FinishDelayedCreation ( Part part, List re_enable ) : void
GetAllChildsRecursive ( Part p ) : Part
GetAllParentsRecursive ( Part p ) : Part
WaitAndUnpack ( Part part, List re_enable ) : IEnumerator

Method Details

AddNodeTransform() public static method

public static AddNodeTransform ( Part p, AttachNode attachNode ) : void
p Part
attachNode AttachNode
return void

CreatePart() public static method

public static CreatePart ( AvailablePart avPart, Vector3 position, Quaternion rotation, Part flagFromPart ) : Part
avPart AvailablePart
position Vector3
rotation UnityEngine.Quaternion
flagFromPart Part
return Part

CreatePart() public static method

public static CreatePart ( string partname, Vector3 position, Quaternion rotation, Part flagFromPart ) : Part
partname string
position Vector3
rotation UnityEngine.Quaternion
flagFromPart Part
return Part

DebugError() public static method

public static DebugError ( string format ) : void
format string
return void

DebugLog() public static method

public static DebugLog ( string format ) : void
format string
return void

DebugWarning() public static method

public static DebugWarning ( string format ) : void
format string
return void

DecoupleAllChilds() public static method

public static DecoupleAllChilds ( Part p ) : void
p Part
return void

DecoupleFromAll() public static method

public static DecoupleFromAll ( Part p ) : void
p Part
return void

DirectionToQuaternion() public static method

public static DirectionToQuaternion ( Transform transf, Vector3 nodeDirection ) : Quaternion
transf UnityEngine.Transform
nodeDirection Vector3
return UnityEngine.Quaternion

DisableEditorClickthrough() public static method

public static DisableEditorClickthrough ( Rect guiWindowRect ) : void
guiWindowRect UnityEngine.Rect
return void

DisableVesselCollision() public static method

public static DisableVesselCollision ( Vessel vess, Collider col ) : void
vess Vessel
col UnityEngine.Collider
return void

GetAllChilds() public static method

public static GetAllChilds ( Part tgtPart, bool addSelf = false ) : List
tgtPart Part
addSelf bool
return List

GetAllParents() public static method

public static GetAllParents ( Part tgtPart, bool addSelf = false ) : List
tgtPart Part
addSelf bool
return List

GetAllWinch() public static method

public static GetAllWinch ( Vessel fromVessel = null ) : List
fromVessel Vessel
return List

GetAngleFromDirAndPoints() public static method

public static GetAngleFromDirAndPoints ( Vector3 dir, Vector3 srcPos, Vector3 tgtPos ) : float
dir Vector3
srcPos Vector3
tgtPos Vector3
return float

GetBaseConfigNode() public static method

public static GetBaseConfigNode ( PartModule partModule ) : ConfigNode
partModule PartModule
return System.ConfigNode

GetConnectedWinch() public static method

public static GetConnectedWinch ( Part p ) : KASModuleWinch
p Part
return KASModuleWinch

GetEvaCollider() public static method

public static GetEvaCollider ( Vessel evaVessel, string colliderName ) : Collider
evaVessel Vessel
colliderName string
return UnityEngine.Collider

GetKerbalEvaUnderCursor() public static method

public static GetKerbalEvaUnderCursor ( ) : KerbalEVA
return KerbalEVA

GetLocalPosFrom() public static method

public static GetLocalPosFrom ( Transform trf, Transform from ) : Vector3
trf UnityEngine.Transform
from UnityEngine.Transform
return Vector3

GetLocalRotFrom() public static method

public static GetLocalRotFrom ( Transform trf, Transform from ) : Quaternion
trf UnityEngine.Transform
from UnityEngine.Transform
return UnityEngine.Quaternion

GetPartByID() public static method

public static GetPartByID ( Vessel searchVessel, string partID ) : Part
searchVessel Vessel
partID string
return Part

GetPartByID() public static method

public static GetPartByID ( string vesselID, string partID ) : Part
vesselID string
partID string
return Part

GetPartUnderCursor() public static method

public static GetPartUnderCursor ( ) : Part
return Part

GetTransformUnderCursor() public static method

public static GetTransformUnderCursor ( ) : Transform
return Transform

GetVesselByName() public static method

public static GetVesselByName ( string name ) : Vessel
name string
return Vessel

GetWinchModuleGrabbed() public static method

public static GetWinchModuleGrabbed ( Vessel evaVessel ) : KASModuleWinch
evaVessel Vessel
return KASModuleWinch

InvalidateContextMenu() public static method

public static InvalidateContextMenu ( Part part ) : void
part Part
return void

LoadPartSnapshot() public static method

public static LoadPartSnapshot ( Vessel vessel, ConfigNode node, Vector3 position, Quaternion rotation ) : Part
vessel Vessel
node ConfigNode
position Vector3
rotation Quaternion
return Part

LoadProtoPartSnapshot() public static method

public static LoadProtoPartSnapshot ( ConfigNode node ) : ProtoPartSnapshot
node ConfigNode
return ProtoPartSnapshot

MouseIsOverWindow() public static method

public static MouseIsOverWindow ( Rect guiWindowRect ) : bool
guiWindowRect Rect
return bool

MoveAbove() public static method

public static MoveAbove ( Transform fromTransform, Vector3 fromLocalPos, Vector3 fromOrientation, RaycastHit hit ) : void
fromTransform Transform
fromLocalPos Vector3
fromOrientation Vector3
hit RaycastHit
return void

MoveAlign() public static method

public static MoveAlign ( Transform source, Transform childNode, RaycastHit hit, Quaternion adjust ) : void
source Transform
childNode Transform
hit RaycastHit
adjust Quaternion
return void

MoveAlign() public static method

public static MoveAlign ( Transform source, Transform childNode, Transform target ) : void
source Transform
childNode Transform
target Transform
return void

MoveAlign() public static method

public static MoveAlign ( Transform source, Transform childNode, Vector3 targetPos, Quaternion targetRot ) : void
source Transform
childNode Transform
targetPos Vector3
targetRot Quaternion
return void

MoveAlignLight() public static method

public static MoveAlignLight ( Part fromPart, Transform fromTransform, Part toPart, Transform toTransform, List partToMoveWith = null ) : void
fromPart Part
fromTransform Transform
toPart Part
toTransform Transform
partToMoveWith List
return void

MoveAlignLight() public static method

public static MoveAlignLight ( Vessel fromVessel, Transform fromTransform, Vessel toVessel, Transform toTransform ) : void
fromVessel Vessel
fromTransform Transform
toVessel Vessel
toTransform Transform
return void

MovePartWith() public static method

public static MovePartWith ( Part rootPart, List moveWithParts, Vector3 position, Quaternion rotation ) : void
rootPart Part
moveWithParts List
position Vector3
rotation Quaternion
return void

MoveRelatedTo() public static method

public static MoveRelatedTo ( Transform fromTransform, Transform toTransform, Vector3 position, Vector3 direction ) : void
fromTransform Transform
toTransform Transform
position Vector3
direction Vector3
return void

ParseCfgVector3() public static method

public static ParseCfgVector3 ( string vectorString ) : Vector3
vectorString string
return Vector3

RemoveAttachJointBetween() public static method

public static RemoveAttachJointBetween ( Part part1, Part part2 ) : void
part1 Part
part2 Part
return void

RemoveFixedJointBetween() public static method

public static RemoveFixedJointBetween ( Part part1, Part part2 ) : void
part1 Part
part2 Part
return void

RemoveHingeJointBetween() public static method

public static RemoveHingeJointBetween ( Part part1, Part part2 ) : void
part1 Part
part2 Part
return void

RequestPower() public static method

public static RequestPower ( Part prt, float power ) : bool
prt Part
power float
return bool

ResetChildPartVesselCollision() public static method

public static ResetChildPartVesselCollision ( Part p ) : void
p Part
return void

ResetCollisionEnhancer() public static method

public static ResetCollisionEnhancer ( Part p, bool create_new = true ) : void
p Part
create_new bool
return void

SavePartSnapshot() public static method

public static SavePartSnapshot ( Part part ) : ConfigNode
part Part
return ConfigNode

SendMsgToWinch() public static method

public static SendMsgToWinch ( String methodeName, object value = null, Vessel vess = null ) : void
methodeName String
value object
vess Vessel
return void

SetAllChildsPartPos() public static method

public static SetAllChildsPartPos ( string vesselID, Vector3>.Dictionary partsPos ) : void
vesselID string
partsPos Vector3>.Dictionary
return void

SetChildTrfParent() public static method

public static SetChildTrfParent ( Part sourcePart, Transform parent ) : void
sourcePart Part
parent Transform
return void

SetPartLocalPosFrom() public static method

public static SetPartLocalPosFrom ( Transform trf, Transform from, Vector3 localPos ) : void
trf Transform
from Transform
localPos Vector3
return void

SetPartLocalPosRotFrom() public static method

public static SetPartLocalPosRotFrom ( Transform trf, Transform from, Vector3 localPos, Quaternion localRot ) : void
trf Transform
from Transform
localPos Vector3
localRot Quaternion
return void

SetPartLocalRotFrom() public static method

public static SetPartLocalRotFrom ( Transform trf, Transform from, Quaternion localRot ) : void
trf Transform
from Transform
localRot Quaternion
return void

SetPartsPosition() public static method

public static SetPartsPosition ( Part rootPart, List parts, Vector3 position, bool usePristineCoords ) : void
rootPart Part
parts List
position Vector3
usePristineCoords bool
return void

SetPartsRotation() public static method

public static SetPartsRotation ( Part rootPart, List parts, Quaternion rotation ) : void
rootPart Part
parts List
rotation Quaternion
return void

UpdateChildsOrgPos() public static method

public static UpdateChildsOrgPos ( Part p, bool includeItself = false ) : void
p Part
includeItself bool
return void

UpdateChildsOrgPosDelayed() public static method

public static UpdateChildsOrgPosDelayed ( Part p, float waitTime ) : IEnumerator
p Part
waitTime float
return IEnumerator

createFXSound() public static method

public static createFXSound ( Part part, FXGroup group, string sndPath, bool loop, float maxDistance = 30f ) : bool
part Part
group FXGroup
sndPath string
loop bool
maxDistance float
return bool