GameObject.renderer 渲染器

var renderer : Renderer

Description描述

The Renderer attached to this GameObject (Read Only). (null if there is none attached)
附属于这个游戏物体上的渲染器(只读)。(如果没有则为空)

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public GameObject other;
	public void Awake() {
		other.renderer.material.color = Color.green;
	}
}
var other : GameObject;
other.renderer.material.color = Color.green;
Page last updated: 2010-12-15