Ejemplo n.º 1
0
    double[] GetInput()
    {
        double[] input = new double[inputSize];

        Vector3 dir = target.position - transform.position;

        input[0] = dir.magnitude * 0.2f;

        input[1] = Vector2.SignedAngle(transform.up, dir) / 180;

        dir      = new Vector3(UIcontroller.Round20(transform.position.x), UIcontroller.Round20(transform.position.y), 0) - transform.position;
        input[2] = dir.magnitude * 0.2f;
        input[3] = Vector2.SignedAngle(transform.up, dir) / 180;


        vel      = target.GetComponent <Rigidbody2D>().velocity;
        input[4] = Vector2.Dot(vel, dir) * 0.2f;
        input[5] = Vector2.Dot(vel, Vector2.Perpendicular(dir)) * 0.2f;

        input[6] = move.lastShoot;

        return(input);
    }