|
Post by nfighter on Oct 6, 2018 17:50:07 GMT
For the fast prototyping I have used a UI scripts that open/close panels on a key press and run series of event to enable/disable all invector input and show/unlock mouse cursor. But, obviously, it doesn't work after the character death. Instantiating new character prefab to scene breaking all the events links from UI scripts.
So, the question is what is the most convenient way of creating a UI panels?
Should I rewrite all the UI framework to search the invectors component instead just run linked events? Or is it possible to add custom buttons to Invector's Input manager and call the menu UI from invector? Or maybe there is some other straight forward solution? I thought it's a common task, so it should be a simple solution...
|
|
|
Post by shadex on Oct 12, 2018 16:59:15 GMT
For the fast prototyping I have used a UI scripts that open/close panels on a key press and run series of event to enable/disable all invector input and show/unlock mouse cursor. But, obviously, it doesn't work after the character death. Instantiating new character prefab to scene breaking all the events links from UI scripts. So, the question is what is the most convenient way of creating a UI panels? Should I rewrite all the UI framework to search the invectors component instead just run linked events? Or is it possible to add custom buttons to Invector's Input manager and call the menu UI from invector? Or maybe there is some other straight forward solution? I thought it's a common task, so it should be a simple solution... The inventory UI needs to spawn with the player. So you should put your custom UI along with invector's under the same canvas and spawn it (make sure it's not just in the scene) on player spawn. If you take a look at Shade's spell system, we have a modded UI that searches for invector components. As for adding custom button's, it's really simple. Make a function on a script. Attach that script to a gameobject (it can be on the UI gameobjects) Then go to the OnClick Event on where your button is, and drag the gameobject with your custom script. Find it in the dropbox. public void ClickingTheButton() { Debug.Log("Button was pressed!"); } Inside the ClickingTheButton() you can put in whatever you want. If your just trying to open/close windows, hide/show gameobjects and other standard functions, you can just select those from the dropdown box without having to create the script.
|
|