예제 #1
0
    public void init(PhotoAlbum para_albumData, Sprite[] para_photoCompletionIcons,ProgressScript c)
    {
        control = c;
        //Debug.Log("START ALBUM");

        contentsPageChild = transform.FindChild("PhotoAlbum_Contents");
        photoPageChild = transform.FindChild("PhotoAlbum_PhotoPage");

        Rect contentsAreaGUIBounds = WorldSpawnHelper.getWorldToGUIBounds(contentsPageChild.FindChild("ContentsScrollArea").renderer.bounds,new bool[]{false,true,false});
        templateContentsRow = new Rect(0,0,contentsAreaGUIBounds.width,contentsAreaGUIBounds.height / (3.5f));
        templateContentsRowText = new Rect(0,0,templateContentsRow.width * 0.75f,templateContentsRow.height);
        templateContentsRowImg = new Rect(templateContentsRow.width * 0.7f,templateContentsRow.height * 0.1f,templateContentsRow.width * 0.25f,templateContentsRow.height - (2 * (templateContentsRow.height * 0.1f)));

        album = para_albumData;
        availablePhotoPages = album.getAllAvailablePages();
        photoCompletionIcons = para_photoCompletionIcons;

        displayContentsView();
    }
예제 #2
0
    private PhotoAlbum createAlbum(int para_charID)
    {
        List<DifficultyMetaData> difficulties = new List<DifficultyMetaData>();

        int lA = characterLanguageAreas[ para_charID] ;

        //Debug.Log("Creating album for character "+para_charID+" and LA "+lA);

        foreach(int diff in characterDifficulties[para_charID]){

            if(unlockedDifficulties[lA][diff]){

                difficulties.Add(new DifficultyMetaData(lA+"*"+diff, createDifficultyShortDescription(lA,diff),createExplanation(lA,diff)));
                //Debug.Log(lA+"*"+diff+" -> "+difficultyShortDescription);

            }
        }

        PhotoAlbum pPA = new PhotoAlbum(para_charID, difficulties  );

        foreach(PhotoPage page in pPA.getAllAvailablePages()){

            int i = 0;
            foreach(Photo photo in satchel.getPhotos()[page.getLangArea()][page.getDifficulty()]){

                page.addPhoto(photo,i++);
            }
        }

        return pPA;
    }