Exemple #1
0
    private void OnSceneGUI()
    {
                #if UNITY_EDITOR
        selectedCheckerInfo = target as EnemyBodyPatrolChecker;
        if (null == selectedCheckerInfo)
        {
            return;
        }
        if (null == selectedCheckerInfo.eActor)
        {
            selectedCheckerInfo.actor  = selectedCheckerInfo.GetComponentInParent <Actor> ();
            selectedCheckerInfo.eActor = selectedCheckerInfo.GetComponentInParent <EnemyActor>();
        }

        EnemyViewRenderer.DrawViewableRect(selectedCheckerInfo.eActor.GetEnemyOutsideInfo());
        EnemyViewRenderer.DrawRecognizableRect(selectedCheckerInfo.eActor.GetEnemyOutsideInfo());
        DrawPatrolNodes(selectedCheckerInfo);
                #endif
    }
Exemple #2
0
    private void OnSceneGUI()
    {
                #if UNITY_EDITOR
        selectedChekcerInfo = target as EnemyBodyHideChecker;

        if (null == selectedChekcerInfo)
        {
            return;
        }

        selectedChekcerInfo.actor                    = selectedChekcerInfo.GetComponentInParent <Actor> ();
        selectedChekcerInfo.eActor                   = selectedChekcerInfo.GetComponentInParent <EnemyActor>();
        selectedChekcerInfo.eActor.customAgent       = selectedChekcerInfo.actor.GetComponent <CustomNavMeshAgent>();
        selectedChekcerInfo.eActor.customAgent.agent = selectedChekcerInfo.eActor.GetComponent <NavMeshAgent> ();

        EnemyViewRenderer.DrawViewableRect(selectedChekcerInfo.eActor.GetEnemyOutsideInfo());
        EnemyViewRenderer.DrawRecognizableRect(selectedChekcerInfo.eActor.GetEnemyOutsideInfo());

        float size = HandleUtility.GetHandleSize(selectedChekcerInfo.eActor.customAgent.agent.destination);

        Handles.color = Color.red;
        Handles.Button(selectedChekcerInfo.eActor.customAgent.agent.destination, Quaternion.Euler(Vector3.back), size * handleSize, pickSize, Handles.ArrowHandleCap);
                #endif
    }