Version: 2017.2

Color.operator *

切换到手册
public static Color operator * (Color a, Color b);

描述

将两个颜色相乘。每个分量分别相乘。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public Color grayColor = Color.gray * Color.white; }

public static Color operator * (Color a, float b);

描述

将颜色 a 乘以浮点 /b/。每个颜色分量分别缩放。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public Color whiteColor = Color.gray * 2; }

public static Color operator * (float b, Color a);

描述

将颜色 a 乘以浮点 /b/。每个颜色分量分别缩放。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public Color whiteColor = 2 * Color.gray; }