Пример #1
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (currentMotion >= maxMotion)
        {
            FindClosestBall();
            currentMotion = 0;
        }
        else
        {
            currentMotion++;
        }

        poolBallController.DoSphereMotion(rb, GetDirection());

        if (currentAttack >= maxAttack)
        {
            poolBallController.DoForwardMotion(rb, GetDirection(), true);
            currentAttack = 0;
        }
        else
        {
            currentAttack++;
            poolBallController.chargeAttack(true);
        }
    }
    void GetInput()
    {
        poolBallController.DoSphereMotion(rb, Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));

        poolBallController.chargeAttack(Input.GetKey(KeyCode.LeftShift));

        poolBallController.DoForwardMotion(rb, Input.GetKeyUp(KeyCode.LeftShift));
    }