Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please help me with some tutorial of GUI system #7

Closed
takaaptech opened this issue Nov 17, 2017 · 17 comments
Closed

Please help me with some tutorial of GUI system #7

takaaptech opened this issue Nov 17, 2017 · 17 comments

Comments

@takaaptech
Copy link
Contributor

Hi!
I just found this is an awesome framework to start with!
I need a small tutorial or sample to understand how UIWindowBase works.
Would you please quick note how to make a screen with:
Button Setting: Open Popup Setting
Button Shop: Open Popup Shop
Button Start Game - > Open New Game Scene

In Scene Game, it will be great if you can demo the use of
GameUI,
Fixed,
Normal,
TopBar,
PopUp

Big thankyou to you!

@kisence-mian
Copy link
Owner

Hello, I made a Demo project, it should be able to help you,
ApplicationManager -> First Status -> DemoStatus

@takaaptech
Copy link
Contributor Author

Hi @GaoKaiHaHa !
Awesome! I really appreciate your demo.
Could you please write some note for what Panel, GUI should be in GameUI, what should set as Fixed, Normal, PopUp and TopBar (I can understand PopUp and TopBar but for GameUI, Fixed, Normal, I need an example note)

And In MainWindow or ShopWindow, I see Object List, Bg Mask and UI Root, I just think maybe they made by automatic or some way? Do we need drag and drop them with the mouse?

And If I try to make New UI Prefab like MainWindow (By clone it),
I think I need to register in some way because I got the error when calling:
OpenUI();

System.Exception: RecourcesConfigManager GetBundleConfig : Dont find ->MainWindow1<- please check BundleConfig!

I try to look at Window menu but sorry it is china language so I can not find where to action.

If would be great if you can have small video or quick note step by step how to make UI prefab.

Thank again, you make big work for me, I am very happy when seeing Demo work!

@takaaptech
Copy link
Contributor Author

Hi! I can now answer myself how to update BundleConfig by press the first button to refresh UI folder and press the second button to recreate BundleConfig.

Now can you write simple note step by step to create UI Prefab and basic about the rule to follow?
(Folder to put it in, BG and root, Object List ...)

Thank so much!

@kisence-mian
Copy link
Owner

kisence-mian commented Nov 27, 2017

hi
I am sorry to respond to you so late.
At your request

I am currently working on a wiki for this project. At present, I have completed some of the documents you requested and I will make up as soon as possible.

@takaaptech
Copy link
Contributor Author

takaaptech commented Nov 28, 2017

Hi!
No problem! I am waiting for wiki about "UI system" now.Keep up the good work!

@kisence-mian
Copy link
Owner

kisence-mian commented Nov 30, 2017

Hi!
I improved the UI system documentation, what else do you want to know can ask me.

@takaaptech
Copy link
Contributor Author

Hi @GaoKaiHaHa !
Awesome! I follow your new wiki and now I can create a window and show it using API call.
Now in other windows (for example MainWindow) I see some button in root game object, so I create the same but I do not know how to register or auto adds to Object List? Can it was done using the tool or we must manually add to the list?
Thank so much!

P/S: It would be great if you can list all china label into excel or text file, then we can google translate and then can understand a bit.

By the way, your wiki is awesome!!!

@kisence-mian
Copy link
Owner

kisence-mian commented Dec 1, 2017

hi!
I will gradually translate the names of some of the labels into English and then make a selection button to allow the user to switch languages.

If you create a button, you need to make sure the name of the button is different from the names of the other UI in your UIWindow, and then drag it to the UIWindow's ObjectList.Then you can use it in UIWindow using the AddOnClickListener or GetButton methods.

UIWindow API I will fill in the wiki.

@takaaptech
Copy link
Contributor Author

Hi!
Thank so much @GaoKaiHaHa !
If I check use assets bundle on ApplicationManger game object, when I run game, it throws the error as below. How can I try to use assets bundle feature?

Unable to open archive file: /Users/imac/Downloads/MyUnityFrameWork-master 4/Assets/StreamingAssets/ResourcesManifest.assetBundle
UnityEngine.AssetBundle:LoadFromFile(String)
ResourcesConfigManager:ReadResourceConfigContent() (at Assets/Script/Core/ResourceLoad/ResourcesConfigManager.cs:109)
ResourcesConfigManager:GetResourcesConfig() (at Assets/Script/Core/ResourceLoad/ResourcesConfigManager.cs:72)
ResourcesConfigManager:Initialize() (at Assets/Script/Core/ResourceLoad/ResourcesConfigManager.cs:17)
ApplicationManager:AppLaunch() (at Assets/Script/Core/Application/ApplicationManager.cs:70)
ApplicationManager:Awake() (at Assets/Script/Core/Application/ApplicationManager.cs:60)

