// 读取INI配置（伪代码，需结合实际解析库）
public class GameConfig {
    public float DetectionRange { get; set; }
    public float MoveSpeed { get; set; }
}

// 敌人AI逻辑（合法视野检测）
public class EnemyAI : MonoBehaviour {
    private GameConfig config;
    private Transform player;

    void Start() {
        // 从INI加载配置（示例）
        config = INIParser.Load<GameConfig>("GameConfig.ini");
        player = GameObject.FindWithTag("Player").transform;
    }

    void Update() {
        if (IsPlayerInRange()) {
            ChasePlayer();
        }
    }

    private bool IsPlayerInRange() {
        // 合法距离检测（基于INI配置的DetectionRange）
        float distance = Vector3.Distance(transform.position, player.position);
        return distance <= config.DetectionRange && CanSeePlayer();
    }

    private bool CanSeePlayer() {
        // 合法射线检测（无透视作弊）
        RaycastHit hit;
        return Physics.Raycast(transform.position, player.position - transform.position, 
            out hit, config.DetectionRange) && hit.collider.CompareTag("Player");
    }

    private void ChasePlayer() {
        // 合法寻路（基于NavMesh）
        Vector3 targetPos = player.position;
        transform.position = Vector3.MoveTowards(transform.position, targetPos, 
            config.MoveSpeed * Time.deltaTime);
    }
}