public void OpenWindow(int tabIndex)
    {
        if (uiManager == null)
        {
            uiManager = GameObject.Find("UIManager").GetComponent <UIManager_v5>();
        }
        uiManager.CloseAllWindows();
        gameObject.SetActive(true);
        DispensaryUIPanel dispensaryPanel = gameObject.GetComponent <DispensaryUIPanel>();

        if (dispensaryPanel != null)
        {
            dispensaryPanel.OnWindowOpen(tabIndex);
        }
        CompanyUIPanel companyPanel = gameObject.GetComponent <CompanyUIPanel>();

        if (companyPanel != null)
        {
            companyPanel.OnWindowOpen(tabIndex);
        }
        CalendarUIPanel calendarPanel = gameObject.GetComponent <CalendarUIPanel>();

        if (calendarPanel != null)
        {
            calendarPanel.OpenCalendar();
        }
        windowOpen = true;
    }
 public void WindowToggle(int index)
 {
     if (index == -1)
     {
         CloseWindow();
         return;
     }
     if (windowOpen)
     {
         DispensaryUIPanel dispensaryPanel = gameObject.GetComponent <DispensaryUIPanel>();
         if (dispensaryPanel != null)
         {
             if (index != dispensaryPanel.currentTabIndex)
             {
                 OpenWindow(index);
                 return;
             }
             else
             {
                 CloseWindow();
                 return;
             }
         }
         CompanyUIPanel companyPanel = gameObject.GetComponent <CompanyUIPanel>();
         if (companyPanel != null)
         {
             if (index != companyPanel.currentTabIndex)
             {
                 OpenWindow(index);
                 return;
             }
             else
             {
                 CloseWindow();
                 return;
             }
         }
         CloseWindow();
     }
     else
     {
         OpenWindow(index);
     }
 }
    public void Search()
    {
        DispensaryUIPanel dispensaryPanel = gameObject.GetComponent <DispensaryUIPanel>();

        if (dispensaryPanel != null)
        {
            dispensaryPanel.Search(searchBar.GetText());
        }
        CompanyUIPanel companyPanel = gameObject.GetComponent <CompanyUIPanel>();

        if (companyPanel != null)
        {
        }
        StoreObjectUIPanel storeObjectPanel = gameObject.GetComponent <StoreObjectUIPanel>();

        if (storeObjectPanel != null)
        {
            storeObjectPanel.CreateStoreObjectsList(searchBar.GetText());
        }
    }