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); // } }
public void SetImgOld() { UITexture imgPreview = UtilMgr.GetChildObj(gameObject, "ImgPreview").GetComponent <UITexture>(); imgPreview.mainTexture = GetTexture(); SetState(STATE.Shown); }
public void ShowStatus() { UILabel lblName = UtilMgr.GetChildObj(gameObject, "LblName").GetComponent <UILabel>(); lblName.text = "" + GetState() + ", " + GetIndex(); // lblName.text = ""+System.GC.GetTotalMemory(true); }
void Start() { mState = STATE.Empty; if (mDefaultTexture == null) { mDefaultTexture = UtilMgr.GetChildObj(gameObject, "ImgPreview").GetComponent <UITexture>().mainTexture; } }
public void ResetItem() { // Destroy (mTexture); // mTexture = null; UITexture imgPreview = UtilMgr.GetChildObj(gameObject, "ImgPreview").GetComponent <UITexture>(); imgPreview.mainTexture = mDefaultTexture; SetState(STATE.Empty); }
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); }