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

Pages: [1]
1
I am not looking for detailed analysis, more I am looking for someone to hopefully point me in a good direction to look. Here is the basics of it:

Single channel game, host starts game, creates lobby on a lobby server, and joins channel 1. game scene loads.

client player starts game, joins the server via the lobby server, joins channel 1 and loads in to the scene.

Here is the trick. If the client is run from the editor, everything works fine. However, if the client is running from a compiled build, only this one particular RFC (at least that I am aware of) never reaches the client. I had debug messages sent to my chat window at the start of the RFC to check this.

What could be different that can give me an idea of where to look?

Bonus info: the RFC is on a TNObject that is instantiated at runtime. I am not sure if this impacts anything, but there it is.

Pretty much all of my tests were with editor as client and run time as host so I got pretty far along before I noticed this. It wasn't until the game got put out on our network for a couple people to test that we found it.

2
NGUI 3 Support / Re: Resizing a prefab anchored to a 3d world object
« on: February 21, 2015, 12:05:04 PM »
Beautiful, works like a charm.

SetAnchor(object, left, bottom, right, top) got it working as I wanted, and indeed the object was enabled to begin with so I axed the enable at the end. Thank you very much for your help.

3
NGUI 3 Support / Re: Resizing a prefab anchored to a 3d world object
« on: February 21, 2015, 11:52:49 AM »
Thank you for your response, I think it helps me out tremendously. I am about to leave on a day trip and I hope to jump in code before I depart to see if it corrects my issues.

When the object disappears, I am not sure currently where it goes. Unfortunately this is part of a bit of code that is utilizing networking and only fires when I test and connect with clients to server, so I have been building a couple scenes and running the .exe on clients and server to test. I can plop this code somewhere else for testing, though. I may not need to if my suspicions are correct.

I had not confirmed my gameobject was disabled at the start, I will eliminate that bit of code to confirm it is enabled. I had that in there because of code I found in the sticky for AddChild (remember, I am very new to NGUI so scouring the forums for answers before I post).

GameObject.Find is very slow, I agree. It really is just placeholder code until I get things working, after that it will be a variable stored.

And in final, this is a window that is popping up over a game object in world space, which is why I was anchoring it. I was ignorant to the fact I could declare the left,bottom, right, top anchors inside of setanchor. I bet my problem will be solved if I simply delete setRect and just call dimensions in the anchor. I will post as soon as I can verify.

4
NGUI 3 Support / Re: Resizing a prefab anchored to a 3d world object
« on: February 19, 2015, 06:50:43 PM »
Hmm, I will post my code here. From looking over the methods, it seems to me I should anchor the object before using SetRect. Only when I do that, it appears that the object disappears entirely. If I eliminate SetRect then the UI I want to spawn appears correctly and behaves perfectly. Just much larger than I desire. Forgive the superfelous code I wanted to include from addChild to Active in case I made some rookie mistake (I am a NGUI rookie after all). Where is my mistake? I have tried several things to troubleshoot such as adjusting the arguments being passed to SetRect so I could try to find where the widget ended up at. I have double and triple checked panels and depths to try to make sure it isn't behind everything.... and as I said it appears sans the SetRect() so something in that I am doing wrong I suspect

  1.                                 var win = NGUITools.AddChild(GameObject.Find("CardPanel"), attackedPanel);
  2.                                 win.GetComponent<UIWidget>().SetAnchor(attacker.gameObject);
  3.                                 win.GetComponent<UIWidget>().SetRect(0, 0, 200, 100);
  4.                                 win.GetComponent<UIDragDropContainer>().reparentTarget= GameObject.Find("UsedCards").transform;//This is a panel with -1 depth for hiding widgets from view
  5.                                 win.GetComponent<DefensePanel>().attack = evnt.attack;
  6.                                 win.GetComponent<DefensePanel>().damage = evnt.damage;
  7.                                 win.GetComponent<DefensePanel>().attacker = attacker;
  8.                                 NGUITools.SetActive(win, true);
  9.  

5
NGUI 3 Support / Re: Resizing a prefab anchored to a 3d world object
« on: February 19, 2015, 06:05:08 PM »
Now that I am pointed at SetRect, I am looking at the declaration and it looks to me at a cursory look that it should not lose the anchor and maybe I did something else wrong. I am going to look in to using this after the setanchor and see if I can get it to appear correctly

6
NGUI 3 Support / Re: Resizing a prefab anchored to a 3d world object
« on: February 19, 2015, 06:00:02 PM »
Yes I did, but I may be missing something. When I SetRect before SetAnchor, the dimensions aren't changed, and I assume the SetAnchor to worldspace object changes it's dimensions with the anchors. When I SetRect after SetAnchor it moves it, and I assume that is because SetRect is removing it's anchor target. Correct me if I am wrong.

I didn't explore much in SetRect after that as I was unsure of the recommended way of doing this so I tried other things

7
NGUI 3 Support / Resizing a prefab anchored to a 3d world object
« on: February 19, 2015, 11:59:39 AM »
There may be a simple solution to this I am unaware of. The situaion:

I have a prefab window that in script is brought in to existence using AddChild, parenting it to a panel for proper display/management. I think anchor it to a 3d object using .SetAnchor

I have tried a couple methods to resize this prefab window, but none seem to work. Could someone give me a suggestion?

Thank you in advance,

Jesse

8
NGUI 3 Support / Re: Right Click in editor not working?
« on: February 19, 2015, 11:55:39 AM »
Thank you,

That was embarrassingly simple. I must not have had the rect tool selected the few times I tried it, so I just got the hang of plugging along using menus. Indeed when I have the rect tool selected (which I have 95% of the time when dealing with UI anyway) it worked like a charm. Thanks for the response.

Issue Solved

9
NGUI 3 Support / Right Click in editor not working?
« on: February 18, 2015, 10:21:17 AM »
Hello,

new to ngui. I imported a couple days ago, have watched the tutorials, set up my environment as per tutorial 1. Things are going smoothly so far and I love ngui and it is saving me a lot of time.

The issue I am having is minor, and I could not find anything after doing some searches and reading FAQ which leads me to believe I either missed something very simple or have some odd setting out of whack. What is happening is this: In the Unity 4.6 editor, I can not right click on items in the scene view to get a context menu as I see being done in the tutorial. I can get everything done I have been trying by going through the top menu, though.

It is minor but would be a convenience, and it leads me to worry that if I do not find the root cause there could be other issues. Does anyone have an idea of why this would be happening?

Thank you in advance,
Jesse

Pages: [1]