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


C# Part.SendMessage方法代码示例

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


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

示例1: SendKISMessage

 public static void SendKISMessage(Part destPart, MessageAction action, Part tgtPart = null, AttachNode tgtNode = null)
 {
     BaseEventData bEventData = new BaseEventData(BaseEventData.Sender.AUTO);
     bEventData.Set("action", action.ToString());
     bEventData.Set("targetPart", tgtPart);
     bEventData.Set("targetNode", tgtNode);
     destPart.SendMessage("OnKISAction", bEventData, SendMessageOptions.DontRequireReceiver);
 }
开发者ID:Amorymeltzer,项目名称:KIS,代码行数:8,代码来源:KIS_Shared.cs

示例2: WaitAndSendMsg

 private IEnumerator WaitAndSendMsg(Part partToAttach, Vector3 position, Quaternion rotation, Part toPart = null)
 {
     while (!partToAttach.rigidbody)
     {
         KAS_Shared.DebugLog("WaitAndAttach(Pointer) - Waiting rigidbody to initialize...");
         yield return new WaitForFixedUpdate();
     }
     if (toPart)
     {
         KAS_Shared.DebugLog("WaitAndAttach(Pointer) - Rigidbody initialized, setting velocity...");
         partToAttach.rigidbody.velocity = toPart.rigidbody.velocity;
         partToAttach.rigidbody.angularVelocity = toPart.rigidbody.angularVelocity;
         KAS_Shared.DebugLog("WaitAndAttach(Pointer) - Waiting velocity to apply by waiting 0.1 seconds...");
         yield return new WaitForSeconds(0.1f);
         partToAttach.transform.position = position;
         partToAttach.transform.rotation = rotation;
         partToAttach.SendMessage("OnAttachPart", toPart, SendMessageOptions.DontRequireReceiver);
     }
     else
     {
         partToAttach.transform.position = position;
         partToAttach.transform.rotation = rotation;
         partToAttach.SendMessage("OnAttachStatic", SendMessageOptions.DontRequireReceiver);
     }
 }
开发者ID:ACCBizon,项目名称:KAS,代码行数:25,代码来源:KASAddonPointer.cs

示例3: onPartGeometryUpdate

 public static void onPartGeometryUpdate(Part part, bool createDefaultCube)
 {
     if (isFARInstalled())
     {
         part.SendMessage("GeometryPartModuleRebuildMeshData");
     }
     else if (createDefaultCube && (HighLogic.LoadedSceneIsEditor || HighLogic.LoadedSceneIsFlight))
     {
         DragCube newDefaultCube =DragCubeSystem.Instance.RenderProceduralDragCube(part);
         newDefaultCube.Weight = 1f;
         newDefaultCube.Name = "Default";
         part.DragCubes.ClearCubes();
         part.DragCubes.Cubes.Add(newDefaultCube);
         part.DragCubes.ResetCubeWeights();
     }
 }
开发者ID:Joshg213,项目名称:SSTULabs,代码行数:16,代码来源:SSTUModInterop.cs

示例4: onPartGeometryUpdate

 /// <summary>
 /// Updates part highlight renderer list, sends message to SSTUFlagDecal to update its renderer,
 ///  sends message to FAR to update voxels, or if createDefaultCube==true will re-render the 'default' stock drag cube for the part<para/>
 /// Should be called anytime the model geometry in a part is changed -- either models added/deleted, procedural meshes updated.  Other methods exist for pure drag-cube updating in SSTUStockInterop.
 /// </summary>
 /// <param name="part"></param>
 /// <param name="createDefaultCube"></param>
 public static void onPartGeometryUpdate(Part part, bool createDefaultCube)
 {
     if (!HighLogic.LoadedSceneIsEditor && !HighLogic.LoadedSceneIsFlight) { return; }//noop on prefabs
     //MonoBehaviour.print(System.Environment.StackTrace);
     SSTUStockInterop.updatePartHighlighting(part);
     part.airlock = locateAirlock(part);
     part.SendMessage("onPartGeometryChanged", part);//used by SSTUFlagDecal and potentially others in the future
     if (isFARInstalled())
     {
         //FARdebug(part);
         part.SendMessage("GeometryPartModuleRebuildMeshData");
     }
     else if (createDefaultCube && (HighLogic.LoadedSceneIsEditor || HighLogic.LoadedSceneIsFlight))
     {
         SSTUStockInterop.addDragUpdatePart(part);
     }
 }
开发者ID:shadowmage45,项目名称:SSTULabs,代码行数:24,代码来源:SSTUModInterop.cs


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