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

Pages: [1]
1
NGUI 3 Support / Broken Atlas?
« on: March 17, 2015, 09:54:47 AM »
Hi,
after some time of inactivity I got back to development and updated to Unity 4.6.x (and later to Unity 5) and latest version of NGUI and my atlases look brooken. I'll provide more details later, but here's something that may have triggered the issue:
I didn't notice immediately because the project was half broken and I had some errors preventing the scenes to display. In particular Unity was prompting "missing gameobject reference" everywhere. When I tried to attach any script to any GO it said that the script didn't exist.
To solve this I went through many attempts like reimport all, delete all .meta files, and finally I solved deleting the whole Library directory.

Now finally the project is ok and running, but it seems that my atlases are broken. Look at the buttons in my main menu:
http://i.imgur.com/Z8AcfBD.jpg

In the atlas maker if I open the atlas where those buttons are stored, all the sprites names are messed up and the sprites themselves are not the correct ones (it looks like it took an image and cut it up randomly to make all the sprites).

http://i.imgur.com/0r59gZS.jpg

Note: the atlas .png file in the atlas directory is fine.

Any advice?

2
Misc Archive / [RELEASE] Conspiracy! - Rise of a New Leader
« on: August 05, 2014, 06:35:06 AM »


Hi everyone,
I just released a game where I heavily used NGUI: Conspiracy! - Rise of a New Leader.
Quote
Build your Evil Organization, earn Conspiracy Points and complete the activation of the mysterious K.R.A.K.E.N. project to get a secret reward!
It's a clicker game (Adventure Capitalist/Cookie Clicker style) set into the same universe of our main project at Dev9k, Conspiracy!
I'd love to get your feedback on this :)

Screenshots:
http://www.dev9k.com/games/CRoaNL/scr1.jpg
http://www.dev9k.com/games/CRoaNL/scr2.jpg
http://www.dev9k.com/games/CRoaNL/scr3.jpg

p.s. Also I have to thank ArenMook for his amazing work with NGUI, it saved us loads of time!

3
Fixed, look at the edit. Maybe the same fix should be applied to next NGUI update?

Hi,
I'm trying to build my project for WP8.
I'm using Unity 4.5 with NGUI 3.6.3.

When I go to build and it starts compiling the scripts, I get the following error:

