Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions HLAirships/HLEnvelope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,21 +281,18 @@ public void BuoyancyC_Action(KSPActionParam param)

public override void OnAwake()
{
if (!HighLogic.LoadedSceneIsEditor && !HighLogic.LoadedSceneIsFlight)
return;

this.objGravity = new GameObject();
this.objUp = new GameObject();
this.objPosition = new GameObject();
this.objUpProjected = new GameObject();
this.objPositionProjected = new GameObject();

/// Constructor style setup.
/// Called in the Part\'s Awake method.
/// The model may not be built by this point.

// Set starting animation state
Debug.Log("Set Envelope Animation");
/// Constructor style setup.
/// Called in the Part\'s Awake method.
/// The model may not be built by this point.

this.objGravity = new GameObject();
this.objUp = new GameObject();
this.objPosition = new GameObject();
this.objUpProjected = new GameObject();
this.objPositionProjected = new GameObject();

// Set starting animation state
Debug.Log("Set Envelope Animation");
if (animationState == 0 || targetBuoyantVessel == 0)
{
// If it does not have animation start it "opened"
Expand Down Expand Up @@ -438,9 +435,6 @@ public void animateEnvelope()

public override void OnStart(StartState state)
{
if (!HighLogic.LoadedSceneIsEditor && !HighLogic.LoadedSceneIsFlight)
return;

// OnFlightStart seems to have been removed
/// Called during the Part startup.
/// StartState gives flag values of initial state
Expand Down Expand Up @@ -493,6 +487,9 @@ public override void OnFixedUpdate()
/// Called ONLY when Part is ACTIVE!
///

if (!HighLogic.LoadedSceneIsEditor && !HighLogic.LoadedSceneIsFlight)
return;

if (leadEnvelope == this.part) leadEnvelopeUpdate();

// Update buoyancy properties
Expand Down