本文整理汇总了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);
}
示例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);
}
示例3: Add
public void Add(Part p)
{
if (internalHighlight.Contains(p))
return;
internalHighlight.Add(p);
p.highlightColor = Color.blue;
p.SetHighlight(true);
}
示例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);
}
}
示例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); */
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
}
示例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);
}
}
示例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);
}
}
示例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 );
}
}
}
示例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;
}
示例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;
}
示例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 );
}
}
}