文档

Unity Engine

Unity Engine

activeSelf

The local active state of the GameObject. True if active, false if inactive. (Read Only)
阅读时间1 分钟最后更新于 1 天前

Definition

public bool activeSelf { get; }

Remarks

The local active state of this GameObject, which is set using GameObject.SetActive. A locally active GameObject may still be inactive in the scene hierarchy because a parent is not active. Use GameObject.activeInHierarchy if you want to check if the GameObject is actually treated as active in the Scene.