페이지

2023년 7월 5일 수요일

When are All GameObject Awake(), OnEnable(), Start() called?

 1.

ExLifeCycle script is attached into All GameObjects (ex: Parent, Child1, ... )



public class ExLifeCycle : MonoBehaviour
{
private void Awake()
{
Debug.Log($"{name}:Awake");
}

private void OnEnable()
{
Debug.Log($"{name}:OnEnable");
}
void Start()
{
Debug.Log($"{name}:Start");
}
}


When Playing, the follow logs comes
----------------------
Child1:Awake
Child1:OnEnable
SubChild(1):Awake
SubChild(1):OnEnable
Child1(3):Awake
Child1(3):OnEnable
Parent:Awake
Parent:OnEnable
Child1(2):Awake
Child1(2):OnEnable
.....
Child1:Start
SubChild(1):Start
...


the calling order of GameObject Awake,Enable is not fixed, and random.
and After All gameObject OnEnable() are called, Start() of all are called.


2.


when playing unity in this case, 

SubChild:Awake
SubChild:OnEnable
Child1(2):Awake
Child1(2):OnEnable
SubChild:Start
Child1(2):Start

are not printed in console.
.






2023년 5월 5일 금요일

Unity Apple PlugIn Build Error ( .. has no meta file, but it's in an immutable folder .. )

 apple unity plugin

the upper build guide doesn't have the information correctly.


Before typing this python command,

python3 build.py

Make sure that you have Unity 2020.3.33f1 version.


IF not,

When you build your app by Unity iOS,

the following error will occur.


Asset Packages/com.apple.unityplugin.core/Plugins/iOS has no meta file, but it's in an immutable folder. The asset will be ignored.



https://developer.apple.com/forums/thread/710437