internal void Register(string a_eventKey, FFPanel a_panel) { _panelsToLoadCount--; if (!_panelsByName.ContainsKey(a_eventKey)) { _panelsByName.Add(a_eventKey, a_panel); if (a_panel.ShouldMoveToRoot) { Transform parent = a_panel.transform; while (parent.parent != null) { parent = parent.parent; } a_panel.transform.SetParent(root.transform); GameObject.Destroy(parent.gameObject); } } else { Debug.LogWarning("Same panel registered twice."); } if (_panelsToLoadCount == 0 && _isLoading) { FFEngine.Events.FireEvent(EEventType.UILoadingComplete); Debug.Log("UI LOADING COMPLETE"); } }
internal void Register(string a_eventKey, FFPanel a_panel) { _panelsToLoadCount--; if (!_panelsByName.ContainsKey (a_eventKey)) { _panelsByName.Add (a_eventKey, a_panel); if(a_panel.ShouldMoveToRoot) { Transform parent = a_panel.transform; while(parent.parent != null) { parent = parent.parent; } a_panel.transform.SetParent(root.transform); GameObject.Destroy(parent.gameObject); } } else { Debug.LogWarning("Same panel registered twice."); } if(_panelsToLoadCount == 0 && _isLoading) { FFEngine.Events.FireEvent(EEventType.UILoadingComplete); Debug.Log ("UI LOADING COMPLETE"); } }