this[]
Access the r, g, b,a components using [0], [1], [2], [3] respectively.
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Property
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
this[int]
public float this[int index] { readonly get; set; }
Parameters
Returns
Type | Description |
|---|---|
| float |
Examples
using UnityEngine;public class Example : MonoBehaviour{ Color color = Color.white; void Start() { //The same as color.g = 5 color[1] = 5; }}