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


C# Part.SetHighlight方法代码示例

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


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

示例1: Remove

 static internal void Remove (Part part)
 {
     if (highlight.ContainsKey (CallContext.Client))
         highlight [CallContext.Client].Remove (part);
     part.highlightType = Part.HighlightType.OnMouseOver;
     part.SetHighlight (false, false);
 }
开发者ID:paperclip,项目名称:krpc,代码行数:7,代码来源:PartHighlightAddon.cs

示例2: Add

 static internal void Add (Part part)
 {
     if (!highlight.ContainsKey (CallContext.Client))
         highlight [CallContext.Client] = new List<Part> ();
     highlight [CallContext.Client].Add (part);
     part.highlightType = Part.HighlightType.AlwaysOn;
     part.SetHighlight (true, false);
 }
开发者ID:paperclip,项目名称:krpc,代码行数:8,代码来源:PartHighlightAddon.cs

示例3: Add

        public void Add(Part p)
        {
            if (internalHighlight.Contains(p))
                return;

            internalHighlight.Add(p);
            p.highlightColor = Color.blue;
            p.SetHighlight(true);
        }
开发者ID:KaiSforza,项目名称:ActionGroupManager,代码行数:9,代码来源:Highlighter.cs

示例4: ClearHighlight

        public static void ClearHighlight(Part part)
        {
            try
            {

                if (part != null)
                {
                    part.SetHighlightDefault();
                    part.SetHighlight(false);
                }
            }
            catch (Exception ex)
            {
                Debug.Log(" in ClearHighlight. Error: {0} \r\n\r\n{1}"+ ex.Message+ ex.StackTrace);
            }
        }
开发者ID:philotical,项目名称:ResourceRecovery,代码行数:16,代码来源:FlightRefuelController.cs

示例5: SetPartGlow

        private void SetPartGlow(Part part, bool active)
        {
            if (active) {

            part.SetHighlightColor(Color.magenta);
            part.SetHighlightType(Part.HighlightType.AlwaysOn);
            part.SetHighlight(true, true);

              } else {
            /*        part.SetHighlightColor(Color.red);
                part.SetHighlightType(Part.HighlightType.OnMouseOver);
                part.SetHighlight(false);*/
              }
              /*      foreach (Part child in part.children)
              SetPartGlow(part, active); */
        }
开发者ID:zachwillms,项目名称:MunarIndustries,代码行数:16,代码来源:CameraFilterThermal.cs

示例6: ClearPartHighlight

 /// <summary>
 /// Remove highlighting on a part.
 /// </summary>
 /// <param name="part">Part to remove highlighting from.</param>
 internal static void ClearPartHighlight(Part part)
 {
     try
     {
         if (part != null)
         {
             part.SetHighlight(false, false);
             part.SetHighlightDefault();
             part.highlightType = Part.HighlightType.OnMouseOver;
         }
     }
     catch (Exception ex)
     {
         Utilities.LogMessage(string.Format(" in  ClearPartHighlight.  Error:  {0} \r\n\r\n{1}", ex.Message, ex.StackTrace), "Error", true);
     }
 }
开发者ID:Shavenbeard,项目名称:ShipManifest,代码行数:20,代码来源:SMHighlighter.cs

示例7: SetPartHighlight

        public static void SetPartHighlight(Part part, Color color)
        {
            try
            {

                if (part != null)
                {
                    part.SetHighlightColor(color);
                    part.SetHighlight(true);
                }
            }
            catch (Exception ex)
            {
                Debug.Log(" in SetPartHighlight. Error: {0} \r\n\r\n{1}"+ ex.Message+ ex.StackTrace);
            }
        }
开发者ID:philotical,项目名称:ResourceRecovery,代码行数:16,代码来源:FlightRefuelController.cs

示例8: RemoveHighlight

        public void RemoveHighlight(Part HighlightPart)
        {
            if (null == HighlightPart) { return; }
            Debug.LogError("SAFix.RemoveHighlight()");

            HighlightPart.SetHighlightColor();
            HighlightPart.SetHighlight(false, false);

            if (null == HighlightPart.symmetryCounterparts) { return; }

            for (int IndexSiblings = 0; IndexSiblings < HighlightPart.symmetryCounterparts.Count; IndexSiblings++)
            {
                Part Sibling = HighlightPart.symmetryCounterparts[IndexSiblings];
                Sibling.SetHighlightColor();
                Sibling.SetHighlight(false, true);
            }
        }
开发者ID:cpcallen,项目名称:KSP-Stock-Bug-Fix-Modules,代码行数:17,代码来源:SymmetryActionFix.cs

