Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - hexaust

Pages: 1 2 [3]
31
NGUI 3 Support / Re: Best practices for Managers
« on: March 12, 2014, 04:03:43 AM »
My approach is:

1. Create a class that extends from Monobehaviour and make it a Singleton.

2. Create public references for all my interface "windows", etc... So I can drag them.

3. Create wrappers from them so it's easier to use them.

I like this approach because it's really easy to use and because for the main logic I like to mix it with PlayMaker SendMessage actions (it's easier to mantain when you take a project that it's not yours or you haven't look at it for several months). Example:

Intro --> MainMenu --> OptionMenu --> Return to MainMenu --> Play... (An so on...)

With a PlayMaker FSM it's really visual and easy to add later for example, an intermediate window.

Quick example (I'm writing here so it can have compilation errors):

  1. public class InterfaceManager : MonoBehaviour {
  2.    private static InterfaceManager instance;
  3.  
  4.    public static InterfaceManager Instance
  5.    {
  6.       get
  7.       {
  8.          if (instance == null)
  9.          {
  10.             Debug.LogError("You must attach this script to a Monobehaviour. Also, don't call it from Awake");
  11.          }
  12.          return instance;
  13.       }
  14.    }
  15.  
  16.    public MyWindow window;
  17.  
  18.    void Awake() {
  19.       instance = this;
  20.    }
  21.  
  22.    public void ShowMyWindow() {
  23.       window.Show();
  24.    }
  25.  
  26.    public void HideMyWindow() {
  27.       window.Hide();
  28.    }
  29. }
  30.  

Hey, can you be more specific on how to use this approach? I'm having trouble understanding it. For example should I create a public variable for every window(game object) and attach a script to each window?
  1. public FirstWindow window1;
  2. public SecondWindow window2;
  3. ....
  4.  

And where should the Hide() and Show() functions be? Thank you!

32
Other Packages / Re: Hud Text and Playmaker
« on: March 07, 2014, 06:55:35 AM »
I asked for help on the playmaker forums and someone wrote me an action and it works :)

Can you post a link here from the playmaker forum? Thanks.

33
Other Packages / Re: UI Starter Kit: Starlink (NGUI + TNet)
« on: March 05, 2014, 10:39:04 AM »
Any idea on what happened with the fonts? I updated to NGUI 3.5.2 and this showed up:



34
I was wondering if UIScrollView is the right way to go or a special script must be created for achieving a scrolling tileable isometric map in Unity 2D. Something similar to http://hexul.com/isometric/ (this is old and buggy, but you'll get the idea).

Any performance issues will arise on large maps? Did anyone did this before?

Thanks a lot!

35
NGUI 3 Support / Re: (!!!) Improving NGUI: Voice your opinion
« on: March 04, 2014, 05:44:40 AM »
Any chance of adding rulers and guides support?  :P

Pages: 1 2 [3]