コード例 #1
0
 public UINavigator(BasePresenter presenter, GameObject prefabs)
 {
     Presenter = presenter;
     Prefabs   = prefabs;
     BaseView  = prefabs.GetComponent <BaseView>();
     BaseView.SetViewFocusUnit(presenter.GetUIPrefabs());
     //BaseView.gameObject.layer = LayerMask.NameToLayer("UI");
     BaseView.ChangeLayer("UI", isChild: true);
 }
コード例 #2
0
ファイル: UIController.cs プロジェクト: KimCheulOck/ProjectR
    /// <summary>
    /// Presenter 외에서 절대 호출하지 말아야한다.
    /// </summary>
    public static T CreateUI <T>(BasePresenter presenter)
    {
        string        prefabsName = string.Format("Prefabs/View/{0}", presenter.GetUIPrefabs().ToString());
        MonoBehaviour prefabs     = Instantiate(Resources.Load <MonoBehaviour>(prefabsName), Instance.uiParent);

        if (prefabs == null)
        {
            Debug.LogError("Error!! Not Find of PrefabsName : {0}", prefabsName);
            return(default(T));
        }

        prefabs.transform.SetParent(Instance.uiParent);
        Instance.navigator.Add(new UINavigator(presenter, prefabs.gameObject));

        Instance.SetPriorityZPosition();

        return(prefabs.GetComponent <T>());
    }