void Awake() { // obtain reference to the spawner spawner = GameObject.Find("Control").GetComponent <Spawner>(); freqHold = GameObject.Find("FreqHold").GetComponent <FreqHold>(); player = GameObject.Find("Player"); notClosed = true; expandAndDestroy = false; if (spawner.isEmpty()) { // this is the first platform, generate itself generate(6, 12, 0); // turn off fade in for the first platform fadingIn = false; foreach (Transform seg in transform) { seg.gameObject.renderer.material.SetColor("_Color", new Color(1f, 1f, 1f, 1f)); seg.gameObject.collider2D.enabled = true; } } }
// may not be appropriate to put pause() and resume() here public void pause() { // display 'paused' screen transform.position = new Vector3(0.5f, targetPos, 0f); guiText.text = "GAME PAUSED"; optionCount = 3; // allow 'resume' to be selected selectIdx = 0; // always points to the first option when shown selectMode = true; // show all three buttons resumeBtn.gameObject.SetActive(true); retryBtn.gameObject.SetActive(true); menuBtn.gameObject.SetActive(true); // pause everything else // toDistort.Pause(); AudioListener.pause = true; // get the latest highscore updateHighscore(); FreqHold freqHold = GameObject.Find("FreqHold").GetComponent <FreqHold>(); freqHold.deactivate(); }
public void resume() { // hide 'paused' screen transform.position = new Vector3(0.5f, -0.5f, 0f); selectMode = false; // hide all three buttons resumeBtn.gameObject.SetActive(false); retryBtn.gameObject.SetActive(false); menuBtn.gameObject.SetActive(false); // resume everything else //toDistort.Play(); AudioListener.pause = false; FreqHold freqHold = GameObject.Find("FreqHold").GetComponent <FreqHold>(); freqHold.activate(); PlayerScript playerScript = GameObject.Find("Player").GetComponent <PlayerScript>(); playerScript.SendMessage("Resume"); }
void Start() { freqHold = GameObject.Find("FreqHold").GetComponent<FreqHold>(); }
void Awake() { // obtain reference to the spawner spawner = GameObject.Find("Control").GetComponent<Spawner>(); freqHold = GameObject.Find("FreqHold").GetComponent<FreqHold>(); player = GameObject.Find ("Player"); notClosed = true; expandAndDestroy = false; if (spawner.isEmpty()) { // this is the first platform, generate itself generate(6, 12, 0); // turn off fade in for the first platform fadingIn = false; foreach (Transform seg in transform) { seg.gameObject.renderer.material.SetColor("_Color", new Color(1f, 1f, 1f, 1f)); seg.gameObject.collider2D.enabled = true; } } }
void Start() { freqHold = GameObject.Find("FreqHold").GetComponent <FreqHold>(); }