本文整理汇总了C#中Vessel.SpawnCrew方法的典型用法代码示例。如果您正苦于以下问题:C# Vessel.SpawnCrew方法的具体用法?C# Vessel.SpawnCrew怎么用?C# Vessel.SpawnCrew使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vessel
的用法示例。
在下文中一共展示了Vessel.SpawnCrew方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: delCrew
//remove crew from a vessel
public static List<ProtoCrewMember> delCrew(Vessel vsl, List<ProtoCrewMember> crew)
{
var deleted = new List<ProtoCrewMember>();
vsl.parts.ForEach(p => deleted.AddRange(delCrew(p, crew)));
vsl.SpawnCrew();
return deleted;
}
示例2: addCrew
//add some crew to a vessel
public static void addCrew(Vessel vsl, List<ProtoCrewMember> crew)
{
foreach(Part p in vsl.parts)
{
if(crew.Count == 0) break;
addCrew(p, crew);
}
vsl.SpawnCrew();
}
示例3: delCrew
//remove crew from a vessel
public static List<ProtoCrewMember> delCrew(Vessel vsl, List<ProtoCrewMember> crew)
{
List<ProtoCrewMember> deleted = new List<ProtoCrewMember>();
foreach(Part p in vsl.parts)
deleted.AddRange(delCrew(p, crew));
GameEvents.onVesselChange.Fire(vsl);
vsl.SpawnCrew();
return deleted;
}
示例4: RespawnCrew
internal void RespawnCrew(Vessel vessel)
{
vessel.SpawnCrew();
RMAddon.FireEventTriggers(vessel);
}
示例5: handleLoadCrew
//Thanks to sarbian's Kerbal Crew Manifest for showing all this crew handling stuff
private void handleLoadCrew(Vessel ves, int crewCount, int minCrew)
{
//print("crewCount " + crewCount);
//print(ves.GetCrewCapacity());
if (ves.GetCrewCapacity() < crewCount)
crewCount = ves.GetCrewCapacity();
string[] prefCrewNames = new string[0];
getPreferredCrewNames(ref prefCrewNames);
foreach (Part p in ves.parts)
{
if (p.CrewCapacity > p.protoModuleCrew.Count)
{
//print(p.CrewCapacity + " " + p.protoModuleCrew.Count);
for (int i = 0; i < p.CrewCapacity && crewCount > 0; i++)
{
bool added = false;
//tourist
if (minCrew <= 0)
{
foreach (String name in prefCrewNames)
{
if (!added)
{
foreach (ProtoCrewMember cr in HighLogic.CurrentGame.CrewRoster.Tourist)
{
if (name == cr.name && cr.rosterStatus == ProtoCrewMember.RosterStatus.Available)
{
if (AddCrew(p, cr))
{
crewCount = crewCount - 1;
added = true;
}
}
}
}
}
}
//preferred crew
foreach (String name in prefCrewNames)
{
if (!added)
{
foreach (ProtoCrewMember cr in HighLogic.CurrentGame.CrewRoster.Crew)
{
if (name == cr.name && cr.rosterStatus == ProtoCrewMember.RosterStatus.Available)
{
if (AddCrew(p, cr))
{
crewCount = crewCount - 1;
minCrew = minCrew - 1;
added = true;
}
}
}
}
}
//next crew or new crew
//print("one crew start");
//print("crew" + kerbal.name);
if (!added)
{
ProtoCrewMember crew = null;
crew = HighLogic.CurrentGame.CrewRoster.GetNextAvailableKerbal();
if (crew != null)
{
if (AddCrew(p, crew))
{
crewCount = crewCount - 1;
minCrew = minCrew - 1;
added = true;
}
}
}
}
}
}
ves.SpawnCrew();
}