Пример #1
0
    void OnSceneGUI()
    {
        EnemySight fow = (EnemySight)target;

        Handles.color = Color.white;
        Handles.DrawWireArc(fow.transform.position, Vector3.up, Vector3.forward, 360, fow.viewRadius);
        Vector3 viewAngleA = fow.DirFromAngle(-fow.viewAngle / 2, false);
        Vector3 viewAngleB = fow.DirFromAngle(fow.viewAngle / 2, false);

        Handles.DrawLine(fow.transform.position, fow.transform.position + viewAngleA * fow.viewRadius);
        Handles.DrawLine(fow.transform.position, fow.transform.position + viewAngleB * fow.viewRadius);

        Handles.color = Color.red;
        foreach (Transform visibleTarget in fow.visibleTargets)
        {
            Handles.DrawLine(fow.transform.position, visibleTarget.position);
        }
    }
Пример #2
0
    private void OnSceneGUI()
    {
        EnemySight sight = (EnemySight)target;

        Handles.color = Color.white;
        Handles.DrawWireArc(sight.transform.position, Vector3.up, Vector3.forward, 360, sight.viewRadius);
        Vector3 viewingAngleA = sight.DirFromAngle(-sight.viewAngle / 2, false);
        Vector3 viewingAngleB = sight.DirFromAngle(sight.viewAngle / 2, false);

        Handles.color = Color.green;
        Handles.DrawLine(sight.transform.position, sight.transform.position + viewingAngleA * sight.viewRadius);
        Handles.DrawLine(sight.transform.position, sight.transform.position + viewingAngleB * sight.viewRadius);

        Handles.color = Color.red;
        foreach (Transform visibleTarget in sight.visibleTargets)
        {
            Handles.DrawLine(sight.transform.position, visibleTarget.position);
        }
    }
Пример #3
0
    void OnSceneGUI()
    {
        EnemySight fow = (EnemySight)target;

        Handles.color = Color.white;
        Handles.DrawWireArc(fow.transform.position, Vector3.up, Vector3.forward, 360, fow.detectionCol.radius * 1.2f);
        Vector3 viewAngleA = fow.DirFromAngle(-fow.fovAngle / 2, false);
        Vector3 viewAngleB = fow.DirFromAngle(fow.fovAngle / 2, false);

        Handles.DrawLine(fow.transform.position, fow.transform.position + viewAngleA * fow.detectionCol.radius * 1.2f);
        Handles.DrawLine(fow.transform.position, fow.transform.position + viewAngleB * fow.detectionCol.radius * 1.2f);

        Handles.color = Color.red;

        if (fow.playerInSight)
        {
            Handles.DrawLine(fow.transform.position, fow.playerController.transform.position);
        }
    }
    private void OnSceneGUI()
    {
        EnemySight es = (EnemySight)target;

        Handles.color = Color.yellow;
        Handles.DrawWireArc(es.transform.position, Vector3.up, Vector3.forward, 360, es.viewRadius);
        Handles.color = Color.red;
        Handles.DrawWireArc(es.transform.position, Vector3.up, Vector3.forward, 360, es.tooCloseRadius);
        Vector3 viewAngleA = es.DirFromAngle(-es.viewAngle / 2, false);
        Vector3 viewAngleB = es.DirFromAngle(es.viewAngle / 2, false);

        Handles.DrawLine(es.transform.position, es.transform.position + viewAngleA * es.viewRadius);
        Handles.DrawLine(es.transform.position, es.transform.position + viewAngleB * es.viewRadius);

        Handles.color = Color.cyan;
        if (es.playerVisible != null)
        {
            Handles.DrawLine(es.transform.position, es.playerVisible.position);
        }
    }