The following results are the test conclusions.
Isactive in hierachy is equivalent to whether a GameObject is active or not, which is the same as a simple understanding.
Isactive andenabled requires three conditions:
The isactiveinheerachy of
- GameObject is true, and onenable
So:
- in onenable of a script, isactive andenabled is always true. In ondisable of a script, isactive andenabled is always false
Test example: place a GameObject in the scene and two scripts below. Set GameObject and scripts to be active. In the process of running the scenario, in the script that calls onenable first, you can find that your isactive andenabled is true, but another script’s isactive andenabled is false.
So: there is no script to call onenable, though gameObject.isActiveInHierachy Is true, and enabled is true, but isactive andenabled is false.
Read More:
- Notes on unity project_ Unity webplayer failed to update unity web player
- The meaning of escape character is’ ^] ‘prompted by telnet under linux / Unix
- Unity3d open prompt failed to initialize unity graphic
- The Vue parent component uses ref to call the sub component method and reports an error
- Unity install ilruntime plug-in [novice installation tutorial] (supported by unity2018 and later versions)
- Unity-failed to update unity web player
- After unity connects with androidstudio, unity packages APK with an error: commandinvocationfailure: failed to re package resources
- Unknown custom element: <component> – did you register the component correctly
- Create game scene in unity_ Creating a beat em up game in unity
- 【Unity 3D】Because you are not a member of this project this build will not access Unity services.
- webstorm npm install –save –save-exact –loglevel error react react-dom react-scripts has failed.
- sys.path.append(), os.path.exists(), os.path.join() and os.makedirs() meaning
- Statistical learning: ANOVA (analysis of variance) (1)
- Source code analysis of macOS startup process
- Analysis of “RSL error 1 of 1”
- Unity report error CS0619: ‘XRDevice.isPresent’ is obsolete
- Bitcoin source code analysis – load Wallet
- Online problem solving analysis
- Keepalived add service self-start error analysis [How to Solve]
- [Linux] [kernel] bug: scheduling while atomic problem analysis