コード例 #1
0
 public void SetImageGroup(ImageGroup group)
 {
     this.group = group;
     index      = 0;
     scale      = 1.0f;
     Refresh();
 }
コード例 #2
0
ファイル: ImageViewer.cs プロジェクト: lvshiling/Nova
 public void Show(ImageGroup group, ImageUnlockInfo unlockInfo)
 {
     gameObject.SetActive(true);
     this.group      = group;
     this.unlockInfo = unlockInfo;
     index           = ImageGalleryController.GetNextUnlockedImage(group, unlockInfo, -1);
     scale           = 1.0f;
     Refresh();
 }
コード例 #3
0
        public static int GetNextUnlockedImage(ImageGroup group, ImageUnlockInfo unlockInfo, int start)
        {
            for (int i = start + 1; i < group.entries.Count; ++i)
            {
                if (unlockInfo.Contains(Utils.ConvertPathSeparator(group.entries[i].resourcePath)))
                {
                    return(i);
                }
            }

            return(-1);
        }
コード例 #4
0
        public static int GetPreviousUnlockedImage(ImageGroup group, ImageUnlockInfo unlockInfo, int start)
        {
            for (int i = start - 1; i >= 0; --i)
            {
                if (unlockInfo.Contains(Utils.ConvertPathSeparator(group.entries[i].resourcePath)))
                {
                    return(i);
                }
            }

            return(-1);
        }
コード例 #5
0
        public void SetGroup(ImageGroup group)
        {
            this.group = group;

            if (group == null)
            {
                snapshot.gameObject.SetActive(false);
            }
            else
            {
                snapshot.gameObject.SetActive(true);
                snapshot.sprite = group.LoadSnapshot();
            }
        }
コード例 #6
0
 private void ShowGroup(ImageGroup group, ImageUnlockInfo unlockInfo)
 {
     imageViewer.Show(group, unlockInfo);
 }
コード例 #7
0
 public static int GetUnlockedImageCount(ImageGroup group, ImageUnlockInfo unlockInfo)
 {
     return(group.entries.Count(entry => unlockInfo.Contains(Utils.ConvertPathSeparator(entry.resourcePath))));
 }
コード例 #8
0
 public void DisplayGroup(ImageGroup group)
 {
     imageViewer.SetImageGroup(group);
     imageViewer.Show();
 }