当前位置: 首页>>代码示例>>C#>>正文


C# Vessel.SpawnCrew方法代码示例

本文整理汇总了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;
 }
开发者ID:pjslauta,项目名称:hangar,代码行数:8,代码来源:CrewTransfer.cs

示例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();
 }
开发者ID:pjslauta,项目名称:hangar,代码行数:10,代码来源:CrewTransfer.cs

示例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;
 }
开发者ID:kevin-ye,项目名称:hangar,代码行数:10,代码来源:CrewTransfer.cs

示例4: RespawnCrew

 internal void RespawnCrew(Vessel vessel)
 {
     vessel.SpawnCrew();
     RMAddon.FireEventTriggers(vessel);
 }
开发者ID:JPLRepo,项目名称:RosterManager,代码行数:5,代码来源:RMAddon.cs

示例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();
        }
开发者ID:PrivateFlip,项目名称:RoutineMissionManager,代码行数:84,代码来源:Routine.cs


注:本文中的Vessel.SpawnCrew方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。