예제 #1
0
파일: Platform.cs 프로젝트: Fmacgt/Uroboros
    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;
            }
        }
    }
예제 #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();
    }
예제 #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");
    }
예제 #4
0
 void Start()
 {
     freqHold = GameObject.Find("FreqHold").GetComponent<FreqHold>();
 }
예제 #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;
            }
        }
    }
예제 #6
0
 void Start()
 {
     freqHold = GameObject.Find("FreqHold").GetComponent <FreqHold>();
 }