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 - webik150

Pages: [1] 2 3
1
NGUI 3 Support / Re: [RELEASED] Minimap / World Map System for NGUI 3
« on: April 23, 2015, 06:18:59 AM »
Hey hjupter, is this still alive? I could really use something like this, but I don't want to buy something without Unity 5 support.

2
NGUI 3 Support / Re: Popup-list's "Drop-down list" is offset
« on: April 23, 2015, 05:59:11 AM »
Ok. Thank you.

3
NGUI 3 Support / Re: Popup-list's "Drop-down list" is offset
« on: April 22, 2015, 09:08:57 AM »
Update: I've figured out that when I move the popup-list to the middle of my screen, it gets normal....

4
NGUI 3 Support / Popup-list's "Drop-down list" is offset
« on: April 22, 2015, 08:47:38 AM »
Hey. I've encountered a problem today. I trying to create graphics settings, so I put the Popup-list prefab in my scene. It worked completely normally. Then I changed it to how I wanted it, and suddenly this happens:



Any idea on what I've done wrong?  (I've even tried doing what I did above once more)

5
NGUI 3 Support / Re: Global Functions
« on: March 29, 2015, 12:41:45 PM »
They're not really "global functions" as such, it's just that SendMessage can call private methods in components by name.

You just call them with

  1. aGameObject.SendMessage("MyMethod");

You can also use BroadcastMessage("MethodName") to send a message to ALL gameobject - closer to a real global method, I suppose, but it's a little performance heavy, so not recommended to do often.

Oh! This is exactly what I'm looking for. Thanks a lot.

Actually, I don't really remember why I asked in the first place... Probably some crazy idea...

6
NGUI 3 Support / Global Functions
« on: March 25, 2015, 12:46:50 PM »
Hey. First, I'm not sure if this is the right forum to ask, so please tell me if it isn't. It isn't really NGUI question, but it also is...

So:
Could someone please explain to me how the global functions in NGUI work? (I mean OnClick and so on) How are they called? Is is possible for me to easily add my own global functions to my project?

7
NGUI 3 Support / Re: Opening GUI on OnMouseDown()
« on: September 22, 2014, 12:57:33 PM »
Ok. I'm really sorry for bothering you with all of this. I finally found my solution. This:
  1. if (Input.anyKeyDown) {
  2.             label.text = "";
  3.             NGUITools.SetActive(thismessage,false);
  4.                 }
  5.     }
Has been called before the naked eye could see the message appear. So... I've made the message box clickable and I'm disabling it with that. :)

8
NGUI 3 Support / Re: Opening GUI on OnMouseDown()
« on: September 22, 2014, 10:55:22 AM »
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class ColorChangeOnHover : MonoBehaviour {
  5.  
  6.         // Use this for initialization
  7.  
  8.         Color32 initCol;
  9.         public int materialID;
  10.         public byte RED;
  11.         public byte GREEN;
  12.         public byte BLUE;
  13.         Color32 changeto;
  14.         public GameObject target;
  15.  
  16.         void Start(){
  17.                 initCol = target.renderer.materials[materialID].color;
  18.                 changeto = new Color32(RED,GREEN,BLUE,255);
  19.  
  20.         }
  21.  
  22.         void OnMouseOver () {
  23.  
  24.                 target.renderer.materials[materialID].color = changeto;
  25.  
  26.         }
  27.         void OnMouseExit(){
  28.                 target.renderer.materials[materialID].color = initCol;
  29.         }
  30.        
  31.         // Update is called once per frame
  32.         void Update () {
  33.        
  34.         }
  35. }
  36.  

But that still isn't my problem. My problem is that I can't get the NGUITools.SetActive to work with the OnMouseDown

9
NGUI 3 Support / Re: Opening GUI on OnMouseDown()
« on: September 21, 2014, 02:08:35 PM »
When I put the NGUI Events script to my main camera, my OnMouseOver stops working. However OnPress(bool) gets called, but it just won't enable the message panel. I've tried almost everything, but I just can't get the panel activate.

10
NGUI 3 Support / Re: Opening GUI on OnMouseDown()
« on: September 21, 2014, 09:10:04 AM »
No! My message (the one that sets the message panel active) script is on a computer monitor (check screen).

11
NGUI 3 Support / Re: Opening GUI on OnMouseDown()
« on: September 20, 2014, 11:22:26 AM »
Damn! Still can't get it to work. The only thing I want, is to Set NGUI Panel to active when I click on an object. I already have working pause menu so why isn't this working? (I'm probably just dumb)

12
NGUI 3 Support / Re: Opening GUI on OnMouseDown()
« on: September 20, 2014, 04:16:48 AM »
I would use OnPress(bool pressed) instead of OnMouseDown, and remember to set the collider properly.

Make sure your references are set up and the UIPanel component isn't disabled instead of the gameobject. SetActive goes on the gameobject, otherwise you have to use the component.enabled. Also make sure it's not a prefab you're referencing instead of an instance in the hierarchy in MessageBox. Otherwise you have to instantiate it properly first (use NGUITools.AddChild).

As for a Panel or anything else that needs to set timescale to 0 while active, use OnEnable and OnDisable.

  1. void OnEnable()
  2. {
  3. Time.timeScale = 0f;
  4. }
  5. void OnDisable(){Time.timeScale = 1f;}
  6.  

Hey. Ok, I should've said that before, my GameObject is a world object like chair or table. I'm trying to make some general script which I would just hook up on a game object (and set up the message, messagebox and label), and it would display the one messagebox. Here are some pictures:
This is just plain computer:

When I hover over the keyboard:

When I hover over the monitor:


For the colors I've used the OnMouseOver, so that's why I'm using OnMouseDown now. Should I really use OnPress?

13
NGUI 3 Support / Opening GUI on OnMouseDown()
« on: September 19, 2014, 10:50:50 AM »
Hey! I've got back to unity after month, and I'm trying to make an object that would say something to you, when you click on it. I have a MessageBox panel which has background, animated sprite and a label. Then I have this script on the Item I'm clicking:
  1.         public string text;
  2.         public GameObject MessageBox;
  3.         public UILabel label;
  4.  
  5.         // Use this for initialization
  6.         void Start () {
  7.        
  8.         }
  9.        
  10.  
  11.         void OnMouseDown () {
  12.                 NGUITools.SetActive(MessageBox,true);
  13.                 label.text = text;
  14.                 Debug.Log("Hello");
  15.         }
  16. }

Also on the panel there is script:
  1. void LateUpdate () {
  2.         if (Input.anyKeyDown) {
  3.                         label.text = "";
  4.                         NGUITools.SetActive(thismessage,false);
  5.                                 }
  6.         }
to close the panel and clear the message.

When I run the game (with the panel disabled by default) and click the object, it only prints Hello!, but nothing else happens. Any ideas how to fix this?


EDIT: I would also like to know if it's possible to make a panel that would set the timescale to 0 whenever it's active. I've tried but failed.

14
NGUI 3 Support / Re: Blurry textures after one run.
« on: April 23, 2014, 06:32:29 AM »
Ok, so I don't have any script like that, and I had set the default settings to "fantastic".


EDIT: Problem solved. All I had to do was to delete all the quality settings, other than "fantastic".

Thanks.

15
NGUI 3 Support / Re: Blurry textures after one run.
« on: April 23, 2014, 05:16:59 AM »
Doesn't anyone know? I really need help, because I have this for school, and I have to have it done in two weeks.

Thanks

Pages: [1] 2 3