how to call a void one time ?

Hi guys ! I’ve created this script

  void Start ()
         {
  instance = this;
  NumDoor = 0;
       }

     void Update()
     {
       OpenDoor();
     }


      public void OpenDoor()
     {
        if (NumDoor >= 1)
     {
        BigDoor.Play("BigDoor 001");
      }
  }

Now the OpenDoor was called every frame, but i want to call it only one time just to play the animation, what is the correct script ?

There is a lot of ways but the most simple way is to add a bool check like this.

    bool isDoorOpen;

    void Update()
    {
        if (isDoorOpen == false && NumDoor >= 1)
        {
            OpenDoor();
        }
    }

    public void OpenDoor()
    {
        BigDoor.Play("BigDoor 001");
        isDoorOpen = true;
    }