-
Notifications
You must be signed in to change notification settings - Fork 14
Popup
HoangVanThu edited this page Jun 24, 2024
·
5 revisions
- The UI screens in the game will be considered as popups.
- For each popup, there will be a unique prefab and a script inherited from Popup.cs.
- PopupController has a camera and a canvas. The camera will display the UI elements in the canvas. When entering the game, the popups in PopupConfig will be instantiated in the canvas and can be displayed as needed.
- The display order of the popup layers will correspond to their arrangement in the config.
- You can create new prefab in Canvas Enviroment or copy existent popup prefab, then attach script inherited Popup.cs like image below:
- Add popup to config
- Show popup
PopupController.Instance.Show<PopupInGame>();
- Hide popup
PopupController.Instance.Hide<PopupInGame>();
- Hide all popup
PopupController.Instance.HideAll();
- Get popup
PopupController.Instance.Get<PopupInGame>();