-
-
Save alxhub/bb009a1ee7761bbf460c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Make sure we're using all available stuff | |
using System; | |
using UnityEngine; | |
namespace PraiseTheSun | |
{ | |
//Inherit ModuleScienceExperiment stuff | |
public class SolarExperiment : ModuleScienceExperiment{ | |
// Check if you're around the Sun, and check height from the Surface, then post the m | |
public bool checkBody() { | |
if (vessel.mainBody.name == "Sun" && vessel.heightFromSurface <= 10000000d) | |
return true; | |
ScreenMessages.PostScreenMessage("This experiment only operates around Kerbol!", 3, ScreenMessageStyle.UPPER_CENTER); | |
return false; | |
} | |
// If deploying an Experiment, check the boolean and act accordingly | |
new public void DeployExperiment() { | |
if(checkBody()) | |
base.DeployExperiment(); | |
} | |
// If doing an action, check the boolean and act accordingly | |
new public void DeployAction(KSPActionParam p) { | |
if(checkBody()) | |
base.DeployAction(p); | |
} | |
}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment