Already at it… The thing is, that the Unity UI doesn’t work as straight forward and out of the box, as NGUI does, and it takes some effort to get the asset to work as it does with the Unity UI.
But the package works with NGUI 2.7, which is free, so you don’t have to purchase the newest version from the asset store, you can simply download NGUI 2.7 from Tasharen >>
I’m afraid you’ll have to be more specific on this. Wall placement doesn’t equal wall placement. Do you want to place walls piece by piece or do you want to stretch them out from one point to another? Also, if you want to stretch them out, do you want the wall to run along a grid or do you want it to be drawn in a straight line from point to point? This kind of placement can be a science of its own, you know…
Walls can be a science lol. I was trying to wrap my head around it yesterday. I’m pretty green with programming still, walls would just baffle me. Think of any old rts (AoE, Ceaser III) and how placing walls works with them. That’s what I was talking about. Stretching, snapping, and I do believe they are on a grid. I’m on my mobile, so text may not make any sense lol.
For uGUI, I came up with a pretty good method.
Empty game object called uimanager.
C# script called UiManager attached to the game object.
Then I give the script a namespace.
Inside the script I use public enums called ShowGui and list all the different states that would show a ui.
Then I use switch statements for each gui name in the enum.
This has worked perfect for me. I even use System.serialazable classes inside the UiManger to keep the inspector nice and tidy. But I know, we all do things differently lol. I just hope I am doing what other more seasoned vets like you would do
Hey, sorry for taking so long, was pretty busy these days.
Placing walls like in AoE (stretching a wall from point to point over a grid) requires a pathfinding system. The asset doesn’t have that. It’s designed for placing single objects, without repetition. The kind of placement you describe would require a great deal of work on the modelling and texturing part as well, since you’d want to have a seamless blend in the repetition of your wall “pieces”. The asset might then create more problems than it solves.
Besides even though it has scripts for click-based placement, like in old fashioned RTS games, its main purpose is to be mobile friendly. This kind of placement would be tricky and not very user friendly without a mouse. I might consider adding that kind of functionality in the future, but even if so, I’m afraid it’s not gonna be anytime soon.
The problem with UGUI is that you’d need to set up custom events, since the mobile version of the asset uses NGUIs “OnPress” event, that UGUI doesn’t have (at least not that I would know of, I’m a bit of an NGUI fanboy). But you could try your method and maybe work your way around NGUI, before I get to do it.
No, there is no onpress, but Onclick works perfectly fine with with mobile. No other coding required.
What I do is a method for onclick, then a public enum for the button type. Then I attach it to the button, then set the button to use Onclick method in the button settings. Works perfect
You know… I need more programming experience, maybe I could help? I don’t need anything in return
OnClick reacts only when you release the mouse button, OnPress reacts for both, pressing and releasing, so I’m still not sure, how you want to do this.
Nope, I left workers out intentionally, because it would force people to use them, even if the user wouldn’t want to. Users are free to implement their own workers, but don’t have to, if they don’t want to. If you have workers running around and want to use them, you can add some code to the placement script (it contains placeholders for custom code), to tell it, that placement should only commence, when a specific worker arrives at the desired location.
What am I doing wrong if it works fine in play mode from the editor but the build version the second time I build a building it scales it into a very skinny object about .25 x .25 game units?
I didn’t find the time to remove the NGUI requirement yet - I’m quite busy with AQUAS atm, as you know.
I only took the NGUI requirement in, because I prettymuch prototyped it for myself and only later decided to share it on the store.
Hi, I purchased your asset, which is awesome, I came here because of ngui (can’t seem to make nice buttons with it).
I looked through the code and changed the void OnClick to public Void and call it through the ugui button script.
It seems to work exactly the same.
All the customizations I did too.
I wanted to pm you but after reading this, is there anything that I might be missing why it shouldn’t work?
yeah it all seems to work perfectly.
I’m kinda new to unity (2 months) so I’m not sure.
I tried for last two weeks to learn ngui but have had trouble making nice designs.
So I really want to use ugui
*** I’m worried that this was too easy, and I would go to making all of it in ugui now just having to start again because I missed something
Actually, you might have gotten everything right, I haven’t checked, but if everything works, I don’t see why you wouldn’t be able to use it like that.