2 animations in same button (door open-close)

Hi everyone I’m making this door script but I’m blocked this scipt will do door open-close animations I can open it but I can’t close it please help me out because I’m annoyed of this

public GameObject text;
    public GameObject dot;
    public Animator oynatici;
    public bool acildimi = false; //door status checker


    // Use this for initialization  
    void Start () {
        text = GameObject.Find("Oyun_canvas/bildirim_text").gameObject;
        dot = GameObject.Find("Oyun_canvas/Dot").gameObject;
        oynatici = GameObject.Find("kapi_cerceve/on_kapi_cevirici").gameObject.GetComponent<Animator>();
    }
	
	// Update is called once per frame
	void Update () {
       // I don't want use here for performance issues
    }
    public void check()
    {
        if (Input.GetKeyDown(KeyCode.E))
        {
            acildimi = true;
            oynatici.Play("kapi_ac");
            
            
        }
       else if ((Input.GetKeyDown(KeyCode.E)) && (acildimi==true))
        { 

            acildimi = false;
            oynatici.Play("kapi_kapa");
            
        }

    }
    public void kelime()
    {
        
        dot.SetActive(false);
        if (acildimi==true)
        {
            text.gameObject.GetComponent<Text>().text = "Kapıyı Kapat";
        }
        else
        {
            text.gameObject.GetComponent<Text>().text = "Kapıyı aç";
        }
    }

    private void OnTriggerEnter(Collider other)
    {
        check();
        kelime();
    }
    private void OnTriggerStay(Collider other)
    {
        check();
        kelime();
    }
    private void OnTriggerExit(Collider other)
    {
        
        text.gameObject.GetComponent<Text>().text = "";
        dot.SetActive(true);
       
    }

}

The triggers, add a Debug.Log and check how often they trigger.

Edit : @wolfgangmami nevermind, i found the error :

In your check, you check the button press, and in the else if you check it again, that means you will always enter the first case, since the animation trigger is button press. Add “&& !acildimi” in the first check to differentiate between door states.

Have you thought about creating an animator?

Edit: if you’re worried about performance, it’s also not wise to use GameObject.Find. You’re better off using Tags or public variables assigned in the inspector