Color.this [int index] 访问索引

var this[index : int] : float

Description描述

Access the r, g, b,a components using [0], [1], [2], [3] respectively.

分别用[0],[1],[2],[3]访问r,g,b,a组件。

using UnityEngine;

using System.Collections;



public class example : MonoBehaviour {

	public Color p;

	public void Awake() {

		p[1] = 5;

	}

}
var p : Color;

p[1] = 5; 

// the same as p.g = 5

// 等同于 p.g = 5 
Page last updated: 2010-12-16