NullReferenceException: Object reference not set to an instance of an object
ResourcesConfigManager.ReadResourceConfigContent () (at Assets/Script/Core/ResourceLoad/ResourcesConfigManager.cs:113)
ResourcesConfigManager.GetResourcesConfig () (at Assets/Script/Core/ResourceLoad/ResourcesConfigManager.cs:72)
ResourcesConfigManager.Initialize () (at Assets/Script/Core/ResourceLoad/ResourcesConfigManager.cs:17)
ApplicationManager.AppLaunch () (at Assets/Script/Core/Application/ApplicationManager.cs:70)
ApplicationManager.Awake () (at Assets/Script/Core/Application/ApplicationManager.cs:60)

@kisence-mian
Copy link
Owner

kisence-mian commented Dec 1, 2017

If you want to use AssetsBundle, you need to first package your assets into AssetsBundle

the specific method is in Window->打包设置编辑器 (package settings editor) ->自动添加Resource目录下的资源并保存 (automatically add resources under the Resource directory and save) ->打包 (package)

After you update your resources, remember to re-package your AssetsBundle, If you think the whole package time is too long, you can individually package a resource

I recommend using Resource mode during development and AssetsBundle mode at release time

@takaaptech
Copy link
Contributor Author

Thank so much! Follow your help, I just press 打包 (package) and it was done!
If check Use AssetBundle, should we delete Resources folder when build game?
For the simple and small game, can you suggest what method we should use? Check or uncheck Assets bundle? What is the main difference when check or uncheck that option?

Thank so much, I just a newbie in unity and your Framework helps me much!

@kisence-mian
Copy link
Owner

Yes, if we use AssetsBundle mode, after the package is complete, we should delete the Resources folder, I recommend the use of the renamed method, Change Resources to _Resources,

The main difference between these two methods is that one can hot Update the resources, and the other can not, the application of the startup speed and loading speed are also different

@takaaptech
Copy link
Contributor Author

I can use Assets Bundle option, change Resources to_Resources, and it works well on the editor with platform switch to Android.
But when I build apk and run on real device, Game only load to main and do not show MainWindow
(Only transparent skybox in 3D)
Can you take a look at that?
Thank so much!

@kisence-mian
Copy link
Owner

That may be an error, you left and right hand while pressing the 6 fingers on the screen, check the console output

@takaaptech
Copy link
Contributor Author

Hi @GaoKaiHaHa
It is my error when building with Use Assets Bundle option. Maybe i press to many button on pakage setting editor gui. When download project from github and press only (pakage) button, every thing ok!
Thank so much!

@takaaptech
Copy link
Contributor Author

I just found why sometimes app run and sometimes I cannot run on the device if I check use assets bundle.
Because I create asset bundle for other build target and then switch to Android to build apk.
On Editor works fine so it seems not an error.
Just post here if someone got this error. Thank so much!

12-04 09:37:55.506 13485-13510/? E/Unity: The file can not be loaded because it was created for another build target that is not compatible with this platform.
Please make sure to build AssetBundles using the build target platform that it is used by.
File's Build target is: 5

                                      (Filename:  Line: 1093)

12-04 09:37:55.506 13485-13510/? E/Unity: The AssetBundle 'ResourcesManifest.assetBundle' can't be loaded because it was not built with the right version or build target.

                                      (Filename:  Line: 437)

12-04 09:37:55.602 13485-13510/? E/Unity: NullReferenceException: Object reference not set to an instance of an object
at ResourcesConfigManager.ReadResourceConfigContent () [0x00000] in :0
at ResourcesConfigManager.GetResourcesConfig () [0x00000] in :0
at ResourcesConfigManager.Initialize () [0x00000] in :0
at ApplicationManager.AppLaunch () [0x00000] in :0
at ApplicationManager.Awake () [0x00000] in :0

                                      (Filename:  Line: -1)

@kisence-mian
Copy link
Owner

kisence-mian commented Dec 4, 2017

When you build an AssetsBundle on a PC platform, the Bundle you typed is not available on Android

You need to switch to the Android platform to package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants