public void ReSetAll() { IsGetStartAC = false; IsStartPenhuo = false; GetInStand = false; IsInStanding = false; penhuoJishi = 0; IsShock = false; _isGetOver = false; IsInPenhuoing = false; TX_QS.Stop(); TX_Huoyan.Stop(); TX_Huoyan.gameObject.SetActive(false); }
// Update is called once per frame void Update() { if (_roleDate.isDie || _roleDate.isBeHiting || (_player && _player.GetComponent <RoleDate>().isDie)) { ReSetAll(); _isGetOver = true; ObjectEventDispatcher.dispatcher.dispatchEvent(new UEvent(EventTypeName.CAMERA_SHOCK, "end"), this); return; } if (GetInStand) { if (IsOverInStand()) { //print(" inStand!!!!! "); ReSetAll(); _isGetOver = true; } return; } //print(_gameBody.GetDB().animation.lastAnimationName + " zhuangtai " + _gameBody.GetDB().animation.lastAnimationState._fadeProgress); if (IsGetStartAC && !_gameBody.isAcing) { IsGetStartAC = false; //_gameBody.isAcing = false; print(" ---->??? qishou wancheng "); _gameBody.GetPlayerRigidbody2D().velocity = Vector2.zero; IsStartPenhuo = true; //播放 起始 的特效 这里是循环的 //_gameBody.GetAcMsg(PenHuoACName); return; } if (IsStartPenhuo) { //GetInStand = true; if (!IsInPenhuoing) { IsInPenhuoing = true; penhuoJishi = 0; _gameBody.GetDB().animation.FadeIn(PenHuoACName); TX_Huoyan.gameObject.SetActive(true); TX_Huoyan.Play(); moveSpeedX = this.transform.localScale.x > 0 ? -Mathf.Abs(moveSpeedX) : Mathf.Abs(moveSpeedX); print(" ******************************* moveSpeedX " + moveSpeedX + " localScale " + this.transform.localScale.x); } if (!IsShock) { IsShock = true; ObjectEventDispatcher.dispatcher.dispatchEvent(new UEvent(EventTypeName.CAMERA_SHOCK, "z2-" + (penhuoCXTimes - 0.4f)), this); } penhuoJishi += Time.deltaTime; this.transform.position = new Vector2(this.transform.position.x + moveSpeedX, this.transform.position.y); //print(" moveSpeedX "+ moveSpeedX+ " localScale "+ this.transform.localScale.x); //print(" penhuoJishi "+ penhuoJishi); if (penhuoJishi >= penhuoCXTimes) { penhuoJishi = 0; print(" penghuo OVER!!!!!!! "); TX_QS.Stop(); TX_Huoyan.Stop(); TX_Huoyan.gameObject.SetActive(false); IsStartPenhuo = false; GetInStand = true; } } }
protected void GetStartAC() { _gameBody.GetAcMsg(StartACName, 2); TX_QS.Play(); Audio_Penhuo.Play(); }