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

Pages: 1 ... 4 5 [6] 7 8 9
76
NGUI 3 Support / Re: BoxCollider does not stop Input in 3.X
« on: October 21, 2013, 04:56:14 PM »
Uff, that saved my life.

But just for the record: where is the difference between "World" and "UI". Is it better to use the latter?

77
NGUI 3 Support / Re: BoxCollider does not stop Input in 3.X
« on: October 21, 2013, 04:50:32 PM »
I only have 3.0.2 and don't own a Professional License. A workaround for now would be great.

But I'm still interested in the empty Widget-thing. Does it just intercept the events or is it still depth-related, since I need the collider to stop the input on a certain Z-Value

78
NGUI 3 Support / Re: BoxCollider does not stop Input in 3.X
« on: October 21, 2013, 04:36:15 PM »
I just read that changing on the Z-Axis has no effect at all. Tried that out and it seems to be true. That is really bad news. Changing Depth does NOT work for me, since changing Depth rearranges the Sprite-Draw-Order.

Please tell me there is a solution :(

79
NGUI 3 Support / BoxCollider does not stop Input in 3.X
« on: October 21, 2013, 04:27:46 PM »
Hey there,

so in order to stop Input on Buttons (and other stuff) I created in my a "STOPINPUTCOLLIDER" which is a GameObject with a Transform and only a BoxCollider; set to Trigger.
I change his Center.Z value like I want to certain values, most the time it is set to -15 so no button on screen (which have center.z values from 0 to  -10) can be touched.
This worked great for me.

NOW in 3.X I'm experiencing some weird stuff with this method. It kind of works in a different, weird and for my purposes not userfriendly way. It doesn't matter if I change the Value of the center.z, Buttons can be pressed. I managed to find out what the problem was. The Depth of the Background-Sprites of the Buttons.
When set to 0 or something negative the STOPINPUTCOLLIDER works, but as soon the Depth-Value of some sprites are set to 1 or above, the STOPINPUTCOLLIDER is ignored and every button can be touched.

Is there a solution to that or a workaround?

80
NGUI 3 Support / Re: Scrolling Credits Scene
« on: October 18, 2013, 02:56:36 AM »
Where is the problem to import the JPEGS and use them as NGUI-Sprites?

81
NGUI 3 Support / Re: Scrolling Credits Scene
« on: October 17, 2013, 03:06:17 PM »
Do you mean automatic scrolling like in most games/movies or do you mean that the Credit-Screen itself can be scrolled via Touchinput.   

For the first one (one method off millions, I guess):

- make one NGUI-Label for the whole Credits or for every Name/Word a single Label
- create an empty GameObject -> make this Object the parent of the labels
- attach a script to the GameObject where you move it constantly up/down/whatever


For the other one you could create a Scroll-View-Panel. In fact, you could make the first one a Panel, too. So you could use Clipping (Soft Clipping) which would look nicer.

Long answer short: yes, it is possible.

82
NGUI 3 Support / Re: Prevent second Buttonpress
« on: August 28, 2013, 01:09:48 PM »
Mhm, to be honest I didn't quite understand how to prevent the second input with the animation-bool?
Some Pseudo-Code-Advice?

83
NGUI 3 Support / Re: Prevent second Buttonpress
« on: August 28, 2013, 12:51:21 PM »
Same procedure with OnPress? The Button works with the OnPress(bool pressed) method.

84
NGUI 3 Support / Prevent second Buttonpress
« on: August 28, 2013, 12:01:38 PM »
So I have a button and when this button is pressed it's playing a certain Animation (2DToolkit), but when the button is pressed again, the animation starts again before the last cycle of the animation could end.

Is there a way to prevent more input on the button till the moment the animation is done playing?

85
That's not the problem. The "problem" is, that using the Widgettool and adding a new UI-Object to the scene it's showing the very first Texture of the TextureAtlas till I hit "PLAY", then it shows the right selected Sprite.

I just wanted to mention that. It doesn't crash Unity, no problems on deploying to the device, no other problems. It is just strange :)

86
Hm, when I run the Scene everything is normal. But when first-time setting a new Imagebutton up it's showing the first Sprite of the TextureAtlas. Strange.

87
Hey there.
So when I create an ImageButton I have to select for each Status of the Button (Normal, Hover, Pressed, etc.) a Sprite. Fine.
But when I'm adding it to the Panel in the Scene it's showing a different Sprite in the Scene, normally the first Sprite of the NGUI-Atlas. In the Inspector it shows me the Sprites I selected in the Widget Tool Editor, in order to get the results I want, I have to select the Background-Object of the ImageButton and reselect the Sprite I want.

Is this behaviour intended? I'm using the latest nGUI-Version which is provided by your private link.

88
NGUI 3 Support / Re: "Releasing" ButtonInput?
« on: June 15, 2013, 06:06:57 PM »
I would like to see the Code-Solution :)

89
NGUI 3 Support / "Releasing" ButtonInput?
« on: June 15, 2013, 04:58:59 PM »
Hey there!

I have problems changing from one animation to another while pressing buttons, here is the scenario:

1. The character walks around (walking animation) - pressing the Movementbuttons
2. An Enemy appears
3. Character walks into Enemy and is hit (hit animation) - pressing STILL the movementbuttons, while the hitanimation is played
4. Character is stuck in the hitanimation and "walks" with this animation, till I release the Buttons.

