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

Pages: [1]
1
NGUI 3 Support / Re: Getting unusual OnPress results
« on: December 28, 2017, 04:10:09 PM »
Ok think I quickly found the issue. Had the main Camera's UI camera set to 3D UI and not 3D World. Now seems to work :\

Sorry about that

2
NGUI 3 Support / Getting unusual OnPress results
« on: December 28, 2017, 04:02:21 PM »
Hey there,

currently using void OnPress(bool isOver) on two gameObjects. One is the ground, the other is a building on the ground. The OnPress effect seems to only work on the building when it is close to the camera. When the camera is far away OR if you click on like the far side of the building it doesn't register and instead the ground is clicked. I'm using version 3.11.4 which I think it the most recent.

What do I have wrong here?

3
NGUI 3 Support / Re: Camera UI is vibrating?
« on: November 14, 2013, 11:12:51 PM »
OK Aren, having a new issue. I have two cameras in the scene, one is dedicated to the UI, the other is for the player and objects.

It was working for awhile but now the UI camera is not talking to the MainCamera. The UI is visible in the Camera preview when the UIcamera is selected in the inspector, but it is not visible in the game window. EXCEPT when I turn something on/off in the inspector (like disable the camera/reenable the camera is now appears in the game window)

I've looked through all of the scripts and nothing is disabling the UIcamera or any of its components. Its just not appearing over the main camera.

EDIT:

Ok, apparently there was something wrong with the UI camera itself. I replaced it and everything it working now.

4
NGUI 3 Support / Re: Camera UI is vibrating?
« on: November 14, 2013, 08:26:00 PM »
Thanks Aren, guess I still have a lot to learn about NGUI.  :P

5
NGUI 3 Support / Re: Camera UI is vibrating?
« on: November 13, 2013, 07:52:10 PM »
Ok, nvm the camera rotation as being part of it. It just seems as though if the UIRoot widgets will vibrate if it moves far away from 0,0,0 regardless if the camera is rotated.


EDIT: Had to clarify that.

6
NGUI 3 Support / Camera UI is vibrating?
« on: November 13, 2013, 07:45:31 PM »
I'm not sure what I missed but the UI seems to be vibrating for some reason. This ONLY happens when the camera is rotated. If the character (which UI Root is a child of) just moves around there isn't a problem. But if I rotate the camera around the character the UI starts to vibrate when the character starts moving around. Also it only happens when the the UI root is REALLY far away from the 0,0,0 origin. Ex: At 17920, 0, -75280 the vibrations are very noticeable. but at 10,0,0 you can't notice it.

This happens when there are no scripts (other than the default NGUI ones that are attached but the wizard and widget tool) are attached to anything.

7
NGUI 3 Support / Re: Disable OnPress through collider?
« on: October 29, 2013, 05:22:12 PM »
Our line numbers don't match. Please update to the latest version before posting.

Done. Still getting the same issue. UICamera.cs:762, UICamera.cs:758 are the new line #s though.

And yes, if you set the generic event handler, you will start receiving a copy of the events. This is not how it was meant to be used. Generic event handler should be set in OnEnable() and removed in OnDisable(), and it should be done so on some manager script.

What you should be doing instead is moving focus from the object you started dragging to the object you want to receive events (as I assume that's what you are trying to do? not sure why else you'd be setting the generic event handler)

Annnd yeah. I was messing around with the UICamera.genericEventHandler earlier and I guess I just kept over looking it. That was the problem and removing it fixed the issue.  ;)

Thanks.

8
NGUI 3 Support / Re: Disable OnPress through collider?
« on: October 29, 2013, 05:02:07 PM »
NGUI events are consumed by the first collider, so I am guessing you're doing your own raycasts, which is where the problem comes from.

No, I'm not using any raycasts.

The basic setup:


Object1 scripts:

  1. void OnPress(bool isDown)
  2. {              
  3.         UICamera.genericEventHandler = gameObject;
  4.         //Debug.Log(UICamera.currentTouch.current.collider.name);
  5.         if(isDown)
  6.         {
  7.                 if(UICamera.currentTouchID == -1)
  8.                 {
  9.                         SelectionManager.GetComponent<SelectedManager>().SelectedObject = gameObject;
  10.                         Debug.Log("Object1 Selected");
  11.                 }
  12.         }
  13.         }
  14.  


