コード例 #1
0
ファイル: BoardLoader.cs プロジェクト: yavin666/ARGame
    public void LoadLevel(int id)
    {
        // Destroys the previous level
        if (currentLevel != null)
        {
            currentLevel.GetComponent <GameBoard>().DestroyBoard();
            succesSound.Play();
        }

        // Create the new level
        currentLevel = Instantiate(levels[id]);
        currentLevel.transform.SetParent(transform, false);
        currentLevel.GetComponent <Animator>().SetBool("showBoard", true);
        GameBoard gameBoard = currentLevel.GetComponent <GameBoard>();

        levelDescription.ShowDescription(gameBoard.title, gameBoard.subtitle);

        followingCameras = currentLevel.GetComponentsInChildren <FollowingCamera>();

        foreach (FollowingCamera followingCamera in followingCameras)
        {
            followingCamera.toFollow = toFollow;
        }
    }