Exemplo n.º 1
0
    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;
            }
        }
    }
Exemplo n.º 2
0
    // 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();
    }
Exemplo n.º 3
0
    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");
    }
Exemplo n.º 4
0
 void Start()
 {
     freqHold = GameObject.Find("FreqHold").GetComponent<FreqHold>();
 }
Exemplo n.º 5
0
    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;
            }
        }
    }
Exemplo n.º 6
0
 void Start()
 {
     freqHold = GameObject.Find("FreqHold").GetComponent <FreqHold>();
 }