How to start function that active objects and in the meanwhile stopping readvalue ?

Hello, I have a problem with the management of my code, I would like that once my variable is satisfied, objects are activated in the scene.

The problem is that once activated these objects require a few seconds to perform their transformations, so I would like the script to give priority to reach the completion of the transformation and then resume the reading of the values that takes place through a bitalino in real-time, and if these values no longer reflect this range, then it returns to change the range.

This is the code:

         private void ReadValue(int[][] packageOfData, int chnIndex)
         {
             for (int i = 0; i < packageOfData.Length; i++)
             {
                // First stage condition (High level of stress)
                if (packageOfData[i][chnIndex] < 1000 && packageOfData[i][chnIndex] > 800)
                {
                    time += Time.deltaTime;
                    if (time >= 6.0f)
                    {
                        if (Aura != null)
                    
                        {
                            Aura.SetActive(false);
                        }
    
                        if (AuraGlow != null)
                    
                        {
                            AuraGlow.SetActive(false);
                        }
    
                        if (DirectionalLight != null)
                        {
                            DirectionalLight.transform.rotation = Quaternion.Slerp(point0.rotation, pointA.rotation, timeCount);
                            timeCount = timeCount + Time.deltaTime*Rotation_Smoothness_Sun;
                        }  
    
                        if (RustGarden1 != null)
                        {
                            Quaternion_Rotate_From = RustGarden1.transform.rotation;
                            Quaternion_Rotate_To = Quaternion.Euler (0,20,0);
                            RustGarden1.transform.rotation = Quaternion.Lerp (Quaternion_Rotate_From, Quaternion_Rotate_To, Time.deltaTime*Rotation_Smoothness);
                        }       
                    } 
    
                       else
                       {
                           time = 0.0f;
                           //ReadValue(int[][] packageOfData, int chnIndex);
                       } 
                }  
             }
           }

Please don’t multipost. Please follow up in the original thread, you’ve asked on 3 separate threads now. If you have questions, please ask here Script which helps me to check values into a range of time As has been mentioned, you would want to use Update() and perhaps call ReadValue() from there based on a condition. Be sure to place plenty of Debug.Log statements throughout your code so can confirm what is being executed and what the variable values are at runtime. This may help also to help debug your code Tips for new Unity users