/// <summary> /// /// </summary> /// <param name="State"></param> /// <param name="Msg"></param> /// <param name="Result">Select操作时此处使用ResList类型对象</param> public ResponseAppResult(ResState State, string Msg, ResList Result) { state = (int)State; msg = Msg; result = Result == null ? "" : (object)Result; rtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); }
// Update is called once per frame void Update() { switch (state) { case ResState.Idle: if (Input.GetMouseButtonDown(1)) { GetComponent <MeshRenderer>().enabled = true; resurrectHoldTime = Time.time + 1.0f; resurrectionCoroutine = StartCoroutine(ResurrectionAnimation()); state = ResState.Preparing; } break; case ResState.Preparing: if (Time.time >= resurrectHoldTime) { GetComponent <MeshRenderer>().enabled = false; ResurrectEnemies(); state = ResState.Resurrecting; } else if (Input.GetMouseButtonUp(1)) { state = ResState.Idle; GetComponent <MeshRenderer>().enabled = false; StopCoroutine(resurrectionCoroutine); } break; case ResState.Resurrecting: state = ResState.Idle; break; } }
public SqlExceRes(string res) { if ("".Equals(res)) { Result = ResState.Error; } else { string[] strs1 = res.Split(':'); string[] strs2 = strs1[1].Split(','); CmdIndex = Convert.ToInt32(strs1[0]); ModifiedLine = Convert.ToInt32(strs2[0]); ExceMsg = strs2[1]; if (ExceMsg.Contains("操作成功") && ModifiedLine > 0) { Result = ResState.Success; } else if (ExceMsg.Contains("操作成功") && ModifiedLine == 0) { Result = ResState.Repetition; } else { Result = ResState.Error; } } }
public NameboardData() { UIResState = ResState.WaitLoad; LooksNode = null; Name = ""; Height = 1.6f; }
private void CancButton_Click(object sender, EventArgs e) { if (IsCubicleOnEdit) { ResetButton.Visible = false; SaveButton.Visible = false; CancButton.Visible = false; IsCubicleOnEdit = false; //ArrowKeys used to resize the cubicle UPArrow.Visible = false; LeftArrow.Visible = false; resetSize.Visible = false; RightArrow.Visible = false; DownArrow.Visible = false; for (int i = 0; i < 6; i++) { l[i].Visible = false; l[i].Dispose(); } C_Name.Dispose(); CubNo.Dispose(); EmpName.Dispose(); EmpSno.Dispose(); C_State.Dispose(); Other.Dispose(); S = -1; } else if (IsResourceOnEdit) { IsResourceOnEdit = false; ResetButton.Visible = false; SaveButton.Visible = false; CancButton.Visible = false; for (int i = 0; i < 7; i++) { l[i].Visible = false; l[i].Dispose(); } AssEmpNo.Dispose(); AssCubNo.Dispose(); ResNo.Dispose(); ResType.Dispose(); ResState.Dispose(); DateOfIssue.Dispose(); OtherInfo.Dispose(); P = -1; } }
public void UnuseLooks() { if (UIResState == ResState.Loaded && LooksNode != null) { LooksNode.gameObject.SetActive(false); ResMgr.GetInstance().UnuseGameObject("Nameboard", LooksNode.gameObject); UIResState = ResState.WaitLoad; LooksNode = null; } }
// Start is called before the first frame update void Start() { GetComponent <MeshRenderer>().enabled = false; resurrectHoldTime = Time.time; state = ResState.Idle; Vector3 meshExtents = GetComponent <MeshRenderer>().bounds.extents; transform.localScale = radius * meshExtents; }
public virtual void Init(ResLoadInfo resLoadInfo) { mResPath = resLoadInfo.mResPath; mLoadRePriority = resLoadInfo.loadResPriority; DestroyCache = resLoadInfo.DestroyCache; isSprite = resLoadInfo.mIsSprite; resItem = new ResItem(); resItem.mCrc = Crc32.GetCrc32(mResPath); mListener = resLoadInfo.mListener; mResState = ResState.Waiting; }
public virtual bool LoadAsync() { if (!CheckLoadAble()) { AFLogger.e("资源不是等待下载状态:" + mResState); return(false); } if (mResPath.IsNullOrEmpty()) { AFLogger.e("加载路径不能为空"); return(false); } mResState = ResState.Loading; ResourceLoader.Instance.PushIEnumeratorTask(this); return(true); }
public bool ReleaseRes() { if (m_ResState == ResState.Loading) { return(false); } if (m_ResState != ResState.Ready) { return(true); } OnReleaseRes(); m_ResState = ResState.Waiting; m_OnResLoadDoneEvent = null; return(true); }
public bool ReleaseRes() { if (mResState == ResState.Loading) { return(false); } if (mResState != ResState.Ready) { return(true); } //Log.I("Release Res:" + mName); OnReleaseRes(); mResState = ResState.Waiting; mResListener = null; return(true); }
public void Download(Action <ResInfo, Exception> onDown, bool UpdateVerInfo = true) { Action <UnityWebRequest, string> load = (uwr, tag) => { Exception _err = null; try { //Debug.Log($"name={name},lenth={uwr.downloadHandler.data.Length},url={uwr.uri}"); ResourceSystem.Instance.SaveToCache(group + "/" + name, uwr.downloadHandler.data); this.size = uwr.downloadHandler.data.Length; this.hash = Convert.ToBase64String(ResourceSystem.Instance.sha1.ComputeHash(uwr.downloadHandler.data)); this.state = ResState.ResState_UseDownloaded; this.needupdate = false; } catch (Exception err) { _err = err; } if (this.size == 0) { _err = new Exception("下载size==0" + uwr.url); } if (_err == null && UpdateVerInfo) {//保存信息 ResourceSystem.Instance.verLocal.SaveGroup(group); } if (onDown != null) { onDown(this, _err); } }; ResourceSystem.Instance.LoadFromRemote(group + "/" + name, "", load); //int i = (int)this.state & 0x0F; // this.state = ResState.ResState_InUpdate | (ResState)i; //this.state |= ResState.ResState_NeedUpdate; this.needupdate = true; Debug.Log("-Download-------->" + this.state); }
public void Download(Action <ResInfo, Exception> onDown, bool UpdateVerInfo = true) { Action <WWW, string> load = (WWW, tag) => { Exception _err = null; try { ResmgrNative.Instance.SaveToCache(group + "/" + name, WWW.bytes); this.size = WWW.bytes.Length; this.hash = Convert.ToBase64String(ResmgrNative.Instance.sha1.ComputeHash(WWW.bytes)); this.state = ResState.ResState_UseDownloaded; this.needupdate = false; } catch (Exception err) { _err = err; } if (this.size == 0) { _err = new Exception("下载size==0" + WWW.url); } if (_err == null && UpdateVerInfo) {//保存信息 ResmgrNative.Instance.verLocal.SaveGroup(group); } if (onDown != null) { onDown(this, _err); } }; ResmgrNative.Instance.LoadFromRemote(group + "/" + name, "", load); //int i = (int)this.state & 0x0F; // this.state = ResState.ResState_InUpdate | (ResState)i; //this.state |= ResState.ResState_NeedUpdate; this.needupdate = true; Debug.Log("-Download-------->" + this.state); }
private void ClearMyAccessPanel() { IsResourceOnEdit = false; ResetButton.Visible = false; SaveButton.Visible = false; CancButton.Visible = false; for (int i = 0; i < 7; i++) { l[i].Visible = false; l[i].Dispose(); } AssEmpNo.Dispose(); AssCubNo.Dispose(); ResNo.Dispose(); ResType.Dispose(); ResState.Dispose(); DateOfIssue.Dispose(); OtherInfo.Dispose(); P = -1; }
public void Download(Action<ResInfo, Exception> onDown, bool UpdateVerInfo = true) { Action<WWW, string> load = (WWW, tag) => { Exception _err = null; try { ResmgrNative.Instance.SaveToCache(group + "/" + name, WWW.bytes); this.size = WWW.bytes.Length; this.hash = Convert.ToBase64String(ResmgrNative.Instance.sha1.ComputeHash(WWW.bytes)); this.state = ResState.ResState_UseDownloaded; this.needupdate = false; } catch (Exception err) { _err = err; } if (this.size == 0) { _err = new Exception("下载size==0"+WWW.url); } if (_err == null && UpdateVerInfo) {//保存信息 ResmgrNative.Instance.verLocal.SaveGroup(group); } if (onDown != null) { onDown(this, _err); } }; ResmgrNative.Instance.LoadFromRemote(group + "/" + name, "", load); //int i = (int)this.state & 0x0F; // this.state = ResState.ResState_InUpdate | (ResState)i; //this.state |= ResState.ResState_NeedUpdate; this.needupdate = true; Debug.Log("-Download-------->" + this.state); }
public ResInfo(string group, string name, string hash, int size) { this.name = name; this.hash = hash; this.size = size; this.group = group; this.state = ResState.ResState_UseLocal; PathList = GetPathList(name); FileName = PathList[PathList.Length - 1]; }
protected void OnResLoadFailed() { m_ResState = ResState.Waiting; NotifyResLoadDoneEvent(false); }
public virtual void CancelLoad() { mListener.InvokeGracefully(false, this); mResState = ResState.Waiting; }
protected void OnResLoadFaild() { mResState = ResState.Waiting; NotifyResEvent(false); }
//回收资源时调用 public virtual void OnRecycled() { mResState = ResState.Waiting; IsRecycled = true; mListener = null; }