本文整理汇总了C#中UnityEngine.Color.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Color.Equals方法的具体用法?C# Color.Equals怎么用?C# Color.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Color
的用法示例。
在下文中一共展示了Color.Equals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: renderPart
/// <summary>
/// Renders a single part and adds all its children to the draw queue.
/// Also adds its bounding box to the bounding box queue.
/// </summary>
/// <param name="part">Part to render</param>
/// <param name="scrnMatrix">Screen transform</param>
private void renderPart(Part part, Matrix4x4 scrnMatrix, bool fill)
{
//first off, add all the parts children to the queue
foreach (Part child in part.children)
{
if (!child.Equals(part.parent))
{
partQueue.Enqueue(child);
}
}
//get the appropriate colors
Color partColor = new Color();
Color boxColor = new Color();
if (customMode == null)
{
if (!fill) partColor = getPartColor(part, basicSettings.colorModeWire);
else partColor = getPartColor(part, basicSettings.colorModeFill);
}
else
{
switch (customMode.ColorModeOverride)
{
case (int)CustomModeSettings.OVERRIDE_TYPES.AS_BASIC:
if (!fill) partColor = getPartColor(part, basicSettings.colorModeWire);
else partColor = getPartColor(part, basicSettings.colorModeFill);
break;
case (int)CustomModeSettings.OVERRIDE_TYPES.STATIC:
if (!fill) partColor = getPartColor(part, customMode.staticSettings.colorModeWire);
else partColor = getPartColor(part, customMode.staticSettings.colorModeFill);
break;
case (int)CustomModeSettings.OVERRIDE_TYPES.FUNCTION:
if (fill) partColor = customMode.fillColorDelegate(customMode,part);
else partColor = customMode.wireColorDelegate(customMode, part);
break;
}
}
if (customMode == null)
{
boxColor = getPartColor(part, basicSettings.colorModeBox);
}
else
{
switch (customMode.ColorModeOverride)
{
case (int)CustomModeSettings.OVERRIDE_TYPES.AS_BASIC:
boxColor = getPartColor(part, basicSettings.colorModeBox);
break;
case (int)CustomModeSettings.OVERRIDE_TYPES.STATIC:
boxColor = getPartColor(part, customMode.staticSettings.colorModeBox);
break;
case (int)CustomModeSettings.OVERRIDE_TYPES.FUNCTION:
boxColor = customMode.boxColorDelegate(customMode, part);
break;
}
}
if (customMode == null)
{
if (basicSettings.colorModeBoxDull) {
boxColor.r = boxColor.r / 2;
boxColor.g = boxColor.g / 2;
boxColor.b = boxColor.b / 2;
}
}
else
{
switch (customMode.ColorModeOverride)
{
case (int)CustomModeSettings.OVERRIDE_TYPES.AS_BASIC:
if (basicSettings.colorModeBoxDull) {
boxColor.r = boxColor.r / 2;
boxColor.g = boxColor.g / 2;
boxColor.b = boxColor.b / 2;
}break;
case (int)CustomModeSettings.OVERRIDE_TYPES.STATIC:
if (customMode.staticSettings.colorModeBoxDull) {
boxColor.r = boxColor.r / 2;
boxColor.g = boxColor.g / 2;
boxColor.b = boxColor.b / 2;
}break;
case (int)CustomModeSettings.OVERRIDE_TYPES.FUNCTION:
if (customMode.boxColorDullDelegate(customMode)) {
boxColor.r = boxColor.r / 2;
boxColor.g = boxColor.g / 2;
boxColor.b = boxColor.b / 2;
}break;
}
}
if (fill)
{
//.........这里部分代码省略.........