public UI Create(Scene scene, string type, GameObject gameObject) { try { ResourcesComponent resourcesComponent = ETModel.Game.Scene.GetComponent <ResourcesComponent>(); resourcesComponent.LoadBundle($"{type}.unity3d"); GameObject bundleGameObject = (GameObject)resourcesComponent.BundleNameGetAsset($"{type}.unity3d", $"{type}"); GameObject go = UnityEngine.Object.Instantiate(bundleGameObject); go.layer = LayerMask.NameToLayer(LayerNames.UI); UI ui = ComponentFactory.Create <UI, string, GameObject>(type, go); ui.AddComponent <LoginPanelComponent>(); return(ui); } catch (Exception e) { Log.Error(e); return(null); } }