Skip to content

Commit

Permalink
update for proc parts
Browse files Browse the repository at this point in the history
  • Loading branch information
rsparkyc committed Jun 2, 2017
1 parent d2ee410 commit ed72051
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Binary file modified GameData/ProceduralFairings/ProceduralFairings.dll
Binary file not shown.
17 changes: 13 additions & 4 deletions Source/ProcAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using UnityEngine;
using KSP.UI.Screens;


namespace Keramzit
{

Expand Down Expand Up @@ -55,17 +54,14 @@ public virtual void checkTweakables()
if (height != lastHeight) { lastHeight = height; changed = true; }
}


public virtual void FixedUpdate()
{
checkTweakables();
changed = true;
if (changed)
updateShape();
justLoaded = false;
}


public virtual void updateShape()
{
changed = false;
Expand Down Expand Up @@ -113,12 +109,25 @@ public virtual void updateShape()
}




public override void OnStart(StartState state)
{
base.OnStart(state);

if (state == StartState.None) return;

StartCoroutine(FireFirstChanged());

}

public IEnumerator<YieldInstruction> FireFirstChanged()
{
while(!(part.editorStarted || part.started)) {
yield return new WaitForFixedUpdate();
}
//wait a little more
yield return new WaitForSeconds(.01f);
changed = true;
}

Expand Down

0 comments on commit ed72051

Please sign in to comment.