// Use this for initialization void Start() { quitMenu.SetActive(false); optionsMenu.SetActive(false); helpMenu.SetActive(false); creditsMenu.SetActive(false); resumeButton = resumeButton.GetComponent <Button>(); newGameButton = newGameButton.GetComponent <Button>(); optionsButton = optionsButton.GetComponent <Button>(); helpButton = helpButton.GetComponent <Button>(); creditsButton = creditsButton.GetComponent <Button>(); exitGamebutton = exitGamebutton.GetComponent <Button>(); saveMenuStateScript = GameObject.FindGameObjectWithTag("GameSession").GetComponent <SaveMenuState>(); menuBG = GameObject.FindGameObjectWithTag("MenuBG"); if (isIngameMenu) { //Enable or disable Resume button resumeButton.gameObject.SetActive(true); ingameMenuBG.SetActive(true); initialMenuBG.SetActive(false); menuBG.GetComponent <Image>().color = new Color(0.0f, 0.0f, 0.0f, 0.5f); } else { resumeButton.gameObject.SetActive(false); ingameMenuBG.SetActive(false); initialMenuBG.SetActive(true); } }
public void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }