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


C# Part.ToString方法代码示例

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


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

示例1: ProcFairingExplode

 private void ProcFairingExplode(VesselElementViewOptions ol, VesselElementViewOption o, Part part)
 {
     MonoBehaviour.print("Exploding Procedural Fairing: " + part.ToString());
     var nct = part.FindModelTransform("nose_collider");
     if (!nct) return;
     MeshFilter mf;
     Vector3 extents = (mf = part.gameObject.GetComponentInChildren<MeshFilter>()) ? mf.mesh.bounds.size : new Vector3(o.valueParam, o.valueParam, o.valueParam);
     part.transform.Translate(Vector3.Scale(nct.right, extents), Space.World);
 }
开发者ID:EdwardWongHau,项目名称:ksp-kronalutils,代码行数:9,代码来源:VesselViewConfig.cs

示例2: ProcFairingHide

 private void ProcFairingHide(VesselElementViewOptions ol, VesselElementViewOption o, Part part)
 {
     MonoBehaviour.print("Hiding Procedural Fairing: " + part.ToString());
     var nct = part.FindModelTransform("nose_collider");
     if (!nct) return;
     var forward = EditorLogic.startPod.transform.forward;
     var right = EditorLogic.startPod.transform.right;
     if (Vector3.Dot(nct.right, -(forward + right).normalized) > 0f)
     {
         var renderer = part.GetComponentInChildren<Renderer>();
         if (renderer) renderer.enabled = false;
     }
 }
开发者ID:EdwardWongHau,项目名称:ksp-kronalutils,代码行数:13,代码来源:VesselViewConfig.cs

示例3: EngineFairingExplode

 private void EngineFairingExplode(VesselElementViewOptions ol, VesselElementViewOption o, Part part)
 {
     MonoBehaviour.print("Exploding Engine Fairing: " + part.ToString());
     var module = part.Module<ModuleJettison>();
     if (!module.isJettisoned)
     {
         if (!module.isFairing)
         {
             module.jettisonTransform.Translate(module.jettisonDirection * o.valueParam);
         }
     }
 }
开发者ID:EdwardWongHau,项目名称:ksp-kronalutils,代码行数:12,代码来源:VesselViewConfig.cs

示例4: EngineFairingHide

 private void EngineFairingHide(VesselElementViewOptions ol, VesselElementViewOption o, Part part)
 {
     MonoBehaviour.print("Hiding Engine Fairing: " + part.ToString());
     var module = part.Module<ModuleJettison>();
     if (module.jettisonTransform)
     {
         foreach (var r in module.jettisonTransform.gameObject.GetComponentsInChildren<Renderer>())
         {
             r.enabled = false;
         }
     }
 }
开发者ID:EdwardWongHau,项目名称:ksp-kronalutils,代码行数:12,代码来源:VesselViewConfig.cs

示例5: RadialDecouplerExplode

 private void RadialDecouplerExplode(VesselElementViewOptions ol, VesselElementViewOption o, Part part)
 {
     MonoBehaviour.print("Exploding Radial Decoupler: " + part.ToString());
     var module = part.Module<ModuleAnchoredDecoupler>();
     if (module.isDecoupled) return;
     if (string.IsNullOrEmpty(module.explosiveNodeID)) return;
     var an = module.explosiveNodeID == "srf" ? part.srfAttachNode : part.findAttachNode(module.explosiveNodeID);
     if (an == null || an.attachedPart == null) return;
     var distance = o.valueParam;
     Part partToBeMoved;
     if (an.attachedPart == part.parent)
     {
         distance *= -1;
         partToBeMoved = part;
     }
     else
     {
         partToBeMoved = an.attachedPart;
     }
     partToBeMoved.transform.Translate(part.transform.right * distance, Space.World);
 }
开发者ID:EdwardWongHau,项目名称:ksp-kronalutils,代码行数:21,代码来源:VesselViewConfig.cs

