示例#1
0
    // Update is called once per frame
    void Update()
    {
        if (_roleDate.isBeHiting || _roleDate.isDie)
        {
            _gameBody.GetZongTuili(new Vector2(0, 0));
        }


        if (_roleDate.isBeHiting || _roleDate.isDie || (_gameBody.IsGround && _gameBody.IsGetStand()))
        {
            //_gameBody.GetPlayerRigidbody2D().gravityScale = _recordGravity;
            _gameBody.isJumping = false;
            //print(" *******  技能终止!!!!! ");
            ReSetAll();
            IsStarting = false;
        }


        if (!IsStarting)
        {
            return;
        }

        if (GetComponent <AIBase>().IsTuihuiFangshouquing)
        {
            ReSetAll();
            return;
        }


        //撞墙判断
        if (_gameBody.IsShentiHitWall && !_roleDate.isDie)
        {
            //float vx = this.transform.localScale.x > 0 ? 0.2f : -0.2f;
            float vx = this.transform.localScale.x > 0 ? 400 : -400;
            print("  身体 前面撞墙了!!!!! " + vx);
            _gameBody.GetZongTuili(new Vector2(vx, 0));
            //GetZongTuili(Vector2.up * yForce);
            //_gameBody.GetPlayerRigidbody2D().velocity = new Vector2(vx, _gameBody.GetPlayerRigidbody2D().velocity.y);
            //print(_gameBody.GetPlayerRigidbody2D().velocity);
            //float __x = this.transform.position.x + vx;
            //print(vx+" ---  "+this.transform.position);
            //this.transform.position = new Vector2(__x, this.transform.position.y);
            //print(this.transform.position);
            //IsKaqiang = true;
            return;
        }

        //if(_gameBody.GetDB().animation.lastAnimationName == "jumpUp_1"&& _gameBody.GetPlayerRigidbody2D().velocity == Vector2.zero)
        //{
        //    if (IsKaqiang)
        //    {
        //        IsKaqiang = false;
        //        print("我靠 发什么神经!!!!!" + _gameBody.GetPlayerRigidbody2D().gravityScale);
        //        float vx = this.transform.localScale.x > 0 ? 100 : -100;
        //        _gameBody.GetZongTuili(new Vector2(vx, 100));
        //    }

        //}


        if (!_roleDate.isDie && IsJumpToPlayerPostion && IsStartXV && _gameBody.isInAiring && _gameObj)
        {
            //print("我进来没、、、、、、、、、、、、、、///////////////////////////////////-------------->");
            StartVX();
        }
    }