Quote
Assets/NGUI/Scripts/Internal/NGUITools.cs(470,17): error CS0103: The name `UnityEditor' does not exist in the current context

This is the line triggering the error:

Quote
UnityEditor.Undo.RegisterCreatedObjectUndo(go, "Create Object");

I tried to add a "using UnityEditor;" on top of the script and I get the error again, this time on the line where I put the "using" instruction and asking if I'm missing an assembly reference.
I checked on my Assembly-CSharp/References and the UnityEditor.dll is there.

Any advice?

Edit:
I wrapped line 470 of NGUITools.cs with the platform dependent directive:
Quote
#IF UNITY_EDITOR
UnityEditor.Undo.RegisterCreatedObjectUndo(go, "Create Object");
#endif
and it stopped giving the error.

It seems that a built game cannot use the UnityEditor namespace.

4
Hi,
I'd like to make a background filled with a tileable texture, and make it move (I'm trying to achieve a moving dust effect).

I see that I can move any widget attaching a UITweenPosition script to it, but I have no idea how to automatically tile the texture so it doesn't leave empty space when it moves.

I'm not sure if my explanation is understandable, so I found a random website that has the moving background effect that I'm trying to achieve:
http://getcharacters.com/

Thanks!

5
NGUI 3 Support / UI cropped in Web Player
« on: November 15, 2013, 09:16:00 AM »
Hi,
after upgrading NGUI from version 2.x to 3.x I have an issue on the Web Build of my game: the interface is cropped.

Maybe I misconfigured my UI Root, but I can't figure it out.
It's set to FixedSizeOnMobiles, Manual Height 600, Minimum Height 600, Maximum Height 1536.

Player is set to 960x600 resolution.

Here's what happens.

Ok inside Unity and on mobile devices: https://dl.dropboxusercontent.com/u/17965504/ok.jpg
Issue running in web player: https://dl.dropboxusercontent.com/u/17965504/not.jpg

Any idea?

6
NGUI 3 Support / tweencolor or animation?
« on: October 28, 2013, 12:55:37 PM »
Hi,
I have a sprite of color A and when a certain event is triggered I would like to change that color to color B and then back to color A to highlight what happened.

I tried to attach a tweencolor script to the sprite and use the methods play/toggle without success. The best I obtained is that it worked only the first time the event was triggered.

Any advice ?

Maybe i have to make an animation ?

7
NGUI 3 Support / Issues on achieving the desired dragging behaviour
« on: September 06, 2013, 05:42:45 AM »
Hello,
I have a panel containing multiple instances of the same item.
I'm trying to achieve the following behaviour:
- when the user taps on an item and drags it horizontally, all the other items are moved horizontally with him.
- when the user taps on an item and drags it vertically, only that single item is moved vertically.

Something similar could be achieved attaching to each item two UIDragObject.
The first one is for horizontally dragging, therefore its dragging target is the panel containing all the items and the movement is locked on the horizontal axis.
The second one is for vertically dragging, therefore its dragging target is the item itself and the movement is locked on the vertical axis.

This solution seems quite dirty to me, and also has the side effect that it is possible to move the item horizontally and vertically at the same time (a.k.a. diagonal movement :D) while I would like that the item is movable on one axis at time.

Any idea ?

Thanks

Antonio

8
Hi,
I have the usual draggable panel with a grid and a vertical list of gameobject spawned inside this grid.
At a specific time, I'd like to move automatically the panel and center it on a specific child.

How can I do It ?

9
NGUI 3 Support / Two draggable panels issue.
« on: May 27, 2013, 05:44:56 AM »
[SOLVED, read post #2]

Hi!
I'm having issues in a scene where I have two draggable panels.

This is the Hierarchy:

*Panel_DeckBuilder
**Sprite_A  ( position -303,0,-1 scale 400x800, collider 400x800)
**Sprite (position 177,0,-2 scale 400x800, collider 400x800)
**Panel_A_Draggable (position -303,0,-1)
***Grid_A
**Panel_B_Draggable (position 177,0,-2)
***Grid_B

On Sprite_A I have a UIDragPanelContents script with Panel_A as draggable panel.
On Sprite_B I have a UIDragPanelContents script with Panel_B as draggable panel.

On Panel_A and Panel_B is attached a UIDraggablePanel script with the same settings.

GameObjects Grid_A and Grid_B have a UIGrid script attached.

At runtime I spawn objects inside these two grids.

The issue:
- Only the objects on Grid_B are dragged, no matter where I click
- The objects are dragged even if i click outside the sprite SPRITE_B
- If I set a lower Z position on SPRITE_A (for instance bringing it to -3 instead -1) and I leave SPRITE_B at the same Z (-2) It drags the objects on GRID_A and not the objects on GRID_B.

I thought it was a collider problem, I thought that maybe the colliders on the sprites are too big and the one nearer to the camera intercepts the clicks. But it seems it's not that.

Any idea ?

Thanks a lot



10
NGUI 3 Support / Issue on spawning buttons
« on: May 06, 2013, 06:15:27 AM »
Hi,
I'm using NGUITools.AddChild to spawn buttons into my menu from prefabs.
I have a strange issue: when I play the game and the panel with this buttons is displayed, they appear with the color of their pressed state.
When I move the mouse over them it goes away and the right color appears.

Any hint ?

11
NGUI 3 Support / Dynamic text randomly screwed
« on: April 30, 2013, 09:34:08 AM »
Hi, I'm using NGUI 2.5.1 with the library for dynamic text.
Sometimes I get the whole text messing up like in this picture. Totally randomly, I'm not able to replicate it. When it happens, I just restart the game and soon it goes away.

http://db.tt/7PMaJCDe

What may it be ?

12
Hi,
i'm creating a multiplayer menu for my game, where you can find a button to find a random opponent and a list of open games to rejoin.
I'm using a vertical scroll view with a clipped panel that I made following the tutorial on the documentation, and everything seems to be ok when I tested it placing only the random opponent button and some clones of it.

The problem comes when I tried to add the rejoin buttons at runtime. These buttons are instantiated from a prefab with this code:

  1.         void CreateOpenGameButton(int gameId)
  2.         {      
  3.                 GameObject g = null;
  4.                 GameObject randomOpponentButton = GameObject.Find("Button_RandomOpponent");
  5.                 Vector3 gPos = new Vector3(randomOpponentButton.transform.localPosition.x,
  6.                                                                         randomOpponentButton.transform.localPosition.y,
  7.                                                                         randomOpponentButton.transform.localPosition.z);
  8.                
  9.                 GameObject draggablePanel = GameObject.Find("Child");
  10.                
  11.                 GameObject newButton = NGUITools.AddChild(draggablePanel, mButtonPrefab);
  12.                 newButton.GetComponent<RejoinGameButton>().setMultiplayerRef(this);
  13.                 newButton.GetComponent<RejoinGameButton>().setGameId(gamePlanId);
  14.                 newButton.name ="Button_ResumeGame_"+ gamePlanId.ToString();
  15.                 newButton.transform.localScale = new Vector3(0.5f, 0.5f, 0);
  16.                
  17.                 mRejoinButtons.Add(newButton);
  18.                
  19.                
  20.                
  21.                 if (mRejoinButtons.Count > 1)
  22.                 {
  23.                         g = mRejoinButtons[mRejoinButtons.Count -2]; //reference to the penultimate button
  24.                         gPos.x = g.transform.localPosition.x;
  25.                         gPos.y = g.transform.localPosition.y;
  26.                         gPos.z = g.transform.localPosition.z;
  27.                 }
  28.                
  29.                 newButton.transform.localPosition = new Vector3(gPos.x, gPos.y -70, gPos.z)
  30.                        
  31.         }

This script instantiates the buttons and places them in the correct positions calculated in relation with a non-runtime-instantiated button called Button_RandomOpponent.

The buttons are generated correctly, they work correctly and the drag still works, but their colliders are fucked up (they are not in the correct places) and their labels appear below their backgrounds.

I solved the problem of the colliders deleting them from the prefab and creating them when the buttons are generated, adding this code to the script:

  1. NGUITools.AddWidgetCollider(newButton);
  2.  

Then I tried the same strategy with the labels, deleting them from the prefab and creating them when the buttons are instantiated, but it didn't work:

  1. UILabel label = newButton.GetComponentInChildren<UILabel>();
  2. label.text = "Resume Game #" + gameId.ToString();
  3.  

Any advice on this ? If needed I can post the hierarchy of the project and the configuration parameters of every gameobject.


 

13
NGUI 3 Support / Issues instantiating buttons
« on: April 15, 2013, 11:47:42 AM »
Hi all,
I'm making a game menu where some buttons are instantiated runtime to resume the games that the user is playing.

I created an empty GameObject and then created a button inside it.
Then I've made the GameObject a Prefab with the name ResumeGameObject.
Then at runtime I instantiate the gameobject this way (mButtonPrefab is the reference to the ResumeGameObject prefab, mMultiplayerPanel is the panel where I want to attach the button):

  1. GameObject newButton = GameObject.Instantiate(mButtonPrefab) as GameObject;
  2. NGUITools.AddChild(mMultiplayerPanel, newButton);
  3. newButton.name ="test";
  4.  

The result is that each button is created twice.
One copy appears under the right panel and has the name ResumeGameObject(clone)(clone). The other one has the right name ("test") but it's on the top level of the scene hierarchy, along the main camera and the UI Root (2D) object.

What am I doing ?


Pages: [1]