protected override void GetStart() { if (!IsStart) { IsStart = true; TX_Tuijin1.Play(); JinGaoStart(); //ObjectEventDispatcher.dispatcher.addEventListener(EventTypeName.LAIXI_JINGGAO, this.GetJinggao); ObjectEventDispatcher.dispatcher.dispatchEvent(new UEvent(EventTypeName.LAIXI_JINGGAO, null), this); } else { ZibaoJishi(); LaixiJingao(); if (this.transform.position.y >= chushiY + _pianyiY) { _Fy = -6; GetComponent <Rigidbody2D>().velocity = new Vector2(GetComponent <Rigidbody2D>().velocity.x, GetComponent <Rigidbody2D>().velocity.y *0.95f); } else if (this.transform.position.y <= chushiY - _pianyiY) { _Fy = 6; GetComponent <Rigidbody2D>().velocity = new Vector2(GetComponent <Rigidbody2D>().velocity.x, GetComponent <Rigidbody2D>().velocity.y * 0.95f); } GetComponent <Rigidbody2D>().AddForce(new Vector2(Tuili, _Fy)); //print("-------------> "+GetComponent<Rigidbody2D>().velocity); if (GetComponent <Rigidbody2D>().velocity.x > MaxSpeedX) { GetComponent <Rigidbody2D>().velocity = new Vector2(MaxSpeedX, GetComponent <Rigidbody2D>().velocity.y); } } }
protected override void GetStart() { if (!GetDown()) { return; } if (!IsStart) { IsStart = true; TX_Tuijin1.gameObject.SetActive(true); TX_Tuijin1.Simulate(0.0f); TX_Tuijin1.Stop(); TX_Tuijin1.Play(); Audio_DDFashe.Play(); _targetGuai = GetTarget(); GetComponent <Rigidbody2D>().gravityScale = 0; } else { ZibaoJishi(); GetComponent <Rigidbody2D>().AddForce(new Vector2(Tuili, 0)); GenzongTiaozheng(); //print("-------------> "+GetComponent<Rigidbody2D>().velocity); if (GetComponent <Rigidbody2D>().velocity.x > MaxSpeedX) { GetComponent <Rigidbody2D>().velocity = new Vector2(MaxSpeedX, SpeedY); } } }
protected override void GetEnable() { //base.GetEnable(); GetComponent <Rigidbody2D>().gravityScale = 1; DownTiming = 0; isDownOver = false; _targetGuai = null; _YuanshiMaxSpeedX = MaxSpeedX; MaxSpeedX = 140; Audio_DDFashe.Stop(); TX_Tuijin1.gameObject.SetActive(false); TX_Tuijin1.Stop(); }
protected override void GetStart() { if (!IsStart) { IsStart = true; TX_Tuijin1.Play(); JinGaoStart(); //ObjectEventDispatcher.dispatcher.addEventListener(EventTypeName.LAIXI_JINGGAO, this.GetJinggao); ObjectEventDispatcher.dispatcher.dispatchEvent(new UEvent(EventTypeName.LAIXI_JINGGAO, null), this); } else { ZibaoJishi(); LaixiJingao(); GetComponent <Rigidbody2D>().AddForce(new Vector2(Tuili, 0)); GenzongTiaozheng(); //print("-------------> "+GetComponent<Rigidbody2D>().velocity); if (GetComponent <Rigidbody2D>().velocity.x > MaxSpeedX) { GetComponent <Rigidbody2D>().velocity = new Vector2(MaxSpeedX, SpeedY); } } }