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


C# Part.explode方法代码示例

本文整理汇总了C#中Part.explode方法的典型用法代码示例。如果您正苦于以下问题:C# Part.explode方法的具体用法?C# Part.explode怎么用?C# Part.explode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Part的用法示例。


在下文中一共展示了Part.explode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExplodeLeafParts

        // Destruction algorithm borrowed from TAC Self Destruct
        private void ExplodeLeafParts(Part p)
        {
            int c = p.children.Count;
            if (c == 0)
                p.explode();
            else
            {
                Part cP;
                bool passAgain = true;
                for (int i = c - 1; i >= 0; --i)
                {
                    cP = p.children[i];
                    if (cP.Modules.Contains("ProceduralFairingSide")) // this is because fairing sides hold up interstages
                        // so if you blow the sides, then everything below the interstage becomes a new vessel, and will not
                        // go boom properly.
                        continue;

                    ExplodeLeafParts(cP);
                    passAgain = false;
                }
                if (passAgain)
                {
                    for (int i = c - 1; i >= 0; --i)
                        ExplodeLeafParts(p.children[i]);
                }
            }
        }
开发者ID:Zarbizaure,项目名称:RP-0,代码行数:28,代码来源:ModuleRangeSafety.cs

示例2: CreateExplosion

 public void CreateExplosion(Part part)
 {
     float explodeScale = 0;
     for (int i = 0; i < part.Resources.Count; i++)
     {
         var current = part.Resources[i];
         switch (current.resourceName)
         {
             case "LiquidFuel":
                 explodeScale += (float)current.amount;
                 break;
             case "Oxidizer":
                 explodeScale += (float)current.amount;
                 break;
         }
     }
     explodeScale /= 100;
     part.explode();
     ExplosionFX.CreateExplosion(part.partTransform.position, explodeScale * blastRadius, explodeScale * blastPower * 2, explodeScale * blastHeat, part.vessel, FlightGlobals.upAxis, explModelPath, explSoundPath);
 }
开发者ID:gomker,项目名称:BDArmory,代码行数:20,代码来源:BDArmor.cs

示例3: RecycleKerbal

        public float RecycleKerbal(ProtoCrewMember crew, Part part)
        {
            // idea and numbers taken from Kethane
            if (crew.isBadass && part != null) {
            part.explosionPotential = 10000;
            FlightGlobals.ForceSetActiveVessel (this.vessel);
            }
            string message = crew.name + " was mulched";
            ScreenMessages.PostScreenMessage (message, 30.0f, ScreenMessageStyle.UPPER_CENTER);
            if (part != null) {
            FlightLogger.eventLog.Add ("[" + FormatTime (part.vessel.missionTime) + "] " + message);
            part.explode ();
            }

            float mass = 0;
            mass += ReclaimResource ("Kethane", 150, crew.name);
            if (ExLaunchPad.kethane_present) {
            mass += ReclaimResource ("Metal", 1, crew.name);
            } else {
            mass += ReclaimResource ("RocketParts", 1, crew.name);
            }
            return mass;
        }
开发者ID:GlassFragments,项目名称:Extraplanetary-Launchpads,代码行数:23,代码来源:Recycler.cs

示例4: RecycleKerbal

        public float RecycleKerbal(ProtoCrewMember crew, Part part)
        {
            // idea and numbers taken from Kethane
            if (crew.isBadass && part != null) {
            part.explosionPotential = 10000;
            FlightGlobals.ForceSetActiveVessel (this.vessel);
            }
            string message = crew.name + " was mulched";
            ScreenMessages.PostScreenMessage (message, 30.0f, ScreenMessageStyle.UPPER_CENTER);
            if (part != null) {
            FlightLogger.eventLog.Add ("[" + FormatTime (part.vessel.missionTime) + "] " + message);
            part.explode ();
            }

            float mass = 0;
            mass += ReclaimResource (ExSettings.KerbalRecycleTarget,
                                 ExSettings.KerbalRecycleAmount, crew.name);
            mass += ReclaimResource (ExSettings.HullRecycleTarget, 1, crew.name);
            return mass;
        }
开发者ID:Alewx,项目名称:Extraplanetary-Launchpads,代码行数:20,代码来源:Recycler.cs

示例5: tryExplode

 private void tryExplode(Part p)
 {
     try
     {
         p.explode();
     }
     catch
     {
         p.Die();
     }
 }
开发者ID:iPeer,项目名称:ClampsBeGone,代码行数:11,代码来源:Main.cs


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