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

Pages: [1]
1
NGUI 3 Support / Re: NullReferenceException
« on: February 10, 2015, 03:15:29 AM »
Thanks.

2
NGUI 3 Support / Re: Problem UITexture when Update texture
« on: January 28, 2015, 10:10:44 PM »
I not uses most updated NGUI i use NGUI version 3.7.6p2, because i use unity3d 4.5.1 and it does not support the newest NGUI version.

3
NGUI 3 Support / Problem UITexture when Update texture
« on: January 25, 2015, 11:47:47 PM »
I want create sprite but not use UISprite but UITexture because this image to large for create sprite.
so i create code like this to make sprite image and use UITexture and when i create code like this, UITexture not update. Is this problem because UITexture cannot change texture in quick time or my script problem.

This is my code.

  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class SpriteGameEnded : MonoBehaviour {
  5.  
  6.         public Texture2D mTexTemp;
  7.         public Texture2D mTex;
  8.         string path ="GameEnded";
  9.         int numberDigit = 2;
  10.         public UITexture uiTexture;
  11.         void Awake(){
  12.                 uiTexture=GetComponent<UITexture>();   
  13.         }
  14.         void OnEnable(){
  15.                 object[] param=new object[3];
  16.                 param[0]=25;
  17.                 param[1]=path;
  18.                 param[2]=numberDigit;
  19.                 StartCoroutine("PlayVideo",param);
  20.                 if(audio!=null) audio.Play();
  21.         }
  22.         void OnDisable(){
  23.                 mTex=mTexTemp;
  24.                 if(audio!=null && audio.isPlaying) audio.Stop();
  25.         }
  26.        
  27.         void Update(){
  28.                 uiTexture.mainTexture=mTex;
  29.         }
  30.         IEnumerator PlayVideo(object[] param){
  31.                 int fps =(int) param[0] ;
  32.                 string path = (string) param[1];
  33.                 int numberDigits = (int) param[2];
  34.                
  35.                 int i = 0;
  36.                 bool done = false;
  37.                 yield return new WaitForSeconds(0.5f);
  38.                 int allImages = Resources.LoadAll<Texture2D>(path).Length-1;
  39.                 while(!done){
  40.                         string digits="";
  41.                         if(i > allImages){
  42.                                 done = true;
  43.                                 break;
  44.                         }
  45.                         if(i < 10 && i >= 0){
  46.                                 for(int w = 0; w < numberDigits-1; w++){
  47.                                         digits = digits + "0";
  48.                                 }
  49.                                 digits = digits + i;
  50.                         }
  51.                         if(i < 100 && i >= 10){
  52.                                 for(int x = 0; x < numberDigits-2; x++){
  53.                                         digits = digits + "0";
  54.                                 }
  55.                                 digits = digits + i;
  56.                         }
  57.                         if (i < 1000 && i >= 100){
  58.                                 for(int y = 0; y < numberDigits-3; y++){
  59.                                         digits = digits + "0";
  60.                                 }
  61.                                 digits = digits + i;
  62.                         }
  63.                         if (i < 10000 && i >= 1000){
  64.                                 for(int z = 0; z < numberDigits-4; z++){
  65.                                         digits = digits + "0";
  66.                                 }
  67.                                 digits = digits + i;
  68.                         }
  69.                         string currentFile = path+"/"+path+digits;
  70.                         Texture2D videoTexture  = Resources.Load(currentFile)as Texture2D;
  71.                         mTex = videoTexture;
  72.                         i++;
  73.                         yield return new WaitForSeconds(1.0f/fps);
  74.                 }
  75.         }
  76. }
  77.  

4
NGUI 3 Support / Re: So many image files…
« on: June 05, 2014, 11:30:19 PM »
Thank you Nicki for your answer.
Now, I know unity3d's just-built APK just built files that are used

5
NGUI 3 Support / Re: So many image files…
« on: June 02, 2014, 02:19:35 AM »
if I create sprite from NGUI and I use it, what i need to delete all original images or unity3d just create APK from GUI sprite. I worry Unity3D build APK from all existing assets so APK files so large.

Pages: [1]