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

Pages: [1]
1
I'm using 3.0.2

reproduce step:
  • Create a new scene.
  • Through menu [NGUI] -> [Create] -> [Texture]
  • Assign "Fantasy Atlas" material provided from NGUI package to UITexture's material
  • Attach the code below
  • Hit Play

In my game, I use a custom shader to mask the texture, so I can't use UITexture's UV setting.
I tried MarkAsChanged(), it didn't work.
Disable/Enable UITexture or panel.Refresh() work, but I think I should not do that at runtime.
How do I make it work in 3.0.2 ?

Thanks.

  1. using UnityEngine;
  2. public class UITextureOffset : MonoBehaviour
  3. {
  4.         float offset;
  5.         UITexture tex;
  6.         void Start()
  7.         {
  8.                 tex = GetComponent<UITexture>();
  9.         }
  10.         void Update()
  11.         {
  12.                 offset += Time.deltaTime;
  13.                 if (offset > 1)
  14.                         offset = 0;
  15.                 tex.material.mainTextureOffset = new Vector2(offset, 0);
  16.         }
  17. }
  18.  

2
NGUI 3 Support / move UISprite in/out soft clipped panel
« on: July 09, 2012, 09:59:44 PM »
I have a soft clipped panel, and some UISprite inside, I have an animation to move these sprite outside the panel, so i change their transform.parent and position, but they seem to be clipped.

should i change their shader before move out ?

any idea ?

Pages: [1]