Пример #1
0
    void Start()
    {
        // Game Object Setup
        canvas = GameObject.Find("Canvas");
        player = GameObject.Find("Player Container").transform.GetChild(0).gameObject;

        multipleAudio = player.GetComponent <MultipleAudio>();
        pauseButton   = canvas.GetComponent <PauseButtonHandler>();
        audioSource   = player.GetComponent <AudioSource>();
        scoreTally    = GameObject.Find("Canvas/Score Panel/Score Text").GetComponent <ScoreTally>();

        // Grab score text
        lowScoreText.text  = getText(score);
        highScoreText.text = getText(score);
    }
Пример #2
0
    void Start()
    {
        // GameObject and Script Instance Init
        pauseButton        = GameObject.Find("Canvas").GetComponent <PauseButtonHandler>();
        calibrationHandler = GameObject.Find("Canvas").GetComponent <CalibrationButtonHandler>();
        multipleAudio[1]   = GameObject.Find("Main Camera").GetComponent <MultipleAudio>();
        scoreGame          = GameObject.Find("Player Container").transform.GetChild(0).GetComponent <ScoreGame>();

        // Check for user microphone
        if (Microphone.devices.Length > 0)
        {
            micInput = Microphone.Start(Microphone.devices[0], true, 999, 44100);
        }
        else
        {
            Debug.Log("Please connect a microphone to play!");
            Application.Quit();
        }
    }
Пример #3
0
    void Start()
    {
        pauseButton = GameObject.Find("Canvas").GetComponent <PauseButtonHandler>();

        // Set up audio processor and listener
        AudioProcessor processor = FindObjectOfType <AudioProcessor>();

        processor.onBeat.AddListener(onOnbeatDetected);
        processor.onSpectrum.AddListener(onSpectrum);

        // Get origin positions of obstacles for copying
        above     = GameObject.Find("above");
        aboveOrig = above.transform.position;
        below     = GameObject.Find("below");
        belowOrig = below.transform.position;
        aboveEnd  = GameObject.Find("above end");
        belowEnd  = GameObject.Find("below end");

        // set end obstacles for colliding and deleting to be same as originals
        aboveEnd.transform.position = new Vector3(-aboveOrig.x - 3, aboveOrig.y, 0);
        belowEnd.transform.position = new Vector3(-belowOrig.x - 3, belowOrig.y, 0);
    }
Пример #4
0
 // Init
 void Start()
 {
     pauseButton = GameObject.Find("Canvas").GetComponent <PauseButtonHandler>();
 }