activeSelf
The local active state of the GameObject. True if active, false if inactive. (Read Only)
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Property
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
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.
Additional Resources: GameObject.SetActive, GameObject.activeInHierarchy.