コード例 #1
0
    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");
        }
    }
コード例 #2
0
ファイル: UIManager.cs プロジェクト: dannisliang/FFEngine
	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");
		}
	}