I had this code working a couple of days ago, but then I moved stuff around and visual studio doesn’t like it anymore. Both of these scripts are attached to my main camera object. Here is where I’m trying to call my UI manager script.
if (checkForEmptyFieldsOne())
{
this.gameObject.GetComponent<UIManager>().gameRules1();
}
and here is the function I’m trying to call, gameRulesOne.
public void gameRulesOne()
{
if (!gameRules1.gameObject.activeInHierarchy)
{
gameRules1.gameObject.SetActive(true);
StartCoroutine(slideMenu(1f, gameRules1));
}
else
{
gameRules1.gameObject.SetActive(true);
StartCoroutine(slideMenu(-1f, gameRules1));
}
click.PlayOneShot(click.clip);
}