public bool CheckForChangeToNextStep(EStep _currentStep) { switch (_currentStep) { case EStep.Title: if (this.currentSceneDictionary[ESceneType.Title].IsChangedNextStep) { return(true); } break; case EStep.Lobby: if (this.currentSceneDictionary[ESceneType.Lobby].IsChangedNextStep) { return(true); } break; case EStep.InGame: if (this.currentSceneDictionary[ESceneType.InGame].IsChangedNextStep) { return(true); } break; default: throw new System.ArgumentOutOfRangeException("CurrentStep is not correct"); } return(false); }
void ProcessCapture() { mTotalTime += Time.deltaTime; if (mIsCapturing) { return; } mElapsedTime += Time.deltaTime; if (mElapsedTime < mCaptureInterval) { return; } mElapsedTime -= mCaptureInterval; string path = GetXffectPath() + mOutputPath + Effect.gameObject.name + mCurTexIndex + ".png"; EditorUtility.DisplayProgressBar("Processing", path, mTotalTime / mTimeLen); StartCoroutine(CaptureRect(path)); if (mCurTexIndex * mCaptureInterval > mTimeLen || !Effect.gameObject.activeSelf) { mElapsedTime = 0f; mCurTexIndex = 0; mStep = EStep.Finished; } }
void Update() { if (Input.GetKeyDown(capture)) { mStep = EStep.Prepare; } }
private IEnumerator RequestCopy() { var v1 = Versions.LoadVersion(_savePath + Versions.Filename); var basePath = GetStreamingAssetsPath() + "/"; var request = UnityWebRequest.Get(basePath + Versions.Filename); var path = _savePath + Versions.Filename + ".tmp"; request.downloadHandler = new DownloadHandlerFile(path); yield return(request.SendWebRequest()); if (string.IsNullOrEmpty(request.error)) { var v2 = Versions.LoadVersion(path); if (v2 > v1) { var mb = UIDialogue.Show("提示", "是否将资源解压到本地?", "解压", "跳过"); yield return(mb); _step = mb.isOk ? EStep.Coping : EStep.Versions; } else { Versions.LoadVersions(path); _step = EStep.Versions; } } else { _step = EStep.Versions; } request.Dispose(); }
public CAttackBehavior() { m_step = EStep.EStep_Null; m_norAttack = new CNormBehavior(); m_actAttack = new CSkillBehavior(); m_bNormAttack = false; }
void ProcessCapture() { mTotalTime += Time.deltaTime; if (mIsCapturing) { return; } mElapsedTime += Time.deltaTime; if (mElapsedTime < CaptureInterval) { return; } mElapsedTime -= CaptureInterval; EditorUtility.DisplayProgressBar("Processing", "saving Screenshots", mTotalTime / TimeLen); StartCoroutine(CaptureRect()); if (mCurTexIndex * CaptureInterval > TimeLen) { mElapsedTime = 0f; mCurTexIndex = 0; mStep = EStep.Finished; } }
public TickResult Tick() { if (mStep == EStep.Init) { if (!OnInit()) { return(TickResult.Finished); } else { mStep = EStep.Running; } //immediate action need execute in one frame //else //{ // return TickResult.Running; //} } if (mStep == EStep.Running) { if (TickResult.Finished == OnTick()) { OnReset(); mStep = EStep.Finished; } else { return(TickResult.Running); } } return(TickResult.Finished); }
/// <summary> /// Поменять приоритет профиля /// </summary> /// <param name="step">Шаг в направление</param> /// <param name="index">Приоритетный номер</param> public void ChangePriority(EStep step, int index) { if (index < 1 || index > _profiles.Count) { throw new Exception("Приоритетный номер выходит за границы списка!"); } List <CProfile> localProfiles = new List <CProfile>(); switch (step) { case EStep.Up: { if (index == 1) { return; } for (int i = 0; i < _profiles.Count; i++) { if (i == index - 2) { localProfiles.Add(_profiles[i + 1]); localProfiles.Add(_profiles[i]); i++; } else { localProfiles.Add(_profiles[i]); } } break; } case EStep.Down: { if (index == _profiles.Count) { return; } for (int i = 0; i < _profiles.Count; i++) { if (i == index - 1) { localProfiles.Add(_profiles[i + 1]); localProfiles.Add(_profiles[i]); i++; } else { localProfiles.Add(_profiles[i]); } } break; } } _profiles = localProfiles; }
public IEnumerator UnloadAsyncScenesForStep(EStep _currentStep) { this.IsCompleteToUnloadScenes = false; //Is Loaded Scenes Check while (!this.IsCompleteToLoadScenes) { Debug.Log(this.IsCompleteToLoadScenes); yield return(null); } this.fade.StartFadeOut(); while (this.fade.State == EFadeState.FadeOut) { yield return(null); } List <AsyncOperation> asyncUnLoadList = new List <AsyncOperation>(); switch (_currentStep) { case EStep.Title: asyncUnLoadList.Add(SceneManager.UnloadSceneAsync("Title")); break; case EStep.Lobby: asyncUnLoadList.Add(SceneManager.UnloadSceneAsync("Lobby")); break; case EStep.InGame: asyncUnLoadList.Add(SceneManager.UnloadSceneAsync("InGame")); break; default: throw new System.ArgumentOutOfRangeException("Argument:_step is not correct"); } bool roopCheck = true; while (roopCheck) { for (int i = 0; i < asyncUnLoadList.Count; ++i) { if (!asyncUnLoadList[i].isDone) { break; } if (i == asyncUnLoadList.Count - 1) { roopCheck = false; } } yield return(null); } this.currentSceneDictionary.Clear(); this.IsCompleteToUnloadScenes = true; }
void CaptureFinished() { mShowGUI = true; mStep = EStep.None; Effect.DeActive(); AssetDatabase.Refresh(); AssetDatabase.SaveAssets(); EditorUtility.ClearProgressBar(); return; }
public void OnEventTriggered() { if (mStep != EStep.EventListenning) { return; } mStep = EStep.Comparing; Tick(); }
public FImportFromBdd() { InitializeComponent(); btnChkAll.Text = ""; btnUnckeAll.Text = ""; currentStep = EStep.Selection; pnlSelection.Dock = DockStyle.Fill; pnlAnalyze.Dock = DockStyle.Fill; pnlChoice.Dock = DockStyle.Fill; DisplayStep(); }
public bool Init() { if (false == mEvent.Init()) { return(false); } mEvent.SetMsgHndler(this); mStep = EStep.EventListenning; return(true); }
public void Restore(System.IO.BinaryReader r) { Repeat = new RepeatCount(r.ReadInt32()); mStep = (EStep)r.ReadSByte(); int length = r.ReadInt32(); byte[] data = r.ReadBytes(length); mVarMgr = VariableMgr.Import(data); mAction.Restore(r); }
// Other methods/property void CreateEntityStatic() { _step = EStep.InCreating; DoodadEntityCreator.CreateDoodad(this); if (entity == null) { Debug.LogWarning("[EntityPosAgent]:Failed to create entity " + _type.ToString() + protoId); } // now doodad's lod(SceneDoodadLodCmpt) would handle doodads, posAgent not needed longer after dooad created. SceneMan.RemoveSceneObj(this); _step = EStep.Created; }
void PrepareCapture() { mShowGUI = false; MainCamera.camera.backgroundColor = Color.black; mElapsedTime += Time.deltaTime; if (mElapsedTime > 0.5f) { Effect.Active(); mElapsedTime = 0f; mStep = EStep.Processing; mTotalTime = 0f; mIsCapturing = false; } }
private void Start() { _downloader = gameObject.GetComponent <Downloader>(); _downloader.onUpdate = OnUpdate; _downloader.onFinished = OnComplete; _monitor = gameObject.GetComponent <NetworkMonitor>(); _monitor.listener = this; _savePath = string.Format("{0}/DLC/", Application.persistentDataPath); _platform = GetPlatformForAssetBundles(Application.platform); _step = EStep.Wait; XAsset.s_UpdatePath = _savePath; }
public TickResult Tick() { if (EStep.Finished == mStep) { return(TickResult.Finished); } if (mStep == EStep.Comparing) { if (mCondition.Do()) { mAction.Init(); mStep = EStep.ActionRunning; } else { mStep = EStep.EventListenning; } } if (mStep == EStep.ActionRunning) { if (TickResult.Finished == mAction.Tick()) { Repeat.Manus(); if (false == Repeat.IsZero) { mStep = EStep.EventListenning; } else { mStep = EStep.Finished; } } } if (EStep.Finished == mStep || Repeat.IsZero) { return(TickResult.Finished); } else { return(TickResult.Running); } }
void CaptureFinished() { mStep = EStep.None; // Effect.DeActive(); AssetDatabase.Refresh(); AssetDatabase.SaveAssets(); EditorUtility.ClearProgressBar(); if (disable.Length != 0) { foreach (GameObject g in disable) { g.SetActive(true); } } return; }
public override void Enter(uint dwParam) { uint dwSkillID = dwParam; m_pSkill = m_pOwner.FindSkillByTypeID(dwSkillID); if (m_pSkill == null) { return; } if (m_pSkill.GetProto().eType == ESkillType.ESUT_Norm) { m_step = EStep.EStep_NorAttack; m_norAttack.Enter(m_pSkill); } else { m_step = EStep.EStep_Attack; m_actAttack.Enter(m_pSkill); } }
void PrepareCapture() { if (disable.Length != 0) { foreach (GameObject g in disable) { g.SetActive(false); } } mElapsedTime += Time.deltaTime; if (mElapsedTime > 0.5f) { mElapsedTime = 0f; mStep = EStep.Processing; mTotalTime = 0f; mIsCapturing = false; } }
public void OnClear() { OnMessage("数据清除完毕"); OnProgress(0); _versions.Clear(); _downloader.Clear(); _step = EStep.Wait; _reachabilityChanged = false; XAsset.Get().Clear(); if (listener != null) { listener.OnClear(); } if (Directory.Exists(_savePath)) { Directory.Delete(_savePath, true); } }
IEnumerator TryCreateEntityUnstatic() { _step = EStep.InCreating; int n = 0; while (n++ < MaxTimes) { if (CheckSetAvailablePos()) { switch (_type) { case EntityType.EntityType_Npc: NpcEntityCreator.CreateNpc(this); break; case EntityType.EntityType_Monster: MonsterEntityCreator.CreateMonster(this); break; } if (entity != null) { spInfo.OnSuceededToCreate(this); } else { //if(protoId >= 0){ // Airborne monster would go here to remove its agent // Debug.LogWarning("[EntityPosAgent]:Failed to create entity "+_type.ToString()+protoId); //} spInfo.OnFailedToCreate(this); } break; } yield return(new WaitForSeconds(OneWait)); } if (n >= MaxTimes) { Debug.LogWarning("[EntityPosAgent]:Failed to create entity " + _type.ToString() + protoId + " during " + n * OneWait); } _step = EStep.Created; }
private void CProfileUserControlMove(int priority, EStep step) { DirectionWithProfile.PriorityProfile.ChangePriority(step, priority); CProfileUserControl buf = _profileUserControls[priority - 1]; int thisControl = priority - 1; int thatControl = priority - 2 + (int)step * 2; _profileUserControls[thisControl].Priority = _profileUserControls[thisControl].Priority - 1 + (int)step * 2; _profileUserControls[thatControl].Priority = _profileUserControls[thatControl].Priority + 1 - (int)step * 2; Thickness thickness = new Thickness(0, _profileUserControls[thisControl].Margin.Top, 0, 0); _profileUserControls[thisControl].Margin = new Thickness(0, _profileUserControls[thatControl].Margin.Top * (1 - (int)step) + //Up (_profileUserControls[thisControl].Margin.Top + _profileUserControls[thatControl].Height) * (int)step, 0, 0); //Down _profileUserControls[thatControl].Margin = new Thickness(0, thickness.Top * (int)step + //Up (_profileUserControls[thatControl].Margin.Top + _profileUserControls[thisControl].Height) * (1 - (int)step), 0, 0); //Down _profileUserControls[thisControl] = _profileUserControls[priority - 2 + (int)step * 2]; _profileUserControls[thatControl] = buf; GetUpMove(_profileUserControls[thisControl]); GetUpMove(_profileUserControls[priority - 2 + (int)step * 2]); }
public void takeShot() { mStep = EStep.Prepare; }
public void TakeAphoto() { mStep = EStep.Prepare; }
void OnGUI() { if (!mShowGUI) { return; } mStyle.normal.background = RectTex; GUI.Box(mOutputRect, "", mStyle); GUI.Label(new Rect(240, 0, 300, 70), "left mouse button to rotate, scroll to zoom, right mouse button to move."); #region View Controller GUI.BeginGroup(new Rect(0, 0, 240, 120)); GUI.Label(new Rect(60, 0, 100, 30), "View Controller"); GUI.BeginGroup(new Rect(0, 30, 240, 30)); GUI.Label(new Rect(0, 0, 80, 30), "OutputWidth:"); mSliderW = GUI.HorizontalSlider(new Rect(80, 5, 100, 30), mSliderW, 0.0f, 1.0f); GUI.Label(new Rect(180, 0, 60, 30), mOutputWidth.ToString()); GUI.EndGroup(); GUI.BeginGroup(new Rect(0, 60, 240, 30)); GUI.Label(new Rect(0, 0, 80, 30), "OutputHeight:"); mSliderH = GUI.HorizontalSlider(new Rect(80, 5, 100, 30), mSliderH, 0.0f, 1.0f); GUI.Label(new Rect(180, 0, 60, 30), mOutputHeight.ToString()); GUI.EndGroup(); if (GUI.Button(new Rect(0, 90, 200, 30), "Preview")) { Effect.Active(); } GUI.EndGroup(); #endregion #region Parameter GUI.BeginGroup(new Rect(0, 140, 240, 130)); GUI.Label(new Rect(60, 0, 100, 30), "Parameter"); GUI.BeginGroup(new Rect(0, 30, 240, 30)); GUI.Label(new Rect(0, 0, 80, 30), "Interval:"); mCaptureInterval = GUI.HorizontalSlider(new Rect(80, 5, 100, 30), mCaptureInterval, 0.05f, 2.0f); GUI.Label(new Rect(180, 0, 60, 30), mCaptureInterval.ToString("0.00") + " s"); GUI.EndGroup(); GUI.BeginGroup(new Rect(0, 60, 240, 30)); GUI.Label(new Rect(0, 0, 80, 30), "Time Len:"); mTimeLen = GUI.HorizontalSlider(new Rect(80, 5, 100, 30), mTimeLen, 0.1f, 8f); GUI.Label(new Rect(180, 0, 60, 30), mTimeLen.ToString("0.0") + " s"); GUI.EndGroup(); if (GUI.Button(new Rect(0, 90, 200, 30), "Capture")) { mStep = EStep.Prepare; } GUI.EndGroup(); #endregion //if (GUI.Button(new Rect(0, 0, 30f, 20f), RectTex)) //{ // mStep = EStep.Prepare; //} RefreshRect(); }
private IEnumerator RequestVersions() { OnMessage("正在获取版本信息..."); if (Application.internetReachability == NetworkReachability.NotReachable) { var mb = UIDialogue.Show("提示", "请检查网络连接状态", "重试", "退出"); yield return(mb); if (mb.isOk) { StartUpdate(); } else { Quit(); } yield break; } var request = UnityWebRequest.Get(GetDownloadURL(Versions.Filename)); request.downloadHandler = new DownloadHandlerFile(_savePath + Versions.Filename); yield return(request.SendWebRequest()); var error = request.error; request.Dispose(); if (!string.IsNullOrEmpty(error)) { var mb = UIDialogue.Show("提示", string.Format("获取服务器版本失败:{0}", error), "重试", "退出"); yield return(mb); if (mb.isOk) { StartUpdate(); } else { Quit(); } yield break; } try { _versions = Versions.LoadVersions(_savePath + Versions.Filename, true); if (_versions.Count > 0) { PrepareDownloads(); _step = EStep.Prepared; } else { OnComplete(); } } catch (Exception e) { Debug.LogException(e); UIDialogue.Show("提示", "版本文件加载失败", "重试", "退出").onComplete += delegate(UIDialogue.EventId id) { if (id == UIDialogue.EventId.Ok) { StartUpdate(); } else { Quit(); } }; } }
private IEnumerator Checking() { if (!Directory.Exists(_savePath)) { Directory.CreateDirectory(_savePath); } //if (_step == EStep.Wait) //{ // yield return RequestVFS(); // _step = EStep.Copy; //} _step = EStep.Copy; if (_step == EStep.Copy) { yield return(RequestCopy()); } if (_step == EStep.Coping) { var path = _savePath + Versions.Filename + ".tmp"; var versions = Versions.LoadVersions(path); var basePath = GetStreamingAssetsPath() + "/"; yield return(UpdateCopy(versions, basePath)); _step = EStep.Versions; } if (_step == EStep.Versions) { yield return(RequestVersions()); } if (_step == EStep.Prepared) { OnMessage("正在检查版本信息..."); var totalSize = _downloader.size; if (totalSize > 0) { var tips = string.Format("发现内容更新,总计需要下载 {0} 内容", Downloader.GetDisplaySize(totalSize)); var mb = UIDialogue.Show("提示", tips, "下载", "退出"); yield return(mb); if (mb.isOk) { _downloader.StartDownload(); _step = EStep.Download; } else { Quit(); } } else { OnComplete(); } } }
void OnGUI() { if (!mShowGUI) return; mStyle.normal.background = RectTex; GUI.Box(mOutputRect, "", mStyle); GUI.Label(new Rect(240, 0, 300, 70), "left mouse button to rotate, scroll to zoom, right mouse button to move."); #region View Controller GUI.BeginGroup(new Rect(0, 0, 240, 120)); GUI.Label(new Rect(60, 0, 100, 30), "View Controller"); GUI.BeginGroup(new Rect(0, 30, 240, 30)); GUI.Label(new Rect(0, 0, 80, 30), "OutputWidth:"); mSliderW = GUI.HorizontalSlider(new Rect(80, 5, 100, 30), mSliderW, 0.0f, 1.0f); GUI.Label(new Rect(180, 0, 60, 30), mOutputWidth.ToString()); GUI.EndGroup(); GUI.BeginGroup(new Rect(0, 60, 240, 30)); GUI.Label(new Rect(0, 0, 80, 30), "OutputHeight:"); mSliderH = GUI.HorizontalSlider(new Rect(80, 5, 100, 30), mSliderH, 0.0f, 1.0f); GUI.Label(new Rect(180, 0, 60, 30), mOutputHeight.ToString()); GUI.EndGroup(); if (GUI.Button(new Rect(0,90,200,30),"Preview")) { Effect.Active(); } GUI.EndGroup(); #endregion #region Parameter GUI.BeginGroup(new Rect(0, 140, 240, 130)); GUI.Label(new Rect(60, 0, 100, 30), "Parameter"); GUI.BeginGroup(new Rect(0, 30, 240, 30)); GUI.Label(new Rect(0, 0, 80, 30), "Interval:"); mCaptureInterval = GUI.HorizontalSlider(new Rect(80, 5, 100, 30), mCaptureInterval, 0.05f, 2.0f); GUI.Label(new Rect(180, 0, 60, 30), mCaptureInterval.ToString("0.00") + " s"); GUI.EndGroup(); GUI.BeginGroup(new Rect(0, 60, 240, 30)); GUI.Label(new Rect(0, 0, 80, 30), "Time Len:"); mTimeLen = GUI.HorizontalSlider(new Rect(80, 5, 100, 30), mTimeLen, 0.1f, 8f); GUI.Label(new Rect(180, 0, 60, 30), mTimeLen.ToString("0.0") + " s"); GUI.EndGroup(); if (GUI.Button(new Rect(0, 90, 200, 30), "Capture")) { mStep = EStep.Prepare; } GUI.EndGroup(); #endregion //if (GUI.Button(new Rect(0, 0, 30f, 20f), RectTex)) //{ // mStep = EStep.Prepare; //} RefreshRect(); }
void ProcessCapture() { mTotalTime += Time.deltaTime; if (mIsCapturing) return; mElapsedTime += Time.deltaTime; if (mElapsedTime < mCaptureInterval) return; mElapsedTime -= mCaptureInterval; string path = GetXffectPath() + mOutputPath + Effect.gameObject.name + mCurTexIndex + ".png"; EditorUtility.DisplayProgressBar("Processing", path, mTotalTime / mTimeLen); StartCoroutine(CaptureRect(path)); if (mCurTexIndex * mCaptureInterval > mTimeLen || !Effect.gameObject.activeSelf) { mElapsedTime = 0f; mCurTexIndex = 0; mStep = EStep.Finished; } }
public Trigger(PsScript script) { mScript = script; mStep = EStep.Max; mVarMgr = new VariableMgr(); }