public void Initialize() { Invoker = GetComponent <BaseScriptableInvoker>(); if (Invoker) { Invoker.Initialize(); Invoker.Invoke("Initialize", this); #if UNITY_EDITOR || DEVELOPMENT_BUILD Debug.LogFormat("{0} Initialized!", name); #endif } else { Debug.LogErrorFormat("Cannot found LuaInvoker on UIGameobject {0}!!!", gameObject.name); } foreach (var child in GetComponentsInChildren <ScriptableBehaviourUI>(true)) { if (child.Equals(this)) { continue; } child.Initialize(); } }
protected virtual void Awake() { Invoker = GetComponent <BaseScriptableInvoker>(); if (Invoker) { Invoker.Initialize(); Invoker.Invoke("Initialize", this); #if UNITY_EDITOR || DEVELOPMENT_BUILD Debug.LogFormat("{0} Initialized!", name); #endif } else { Debug.LogErrorFormat("Cannot found LuaInvoker on Gameobject {0}!!!", gameObject.name); } }