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

Pages: [1]
1
NGUI 3 Support / Re: TweenLetters ignores Shadow opacity
« on: July 27, 2017, 06:02:44 AM »
Also, if there's a Start Delay specified in the Tween Labels script, it does the following:

1) Enters the first frame of the upcoming tween animation
2) Pauses for the X seconds

I believe there should be an option NOT to enter the first frame of the animation, before the StartDelay elapses.

2
NGUI 3 Support / TweenLetters ignores Shadow opacity
« on: July 27, 2017, 05:38:32 AM »
I have noticed that the TweenLetters script doesn't use the current Shadow (effect) opacity value. Instead it displays the effect as the opacity was full (fully black in case of a black color shadow). When the TweenLetters is over, the shadow opacity goes back to the preset value, resulting in a visual glitch.

ArenMook, any ideas of a quick fix? Thanks!

3
Please provide details on how you exactly implement the dragging, so I could help you.

4
NGUI 3 Support / Re: I need some help.
« on: July 20, 2017, 05:49:08 AM »
Forgot the first line in the code, it should be

  1. List<UISpriteData> spriteList = sourceAtlas.spriteList;

5
NGUI 3 Support / Re: I need some help.
« on: July 20, 2017, 05:44:17 AM »
I have faced a similar problem and solved it by extracting the textures from UIAtlas to a UITexture array upon start. Then I just apply the required UITexture on a Mesh Quad and put the shader on the material that belongs to that specific UITexture.

  1. UISpriteData data = spriteList[i];
  2.        
  3.                        
  4.                         Color[] pix = src_tex2d.GetPixels(data.x, sourceAtlas.texture.height - data.y - data.height, data.width, data.height);
  5.                         spriteTextures[i] = new Texture2D(data.width, data.height, TextureFormat.ARGB32, false);
  6.  
  7.                         spriteTextures[i].SetPixels(pix);
  8.                         spriteTextures[i].Apply();
  9.                
  10.                        
  11.                         IndividualSpriteTexturesDic.Add(spriteList[i].name,spriteTextures[i]);

6
NGUI 3 Support / Re: On Hover not working properly
« on: July 18, 2017, 04:03:40 PM »
You should do it in a completely different way. Put an UIEventTrigger script on each of the GameObjects you need to trigger the hovering sound on.
It has an OnHoverOver event. It should point to another script containing a simple function that plays the sound.

7
Hi ArenMook,

I have to keep a lot of live UISprites during the game, and most of them are situated off-screen.

I am looking for a way to improve performance, by putting a script onto each UISprite containing object. Idea is to disable the UISprite when it's off-screen (completely) and re-enable when some portion of a sprite becomes visible within the screen bounds. (Maybe there is a way to do it through the parent panel? I haven't found)

I tried many solutions but none of them worked. Please help! I am dumb and looking forward to some working code. I know it's a piece of cake for you. Thanks.

This is what I currently have (doesn't work, sets Visible all times)

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class CheckSpriteVisibility : MonoBehaviour {
  6.  
  7.         public UISprite thisSprite;
  8.        
  9.         void Start () {
  10.                
  11.                 thisSprite = this.GetComponent<UISprite>();
  12.                
  13.                 cam = Camera.main;
  14.                 planes = GeometryUtility.CalculateFrustumPlanes(cam);
  15.                
  16.         }
  17.        
  18.         public const bool t = true;
  19.         public const bool f = false;
  20.        
  21.         public Bounds b;
  22.        
  23.         Camera cam;
  24.         Plane[] planes;
  25.        
  26.         public bool Visible;
  27.        
  28.         void Update () {
  29.                
  30.                 b = NGUIMath.CalculateRelativeWidgetBounds(this.transform);
  31.                
  32.          if (GeometryUtility.TestPlanesAABB(planes, b))
  33.                  Visible = true;
  34.          else
  35.                  Visible = false;
  36.        
  37.                
  38.         }
  39. }
  40.  

Pages: [1]