Object2 Script: (basically the same exact thing)

  1. void OnPress (bool isDown)
  2. {      
  3.         if(isDown)
  4.         {
  5.                         SelectionManager.GetComponent<SelectedManager>().SelectedObject = null;
  6.                         MoverShower.SetActive(false);
  7.                         Debug.Log("Object2 Selected");
  8.         }      
  9. }


If all you do is click the first object, nothing bad happens. It prints out correctly that Object1 was selected over and over again with each click. If you click off that object and onto Object2 you get the Object2 Selected print out. BUT if you then go back and click back on Object1, it prints out both "Object1 Selected" "Object2 Selected".

1 Odd thing: if you set the console to collapse, it groups all similar print outs. There's a  "Object1 Selected" print out and TWO  "Object2 Selected". 1 populates when Object1 is clicked (which it shouldn't), the other populates when Object2 is clicked.

The information at the bottom of the console is almost exactly the same with one difference between the two One is:
"UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:734" the other:
"UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:730"

Looking at UICamera I'm guessing its telling me I'm not using a generic event handler for the second click?
Any ideas on what this could be?

9
NGUI 3 Support / Disable OnPress through collider?
« on: October 29, 2013, 01:30:21 PM »
Hey there,

Here's what I'm trying to do: I have two colliders, one is a box and the other is the ground. The Box has a "selection" script that includes an OnPress that says that if it's clicked, it gets added to the selection array. The ground as a DEselection script that clears out the array.

The problem is that the click on the box is going through and also clicking the ground at the same time. So the box can only be added if it's not hovering over the ground.

Is it possible to prevent two OnPress events from happening if they are stacked on top of each other (so that only the top/first OnPress executes)?

10
NGUI 3 Support / Re: OnHover and OnClick conflicting with one another.
« on: September 29, 2013, 06:43:48 PM »
Ok, fast simple fix:

  1.         void OnPress (bool isDown)
  2.         {
  3.                 if(tempObject != null)
  4.                         Destroy(tempObject);
  5.                
  6.         }
  7.  

Guess leave this here if someone else has a similar problem.
But I'll still ask, is there another way to do this so that the OnPress doens't need to be called?

11
NGUI 3 Support / OnHover and OnClick conflicting with one another.
« on: September 29, 2013, 06:40:38 PM »
So I'm trying to get an object to appear when the mouse is over another object.

Basic idea:
  1. void OnHover(bool isOver)
  2. {
  3.         if( isOver == true && ShowTempObject == true )
  4.         {
  5.  
  6.                 tempObject = Instantiate(PreFabObject, gameObject.transform.position, gameObject.transform.rotation) as GameObject;
  7.     }
  8.         else
  9.         {
  10.                         Destroy(tempObject);
  11.     }
  12. }
  13.  


Now this works, UNLESS you click the mouse. It seems like when you click the mouse it kills the OnHover and the destroy doesn't work. I would like to mention that there are NO calls to OnClick or OnPress in the scene.

12
NGUI 3 Support / Rolodex style menu?
« on: September 21, 2013, 09:04:39 PM »
So I'm trying to create a menu system that is similar to a rolodex. 1 window has the buttons X, Y, Z and a second window has corresponding panels X, Y, Z. The button window does not move, but the panels in the second window does. All attached to the same camera.

Here's what hasn't worked so far:

Using the animation system (something similar to the "Example 3 - Menu" scene) works except when the user presses the button that's already at the front then the animation repeats itself. Also animations are often getting confused with one another.

Lerping their locations from one point to another based upon who is in "front".

basically: If(Zbutton pressed && Xpanel == "front")
Lerp Xpanal to frontposition, backposition, speed
lerp Ypanel to Midposition, Midposition, speed
lerp Zpanel to Backposition, frontposition, speed...

At first I had an issue because they were flipping around their rotations. but after fixing that this just seems like an overly complicated/brute force way of doing it. As the number of panels/buttons increase the number of times of having to add this stuff increases pretty quickly. Is there a better way of doing this?

Pages: [1]