Search Unity

EZ GUI - Powerful, Low draw call GUI solution

Discussion in 'iOS and tvOS' started by Brady, Jun 3, 2010.

  1. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,097
    Just wondering, how do we know when you release an update? Will you send registered users an email? Do we periodically check your web site? How do I know if I have the current version?
     
  2. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,321
    I normally post here when a non-beta release is ready, and I normally send out an e-mail to existing customers as well, but since I switched web hosts I've got to re-invite everyone to subscribe. So be sure to look for an e-mail coming soon asking you to re-sub to the mailing list.
     
  3. Sandor

    Sandor

    Joined:
    Apr 17, 2009
    Posts:
    91
    Brady, congratulations :)

    I am playing around with EZgui for a menu system for iPad. Now i would have to make a color wheel for choosing a color for my background (bg is a gameObject). So i was playing around with this snippet found here in the forums:

    Code (csharp):
    1. var colorPickerWheel : Texture2D;
    2. var ObjectToModify : Transform;
    3.    
    4.          
    5. function OnGUI () {
    6.     if (GUI.RepeatButton (Rect (0,0,512,512), colorPickerWheel))
    7.         {
    8.         var pickpos = Event.current.mousePosition;
    9.         var x : int = pickpos.x;
    10.         var y : int = pickpos.y*-1;
    11.         var col = colorPickerWheel.GetPixel(x,y);
    12.         ObjectToModify.renderer.material.SetColor("_Color",col);
    13.         }
    14.     }
    I think that expanding EZGui with an arbitary color wheel would be a good idea (unless i am the only one that would need such a control).

    But anyhow: does one of you guys having simple example for newbies on how we can:

    1. use something different than a GUI.Button for this
    2. store and retrive the picked color

    Thanks!
     
  4. ciaravoh

    ciaravoh

    Joined:
    Dec 16, 2009
    Posts:
    252
    Hello Bradly,

    Still not working. I've checked the spelling, the case, the script. nothing. I've trying through the UI Control Editor window, through the inspector. no way.

    one question : should the Delegate should be setup at the scroll list level or item list level ?

    Any idea ?

    regards,

    hervé
     
  5. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,321
    @Sandor

    In the next release, an input delegate like this should work:
    Code (csharp):
    1.  
    2. void InputDel(POINTER_INFO ptr)
    3. {
    4.    if(!ptr.active)
    5.       return;
    6.  
    7.    Vector2 uv = ptr.hit.textureCoord;
    8.    Color c = colorPickerTex.GetPixelBilinear(uv.x, uv.y);
    9.  
    10.    // Do what you want with the color
    11. }
    12.  
    That won't work in the current version, but the next version includes hit info in the pointer info struct.


    @claravoh

    Could you send me a sample package privately that I could look at? You can use the support e-mail address in your receipt e-mail. PM me if you don't have that available. Thanks.
     
  6. ciaravoh

    ciaravoh

    Joined:
    Dec 16, 2009
    Posts:
    252
    Hello Brad,

    Sorry to ask, but what is a package ? the folder compressed ?

    thanks
     
  7. Lokken

    Lokken

    Joined:
    Apr 23, 2009
    Posts:
    436
    In unity you can export a package. Before it exports it lets you select what you want/dont want in it.

    The file it creates has a 'unitypackage' extension.

    Just go to Assets -> Export Package to start the process
     
  8. ibivibiv

    ibivibiv

    Joined:
    Mar 3, 2007
    Posts:
    81
    I think I have a basic understanding of transitions, but I am missing one important piece. From what I can see you can instantiate a EZTransition object and set the MainSubject property to be the gameobject you would like the transition to act on. I can even clearly see how to start the transition etc. However I am having a bit of trouble locating where I define the actual properties of the transition. Such as the type, the mode, the start and stop positions etc. I was hoping to use a transition on say a button or some other object, but just can't seem to figure out where to define the transition properties themselves. Anyone know where it is or is there some doc or example in the documentation I missed? Thanks all.
     
  9. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,321
    For buttons, the easiest way to setup transitions for existing states is, of course, the transition editor. But if you're wanting to apply them to other objects or to a control apart from when it changes states, you can do so from script.

    The first consideration is that EZTransitions are just a way to execute a batch of EZAnimation effects. You could, for example, just call AnimatePosition.Do() or FadeSprite.Do(), etc, directly in-script (see the EZ GUI scripting reference for more info on each of these types of EZAnimation-derived classes).

    For for setting up EZTransitions themselves in-code, I still have a bit to do to make this more transparent on the scripting side. But for now, you will have to directly resize its animationTypes and animParams arrays and assign them appropriate values. So if you want to elements, for example, you would size these two arrays to 2 elements, and then assign each element of animationTypes an enum value corresponding to the element type you want to perform. Then you'll allocate two AnimParams objects and assign them to the two animParams elements. Depending on the animation/element type and mode, the AnimParams objects make use of different values.

    For example, if you are doing a translation with a "by" mode, you'll need to fill in the "vec" member, as well as the "standard" things such as delay, duration, etc. If you use a "FromTo" mode, you fill in both "vec" and "vec2". The first being the "from" and the second being the "to" value.

    Likewise, a FadeSprite type makes use of the "color" and "color2" fields, depending on the mode. Have a look at the various values in the AnimParams class and you'll see the different ones used for various kinds of elements.

    I plan to wrap this in a more intuitive way in scripting as it is currently geared mainly toward use through the editor. But I hope that information helps.

    But again, if you're wanting to do this in-script, it may be easier to just use the various EZAnimation classes directly.
     
  10. outtoplay

    outtoplay

    Joined:
    Apr 29, 2009
    Posts:
    741
    From a 'non' codeguy's POV it's always a bit frustrating, though oddly amusing, when a codeguy/product developer zips through how easy something is with a few general sentences like 'you can do this, check the API... you can also try this script function...blah blah blah. And I sit scratching my head thinking, 'what the hell are you talking about? Just do it on a cube and I can figure it out from there.

    Really not ragging on Brady, he's terrific and very supportive, and a new Dad. No decent fellow rags on a new dad. For the more experienced, I'm sure the general comments are totally adequate. I just wish we could have a few basic, 2 min examples on cubes or spheres or whatever just to show proper implementation of a few of these snippets.

    But then, my little guy is now 19 months, and I get 6 hours sleep a night. Maybe I should count my blessings, be quiet and go back to scratching my head...
     
  11. ibivibiv

    ibivibiv

    Joined:
    Mar 3, 2007
    Posts:
    81
    Thanks for the pointers. This looks like a great way to do it. I guess I was just fixated on that transition class and didn't think to look at the animation impl's. Thanks again and congrats on the new edition!

    @brendang - Yeah, I hear you, but as a "coding guy" everything he said makes sense and works well. I have actually a reverse struggle to yours. As a developer I keep trying to code things that should be done in the UI of Unity. I am constantly thinking I need to instantiate things programatically when in reality I should just define them as public members and drag a prefab on them in the UI.
     
  12. outtoplay

    outtoplay

    Joined:
    Apr 29, 2009
    Posts:
    741
    Funny how every coin has two sides, huh? It's all good, least we get to do business with that standup guy, Stevie Van Jobs and his company, Orange.

    Err, Steve, where's my dev check?
     
  13. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,321
    Sorry, like I said, it isn't currently designed for use in-script. Until I wrap it up with a nice little bow, it's more of an "advanced" thing for now, which is why I don't have any examples to show at the moment.

    I would suggest instead using the EZAnimation classes in-script.

    Here are examples of how to animate an object's position and a sprite's/control's color:

    Code (csharp):
    1.  
    2.   AnimatePosition.Do(gameObject,  // The object to be animated
    3.      EZAnimation.ANIM_MODE.By, // The mode
    4.      Vector3.up * 1,  // The distance/direction to move
    5.      EZAnimation.linear,  // How to move
    6.      1,  // How long to move (in seconds)
    7.      0,  // How long to wait to start moving
    8.      null, // No start delegate
    9.      null); // No ending delegate
    10.  
    11.  
    12.   FadeSprite.Do(myControl, // The control to be faded
    13.      EZAnimation.ANIM_MODE.To, // The mode
    14.      Color.clear,  // The color to fade to
    15.      EZAnimation.linear,  // how to fade
    16.      0.5,  // How long to take to fade out
    17.      0.5,  // How long to wait before we start fading
    18.      null,  // No start delegate
    19.      null); // No ending delegate
    20.  }
    21.  
    All of the EZAnimation-derived classes follow this same basic pattern. You can find others listed in the scripting reference, but with a few exceptions, they all work like above. Feel free to ask if you have any more questions about this, or want to know more about any of the other animation classes.
     
  14. Burletech

    Burletech

    Joined:
    Jul 1, 2010
    Posts:
    73
    Bought EZ GUI and SM2 as a bundle maybe like a week ago. They're both great products. I HIGHLY recommend them to anyone considering purchasing.

    Having a minor issue with Unity iPhone and EZ GUI I need help on.

    I Have my GUI setup and everything seems great. I do few a builds to my iPod and everything looks great. Then randomly I'll do a build and the atlas will go all pixelated. It's strange and it seems to happen randomly?

    I'm not sure if the issue is A. EZ GUI B. SM2 C. Texture compression or D. Something else. I've looked at the trouble shooting in both manuals and can't find the problem referenced in there outside of "Sprites are messed up after atlas build." But my problem isn't after an atlas build but a build to the iPod itself.

    I think I should also mention I have not done anything regarding texture compression. I've just used the default one it uses on the build(at least I assume so?).

    And lastly I'm going to throw the obligatory "I'm a noob preface" in here. Been using Unity for like a month maybe and my knowledge is extremely limited so please bare with me if this is something that I really should've already known.

    Thanks for any help! This community is amazing!
     
  15. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,321
    Actually, that sounds like a really strange issue. I haven't heard of that one before. I can't think of anything in EZ GUI or SM2 that would cause that. Do you have a screenshot of it both ways?

    Though it shouldn't happen randomly, check the atlas's filtering settings (select the atlas texture and look in the inspector). If the sprites/controls aren't sized pixel-perfect, they can look pixellated if filtering is turned off. However, you'll get the sharpest look if they are sized pixel-perfect and filtering is turned off. But if they aren't pixel-perfect, I definitely recommend using filtering.
     
  16. Burletech

    Burletech

    Joined:
    Jul 1, 2010
    Posts:
    73
    Hey thanks for the fast reply. I'll look at the filter thing right away and see if that helps.

    Before build to Xcode


    After build to Xcode


    The thumbsticks are not part of the atlas so those look fine. Only the buttons have been effected so far. And dont know if this is relevant but the right side buttons and the left side are on 2 separate atlas's when the pic was taken.

    Thanks so much for the help!
     
  17. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,321
    I would review the import settings for the atlas texture (right-click on the texture and select "Import Settings") and verify that the max texture size is set to 1024x1024, and also some of the artifacting I'm seeing there looks like it might be from PVRTC compression, so try disabling that and see what that does.
     
  18. Burletech

    Burletech

    Joined:
    Jul 1, 2010
    Posts:
    73
    Yep its the PVRTC compression. Turning that off and it builds fine without artifacts. So in reality this has nothing to do with EZ GUI and is a completely separate issue. My apologies for not understanding this prior to posting.

    Thanks very much for taking the time to help! Your going to be a great Dad =)
     
  19. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,321
    No problem, and thanks! :)
     
  20. ciaravoh

    ciaravoh

    Joined:
    Dec 16, 2009
    Posts:
    252
    Hello Brad,

    Any news about the delegate problem ? Did you received my package ?

    Thank you .

    Herve
     
  21. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,321
    Sorry, I don't think I received it, unless I missed it somehow. Could you try sending it to my e-mail address again? Thanks.
     
  22. elveatles

    elveatles

    Joined:
    May 2, 2009
    Posts:
    147
    Hi Brady,
    Thanks for putting EZ GUI out in the public. I was making my own GUI system not that long ago, and it would give me a headache every time I worked on it. Text was the worst. Anyway, EZ GUI has been helping me a lot, but I had some questions that I couldn't find in the documentation or the forums.

    For Unity iPhone, sometimes the GUI doesn't appear, and when I restart Unity iPhone, it shows up again. I'm pretty sure I've set the Layers right as well as the Camera Culling Masks.
    Thanks again sir!
     
  23. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,321
    That's odd, I've never heard of that. The only reason I can think of that that could happen is perhaps the sprites/controls that comprise the GUI are set to pixel perfect and they aren't getting their sizes set correctly because of the Unity bug where it doesn't always report the correct viewport size in edit-mode. But in that case, pressing Play should cause it all to show up. If that's not the case, then I'm not sure what might be going on.

    Also make sure your "Depth" settings on your cameras are set correctly, though that shouldn't change just by restarting Unity iPhone, so it's still a bit of a mystery.
     
  24. Silentcoast

    Silentcoast

    Joined:
    Mar 23, 2010
    Posts:
    140
    I am trying to follow along the tutorial for the EZGUI Button. The problem though is its not showing me those same options for example I cannot find where you can change the state and apply a texture.

    I also couldn't get the control editor window to dock but thats probably not a EZGui issue but more me/unity.

    The faqs page doesn't work on the site so i'm not sure if the answer was on there and searched the unity forum's and not finding anything.

    Any ideas?
     
  25. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,321
    Yes, the tutorial was done in Unity 2.6, which supports the custom control inspector. In Unity iPhone, you will need to use the UI Control editor (BTW, editor windows are only dockable in Unity 2.x+). The UI Control editor window is where you choose states and assign textures. Just choose a state across the top, and then drag a texture onto the editor window.
     
  26. Silentcoast

    Silentcoast

    Joined:
    Mar 23, 2010
    Posts:
    140
    Oh ok will try that. Guess I could have tried that I was just trying to follow the tutorial exactly.

    Thanks for that quick response.
     
  27. Silentcoast

    Silentcoast

    Joined:
    Mar 23, 2010
    Posts:
    140
    I guess that doesn't work in the iphone version of unity. I load everything up in regular unity and its fine.

    Go into iPhone version and cant put textures on it or nothing.
     
  28. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,321
    It should work fine. Just drag a texture onto the UI Control editor window and it will take. The window doesn't look quite the same in Unity iPhone as in "regular" Unity, but it works just the same. Once you've dragged the texture on, you should see it right there next to the "X" button that clears it.
     
  29. Silentcoast

    Silentcoast

    Joined:
    Mar 23, 2010
    Posts:
    140
    Yeah thats not working, it shows the green plus sign like it wants to add it, when I release the mouse button it flashes but then doesn't do anything. I am just not going to use it on this project I already got the gui completed for the most part. It works like intended on regular version though which is whats strange.
     
  30. b-joe

    b-joe

    Joined:
    Sep 7, 2009
    Posts:
    48
    Hi Brady,

    Talking about textures, how do I assign a texture to a simple sprite using Unity iPhone and EZGui only (no SM2)?
    The control and panel editors don't work with sprites and there is no option to assign a texture via the inspector (also not in Unity 2.6). Using the material directly seems not to be the way to go as no atlas can be built then.
    I couldn't find anything on simple sprites in the manual and in the tutorial videos you use functionality and editors with sprites that seem to come only with SM2.

    I conclude from the manual that the purpose of managed sprites is to enable batching in Unity 2.6. Am I assuming correctly that I don't need managed sprites in Unity iPhone?

    Thanks for providing this superb GUI solution and for your help.
     
  31. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    weylin: Do you have any errors in the console? (I know that you need to do things like set .net to 2.1, etc..)
     
  32. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    I'll put my voice in about "How should I use a simple sprite?". I'm a bit confused too. I find that for simple things like a background image, I'm using a button with no method to invoke rather than some sort of texture or sprite.

    What's the best way to set the background image for a panel? And if it's simple sprite, how do you assign a texture to it so it will get added to the atlas?
     
  33. Lokken

    Lokken

    Joined:
    Apr 23, 2009
    Posts:
    436
    I would also be interested in hearing that solution.

    On a different note. I remember the discussion in this thread briefly describing the correct process to follow for destroying a packed sprite gameobject. For some reason I remember there being more to it than simply using Destroy() but i cant seem to find the posts that describe it.

    Anyone remember?
     
  34. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    The bottom of page 5 iirc...
     
  35. Lokken

    Lokken

    Joined:
    Apr 23, 2009
    Posts:
    436
    I must be blind! :?

    Code (csharp):
    1. for (var i : int = 0; i < buttonArray.Length; i ++) {
    2.    buttonArray[i].Delete();
    3.    Destroy(buttonArray[i].gameObject);
    4. }
    Thanks Little Angel!

    This brought up another question. If you have a UIScrollList, and you call ClearList(true) is this taken care of or do I need to loop through all of my list items and call Delete() first?

    Thanks!

    L
     
  36. Imari

    Imari

    Joined:
    May 26, 2010
    Posts:
    24
    I'm trying to build the framework for a stand-alone (not iPhone), first-person, point-and-click adventure game --- something similar to Myst: Riven. You'd think that there'd be an engine available for this already, but there's not, and I'm having a really tough time making a prototype in Unity.

    Here's how the game should work -
    1. Each scene is a skybox node with a 360 degree camera pivoting from a fixed position at the center.
    2. The player clicks on "hotspots" that trigger actions, such as moving to another scene or picking up an item.
    3. The cursor image needs to stay within the screen and when the cursor is over a hotspot the texture needs to change to indicate "forward", "back", "use", "item use", and so on.
    4. Progress through the game is done by finding and using items and by solving puzzles. These usualy entail simple flipping of a boolean variable.
    5. Once found, unique items must disappear (so that they do not appear again when the scene is re-entered) and the items must appear in an inventory.
    6. A HUD needs to remain on the screen with links to the Inventory, Journal, and Portal/Shortcuts scenes.
    7. The progress in the game must be able to be saved.

    I was thinking that most of this can be done in Unity with the aid of the three EZ plug-ins, but I'm having a terrible time trying to figure out the best way to set this up.

    I've created the nodes as separate scenes and have the cameras all set up. I'm planning to set up four to six fixed UIPanels within a UIPanelManger for each scene. Each panel would correspond to a different side of the cubic panorama used to create the skybox and the panels would bascially form a cube shape around the camera. Hotspots would be made by placing a series of planes with button scripts attached as children of each panel. Most of the buttons would be invisible, without a texture.

    An "exit door", for instance, would be an untextured button with a IUBtnLoadScene script attached and placed on the panel so that from the fixed central POV, it appears to be on the door. An exit button placed over a keypad would move the player to a scene where the keypad is seen in close-up and where the puzzle can be solved. An item to be picked up would be a small piece of the overall pre-rendered view with the item in place and clicking on the button would remove/destroy the image/button, flip a the variable, and place the item's icon in inventory. A swaying plant or video screen would use an animated sprite button with SM2. I'm assuming that the only way to click on the buttons in with the panels set up in 3D in this way is going to be via rays, but I'd really like to avoid rays if possible, as their use seems to be so erratic.

    For the HUD, I'm assuming that I can make this a menu attached to the camera with EZ GUI. I'm hoping to save the progress with a combination of variables and EZ Game Saver. For the Inventory, I have Little Angel's demo to get me started, but well, I guess that I'm really hoping that by the time I get that far Brady will have released "EZInventory." :wink: Cursors, I'm less sure about. Swapping cursor textures and setting the cursor so that it does not go flying out of the screen and onto the desktop would seem to be a given in a game engine, but it seems to be a real bear in Unity.

    So, I'm wondering what you guys think? Does this sound like a workable plan or is this just too bizarre a use for Unity --- even with the EZ plug-ins? Am I going to have so many panels and buttons in the game that it won't run?

    Thanks.

    P.S. - We really need a separate EZ forum.
     
  37. zergmouse

    zergmouse

    Joined:
    Jun 30, 2010
    Posts:
    216
    Hey I am waiting around for Unity 3.0 so that I can use Maya 2011. So in the meantime I am looking into what I can do in Unity to decide if I should buy it. My question is will there be an update for Unity 3.0 or is this already woring 100% in 3.0?

    I have a digital art background and am a self taught coder so something like this is right up my ally. I just want to make sure it will work with 3.0 when I get 3.0
     
  38. Silentcoast

    Silentcoast

    Joined:
    Mar 23, 2010
    Posts:
    140
    I am at work but when I get home I am going to try to re-import the package and see what happens. No errors are popping up besides it says its missing 1 of the fonts which is normal I guess(was a few pages back I read).
     
  39. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    weylin:

    This is what I see in Unity iPhone 1.7:

    Select a GameObject with a Button Script:


    Go to the WINDOW menu:


    This window should appear:


    What I DO notice, is that sometimes this window gets sorted *behind* the main window, even if it's just been selected from the menu making it appear as if the window doesn't exist, so quickly shuffling thru the windows with <cmd> + <~> or doing a 'show all windows' using exposé might just reveal that hidden window.

    Click on the options of "Normal", "Over", etc., and drag in the icon texture you want from your project panel into your UI Control Editor panel.

    -

    When it comes to why and when those editor windows get lost behind the main window it seems that when the window has not yet been called, calling the window from the menu will reveal it and place it at the top. Clicking on the main window will bring the main window to the front, hiding the editor window (which cannot be docked in 1.7). If one goes to the window menu and selects it again, as it already exists but is now behind the main window, it will not be shuffled to the front, making the menu command seem to be ineffective. D'oh! Not sure if that's a Brady thing or a Unity thing. One would expect even if the window exists, if you are calling if from a menu, it would go the top!
     
  40. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,321
    That's very strange. There has to be something else going on as this should definitely work, and many, if not most, of the people here are using this in Unity iPhone and this is the only way in Unity iPhone to assign textures to a control. I'm with LittleAngel in wondering if perhaps there's another compiler error holding things up perhaps. Definitely check the .NET 2.1 setting as that could account for why you are only having the problem in Unity iPhone.

    Actually, the SimpleSprite class works pretty much just like the "Sprite" class in SM2 (minus animation) in that you hand it a material with a pre-made atlas and tell it the coordinates where its particular image is on the atlas. This was partly done to provide some ability to specify imagery based on a pre-made atlas. However, as pointed out elsewhere, you can just use a control as your graphics, and just make it not do anything so that it just serves to provide graphics.

    For those who do have SM2, you can just use a PackedSprite.

    In the current build, it is not done automatically, but in the next release, it will be.

    @Imari
    It actually sounds like you have things pretty well figured out. You don't necessarily have to put all things like a keypad, etc, in separate scenes, but if you find that to be the most convenient method, you certainly can do it that way. An alternative might be to swap out your skybox, or child all the "background" objects to a single GameObject that you deactivate recursively at the same time you enable the object that holds your keypad, etc.

    I'm not clear on the full design of your game, but judging from my experience with the genre, I'm not sure you'll need panels for each side as panels are used for managing multiple controls as a group. So unless you're wanting to move the controls around as a whole per-side, you probably won't need panels for this purpose. Also remember too that if you have objects the player needs to "inspect", such as a piece of paper that gets zoomed in to be read, remember you can use transitions to accomplish the zooming.

    You do not necessarily have to use a RAY pointer type, if that's what you meant. If you prefer the player to use a mouse cursor, that will work just fine. Though for a rotating view, you may find it more intuitive a control scheme to use a RAY pointer type. But there's certainly no EZ GUI-specific reason why you should need to do so if you prefer not to.

    @zergcow

    Yes, the latest beta versions of the middleware works on the latest Unity 3.0 beta as far as my testing and other's has been able to verify.
     
  41. Imari

    Imari

    Joined:
    May 26, 2010
    Posts:
    24
    Thanks so much for the reply, Brady. I'm having a pretty rough go of it so far and it's heartening to hear that what I want to do is at least feasible. Your suggestions are very helpful.
     
  42. Silentcoast

    Silentcoast

    Joined:
    Mar 23, 2010
    Posts:
    140
    I am going to look into what others have posted about my problem right now. I see everything that your screenshots show except where you have that texture. I have the window but where you have that little square box that has the texture that does not show up on mine. Be right back though.
     
  43. Silentcoast

    Silentcoast

    Joined:
    Mar 23, 2010
    Posts:
    140
    Ok the problem was I took everything from the base package and put it into its own folder to try to organize my project a bit more and it didn't like that. I deleted out the SM2 and GUI folder and reimported the packages and it worked like a charm.

    Im sure there is a script I need to edit but is there a section of the documents that explains how to move everything into your own folders?

    Thanks again for all your help it looks like a great product and the SM2 ive used works great, better then I thought it would!

    Thanks
     
  44. Imari

    Imari

    Joined:
    May 26, 2010
    Posts:
    24
    Glad that you got it sorted out, weylin.

    I've consolidated the EZ files into a separate folder called "EZ_Assets" in my project and I haven't had any problems...at least not that I've noticed.

    Did you reorganize the files inside of Unity in the Projects folder or outside of Unity in Windows Explorer? I read somewhere that one should always reorganize and delete within the editor.
     
  45. Silentcoast

    Silentcoast

    Joined:
    Mar 23, 2010
    Posts:
    140
    I did it within the editor but you know I wonder if something just bugged during the last import of the package because it all seems to be working now.
     
  46. Imari

    Imari

    Joined:
    May 26, 2010
    Posts:
    24
    I'll keep my fingers crossed for you then , weylin. :)

    In the meantime, I'm having problems using the UIBtnLoadScene script. I clearly have not gotten the hang of this yet and I can't seem to figure out what I'm doing wrong.

    I have my UIManager in the scene and have specified MOUSE_AND_RAY and cameras, but have left all the other settings at default. I added a cube into the scene to use as my button, then dragged the UIBtnLoadScene script onto it. Everything is on the same layer. I haven't set up a IUPanel in the scene.

    Since the button simply needs to play a sound and move to the next scene, the only settings that I've changed are setting width and height, specifying a destination scene, adding a sound on click, and setting the delay to 2 seconds to give the sound time to play. The button works, but the sound is truncated and the delay does not seem to slow anything down. I've set delay as high as 30 seconds, but the time between the click and transitioning to the next scene does not appear to be affected and the sound remains truncated.

    Without the EZ GUI controls, I was using the code below to delay the transition until after the sound finished playing. I don't have any other GUI stuff in the scene yet, so I have not written any overall GUI script to cover invoking functions on the buttons. Do I need to add a script with a function to delay the move to the new scene until the sound has played so that I can invoke it in this button? :?
    Code (csharp):
    1.  
    2. var rayLength = 20;
    3.  
    4. function Update(){
    5.     if (Input.GetMouseButton(0)) {
    6.         var ray: Ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    7.         var hit: RaycastHit;
    8.        
    9.         if (Physics.Raycast(ray, hit, rayLength)) {
    10.             if (!audio.isPlaying) audio.Play();
    11.             Invoke("NewLevelFunc", audio.clip.length);
    12.             }
    13.         }
    14. }
    15.  
    16. function NewLevelFunc() {
    17.     Application.LoadLevel ("Blue");
    18. }
    19.  
     
  47. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,321
    @weylin

    I'm not sure what happened, but while you can shove the included middleware folders into any any folder you like, some of the folder names themselves must remain intact. Specifically, the "Editor" folder and the "Plugins" folder should be left named these. This is because "Editor" is a special folder name in Unity that tells Unity that the contents are to run under the UnityEditor namespace. And the Plugins folder is special in Unity in that it gets compiled before other scripts, so if you're using Javascript to call any middleware scripts written in C# (as all my middleware is written), it must be compiled first before other scripts to be available. Putting them under a "Plugins" folder does this.

    @Imari

    Sorry for any confusion, but the "delay" is how long to delay execution of the "Method to Invoke". I know this is mostly meaningless for a button that loads a new scene, but it is an inherited property from UIButton, which is why it is there. So the UIBtnLoadScene control will load the scene as soon as the event specified in "When To Invoke" occurs. If you need a delay before loading the scene, I would instead recommend writing up a simple function in a script somewhere like so:

    Code (csharp):
    1.  
    2. function LoadMyScene()
    3. {
    4.    Application.LoadLevel("My Scene");
    5. }
    6.  
    And then use a normal UIButton instead, and set this function as the "Method To Invoke" for the button. Then use the delay property to control the delay before this gets run.

    Sorry for any confusion. I should probably modify the UIBtnLoadScene to take the "delay" property into account. I'll put that on my ToDo for the next release.
     
  48. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    543
    Hi Brady

    It might have been mentioned before, but the thread has simply grown too long to check. I am very interested in EZ GUI because of the potential performance boost, but I need to know how scriptable it is. Basically I need to produce the entire interface via scripting.

    Thanks
    ~ce
     
  49. Imari

    Imari

    Joined:
    May 26, 2010
    Posts:
    24
    That worked, Brady. Thank you.
     
  50. ciaravoh

    ciaravoh

    Joined:
    Dec 16, 2009
    Posts:
    252
    Hello Brad,

    You should have it now.

    thank you for your help.

    Hervé
     
unityunity