//战斗 子弹 怎么发射? protected void ZidanZhandou() { if (!IsCanFasheZidan) { return; } //是否有子弹 发射 if (!IsHasFashe) { //高速狙击子弹发射 if (ZiDanTypeNum == 23) { //播放 高速子弹播放特效 //ZidanFasheTimes 延长 if (TX_GaosuHuoyandanFashe && !TX_GaosuHuoyandanFashe.gameObject.activeSelf) { TX_GaosuHuoyandanFashe.gameObject.SetActive(true); TX_GaosuHuoyandanFashe.Play(); _FasheYanchiTime = ZidanFasheTimes + 0.4f; //print(" *********************** _FasheYanchiTime "+ _FasheYanchiTime); } } else { if (!StartParticle.gameObject.activeSelf) { StartParticle.gameObject.SetActive(true); StartParticle.Play(); _FasheYanchiTime = ZidanFasheTimes; } } ZidanFasheJishi += Time.deltaTime; //print(" jishi "+ ZidanFasheJishi); if (ZidanFasheJishi >= _FasheYanchiTime) { ZidanTXStop(); IsHasFashe = true; ZidanFasheJishi = 0; if (ZiDanTypeNum == 18 || ZiDanTypeNum == 28) { //连弹*** //print(" *********************** 连弹************ "); StartLiandan(); return; } if (SkillOutAudio) { SkillOutAudio.Play(); } Fire(); } } }
protected void ResetThisAll() { DisX = 0; GetComponent <JN_Date>().HitInSpecialEffectsType = 5; _gameBody.IsJiasu = false; IsTanshe = false; if (YishanHitKuai) { YishanHitKuai.SetActive(false); } if (StartParticle) { StartParticle.Stop(); StartParticle.gameObject.SetActive(false); } _gameBody.isAcing = false; _gameBody.GetPlayerRigidbody2D().velocity = Vector2.zero; }
void ZidanTXStop() { if (StartAudio) { StartAudio.Stop(); } if (StartParticle && StartParticle.gameObject.activeSelf) { print("特效 显示 stop"); StartParticle.Stop(); StartParticle.gameObject.SetActive(false); } if (TX_GaosuHuoyandanFashe && TX_GaosuHuoyandanFashe.gameObject.activeSelf) { TX_GaosuHuoyandanFashe.Stop(); TX_GaosuHuoyandanFashe.gameObject.SetActive(false); } }
/// <summary> /// Calculate and apply any internal forces due to deformation /// to the particles connected to this spring /// </summary> public void ApplyForces() { if (StartParticle != null && EndParticle != null) { Vector dir = EndParticle.Position - StartParticle.Position; double length = dir.Magnitude(); dir /= length; double extension = length - RestLength; double T = extension * Stiffness; if ((Compression && extension < 0) || (Tension && extension > 0)) { // Apply force: Vector force = dir * T; StartParticle.ApplyForce(force); EndParticle.ApplyForce(-force); } } }
protected override void ACSkillShowOut() { //base.ACSkillShowOut(); print(" ZDAIName " + ZDAIName); //string type = ZDAIName.Split('_')[2]; if (StartParticle) { StartParticle.Play(); } if (SkillType == "1") { //4毒 Diu4Du(); } else if (SkillType == "2") { GetComponent <TempAddValues>().TempAddYZ(TempAddYingzhi, 0.6f); //电墙 Dianqiang(); } else if (SkillType == "ywd" || SkillType == "3") { //烟雾弹 Yanwudan(); } else if (SkillType == "rzb" || SkillType == "4") { RenzhebiaoHeng(); } else if (SkillType == "3rzb" || SkillType == "5") { //向天上丢3发忍者镖 Up3RenzheBiao(); } else { print("--------------------------> 丢sanuhuo "); Diu3huo(); } }
bool IsACOver(string ACName) { if (_gameBody.GetDB().animation.lastAnimationName == ACName && _gameBody.GetDB().animation.isCompleted) { _gameBody.isAcing = false; print(" 动作 完成!!!!! " + ACName); return(true); } if (!_gameBody.isAcing && _gameBody.GetDB().animation.lastAnimationName != ACName) { _gameBody.isAcing = true; _gameBody.GetDB().animation.GotoAndPlayByFrame(ACName, 0, 1); if (StartParticle && ACName == SkillSFACName) { print(" ---*****----------- 播放起手特效!!!! "); StartParticle.gameObject.SetActive(true); StartParticle.Play(); } } return(false); }
protected override void ChixuSkillStarting() { //base.ChixuSkillStarting(); if (!_isGetStart) { return; } if (!GetComponent <AIBase>().isActioning) { TheSkillOver(); return; } if (_roleDate.isBeHiting || _roleDate.isDie) { TheSkillOver(); //print("------> 进来没?? "+ GetComponent<Rigidbody2D>().velocity); if (_roleDate.isDie) { GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0); } return; } if (_gameBody.IsHitWall || IsHitWall2) { GetOver(); return; } if (DisX >= YishanDistance) { GetOver(); return; } if (!IsStopSelf) { IsStopSelf = true; _gameBody.GetPlayerRigidbody2D().velocity = Vector2.zero; } if (!IsSkillShowOut) { IsSkillShowOut = true; //print("zd acName: "+ACName); if (ACName != "") { _gameBody.isAcing = true; //_gameBody.GetDB().animation.GotoAndPlayByFrame(ACName, 0, 1); _gameBody.GetDB().animation.GotoAndStopByFrame(ACName); _gameBody.isAcing = true; GetComponent <TempAddValues>().TempAddYZ(TempAddYZ, StartDelayTimes + 1.4f); } } if (_isGetStart) { if (IsStartDelayOver()) { if (!IsTanshe) { IsTanshe = true; vx = Mathf.Abs(vx); vx = this.transform.localScale.x > 0 ? vx * -1 : vx; ZishenHitKuai.SetActive(false); if (YishanHitKuai) { YishanHitKuai.SetActive(true); } _gameBody.GetDB().animation.GotoAndPlayByFrame(ACName, 0, 1); //这里将 攻击属性 改成了 非碰撞 GetComponent <JN_Date>().HitInSpecialEffectsType = 1; _gameBody.IsJiasu = true; GameObject tx = GlobalTools.GetGameObjectInObjPoolByName("TX_Yishan_1"); tx.transform.position = this.transform.position; tx.transform.localScale = new Vector3(this.transform.localScale.x, 1, 1); tx.transform.parent = this.transform.parent; } //if (_gameBody.GetDB().animation.lastAnimationState.isCompleted) //{ // print(" jiehsu maammamamamamam "); //} if (_gameBody.GetDB().animation.lastAnimationName == ACName) { if (StartParticle != null && !IsStartParticle) { IsStartParticle = true; //print("zd qs 播放 起手特效"); StartParticle.gameObject.SetActive(true); StartParticle.Play(); } //print("------------------?????? " + ACName + " sudu " + GetComponent<Rigidbody2D>().velocity); if (_gameBody.GetDB().animation.isCompleted) { //print("??????? 结束 "); //print("??????? 结束 "); //print("??????? 结束 "); _gameBody.GetDB().animation.Stop(); } GetComponent <Rigidbody2D>().velocity = new Vector2(vx, 0); if (YanChen) { YanChen.Play(); } } else { print("跳出了 一闪动作 结束"); GetOver(); } //GetComponent<Rigidbody2D>().velocity = new Vector2(vx, 0); //if (YanChen) YanChen.Play(); DisX = Mathf.Abs(this.transform.position.x - thisChushiX); } } }