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.


Topics - decoy26517

Pages: [1]
1
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?

2
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.

3
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)?

4
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.

5
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]