Renderer.isVisible 是否可见

var isVisible : bool

Description描述

Is this renderer visible in any camera? (Read Only)

这个渲染器在任何摄像机可见(只读)?

Note: when running in the editor, scene view cameras will also cause this value to be true.

注意:当运行在编辑器,场景视图摄像机也将导致这个值为真。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		if (renderer.isVisible)
			ProcessData.AndDoSomeComplexEffect();

	}
}
if (renderer.isVisible)
	ProcessData.AndDoSomeComplexEffect();

参见: OnBecameVisible, OnBecameInvisible.

Page last updated: 2010-12-17