public UI(Scene scene, UIType uiType, UI parent, GameObject gameObject) : base(EntityType.UI) { this.Scene = scene; this.UIType = uiType; gameObject.transform.SetParent(parent?.GameObject.transform); this.GameObject = gameObject; this.AddComponent<ChildrenComponent<UI>>(); }
public UI Create(Scene scene, UIType type, UI parent) { GameObject mainPrefab = Resources.Load<GameObject>("UI/LoginPanel"); mainPrefab = Object.Instantiate(mainPrefab); mainPrefab.layer = LayerMask.NameToLayer(LayerNames.UI); UI ui = new UI(scene, type, parent, mainPrefab); parent.AddChild(ui); return ui; }
public static void CloseScene() { scene.Dispose(); scene = null; }