コード例 #1
0
 public void RemoveIA(anAI myAI)
 {
     if (LivingAI.Contains(myAI))
     {
         LivingAI.Remove(myAI);
     }
 }
コード例 #2
0
ファイル: AIStateUI.cs プロジェクト: Bryndye/Asynchrone
    public void Declaration(anAI ToFollow)
    {
        canvasManager = CanvasManager.Instance;
        transform.parent = canvasManager.accrocheAIstate;

        FondInterrogation.gameObject.SetActive(false);
        InterrogationAmount.fillAmount = 0;
        InterrogationAmount.gameObject.SetActive(false);
        Pursuit.gameObject.SetActive(false);

        myFighter = ToFollow;
        GetComponent<aFollowingUI>().theRenderer = ToFollow.GetComponent<Renderer>();
    }
コード例 #3
0
    private void OnSceneGUI()
    {
        anAI myAI = (anAI)target;

        Handles.color = Color.white;
        Handles.DrawWireArc(myAI.transform.position, Vector3.up, Vector3.forward, 360, myAI.ViewRadius);
        Vector3 ViewAngleA = myAI.DirFromAngle(-myAI.ViewAngle / 2, false);
        Vector3 ViewAngleB = myAI.DirFromAngle(myAI.ViewAngle / 2, false);

        Handles.DrawLine(myAI.transform.position, myAI.transform.position + ViewAngleA * myAI.ViewRadius);
        Handles.DrawLine(myAI.transform.position, myAI.transform.position + ViewAngleB * myAI.ViewRadius);

        Handles.color = Color.red;
    }
コード例 #4
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        anAI myAI = (anAI)target;

        if (GUILayout.Button("Changer l'ennemi de classe"))
        {
            myAI.ChangeClass();
        }
        EditorGUILayout.Space();

        if (GUILayout.Button("Ajouter la position actuelle à la patrouille"))
        {
            myAI.AddPatrolPoint();
        }
        if (GUILayout.Button("Ajouter la position actuelle à la patrouille secondaire"))
        {
            myAI.AddSecondaryPatrolPoint();
        }
        if (GUILayout.Button("Supprimer la patrouille"))
        {
            myAI.ResetPath();
        }
        EditorGUILayout.Space();

        if (GUILayout.Button("Ajouter la rotation actuelles au balayage de garde"))
        {
            myAI.AddRotationPoint();
        }
        if (GUILayout.Button("Supprimer le balayage de garde"))
        {
            myAI.ResetRotations();
        }
        EditorGUILayout.Space();

        EditorGUILayout.Space();
        if (GUILayout.Button("Aller à la position de base"))
        {
            myAI.ResetPositionToFirstPatrolPoint();
        }
    }