本文整理汇总了C#中StartState类的典型用法代码示例。如果您正苦于以下问题:C# StartState类的具体用法?C# StartState怎么用?C# StartState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StartState类属于命名空间,在下文中一共展示了StartState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnStart
public override void OnStart(StartState state)
{
if (!String.IsNullOrEmpty(Pivot1Name) && !String.IsNullOrEmpty(Pivot2Name)) {
ForceTransform = part.FindModelTransform(Pivot2Name);
BreakTransform = part.FindModelTransform(Pivot1Name);
} else {
RTUtil.Log("ModuleRTAntennaAnimated: Pivot error");
enabled = false;
return;
}
if (IsRTBroken) {
TrackingMode = TrackingModes.Broken;
}
base.OnStart(state);
if (RTCore.Instance != null) {
mPivot1 = new Pivot(BreakTransform, Pivot1Speed, Pivot1Range);
mPivot2 = new Pivot(ForceTransform, Pivot2Speed, Pivot2Range);
if (IsRTActive) {
TrackingMode = TrackingModes.Tracking;
mPivot1.SnapToTarget(new DynamicTarget(RTAntennaTargetGuid));
mPivot2.SnapToTarget(new DynamicTarget(RTAntennaTargetGuid));
}
}
}
示例2: OnStart
public override void OnStart(StartState state)
{
base.OnStart(state);
loadValuesFromConfig();
//Parse planet efficiencies
string[] efficiencies = planetEfficiencies.Split(new char[] { ';' });
string[] efficiencyID;
foreach (string efficiency in efficiencies)
{
efficiencyID = efficiency.Split(new char[] { ',' });
efficiencyModifiers.Add(int.Parse(efficiencyID[0]), float.Parse(efficiencyID[1]));
}
//Now set the efficiency based upon planet.
int planetID = this.part.vessel.mainBody.flightGlobalsIndex;
if (efficiencyModifiers.ContainsKey(planetID))
{
this.Efficiency = efficiencyModifiers[planetID];
}
efficiencyString = "Geothermal Efficiency";
}
示例3: OnStart
public override void OnStart(StartState state)
{
base.OnStart (state);
parseTransformData();
findTransforms();
updateGuiData();
}
示例4: OnStart
//the part that is enabled and disabled
public override void OnStart(StartState state)
{
base.OnStart(state);
string[] transformGroupNames = transormNames.Split(',');
models = new List<ModelTransforms>();
//----------------------------------------------------------
//create the list of transforms to be made switchable
//----------------------------------------------------------
foreach (string transformName in transformGroupNames)
{
name = transformName.Trim();
List<Transform> transforms = new List<Transform>();
transforms.AddRange(part.FindModelTransforms(name));
ModelTransforms mt = new ModelTransforms();
mt.transforms = new List<Transform>();
mt.transforms.AddRange(transforms);
models.Add(mt);
}
if (!HighLogic.LoadedSceneIsEditor)
{
Events["toggleModel"].guiActive = false;
}
updateActiveModel();
}
示例5: OnStart
public override void OnStart(StartState state)
{
base.OnStart(state);
base.Startup();
if (Failed)
DoFailure();
}
示例6: OnStart
public override void OnStart(StartState state)
{
base.OnStart (state);
if (state != StartState.Editor) {
RenderingManager.AddToPostDrawQueue (0, OnGUI);
}
}
示例7: OnStart
public override void OnStart(StartState state)
{
base.OnStart(state);
if (state == StartState.Editor || state == StartState.None) return;
KAS_Shared.createFXSound(this.part, fxSndAttach, attachSndPath, false);
KAS_Shared.createFXSound(this.part, fxSndDetach, detachSndPath, false);
}
示例8: OnStart
public override void OnStart(StartState state)
{
base.OnStart(state);
if (HighLogic.LoadedSceneIsFlight == false)
{
setupExperimentGUI();
return;
}
//Get drill animation
drillAnimation = this.part.FindModuleImplementing<ModuleAnimationGroup>();
//Harvester
harvester = this.part.FindModuleImplementing<ModuleResourceHarvester>();
//Core sample state
coreSampleState = CoreSampleStates.Ready;
//If the biome has been unlocked yet then get the samples left
if (situationIsValid() && Utils.IsBiomeUnlocked(this.part.vessel))
coreSampleStatus = getSamplesLeft().ToString();
else
coreSampleStatus = kUnknown;
//Setup the gui
setupGUI();
}
示例9: OnStart
public override void OnStart(StartState state)
{
base.OnStart (state);
initResource (); //find ablator resource in part
initMeshes (); //load mesh from mesh names specified in config
updateHeatShieldColor (); //update heat-shield color to appropriate color from stored ablator amount
}
示例10: OnStart
public override void OnStart(StartState state)
{
if (state == StartState.Editor && !spawned) {
currentState = initialState;
} else {
part.CrewCapacity = currentState ? capacityWhenTrue : capacityWhenFalse;
if (vessel.situation == Vessel.Situations.PRELAUNCH) {
int difference = part.protoModuleCrew.Count - part.CrewCapacity;
if (difference > 0) {
JUtil.LogMessage (this, "Stowaways found in part {0}", part.partName);
}
var stowaways = new List<ProtoCrewMember> ();
// We go through the list backwards, assuming that the 'more important' seats are first in the list of seats.
for (int i = part.protoModuleCrew.Count - 1; i >= 0; i--) {
if (difference > 0) {
stowaways.Add (part.protoModuleCrew [i]);
difference--;
} else {
break;
}
}
foreach (ProtoCrewMember stowaway in stowaways) {
part.RemoveCrewmember (stowaway);
stowaway.seat = null;
stowaway.rosterStatus = ProtoCrewMember.RosterStatus.Available;
}
JUtil.LogMessage (this, "{0} stowaways evicted.", stowaways.Count);
}
// And then make sure the seat flags are correct.
AlterCrewCapacity (part);
if (vessel.isActiveVessel)
GameEvents.onVesselChange.Fire (vessel);
}
spawned = true;
}
示例11: OnStart
public override void OnStart(StartState state)
{
base.OnStart(state);
//Grab the survey module
orbitalSurveyer = this.part.FindModuleImplementing<ModuleOrbitalSurveyor>();
orbitalScanner = this.part.FindModuleImplementing<ModuleOrbitalScanner>();
//Verify that the planet is really unlocked
verifyPlanetUnlock();
//Hide stock survey GUI
if (orbitalSurveyer != null)
{
orbitalSurveyer.Events["PerformSurvey"].guiActive = false;
orbitalSurveyer.Events["PerformSurvey"].guiActiveUnfocused = false;
orbitalSurveyer.Events["PerformSurvey"].guiActiveEditor = false;
}
//Create swizzler
swizzler = new WBIResultsDialogSwizzler();
swizzler.onTransmit = transmitData;
//Setup the science container
scienceContainer = this.part.FindModuleImplementing<ModuleScienceContainer>();
scienceContainer.Events["ReviewDataEvent"].guiActiveUnfocused = false;
scienceContainer.Events["ReviewDataEvent"].guiActive = false;
//Now setup our own GUI
botchedResultsMsg = kSafeMode;
SetupGUI();
}
示例12: OnStart
//set the names of the actions
public override void OnStart(StartState state)
{
base.OnStart(state);
Events["changeRate"].guiName = changeRateString;
Fields["guiProductionRate"].guiName = converterRateName;
}
示例13: OnStart
/* SAT: KSP entry points */
public override void OnStart ( StartState state )
{
if (state == StartState.Editor)
{
print ("[SCANsat] start: in editor");
Events["editorExtend"].active = !string.IsNullOrEmpty(animationName);
} else
{
print ("[SCANsat] start: live");
}
if (animationName != null)
{
Animation[] a = part.FindModelAnimators (animationName);
if (a.Length == 0)
{
print ("[SCANsat] animation '" + animationName + "' not found");
} else
{
print ("[SCANsat] using animation #1 out of " + a.Length.ToString () + " animations named '" + animationName + "'");
anim = a [0];
// maybe use this later for advanced animation...
Transform modeltransform = part.transform.FindChild ("model");
foreach (Transform t in modeltransform.GetComponentsInChildren<Transform>())
{
//print("[SCANsat] transform " + t.name + ": " + t);
}
}
}
print ("[SCANsat] sensorType: " + sensorType.ToString () + " fov: " + fov.ToString () + " min_alt: " + min_alt.ToString () + " max_alt: " + max_alt.ToString () + " best_alt: " + best_alt.ToString () + " power: " + power.ToString ());
}
示例14: OnStart
public override void OnStart(StartState state)
{
base.OnStart(state);
_basePitchTorque = PitchTorque;
_baseYawTorque = YawTorque;
_baseRollTorque = RollTorque;
}
示例15: OnStart
public override void OnStart(StartState state)
{
// parent OnStart
base.OnStart(state);
module = Utils.getModuleByType<ModuleReactionWheel>(base.part);
}