本文整理汇总了C#中Vessel.GetName方法的典型用法代码示例。如果您正苦于以下问题:C# Vessel.GetName方法的具体用法?C# Vessel.GetName怎么用?C# Vessel.GetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vessel
的用法示例。
在下文中一共展示了Vessel.GetName方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Mission
// Mission is created only if the have a Vessel
// Check the vessel, if ok - create the mission
public Mission(Vessel ves)
{
if (this.is_vessel_fits_to_mission(ves))
{
KDebug.Log("Mission is creating by Vessel: " + ves.ToString(), KDebug.Type.CREATE);
this.missionId = Mission.mission_id(ves);
this.missionApproved = true;
this.missionName = ves.GetName(); // Name of the mission is the name of the Vessel
this.missionSituation = ves.situation;
this.missionTime = Mission.mission_time(); // Static call
if (String.IsNullOrEmpty(this.missionName) ) this.missionName = ves.name; // Let's see the unknown created vessels
}
else this.missionApproved = false; // No mission is created, we should not use this mission object
}
示例2: Record
public void Record(Ribbon ribbon, Vessel vessel)
{
if(vessel==null)
{
Log.Warning("no vessel for recorded ribbon "+ribbon.GetName());
return;
}
if (Log.IsLogable(Log.LEVEL.DETAIL)) Log.Detail("recording ribbon "+ribbon.GetName()+" for vessel "+vessel.GetName());
List<ProtoCrewMember> crew = vessel.GetVesselCrew();
if (crew != null)
{
hallOfFame.BeginArwardOfRibbons();
foreach (ProtoCrewMember member in crew)
{
if(!member.IsTourist())
{
Record(ribbon, member);
}
}
hallOfFame.EndArwardOfRibbons();
}
}
示例3: OnOrbitChange
private void OnOrbitChange(Vessel ActiveVessel)
{
//if(ActiveVessel.id !=
Debug.Log("Running OnOrbitChange() / check for periapsis for :" + ActiveVessel.GetName() );
if (!ActiveVessel.PatchedConicsAttached)
{
Debug.Log ("No PatchedConicSolver. Creating a New One. ");
try
{
//v.patchedConicSolver = new PatchedConicSolver ();
ActiveVessel.AttachPatchedConicsSolver ();
ActiveVessel.patchedConicSolver.IncreasePatchLimit ();
ActiveVessel.patchedConicSolver.Update ();
} catch (Exception ex)
{
Debug.Log ("Could not attach patchedConicSolver. Exception:" + ex);
//DontdetachConics = true;
//v.DetachPatchedConicsSolver ();
}
}
Orbit o = ActiveVessel.orbit;
while(o.activePatch)
{
//@@@TODO: Make Altitude variable. 70k for now
Debug.Log("Check Orbit" );
if (o.referenceBody.name == FlightGlobals.Bodies [1].bodyName) // Around Kerbin
{
if(o.PeA >= 70000 )
{
base.SetComplete();
return;
}
if(o.PeA < 70000 )
{
base.SetIncomplete();
return;
}
}
o = o.nextPatch;
}
}
示例4: OnVesselChange
private void OnVesselChange(Vessel vessel)
{
if(vessel==null)
{
Log.Warning("vessel change without a valid vessel detected");
return;
}
// we have to detect a closed orbit again...
this.orbitClosed = false;
ResetObserver();
ResetLandedVesselHasMovedFlag();
//
Log.Info("EventObserver:: OnVesselChange " + vessel.GetName());
if (!vessel.isActiveVessel) return;
//
this.previousVesselState = null;
CheckAchievementsForVessel(vessel);
//
Log.Detail("vessel change finished");
}
示例5: OnLandedVesselMove
private void OnLandedVesselMove(Vessel vessel)
{
Log.Detail("EventObserver:: OnLandedVesselMove " + vessel.GetName());
if (vessel.isActiveVessel)
{
VesselState vesselState = new VesselState(vessel);
CheckAchievementsForVessel(vesselState.MovedOnSurface());
}
}
示例6: OnEnteringDeepAthmosphere
private void OnEnteringDeepAthmosphere(Vessel vessel)
{
Log.Detail("EventObserver:: OnEnteringDeepAthmosphere " + vessel.GetName() );
if (vessel.isActiveVessel)
{
CheckAchievementsForVessel(vessel);
}
}
示例7: OnVesselOrbitClosed
private void OnVesselOrbitClosed(Vessel vessel)
{
orbitClosed = true;
Log.Detail("EventObserver:: OnVesselOrbitClosed " + vessel.GetName());
if(vessel.isActiveVessel)
{
CheckAchievementsForVessel(vessel);
}
}
示例8: RefuelMain
internal void RefuelMain(int id)
{
style = RRSettingsController.get_label_default();
style_10px_row = RRSettingsController.get_label_10px();
style_20px_row = RRSettingsController.get_label_20px();
style_40px_row = RRSettingsController.get_label_40px();
style_60px_row = RRSettingsController.get_label_60px();
style_80px_row = RRSettingsController.get_label_80px();
style_100px_row = RRSettingsController.get_label_100px();
style_120px_row = RRSettingsController.get_label_120px();
style_stretchWidth_row = RRSettingsController.get_label_stretchWidth();
get_button_80px = RRSettingsController.get_button_80px();
buttonStyle = RRSettingsController.get_button_100px();
buttonStyle_active = RRSettingsController.get_button_100px_active();
splitter = RRSettingsController.get_splitter();
vessel = FlightGlobals.fetch.activeVessel;
RRDATAcontroller.update_StorageTotals();
GUILayout.Label("FlightRefuelController: ToDo", style);
string currentPlanet = Utilities.get_current_planet();
//ConfigNode PlanetNode = Scenario.get_PlanetNode(currentPlanet);
groupFilter = (groupFilter == null) ? "all" : groupFilter;
groupFilter = ButtonController.get_groupFilter("all");
//if (vessel.checkLanded())
if (IsStationary())
{
if (resourceSelected != null)
{
ConfigNode SelectedResource = RRDATAcontroller.get_ResourceNode(resourceSelected);
string res_nam = resourceSelected;
//Debug.Log("ResourceRecovery: RefuelMain: beginn resourceSelected");
GUILayout.BeginHorizontal();
GUILayout.BeginVertical();
GUILayout.BeginHorizontal();
if (GUILayout.Button("Back", get_button_80px))
{
Debug.Log("Resource Recovery: resourceSelected: Clicked BackButton");
resourceSelected = null;
}
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
GUILayout.BeginVertical();
GUILayout.Label("ResourceData: " + res_nam, style, GUILayout.Width(200));
if (RRSettingsController.get_KSCPlanet()!=Utilities.get_current_planet())
{
double string_number3 = 0;
double.TryParse(SelectedResource.GetValue("storagecapacity"), out string_number3);
GUILayout.Label(String.Format("Storage Capacity: {0}", string_number3), style_120px_row);
}
else
{
GUILayout.Label(String.Format("Storage Capacity: {0}", SelectedResource.GetValue("storagecapacity")), style_120px_row);
}
if(SelectedResource.GetValue("supply_mode") != "0")
{
double string_number2 = 0;
double.TryParse(SelectedResource.GetValue("storedamount"), out string_number2);
GUILayout.Label(String.Format("Available: {0}", Math.Round(string_number2,2)), style_120px_row);
}
else
{
GUILayout.Label(String.Format("Available: {0}", RRSettingsController.get_resource_supply_mode_definition(0)), style_120px_row);
}
GUILayout.EndVertical();
GUILayout.BeginVertical();
GUILayout.Label("ShipData:", style_100px_row);
GUILayout.Label(String.Format("{0}", vessel.GetName()), style_120px_row);
resources = new Dictionary<string, ResourceInfo>();
RebuildPartsLists(vessel, resources);
double all_parts_max_amount = 0;
double all_parts_amount = 0;
double all_parts_required = 0;
foreach (KeyValuePair<string, ResourceInfo> pair in GetResourceInfo())
{
ResourceInfo resourceInfo = pair.Value;
resourceInfo.pair_key = pair.Key;
resourceInfo.isShowing = (pair.Key != resourceSelected) ? false : true;
if (resourceInfo.isShowing)
{
foreach (ResourcePartMap partInfo in resourceInfo.parts)
{
PartResource resource = partInfo.resource;
all_parts_max_amount += resource.maxAmount;
all_parts_amount += resource.amount;
}
}
}
all_parts_required = all_parts_max_amount - all_parts_amount;
GUILayout.Label(String.Format("maxAmount: {0}", Math.Round(all_parts_max_amount,2)), style_120px_row);
GUILayout.Label(String.Format("Amount: {0}", Math.Round(all_parts_amount,2)), style_120px_row);
GUILayout.Label(String.Format("Required: {0}", Math.Round(all_parts_required,2)), style_120px_row);
GUILayout.EndVertical();
//.........这里部分代码省略.........
示例9: InitializeParts
private void InitializeParts(Vessel vessel)
{
Log("TestFlightManager: Initializing parts for vessel " + vessel.GetName());
// Launch time is equal to current UT unless we have already cached this vessel's launch time
double launchTime = Planetarium.GetUniversalTime();
if (knownVessels.ContainsKey(vessel.id))
{
launchTime = knownVessels[vessel.id];
}
foreach (Part part in vessel.parts)
{
ITestFlightCore core = TestFlightUtil.GetCore(part);
if (core != null)
{
Log("TestFlightManager: Found core. Getting part data");
if (TestFlightManagerScenario.Instance.SettingsAlwaysMaxData)
{
core.InitializeFlightData(core.GetMaximumData());
}
else
{
TestFlightPartData partData = tfScenario.GetPartDataForPart(TestFlightUtil.GetFullPartName(part));
if (partData != null)
{
core.InitializeFlightData(partData.GetFloat("flightData"));
}
else
core.InitializeFlightData(0f);
}
}
}
}
示例10: doScience
public void doScience(Vessel target)
{
print("DOING SCIENCE, " + target.GetName());
print("CLASS: " + target.DiscoveryInfo.size.Value);
ScienceExperiment experiment = ResearchAndDevelopment.GetExperiment((techType == "Occultation") ? ("CactEyeOccultationAsteroid_" + target.DiscoveryInfo.size.Value) : ("CactEyeAsteroid_" + target.DiscoveryInfo.size.Value));
ScienceSubject subject = ResearchAndDevelopment.GetExperimentSubject(experiment, ExperimentSituations.InSpaceHigh, FlightGlobals.Bodies[1], "");
float sciTrans = Mathf.Max(subject.scientificValue - (1f - (opticsModule.isSmallOptics ? 0.10f : maxScience)), 0.0f);
if (sciTrans == subject.scientificValue)
fullRecovery = true;
print("Current sciTrans: " + sciTrans);
ScienceData data = new ScienceData(Mathf.Max(experiment.baseValue * subject.dataScale * sciTrans, 0.001f), 1.0f, 0.0f, subject.id, pName + " " + experiment.experimentTitle);
storedData.Add(data);
dataAsteroid = true;
Events["eventReviewScience"].active = true;
Events["eventDumpData"].active = true;
eventReviewScience();
}
示例11: OnVesselWasModified
private void OnVesselWasModified(Vessel v)
{
if ((object)v == null)
return;
if (KJRJointUtils.debug)
{
StringBuilder debugString = new StringBuilder();
debugString.AppendLine("KJR: Modified vessel " + v.id + " (" + v.GetName() + ")");
debugString.AppendLine(System.Environment.StackTrace);
debugString.AppendLine("Now contains: ");
foreach (Part p in v.Parts)
debugString.AppendLine(" " + p.partInfo.name + " (" + p.flightID + ")");
Debug.Log(debugString);
}
updatedVessels.Remove(v);
RunVesselJointUpdateFunction(v);
}
示例12: RunVesselJointUpdateFunction
private void RunVesselJointUpdateFunction(Vessel v)
{
if (KJRJointUtils.debug)
{
Debug.Log("KJR: Processing vessel " + v.id + " (" + v.GetName() + "); root " +
v.rootPart.partInfo.name + " (" + v.rootPart.flightID + ")");
}
bool child_parts = false;
bool success = false;
foreach (Part p in v.Parts)
{
if (p.parent != null && p.physicalSignificance == Part.PhysicalSignificance.FULL)
{
child_parts = true;
if (p.attachJoint != null)
{
success = true;
if (KJRJointUtils.reinforceAttachNodes)
UpdatePartJoint(p);
}
}
if (KJRJointUtils.reinforceDecouplersFurther)
if (ValidDecoupler(p))
{
KJRJointUtils.AddDecouplerJointReinforcementModule(p);
continue;
}
if (KJRJointUtils.reinforceLaunchClampsFurther)
if (p.Modules.Contains("LaunchClamp") && p.parent != null)
{
p.breakingForce = Mathf.Infinity;
p.breakingTorque = Mathf.Infinity;
p.mass = Mathf.Max(p.mass, (p.parent.mass + p.parent.GetResourceMass()) * 0.01f); //We do this to make sure that there is a mass ratio of 100:1 between the clamp and what it's connected to. This helps counteract some of the wobbliness simply, but also allows some give and springiness to absorb the initial physics kick
if (KJRJointUtils.debug)
Debug.Log("KJR: Launch Clamp Break Force / Torque increased");
if (!p.Modules.Contains("KJRLaunchClampReinforcementModule"))
KJRJointUtils.AddLaunchClampReinforcementModule(p);
}
}
if (success || !child_parts)
updatedVessels.Add(v);
}
示例13: createAsteroidSpectralData
private static ImpactScienceData createAsteroidSpectralData(CelestialBody crashBody, Vessel asteroid, Vessel crashVessel, uint flightID)
{
double crashVelocity = crashVessel.srf_velocity.magnitude;
Log("Velocity=" + crashVelocity);
float crashMasss = crashVessel.GetTotalMass() * 1000;
double crashEnergy = 0.5 * crashMasss * crashVelocity * crashVelocity; //KE of crash
ScienceExperiment experiment = ResearchAndDevelopment.GetExperiment("AsteroidSpectometry");
ExperimentSituations situation = ScienceUtil.GetExperimentSituation(asteroid);
ScienceSubject subject = ResearchAndDevelopment.GetExperimentSubject(experiment, situation, asteroid.id.ToString(), asteroid.GetName(), crashBody, "");
double science = subject.scienceCap;
Log("Impact took place in " + situation);
String flavourText = "Impact at {0} on {1}";
science /= subject.subjectValue;
ImpactScienceData data = new ImpactScienceData(0, asteroid.GetName(),
(float)(science * subject.dataScale), 1f, 0, subject.id,
String.Format(flavourText, asteroid.GetName(), crashBody.theName), false, flightID);
ScreenMessages.PostScreenMessage(
String.Format("Recorded spectrographic impact data at {0} around {1}", asteroid.GetName(), crashBody.theName),
5.0f, ScreenMessageStyle.UPPER_RIGHT);
return data;
}