From 43fb2d3f5f4809a49340988197a304b9c63a6bed Mon Sep 17 00:00:00 2001 From: Miguel Tomas Date: Thu, 9 Jan 2020 00:51:31 +0000 Subject: [PATCH] Fixed the state of a the UiPresenter when loaded. Now the UiPresenters are always disabled when loaded --- CHANGELOG.md | 4 ++++ Runtime/UiService.cs | 5 ++++- package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c442d16..a4554ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this package will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [0.1.1] - 2020-01-09 + +- Fixed the state of a the UiPresenter when loaded. Now the UiPresenters are always disabled when loaded + ## [0.1.0] - 2020-01-05 - Initial submission for package distribution diff --git a/Runtime/UiService.cs b/Runtime/UiService.cs index b732440..f7a4f63 100644 --- a/Runtime/UiService.cs +++ b/Runtime/UiService.cs @@ -328,10 +328,13 @@ public async Task LoadUiAsync(Type type) throw operation.OperationException; } - var uiPresenter = Object.Instantiate(operation.Result).GetComponent(); + // ReSharper disable once AccessToStaticMemberViaDerivedType + var uiPresenter = GameObject.Instantiate(operation.Result).GetComponent(); AddUi(config.Layer, uiPresenter, config.UiType); Addressables.Release(operation); + + uiPresenter.SetActive(false); return uiPresenter; } diff --git a/package.json b/package.json index 3248ca0..078e30c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.gamelovers.uiservice", "displayName": "UiService", - "version": "0.1.0", + "version": "0.1.1", "unity": "2019.3", "description": "This package provides a service to help manage an Unity's, game UI.\nIt allows to open, close, load, unload and request any Ui Configured in the game.\nThe package provides a Ui Set that allows to group a set of Ui Presenters to help load, open and close multiple Uis at the same time.\n\nTo help configure the game's UI you need to create a UiConfigs Scriptable object by:\n- Right Click on the Project View > Create > ScriptableObjects > Configs > UiConfigs", "dependencies": {