Exemplo n.º 1
0
    void Update()
    {
//		ShowStatus ();
        if (GetState() == STATE.Complete)
        {
            UITexture imgPreview = UtilMgr.GetChildObj(gameObject, "ImgPreview").GetComponent <UITexture>();
            SetTexture(UtilMgr.ScaleTexture(mTexture, ThumbsWidth, ThumbsHeight));
            imgPreview.mainTexture = GetTexture();
            mTexture = null;
            SetState(STATE.Shown);
        }
//		else if(GetStatus() == Status.Switching)
//		{
//			UITexture imgPreview = UtilMgr.GetChildObj (gameObject, "ImgPreview").GetComponent<UITexture>();
//			imgPreview.mainTexture = GetTexture();
//			mStatus = Status.Shown;
//		}


//		if(GetListItem().GetStatus() != UIListItem.Status.None)
//		{
//			ResetItem();
//			GetListItem().SetStatus(UIListItem.Status.None);
//		}
    }
Exemplo n.º 2
0
    public void SetImgOld()
    {
        UITexture imgPreview = UtilMgr.GetChildObj(gameObject, "ImgPreview").GetComponent <UITexture>();

        imgPreview.mainTexture = GetTexture();
        SetState(STATE.Shown);
    }
Exemplo n.º 3
0
    public void ShowStatus()
    {
        UILabel lblName = UtilMgr.GetChildObj(gameObject, "LblName").GetComponent <UILabel>();

        lblName.text = "" + GetState() + ", " + GetIndex();
//		lblName.text = ""+System.GC.GetTotalMemory(true);
    }
Exemplo n.º 4
0
 void Start()
 {
     mState = STATE.Empty;
     if (mDefaultTexture == null)
     {
         mDefaultTexture = UtilMgr.GetChildObj(gameObject, "ImgPreview").GetComponent <UITexture>().mainTexture;
     }
 }
Exemplo n.º 5
0
    public void ResetItem()
    {
//		Destroy (mTexture);
//		mTexture = null;

        UITexture imgPreview = UtilMgr.GetChildObj(gameObject, "ImgPreview").GetComponent <UITexture>();

        imgPreview.mainTexture = mDefaultTexture;

        SetState(STATE.Empty);
    }
Exemplo n.º 6
0
    public bool LoadImg()
    {
        if (mDicTexture.ContainsKey(GetImgData()))
        {
            SetState(ScriptImgListItem.STATE.Switching);
            return(false);
        }

        base.LoadImg();

        UILabel lblName  = UtilMgr.GetChildObj(gameObject, "LblName").GetComponent <UILabel>();
        UILabel lblCount = UtilMgr.GetChildObj(gameObject, "LblCount").GetComponent <UILabel>();

        string thumbsFolder = GetKey();
        int    lastIdx      = thumbsFolder.LastIndexOf("/");

        lblName.text  = thumbsFolder.Substring(lastIdx + 1);
        lblCount.text = mCount + "";
        return(true);
    }
    // if texture isn't null then it returns false
    public bool LoadImg()
    {
        UILabel lblName    = UtilMgr.GetChildObj(gameObject, "LblName").GetComponent <UILabel>();
        string  thumbsData = GetImgData();
        int     lastIdx    = thumbsData.LastIndexOf("/");

        lblName.text = thumbsData.Substring(lastIdx + 1);

        if (mDicTexture.ContainsKey(GetImgData()))
        {
//			lblName.text = "SetOld";
//			SetStatus(ScriptImgListItem.Status.Switching);
            SetImgOld();
            return(false);
        }

        base.LoadImg();

        return(true);
    }