예제 #1
0
    void Start()
    {
        leftWall   = GameObject.FindGameObjectWithTag("Left Wall").GetComponent <BreakableWall>();
        rightWall  = GameObject.FindGameObjectWithTag("Right Wall").GetComponent <BreakableWall>();
        topWall    = GameObject.FindGameObjectWithTag("Top Wall").GetComponent <ColorFlash>();
        bottomWall = GameObject.FindGameObjectWithTag("Bottom Wall").GetComponent <ColorFlash>();

        soundManager = GameObject.FindObjectOfType <SoundManager> ();
        canvas       = GameObject.FindObjectOfType <Canvas>();

        text = canvas.GetComponentInChildren <Text> ();

        leftPlayer  = Instantiate(leftPlayer, new Vector3(-6, 0, 0), Quaternion.identity);
        rightPlayer = Instantiate(rightPlayer, new Vector3(6, 0, 0), Quaternion.identity);

        puck = Instantiate(puck, Vector3.zero, Quaternion.identity);

        puck.Initialize();

        StartCoroutine(puck.ResetPosition());
        StartCoroutine(Countdown());
    }