示例9: HighlightPartAndChildren

        // Recurse through a branch and highlight the parts based on main vs. sibling branches
        // isParent = true means that the part is the first for a given branch (main or sibling branch)
        // isMainBranch = true means that the part is in the main moused over branch
        // Activate = true turns on highligting, false turns it off
        public void HighlightPartAndChildren(Part HighlightPart, bool isParent, bool isMainBranch, bool Activate)
        {
            if (null == HighlightPart) { return; }

            Color HighlightColor = Color.white;

            //if (true == inParentBranch) // In main parent branch
            //{
            //    if (true == isParent)
            //    {
            //        HighlightColor = Color.blue;
            //    }
            //    else
            //    {
            //        HighlightColor = Color.magenta;
            //    }
            //}
            //else // In sibling branch
            //{
            //    if (true == isParent)
            //    {
            //        HighlightColor = Color.blue;
            //    }
            //    else
            //    {
            //        HighlightColor = Color.cyan;
            //    }
            //}

            if (true == isMainBranch) // In main  branch
            {
               HighlightColor = Color.green;
            }
            else
            {
                HighlightColor = Color.blue;
            }
            if (true != isParent) // Subdue Children
            {
                HighlightColor *= 0.667f;
            }

            if (true == Activate)
            {
                HighlightPart.SetHighlightColor(HighlightColor);
            }
            else
            {
                HighlightPart.SetHighlightColor();
            }
            HighlightPart.SetHighlight(Activate, false);

            // highlight any children parts
            if (null != HighlightPart.children)
            {
                for (int IndexChildren = 0; IndexChildren < HighlightPart.children.Count; IndexChildren++)
                {
                    Part Child = HighlightPart.children[IndexChildren];
                    HighlightPartAndChildren(Child, false, isMainBranch, Activate);
                }
            }

            if (false == isParent || false == isMainBranch)
            {
                return; // If not the main branch parent, do not touch counterparts
            }
            if (null != HighlightPart.symmetryCounterparts)
            {
                for (int IndexSibling = 0; IndexSibling < HighlightPart.symmetryCounterparts.Count; IndexSibling++)
                {
                    Part Sibling = HighlightPart.symmetryCounterparts[IndexSibling];
                    if (true == isParent)
                    {
                        HighlightPartAndChildren(Sibling, isParent, false, Activate);
                    }

                }
            }
        }
开发者ID:cpcallen,项目名称:KSP-Stock-Bug-Fix-Modules,代码行数:83,代码来源:SymmetryActionFix.cs

示例10: SetPartHighlight

        public static void SetPartHighlight(Part part, Color color)
        {
            try
            {

                if (part != null)
                {
                    part.SetHighlightColor(color);
                    part.SetHighlight(true);
                }
            }
            catch (Exception ex)
            {
                ManifestUtilities.LogMessage(string.Format(" in  SetPartHighlight.  Error:  {0} \r\n\r\n{1}", ex.Message, ex.StackTrace), "Error", true);
            }
        }
开发者ID:ragzilla,项目名称:ShipManifest,代码行数:16,代码来源:ManifestController.cs

示例11: ClearHighlight

        public static void ClearHighlight(Part part)
        {
            try
            {

                if (part != null)
                {
                    part.SetHighlightDefault();
                    part.SetHighlight(false);
                }
            }
            catch (Exception ex)
            {
                ManifestUtilities.LogMessage(string.Format(" in  ClearHighlight.  Error:  {0} \r\n\r\n{1}", ex.Message, ex.StackTrace), "Error", true);
            }
        }
开发者ID:ragzilla,项目名称:ShipManifest,代码行数:16,代码来源:ManifestController.cs

示例12: ColorPart

        private void ColorPart( Part part, Color color )
        {
            if ( !_managedParts.ContainsKey( part ) )
            {
                if ( _useCustomShader )
                {
                    List<SavedMaterial> savedMaterials = new List<SavedMaterial>();
                    Renderer[] renderers = part.FindModelComponents<Renderer>();

                    if ( renderers.Length > 0 )
                    {
                        for ( int i = 0; i < renderers.Length; ++i )
                        {
                            savedMaterials.Insert( i, new SavedMaterial() { Shader = renderers[i].sharedMaterial.shader, Color = renderers[i].sharedMaterial.GetColor( "_Color" ) } );
                            renderers[i].sharedMaterial.shader = _material.shader;
                            renderers[i].sharedMaterial.SetColor( "_Color", color );
                        }

                        _managedParts.Add( part, savedMaterials );
                    }
                }
                else
                {
                    part.SetHighlight( true, false );
                    part.SetHighlightColor( color );
                    part.SetHighlightType( Part.HighlightType.AlwaysOn );
                }
            }
        }
开发者ID:shepheb,项目名称:KSP,代码行数:29,代码来源:IntakeBuildAid.cs

