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

Pages: [1] 2
1
NGUI 3 Support / Re: Windows 8 Phone
« on: June 25, 2014, 03:12:35 PM »
Updated to Unity 4.5.1f3 and seems to have fixed all the NGUI issues I was having.  Thanks

2
NGUI 3 Support / Windows 8 Phone
« on: June 24, 2014, 05:49:21 PM »
Below is the error I get whenever I click anything using UIEventListener.  This app was build for Android then ported to iOS and NGUI has been flawless!  I have Unity 4.3.1f and NGUI 3.6.5.  Any help would be appreciated! 

A first chance exception of type 'System.MissingMethodException' occurred in Unknown Module.
An exception of type 'System.MissingMethodException' occurred in Unknown Module. but was not handled in user code
Exception: Method not found: 'System.Reflection.MethodInfo System.Type.GetMethod(System.String, System.Reflection.BindingFlags)'.
Type: System.MissingMethodException
Module: Assembly-CSharp-firstpass
InnerException: <No Data>
AdditionalInfo:Invoking UIButton::OnClick method with argument count: 0
   at EventDelegate.Cache()
   at EventDelegate.Execute()
   at EventDelegate.Execute(List`1 list)
   at UIButton.OnClick()
   at lambda_method(Closure , Object , Object[] , Int32 )
   at WinRTBridge.MethodTools.InvokeMethod(Object instance, Int32 methodIndex, Object[] args)

3
NGUI 3 Support / Re: Picture in picture Style layout
« on: June 19, 2014, 03:18:39 PM »
Thanks Aren this worked great.

4
NGUI 3 Support / Re: Picture in picture Style layout
« on: June 18, 2014, 06:22:00 AM »
Thanks Aren! But having an issue where I have to enter the menu then exit the reenter to get the coordinates to work.  When I first enter the menu I get a little sliver showing on the screen nowhere near any of the corners.  Then I exit and enter the menu again and everything is perfect.  Below is my code.  My element is anchored to resize to the screen.  The object is disabled when the scene starts and enables when you enter this particular menu.

  1. function OnEnable()
  2. {
  3.         var windowSprite : UISprite = GetComponent(UISprite);
  4.        //Inserted this to try to get the corners to update to the resized positions.
  5.         windowSprite.UpdateAnchors();
  6.  
  7.         var bottomLeft : Vector3 = GUICam.WorldToViewportPoint(windowSprite.worldCorners[0]);
  8.         viewCam.rect.x = bottomLeft.x;
  9.         var bottomRight : Vector3 = GUICam.WorldToViewportPoint(windowSprite.worldCorners[3]);
  10.         viewCam.rect.width = bottomRight.x - bottomLeft.x;
  11. }
  12.  

5
NGUI 3 Support / Picture in picture Style layout
« on: June 16, 2014, 11:42:23 PM »
Hello I am attempting to setup a PIP style UI where I set a camera viewport Rect to the frame of a NGUI sprite.  I cannot get this to work.  I have tried nguimath CalculateAbsoluteWidgetBounds to get the bounds then convert them to viewport points but it puts my viewport all over the place.  I am really hoping someone can point me in the correct direction.  Tried setting up game objects on the ui but it is anchored and changes and then the game object is misplaced.  Thanks for any help!

EDIT
Ok so maybe my description wasn't the best.  I need to get a rect from a UIWidget in viewport coordinates. Then I can assign those values to my camera viewport.

6
NGUI 3 Support / Button 'Sticks' when released
« on: July 18, 2013, 05:21:59 PM »
I have been searching for some help on this for a while but cannot fix it myself or find any information so here is my issue. On some (Android)devices my buttons when pressed then released hang in the pressed position for a second or so after release.  My code is below.  For this example it is a gas pedal for a car and when you release it and it doesn't stop accelerating it becomes a problem quick.  I have run this in FixedUpdate as well as Update with no change.  I have a similar issue with my space lander game buttons sticking.  Any help would be greatly appreciated. Thanks

  1. #pragma strict
  2.  
  3. var release : String;
  4. var go : boolean;
  5. var drive : Drive;
  6.  
  7. function OnPress (isPressed : boolean) {
  8.         if(enabled){
  9.                 go = isPressed;
  10.                 if(!isPressed){
  11.                         OnRelease();
  12.                 }
  13.         }
  14. }
  15.  
  16. function FixedUpdate(){
  17.         if(!go){
  18.                 return;
  19.         }else{
  20.                 drive.Accelerate();
  21.         }
  22. }
  23.  
  24. function OnRelease(){
  25.         drive.Released();
  26. }
  27.  
  28. function OnDisable(){
  29.         if(!go){
  30.                 return;
  31.         }
  32.         go = false;
  33.         drive.Released();
  34. }
  35.  

7
NGUI 3 Support / Re: Stop input when I disable a panel
« on: March 17, 2013, 08:02:14 AM »
Thank You!!  But it was my fault I was using on press to set a bool to do something or not to and I just added a on disabled set bool to false but thank you very much for the quick reply it pointed me in the right direction.

8
NGUI 3 Support / Stop input when I disable a panel
« on: March 16, 2013, 07:59:14 AM »
So here is the issue I have run just into I use uipanels like different windows gliding them on and off the page as a user activates a certain menu.  I have noticed that if a button is held when I disable a panel that button will be continually held until that panel is active again. Is there a way to stop all inputs from a panel before I set it inactive?

9
NGUI 3 Support / Re: Create new widget
« on: December 24, 2012, 08:53:01 PM »
Sorry about that I figured it would work like the generic functions in unity.
Quote
These are known as generic functions. The significance they have for scripting is that you get to specify the types of parameters and/or the return type when you call the function. In JavaScript, this can be used to get around the limitations of dynamic typing:-

// The type is correctly inferred since it is defined in the function call.
var obj = GetComponent.<Rigidbody>();

and that does appear to be angular brackets...humm

But thanks for the help.

10
NGUI 3 Support / Create new widget
« on: December 24, 2012, 07:59:37 PM »
I have been searching here and on Unity forums but cannot find a answer.  I am trying to create a radar system and to do this I have to create new widgets as objects are created.  I have read this post http://www.tasharen.com/forum/index.php?topic=81.msg374#msg374 and cannot get it to work.  Everything I try gives me this error.  Assets/Standard Assets (Mobile)/Scripts/NGUIScripts/Test/Test.js(4,41): BCE0164: Cannot infer generic arguments for method 'NGUITools.AddWidget.<T>(UnityEngine.GameObject)'. Provide stronger type information through arguments, or explicitly state the generic arguments.  and my code has varied but the simplest being
  1. var label : UILabel = NGUITools.AddWidget<UILabel>(gameObject);

11
NGUI 3 Support / Re: Button Held Release Call
« on: December 19, 2012, 03:06:26 PM »
Thank You again for the great product and support.  I understand you are not a instructor for unity however you have been a great help to me even on things not NGUI.

12
NGUI 3 Support / Re: Button Held Release Call
« on: December 19, 2012, 05:34:04 AM »
Thank You very much for your help!!  I am working on making this change but here is the issue I am having.  I want to write 1 script that is reuseable for each button you may encounter in the game, that is why I went with the SendMessage way at first.  But now that I know how bad that is I am trying to do the same thing with variables and cannot get it to work.  Is there a way to call a function that is a variable.  Like above I just typed in the function into the variable call and boom when held I got thrust from a sendmessage.  I can't figure out how to find the a variable type of script, and call variable functions from it.  Is this possible?  If not I will write scripts for each variation of button but really would like to avoid that.  Sorry if I am stupid I am trying to find the answers on my own also.  Thanks again.
  1. var variableScript : Component;
  2. var variableHeldFunction : Function;  <-- This does not show up in the inspector so I cannot define the value.  
  3. var variableScriptName : String;
  4. var variableCall : String;
  5.  
  6. function Start(){
  7.      variableScript = target.GetComponent(variableScriptName);<--  Here it tells me that I cannot convert Script type to component.
  8.      variableHeldFunction = variableCall; <-- Returns errors for string cannot convert string to function.
  9. }
  10.  

13
NGUI 3 Support / Re: Button Held Release Call
« on: December 18, 2012, 11:53:09 PM »
The main question is why does it not call OnRelease every time I release the button?  As a second question now what would you recommend I use besides SendMessage?  This script is attached to the button and my ship has a thrust script that send message calls.  It uses forces on a rigidbody and thats why I have it in fixed update.  Thank you for the help.


14
NGUI 3 Support / Button Held Release Call
« on: December 18, 2012, 05:45:52 PM »
Ok so I am using NGUI Buttons to emulate a controller on a Android device.  I have a script that does not send release calls every time a button is released.  The script is layed out below.  Thank you in advance.

  1. #pragma strict
  2.  
  3. var target : GameObject;
  4. var call : String;
  5. var release : String;
  6. var go : boolean;
  7. var releaseCall : boolean = true;
  8.  
  9. function OnPress (isPressed : boolean) {
  10.         if(enabled){
  11.                 go = isPressed;
  12.                 if(!isPressed && releaseCall){
  13.                         OnRelease();
  14.                 }
  15.         }
  16. }
  17.  
  18. function OnRelease(){
  19.         if(target == null){return;}
  20.         target.SendMessage(release, gameObject, SendMessageOptions.DontRequireReceiver);
  21. }
  22.  
  23. function FixedUpdate(){
  24.         if(go){
  25.                 Send();
  26.         }
  27. }
  28.  
  29. function Send(){
  30.         if(target == null){return;}
  31.         target.SendMessage(call, gameObject, SendMessageOptions.DontRequireReceiver);
  32. }

15
NGUI 3 Support / Re: 2d UI waypoint
« on: November 24, 2012, 12:48:54 AM »
Ok so not how I had hoped to fix this but I added a game object that is offset by the amount off target and made my arrow a child.  This is ok but I really dont like what it.  Is there any way to have a waypoint marker move around the edge of the screen pointing in the direction of the landing zone?   Any info would be great. Thanks

Pages: [1] 2