示例6: DockingPortExplode

 private void DockingPortExplode(VesselElementViewOptions ol, VesselElementViewOption o, Part part)
 {
     MonoBehaviour.print("Exploding Docking Port: " + part.ToString());
     var module = part.Module<ModuleDockingNode>();
     if (string.IsNullOrEmpty(module.referenceAttachNode)) return;
     var an = part.findAttachNode(module.referenceAttachNode);
     if (!an.attachedPart) return;
     var distance = o.valueParam;
     Part partToBeMoved;
     if (an.attachedPart == part.parent)
     {
         distance *= -1;
         partToBeMoved = part;
     }
     else
     {
         partToBeMoved = an.attachedPart;
     }
     partToBeMoved.transform.Translate(module.nodeTransform.forward * distance, Space.World);
 }
开发者ID:EdwardWongHau,项目名称:ksp-kronalutils,代码行数:20,代码来源:VesselViewConfig.cs

示例7: StackDecouplerExplode

 private void StackDecouplerExplode(VesselElementViewOptions ol, VesselElementViewOption o, Part part)
 {
     MonoBehaviour.print("Exploding Stack Decoupler: " + part.ToString());
     var module = part.Module<ModuleDecouple>();
     if (module.isDecoupled) return;
     if (!part.parent) return;
     Vector3 dir;
     if (module.isOmniDecoupler)
     {
         foreach (var c in part.children)
         {
             dir = Vector3.Normalize(c.transform.position - part.transform.position);
             c.transform.Translate(dir * o.valueParam, Space.World);
         }
     }
     dir = Vector3.Normalize(part.transform.position - part.parent.transform.position);
     part.transform.Translate(dir * o.valueParam, Space.World);
 }
开发者ID:EdwardWongHau,项目名称:ksp-kronalutils,代码行数:18,代码来源:VesselViewConfig.cs

示例8: PartHideRecursive

 private void PartHideRecursive(VesselElementViewOptions ol, VesselElementViewOption o, Part part)
 {
     MonoBehaviour.print("Hiding Part " + part.ToString());
     foreach (var r in part.GetComponentsInChildren<Renderer>())
     {
         r.enabled = false;
     }
 }
开发者ID:EdwardWongHau,项目名称:ksp-kronalutils,代码行数:8,代码来源:VesselViewConfig.cs

示例9: Print_Parts_info

        private static void Print_Parts_info(Part I)
        {
            String Output = "Part Info:  \n";
            Output += "\n children.Count:" + I.children.Count;
            Output += "\n ClassID.ToString():" + I.ClassID.ToString();
            Output += "\n ClassName:" + I.ClassName;
            Output += "\n craftID.ToString():" + I.craftID.ToString();
            Output += "\n CrewCapacity.ToString():" + I.CrewCapacity.ToString();
            Output += "\n enabled.ToString():" + I.enabled.ToString();
            Output += "\n flightID.ToString():" + I.flightID.ToString();
            Output += "\n initialVesselName:" + I.initialVesselName;
            Output += "\n missionID:" + I.missionID;
            Output += "\n name:" + I.name;
            Output += "\n partName:" + I.partName;
            Output += "\n started:" + I.started;
            Output += "\n State.ToString ():" + I.State.ToString ();
            Output += "\n ToString ():" + I.ToString ();
            Output += "\n vesselType.ToString ():" + I.vesselType.ToString ();

            Debug.Log(Output);
        }
开发者ID:ve2dmn,项目名称:AsteroidScanner,代码行数:21,代码来源:MyScanner.cs

示例10: WithAttribute

 public WithAttribute(Part part, params string[] values)
     : base(string.Format("The {{0}} field must {0} with \"{1}\".", part.ToString().ToLower(), string.Join("\" or \"", values)))
 {
     _part = part;
     Values = values;         
 }
开发者ID:wduffy,项目名称:Toltech.Mvc,代码行数:6,代码来源:WithAttribute.cs

示例11: GetXML

 private string GetXML(Part part)
 {
     var match = new Regex(TableReg, RegexOptions.IgnoreCase).Match(part.ToString());
     return !match.Success ? null : match.Value;
 }
开发者ID:yangchao123,项目名称:SL.RExcel,代码行数:5,代码来源:MHTWorksheet.cs


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