The movement and animation is done by a script with an "OnPress"-Method, the Rest (getting Hit by Enemy etc.) is done in PlayMaker.
I wanted to tackle it like this:

- while the Movementbuttons are still pressed and the Player gets hit <-> in that State where he gets hit I wanted to "disable" or "release" the Button internally. Is this possible, if so: how? :)

90
NGUI 3 Support / Disabling JUMP-Button after Jumping
« on: May 26, 2013, 09:04:57 AM »
Hey there.

So I've got this Movement/Action-Script which is attached to all my four UIImage-Buttons. They are seperated in four different states and do their job well.

  1.     using UnityEngine;
  2.     using System.Collections;
  3.      
  4. public class TestButton : MonoBehaviour
  5. {
  6.         public ButtonType type;
  7.         public NGUIInput input;
  8.         public RaycastCharacterController controller;
  9.         public tk2dAnimatedSprite playerSprite;
  10.         public SpriteAnimator animator;
  11.         public GameObject weapon;
  12.         private bool attacking = false;
  13.        
  14.         void HitCompleteDelegate (tk2dAnimatedSprite sprite, int clipId)
  15.         {
  16.                
  17.                 if (!playerSprite.IsPlaying ("attack")) {
  18.                         weapon.active = false;
  19.                 }
  20.                                
  21.                 if (!attacking) {
  22.                         CheckDirectionIdle ();
  23.                         playerSprite.Play ("idle");
  24.                 }
  25.                
  26.                 if (animator.jumping) {
  27.                         playerSprite.Play ("jump");
  28.                 }
  29.                
  30.                 if (animator.walking) {
  31.                         playerSprite.Play ("walk");
  32.                 }
  33.         }
  34.        
  35.         void Start ()
  36.         {
  37.                 weapon.active = false;
  38.         }
  39.        
  40.         void Update ()
  41.         {
  42.                 if (playerSprite.IsPlaying ("jump"))
  43.                         CheckDirectionIdle ();
  44.         }
  45.        
  46.         public void OnPress (bool pressed)
  47.         {
  48.                 if (pressed) {
  49.                         switch (type) {
  50.                                
  51.                         case ButtonType.LEFT :
  52.                                 input.SetX (-1f);
  53.                                 weapon.active = false;
  54.                                 playerSprite.animationCompleteDelegate = HitCompleteDelegate;
  55.                                
  56.                                 if (playerSprite.IsPlaying ("attack"))
  57.                                         playerSprite.Stop ();
  58.                                 animator.walking = true;
  59.  
  60.                                 break;
  61.                
  62.                         case ButtonType.RIGHT :
  63.                                 input.SetX (1f);
  64.                                 weapon.active = false;
  65.  
  66.                                 playerSprite.animationCompleteDelegate = HitCompleteDelegate;
  67.                                
  68.                                 if (playerSprite.IsPlaying ("attack"))
  69.                                         playerSprite.Stop ();
  70.                                 animator.walking = true;
  71.                                 break;
  72.                
  73.                        
  74.                    
  75.                         case ButtonType.JUMP :
  76.                                 input.Jump (true);
  77.                                 weapon.active = false;
  78.                                
  79.                                 playerSprite.animationCompleteDelegate = null;                         
  80.                                 break;
  81.                                
  82.                                
  83.                                
  84.                         case ButtonType.ATTACK :
  85.                                
  86.                                 if (!playerSprite.IsPlaying ("attack")) {
  87.                                         playerSprite.Play ("attack");
  88.                                         weapon.active = true;
  89.                                         attacking = true;
  90.  
  91.                                         playerSprite.animationCompleteDelegate = HitCompleteDelegate;
  92.                                         CheckDirectionAttack ();
  93.                                 }
  94.                                
  95.                                 attacking = false;
  96.  
  97.                                 break;
  98.                         }
  99.                 } else {
  100.                         switch (type) {
  101.                         case ButtonType.LEFT :
  102.                                 input.SetX (0.0f);
  103.                                 weapon.active = false;
  104.  
  105.                                 break;
  106.                         case ButtonType.RIGHT :
  107.                                 input.SetX (0.0f);
  108.                                 weapon.active = false;
  109.  
  110.                                 break;
  111.                         case ButtonType.JUMP :
  112.                                 input.Jump (false);
  113.                                 weapon.active = false;
  114.                                
  115.                                 break;
  116.                         case ButtonType.ATTACK :
  117.                                 input.SetX (input.x);
  118.  
  119.                                 weapon.active = false;
  120.                                
  121.                                 break;
  122.                         }
  123.                 }
  124.         }
  125.        
  126.    
  127. public enum ButtonType
  128. {
  129.         LEFT,
  130.         RIGHT,
  131.         JUMP,
  132.         ATTACK,
  133. };

The Problem is the JUMP-Part.

When I press that Button the Character is jumping. Fine. But when I press and HOLD it, the Character is jumping all the time with no change in other States, and of course the Animation is "stuck" in the last frame of the Jump-Animation. What do I want to do:

Is there a way to stop or disable the input of nGUI, meaning: the Player presses and HOLDS the Button, the Character jumps BUT stays grounded after that and the Player has to release the Button and press again.

Thanks in Advance for the Answers :)

Pages: 1 ... 4 5 [6] 7 8 9