示例13: OnMouseDetachExitPart

 void OnMouseDetachExitPart(Part p)
 {
     if (detachActive)
     {
         KISAddonCursor.CursorEnable("KIS/Textures/detach", "Detach", "");
     }
     else
     {
         KISAddonCursor.CursorDefault();
     }
     p.SetHighlight(false, false);
     p.SetHighlightDefault();
     if (p.parent)
     {
         p.parent.SetHighlight(false, false);
         p.parent.SetHighlightDefault();
     }
     detachOk = false;
 }
开发者ID:khr15714n,项目名称:KIS,代码行数:19,代码来源:KISAddonPickup.cs

示例14: WindowGUI


//.........这里部分代码省略.........
                             GUILayout.Label(
                                 string.Format("{0} @ {1} of {2}", current.resourceName,
                                               current.amount.ToString("F"), current.maxAmount.ToString("F")),
                                 new GUILayoutOption[]
                                     {
                                         GUILayout.ExpandWidth(true)
                                     });
                             bool flag3 = false;
                             bool flag4 = transfersFrom[resType].Contains(current);
                             if (transfersTo[resType].Contains(current))
                             {
                                 flag3 = true;
                             }
                             if (GUILayout.Toggle(flag3, "In", GUI.skin.button, new GUILayoutOption[]
                                 {
                                     GUILayout.Width(75f)
                                 }) != flag3)
                             {
                                 if (!flag3)
                                 {
                                     transfersTo[resType].Add(current);
                                     if (transfersFrom[resType].Contains(current))
                                     {
                                         transfersFrom[resType].Remove(current);
                                     }
                                 }
                                 else
                                 {
                                     transfersTo[resType].Remove(current);
                                 }
                             }
                             if (GUILayout.Toggle(flag4, "Out", GUI.skin.button, new GUILayoutOption[]
                                 {
                                     GUILayout.Width(75f)
                                 }) != flag4)
                             {
                                 if (!flag4)
                                 {
                                     transfersFrom[resType].Add(current);
                                     if (transfersTo[resType].Contains(current))
                                     {
                                         transfersTo[resType].Remove(current);
                                     }
                                 }
                                 else
                                 {
                                     transfersFrom[resType].Remove(current);
                                 }
                             }
                             GUILayout.EndHorizontal();
                             if (GUILayoutUtility.GetLastRect().Contains(Event.current.mousePosition))
                             {
                                 if (highlighted != current.part)
                                 {
                                     if (highlighted != null)
                                     {
                                         highlighted.SetHighlightDefault();
                                         highlighted.SetHighlight(false);
                                         highlighted = null;
                                     }
                                     highlighted = current.part;
                                     highlighted.SetHighlightColor(Color.blue);
                                     highlighted.SetHighlight(true);
                                 }
                                 flag = true;
                             }
                         }
                         GUILayout.EndVertical();
                     }
                     else
                     {
                         if (activeResource == resType)
                         {
                             activeResource = 0;
                         }
                     }
                 }
             }
             GUILayout.EndVertical();
         }
         else
         {
             if (curVessel == activeGuiVessel)
             {
                 activeGuiVessel = 0u;
             }
         }
     }
     GUILayout.EndScrollView();
     transferRunning = GUILayout.Toggle(transferRunning, (transferRunning ? "Stop" : "Start") + " Transfer",
                                        GUI.skin.button, new GUILayoutOption[]
                                            {
                                                GUILayout.ExpandWidth(true)
                                            });
     GUI.DragWindow();
     if (flag || highlighted == null) return;
     highlighted.SetHighlightDefault();
     highlighted.SetHighlight(false);
     highlighted = null;
 }
开发者ID:andyleap,项目名称:VFMFuelPanel,代码行数:101,代码来源:FuelPanelPanel.cs

示例15: ResetColor

        private void ResetColor( Part part )
        {
            if ( _useCustomShader )
            {
                if ( _managedParts.ContainsKey( part ) )
                {
                    List<SavedMaterial> savedMaterials = _managedParts[part];
                    if ( savedMaterials.Count == 0 )
                    {
                        _managedParts.Remove( part );
                        return;
                    }

                    Renderer[] renderers = part.FindModelComponents<Renderer>();
                    if ( renderers.Length > 0 )
                    {
                        for ( int i = 0; i < renderers.Length; ++i )
                        {
                            renderers[i].sharedMaterial.shader = savedMaterials[i].Shader;
                            renderers[i].sharedMaterial.SetColor( "_Color", savedMaterials[i].Color );
                        }
                    }

                    if ( _managedParts.ContainsKey( part ) )
                    {
                        _managedParts.Remove( part );
                    }
                }
            }
            else
            {
                part.SetHighlight( false, true );
                if ( _managedParts.ContainsKey( part ) )
                {
                    _managedParts.Remove( part );
                }
            }
        }
开发者ID:shepheb,项目名称:KSP,代码行数:38,代码来源:IntakeBuildAid.cs


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