mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
Merge branch 'master' into develop
This commit is contained in:
@ -240,6 +240,17 @@ namespace ConformalDecals {
|
||||
|
||||
UpdateMaterials();
|
||||
|
||||
// handle tweakables
|
||||
if (HighLogic.LoadedSceneIsEditor) {
|
||||
GameEvents.onEditorPartEvent.Add(OnEditorEvent);
|
||||
GameEvents.onVariantApplied.Add(OnVariantApplied);
|
||||
|
||||
UpdateTweakables();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnStartFinished(StartState state) {
|
||||
// handle game events
|
||||
if (HighLogic.LoadedSceneIsGame) {
|
||||
// set initial attachment state
|
||||
if (part.parent == null) {
|
||||
@ -249,27 +260,20 @@ namespace ConformalDecals {
|
||||
OnAttach();
|
||||
}
|
||||
}
|
||||
|
||||
// handle tweakables
|
||||
if (HighLogic.LoadedSceneIsEditor) {
|
||||
GameEvents.onEditorPartEvent.Add(OnEditorEvent);
|
||||
GameEvents.onVariantApplied.Add(OnVariantApplied);
|
||||
|
||||
UpdateTweakables();
|
||||
}
|
||||
|
||||
// handle flight events
|
||||
if (HighLogic.LoadedSceneIsFlight) {
|
||||
GameEvents.onPartWillDie.Add(OnPartWillDie);
|
||||
|
||||
if (part.parent == null) part.explode();
|
||||
|
||||
Part.layerMask |= 1 << DecalConfig.DecalLayer;
|
||||
decalColliderTransform.gameObject.layer = DecalConfig.DecalLayer;
|
||||
|
||||
if (!selectableInFlight || !DecalConfig.SelectableInFlight) {
|
||||
decalColliderTransform.GetComponent<Collider>().enabled = false;
|
||||
_boundsRenderer.enabled = false;
|
||||
}
|
||||
|
||||
if (part.parent == null) part.explode();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user