Hello everyone!
I want to replace the AC default inventory bar with another one I created for my game (see attached images).
Problems I found:
a) When I run game appears this error:
NullReferenceException: Object reference not set to an instance of an object
AC.MenuPreview.Update () (at Assets/AdventureCreator/Scripts/Menu/MenuPreview.cs:58)
b) I can collect objects correctly into inventory but I can't drag them out from inventory to another object to use it (custom AC Inventory does allow It).
c) Don't appear the Checkmare Image Toggle Button and when I click on don't close the panel. I understand that I need an Actionscript for it?
EDIT: I remove the Toggle button an add a Button with Actionscript to Turn Off the menu when I clicked on it, but doesn't work.
d) Can I make this panel draggable on the screen?
Many thanks!
Comments
b) Update to the latest AC version. Drag-and-drop inventory was added for Unity UI some time ago. The Demo_MenuManager's Inventory Menu, when switched to Unity UI Prefab, can be used with drag-and-drop - you can use that to test with if necessary.
c) Your Menu's Appear type is set to Mouse Over - meaning that even if the Menu is turned off, the "rule" for which it should be open still applies and it will turn back on immediately afterwards. You can either change the Appear type setting, or use the Menu: Change state Action to lock the Menu instead. When a Menu is locked, it will not turn on even if the "rule" for it to do so applies.
d) That will be down to the Unity UI prefab, not AC. AC won't control the Canvas's position - so that you have full control over it yourself. There's likely a script or example for this on the Unity forums.
d) The Console messages suggest that there are issues with the script itself, not the location of it. You will have to go through the messages and solve the script errors they refer to. You can post the script at http://paste.ofcode.org/ if you wish, but bear in mind that this is not a coding forum - and you should refer to Unity's own coding tutorials if you need help learning that aspect of development.