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

Pages: 1 2 [3] 4
31
Other Packages / HUDText - HUDRoot object need rigidbody?
« on: September 30, 2014, 07:06:46 AM »
Your sample uses rigidbody at hudroot object, but why and is it needed?


32
NGUI 3 Support / Why this error occur after update to 3.7.3?
« on: September 24, 2014, 01:49:03 AM »
When I move scroll item from one scrollview to outside and drop it to some container,

following errors occur which does not occur previous ngui version.

Just moving action works but unity console says as attached image.



33
NGUI 3 Support / Is there a way to set data to ngui Item?
« on: September 18, 2014, 08:03:19 PM »
So like in this video,

http://youtu.be/WT1yPEUkdjo

I have units in my list (says inventory), and I can drag some unit and drop to battle field.

So there is 9 spaces on battlefield.

How can I set some data (int value in this case for representing battle field position) to dragged item?

So if I move to 1 posiiton (top left position from 9 positions), I want to assign int value of 1 to that gameobject (ngui dropped item prefab gameobject)

Thanks.


34
NGUI 3 Support / Swap item tweening animation?
« on: September 16, 2014, 11:46:45 PM »
So I succeeded at swapping items between grids by change its parent transform.

But it just immediately changed after dropping, is there easy way to add smooth animation like ngui's default returning back animation when dropped position without container?

Thanks.

35
At ngui official Example 11-Drag & Drop,

Left, right side's item can be draged and dropped to [above] other side's item.

How this can be?

I made similar scheme with this at my scene, but when I move item from one grid(A) to other grid(B),

if I drag and drop on [top of] B's already existing item, then item go back to original position.

How can I avoid this?


36
NGUI 3 Support / UIDragDropItem.cs 169 line problem
« on: September 16, 2014, 04:26:18 AM »
So I made custom script like this,

  1. public class NguiDragRevise : UIDragDropItem {
  2.         public UIScrollView myscroll;
  3.  
  4.         void Start(){
  5.                 myscroll = GameObject.Find("AllyScroll").GetComponent<UIScrollView>();
  6.         }
  7.         protected override void OnDragDropRelease(GameObject obj)
  8.         {
  9.                 myscroll.RestrictWithinBounds(false);
  10.                 base.OnDragDropRelease(obj);
  11.         }
  12. }
  13.  

For solve my last post's dragging problem.

When I attach this script instead of UIDragDropItem script, and if I try to move this item out, error says,

------------
NullReferenceException: Object reference not set to an instance of an object
UIDragDropItem.OnDrag (Vector2 delta) (at Assets/NGUI/Scripts/Interaction/UIDragDropItem.cs:169)
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:1052)
UICamera:ProcessTouch(Boolean, Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:1721)
UICamera:ProcessMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:1388)
UICamera:ProcessTouches() (at Assets/NGUI/Scripts/UI/UICamera.cs:1460)
UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:1207)
-----------

What is problem, how solve?


37
NGUI 3 Support / Drag and Drop does not work well. (solved)
« on: September 16, 2014, 01:38:39 AM »
Using unity 4.5.4, ngui 3.7.2(newest)

I am making unit positioning UI, following NGUI Example 11 Drag&Drop scene.

So I made and set options followed ngui example, but as like this video, item dropping back does not work well.

http://youtu.be/-ThMXfxpxrs


38
Scene made from ngui's example 11,

drag & drop item to other container doesn't make related scrollbar synched perfectly.

I have container A, B  and container A has many card object, started moving card from A to B, B looks can contain 5 cards.

so after move 5 cards, move 6th card to B, at here B's scrollbar should be longed by 1 card's width, but doesn't updated automatically.

when move 7th card, scrollbar longed normally, but still lack by amount of  1 card's width.

This manually can be fixed at runtime when user scroll container B,

but I want it to automatically synched perfectly.

I almost maintain same option with example11, but only turn on option at UIScrollView's [Cancel Drag If Fits].

So this is also example11's problem. It also does not synched well until user manually drag.

To manually revise this phenomenon,

Calling UIScrollView's UpdateScrollBars(true) after OnDragDropRelease(GameObject obj) (little time after like some frames) can update scrollbars well automatically,

but is this best way?

Am I missing something?

Thanks.


39
NGUI 3 Support / Can I get image files used at NGUI's wooden atlases?
« on: August 15, 2014, 05:11:06 AM »
I want to each buttons of them to make new atlases or merge into other atlases.

Thx.

40
NGUI 3 Support / When UIEvent Trigger's [On Deselect] called?
« on: August 15, 2014, 03:04:06 AM »
What I want is, I have 6 UIButtons, if I touch one of them, its tween color start ping pong and shows its now selected.

And if I touch another button, previous button's tween color effect should be turn off and new touched button's tween color effect should start.

So I added UIEventTrigger and set tween color sprite to 'On Select'.

But I don't know how to stop this when click another button.


41
NGUI 3 Support / What resolution is most used from android devices?
« on: August 14, 2014, 11:43:18 PM »
So ngui has FixedSize option, but I feel I should choose default development resolution at develop stage.

I dont know which is the majority, 1280 *720 (Galaxy S3) or 1920 * 1080 (Galaxy S5).

Are there statistic data about major resolution of android devices current mobile gamers uses?

Thanks.

42
NGUI 3 Support / Problem when adding item to scrollview by code
« on: August 14, 2014, 08:43:06 AM »
Hi.

So I am testing adding items to scroll view via code when runtime.

I searched little, wrote like below with NGUI example7-Scroll View(Panel) scene.

  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class ScrollStudy : MonoBehaviour {
  5.  
  6.         public UIGrid grid;
  7.         public UIPanel scroll;
  8.         void Start () {
  9.         }
  10.         public GameObject pref;
  11.         GameObject newItem;
  12.         void Update () {
  13.                 if(Input.GetKeyDown("q")){
  14.                         Generate();
  15.                 }
  16.         }
  17.         public void Generate(){
  18.                 newItem = GameObject.Instantiate(pref, transform.position, transform.rotation) as GameObject;
  19.                 newItem.transform.parent = grid.gameObject.transform;
  20.                 grid.Reposition();
  21.                 NGUITools.MarkParentAsChanged(grid.gameObject);
  22.                 newItem.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f);
  23.         }
  24. }
  25.  

but when add new item, some existing item shows abnormal behaviour like disappearing etc.

see this video, http://youtu.be/xTVx_C8tF6k

Thanks.


43
Let's say mobile game, there are many layers of UI.

First of all, there is Main screen UI, then if user touch like map button, Map screen should be appear on top.

and there if user touch some location at map, detailed description window should be pop up over map.

How you manage these?

gameObject[Ngui object].SetActive(false) ?

or other good method?

Thanks.


44
NGUI 3 Support / Particle effect does not show at top of ngui object?
« on: August 13, 2014, 11:13:45 PM »
How can I make particle effect shows on top of any ngui objects?

Of course I can make another camera for only particle effect, but I want to know ngui solution.

I think this related with UI Root's [Render Q] option?

Thanks in advance.

45
NGUI 3 Support / How to pass string with color to UIText List?
« on: August 13, 2014, 12:48:04 AM »
So I want to make message windows.

Messages will have various color as its sort (battle message, event message, etc), so I want to pass string with color info to UITextList

but UITextList seems only give .Add(str) function. So color should be "[FF0000]msg" like this.

Isn't there another way to pass color info? like, textlist.Add(str, colorpicker);


Pages: 1 2 [3] 4