コード例 #1
0
    public override void CollectObservations()
    {
        Vector3 pos = transform.position;

        // Proximity raycast to find enemies
        PhysicHelper.RadialRaycasts(pos, RaycastEnemyMask, RaycastEnemyCount, RaycastEnemyLength, AddVectorObs);

        // Additional raycasts at a further distance to help determine best global direction (a heatmap could probably be better here)
        PhysicHelper.RadialRaycasts(pos, RaycastEnemyMask, RaycastEnemyCount, RaycastEnemyLength, AddVectorObs, RaycastEnemyLength + 1);

        // Detect Walls
        PhysicHelper.RadialRaycasts(pos, RaycastWallMask, RaycastWallCount, RaycastWallLength, AddVectorObs);

        AddVectorObs(_rigidBody.velocity.x / MaxVelocity);
        AddVectorObs(_rigidBody.velocity.z / MaxVelocity);
    }
コード例 #2
0
    public override void CollectObservations()
    {
        PhysicHelper.RadialRaycasts(transform.position, RaycastEnemyMask, RaycastEnemyCount, RaycastEnemyLength, AddVectorObs);

        AddVectorObs(_delayShoot / (float)_delayBetweenShoot);
    }